-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathglobal.d.ts
More file actions
32 lines (26 loc) · 977 Bytes
/
global.d.ts
File metadata and controls
32 lines (26 loc) · 977 Bytes
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
/// <reference types="svelte" />
/// <reference types="vite/client" />
/// <reference types="vite-plugin-pwa/client" />
/// <reference types="unplugin-icons/types/svelte" />
/// <reference types="@neodrag/svelte/globals" />
type ObjectKeys<Obj> = Obj extends object
? (keyof Obj)[]
: Obj extends number
? []
: Obj extends Array<any> | string
? string[]
: never;
interface ObjectConstructor {
keys<ObjectType>(o: ObjectType): ObjectKeys<ObjectType>;
entries<ObjType>(o: ObjType): [Unpacked<ObjectKeys<ObjType>>, ObjType[keyof ObjType]][];
}
interface Storage {
getItem<T extends string>(key: string): T | null;
}
type Unpacked<ArrayLike> = ArrayLike extends (infer RootType)[] ? RootType : ArrayLike;
type Unpromisify<PromiseLike> = PromiseLike extends Promise<infer RootType>
? RootType
: PromiseLike;
interface Array<T> {
fill<T extends any>(value: T, start?: number | undefined, end?: number | undefined): T[];
}