forked from cocos/cocos-engine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
api.d.ts
32 lines (26 loc) · 927 Bytes
/
api.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
declare let CC_JSB: boolean
declare let CC_NATIVERENDERER: boolean
declare let CC_EDITOR: boolean
declare let CC_PREVIEW: boolean
declare let CC_TEST: boolean
declare let CC_DEBUG: boolean
declare let cc: {
// polyfills: {
// destroyObject? (object: any): void;
// };
[x: string]: any;
}
declare let Editor: any;
// https://medium.com/dailyjs/typescript-create-a-condition-based-subset-types-9d902cea5b8c
type FlagExcludedType<Base, Type> = { [Key in keyof Base]: Base[Key] extends Type ? never : Key };
type AllowedNames<Base, Type> = FlagExcludedType<Base, Type>[keyof Base];
type KeyPartial<T, K extends keyof T> = { [P in K]?: T[P] };
type OmitType<Base, Type> = KeyPartial<Base, AllowedNames<Base, Type>>;
type ConstructorType<T> = OmitType<T, Function>;
declare interface IWritableArrayLike<T> {
readonly length: number;
[index: number]: T;
}
declare let module: {
exports: object
}