forked from Automattic/wp-calypso
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypes.ts
60 lines (49 loc) · 1.45 KB
/
types.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
import type { NonUndefined } from 'utility-types';
// Web stuff
export type URL = string;
export type Scheme = 'http' | 'https';
// User stuff
// Site stuff
export type SiteId = number;
export type SiteSlug = string;
// Plan stuff
export type PlanSlug = string;
// Plugin stuff
// Post stuff
export type PostId = number;
export type PostType = 'page' | 'post' | string;
// Comment stuff
export type CommentId = number;
// Language stuff
export type Lazy< T > = () => T;
export type TimeoutMS = NonUndefined< Parameters< typeof setTimeout >[ 1 ] >;
export type TimestampMS = ReturnType< typeof Date.now >;
export type TimerHandle = ReturnType< typeof setTimeout >;
export type IntervalHandle = ReturnType< typeof setInterval >;
export type JSONSerializable =
| null
| boolean
| number
| string
| JSONSerializable[]
| { [ prop: string ]: JSONSerializable };
/**
* Calypso application state
*
* Calypso application state is not yet well typed.
*/
export type AppState = __TodoAny__;
/**
* This is an `any` type alias.
* It is intended to signify an `any` type that is impossible or impractical to type more strictly.
* It should be accompanied by a comment describing the conditions for its use and when it can be replaced.
*
* **Please, use sparingly!**
*/
export type __TodoAny__ = any; /* eslint-disable-line @typescript-eslint/no-explicit-any */
// Properties added to the `window` object:
declare global {
interface Window {
AppBoot: () => void;
}
}