Skip to content

Commit 127bbf3

Browse files
committed
Correct some types for internals
1 parent 8cd0b75 commit 127bbf3

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

packages/@ember/-internals/metal/lib/computed.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -903,8 +903,8 @@ export function computed(
903903
}
904904

905905
export function autoComputed(
906-
...config: [ComputedPropertyObj]
907-
): ComputedDecorator | DecoratorPropertyDescriptor {
906+
...config: [ComputedPropertyObj | ComputedPropertyGetterFunction]
907+
): ComputedDecorator {
908908
// SAFETY: We passed in the impl for this class
909909
return makeComputedDecorator(
910910
new AutoComputedProperty(config),

packages/@ember/-internals/runtime/lib/mixins/array.d.ts

+9-6
Original file line numberDiff line numberDiff line change
@@ -26,27 +26,27 @@ interface EmberArray<T> extends Enumerable {
2626
): NativeArray<U>;
2727
mapBy<K extends string>(key: K): NativeArray<Value<T, K>>;
2828
filter<Target>(
29-
callback: (this: Target, item: T, index: number, arr: this) => boolean,
29+
callback: (this: Target, item: T, index: number, arr: this) => unknown,
3030
target?: Target
3131
): NativeArray<T>;
3232
reject<Target>(
33-
callback: (this: Target, item: T, index: number, arr: this) => boolean,
33+
callback: (this: Target, item: T, index: number, arr: this) => unknown,
3434
target?: Target
3535
): NativeArray<T>;
3636
filterBy(key: string): NativeArray<T>;
3737
rejectBy(key: string): NativeArray<T>;
3838
find<Target = void>(
39-
callback: (this: Target, item: T, index: number, arr: this) => boolean,
39+
callback: (this: Target, item: T, index: number, arr: this) => unknown,
4040
target?: Target
4141
): T | undefined;
4242
findBy<K extends string>(key: K, value?: Value<T, K>): T | undefined;
4343
every<Target = void>(
44-
callback: (this: Target, item: T, index: number, arr: this) => boolean,
44+
callback: (this: Target, item: T, index: number, arr: this) => unknown,
4545
target?: Target
4646
): boolean;
4747
isEvery<K extends string>(key: K, value?: Value<T, K>): boolean;
4848
any<Target = void>(
49-
callback: (this: Target, item: T, index: number, arr: this) => boolean,
49+
callback: (this: Target, item: T, index: number, arr: this) => unknown,
5050
target?: Target
5151
): boolean;
5252
isAny<K extends string>(key: K, value?: Value<T, K>): boolean;
@@ -103,5 +103,8 @@ export function A<A>(arr: A): A extends Array<infer V> ? NativeArray<V> : Native
103103
export function A<T>(): NativeArray<T>;
104104

105105
export function removeAt<T>(array: T[] | EmberArray<T>, start: number, len: number): EmberArray<T>;
106-
export function uniqBy<T>(array: T[], keyOrFunc: string | ((item: T) => unknown)): T[];
106+
export function uniqBy<T>(
107+
array: T[] | EmberArray<T>,
108+
keyOrFunc: string | ((item: T) => unknown)
109+
): T[] | EmberArray<T>;
107110
export function isArray(obj: unknown): boolean;

0 commit comments

Comments
 (0)