mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
43 lines
3.0 KiB
Plaintext
43 lines
3.0 KiB
Plaintext
implementArrayInterface.ts(19,5): error TS2416: Property 'every' in type 'MyArray<T>' is not assignable to the same property in base type 'T[]'.
|
|
Type '(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any) => boolean' is not assignable to type '{ <S extends T>(predicate: (value: T, index: number, array: T[]) => value is S, thisArg?: any): this is S[]; (predicate: (value: T, index: number, array: T[]) => unknown, thisArg?: any): boolean; }'.
|
|
Signature '(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean' must be a type predicate.
|
|
|
|
|
|
==== implementArrayInterface.ts (1 errors) ====
|
|
declare class MyArray<T> implements Array<T> {
|
|
toString(): string;
|
|
toLocaleString(): string;
|
|
concat<U extends T[]>(...items: U[]): T[];
|
|
concat(...items: T[]): T[];
|
|
join(separator?: string): string;
|
|
pop(): T;
|
|
push(...items: T[]): number;
|
|
reverse(): T[];
|
|
shift(): T;
|
|
slice(start?: number, end?: number): T[];
|
|
sort(compareFn?: (a: T, b: T) => number): this;
|
|
splice(start: number): T[];
|
|
splice(start: number, deleteCount: number, ...items: T[]): T[];
|
|
unshift(...items: T[]): number;
|
|
|
|
indexOf(searchElement: T, fromIndex?: number): number;
|
|
lastIndexOf(searchElement: T, fromIndex?: number): number;
|
|
every(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean;
|
|
~~~~~
|
|
!!! error TS2416: Property 'every' in type 'MyArray<T>' is not assignable to the same property in base type 'T[]'.
|
|
!!! error TS2416: Type '(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any) => boolean' is not assignable to type '{ <S extends T>(predicate: (value: T, index: number, array: T[]) => value is S, thisArg?: any): this is S[]; (predicate: (value: T, index: number, array: T[]) => unknown, thisArg?: any): boolean; }'.
|
|
!!! error TS2416: Signature '(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean' must be a type predicate.
|
|
some(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean;
|
|
forEach(callbackfn: (value: T, index: number, array: T[]) => void, thisArg?: any): void;
|
|
map<U>(callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): U[];
|
|
filter(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): T[];
|
|
reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T;
|
|
reduce<U>(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U;
|
|
reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T;
|
|
reduceRight<U>(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U;
|
|
|
|
length: number;
|
|
|
|
[n: number]: T;
|
|
}
|
|
|