@nano-lib/util 1.0.6 → 1.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/types/index.d.ts +21 -0
- package/package.json +1 -1
package/lib/types/index.d.ts
CHANGED
|
@@ -4,7 +4,24 @@ export type PromiseFn<T = any, R = T> = {
|
|
|
4
4
|
export type AnyObj<T = any> = {
|
|
5
5
|
[key: string]: T;
|
|
6
6
|
};
|
|
7
|
+
export type Fn<T = any, R = T> = {
|
|
8
|
+
(...arg: T[]): R;
|
|
9
|
+
};
|
|
10
|
+
export type Writable<T> = {
|
|
11
|
+
-readonly [P in keyof T]: T[P];
|
|
12
|
+
};
|
|
7
13
|
export type Nullable<T> = T | null;
|
|
14
|
+
export type Recordable<T = any> = Record<string, T>;
|
|
15
|
+
export type ReadonlyRecordable<T = any> = {
|
|
16
|
+
readonly [key: string]: T;
|
|
17
|
+
};
|
|
18
|
+
export type DeepPartial<T> = {
|
|
19
|
+
[P in keyof T]?: DeepPartial<T[P]>;
|
|
20
|
+
};
|
|
21
|
+
export type Without<T, U> = {
|
|
22
|
+
[P in Exclude<keyof T, keyof U>]?: never;
|
|
23
|
+
};
|
|
24
|
+
export type Exclusive<T, U> = (Without<T, U> & U) | (Without<U, T> & T);
|
|
8
25
|
export type TimeoutHandle = ReturnType<typeof setTimeout>;
|
|
9
26
|
export type IntervalHandle = ReturnType<typeof setInterval>;
|
|
10
27
|
export type OptionType = {
|
|
@@ -15,3 +32,7 @@ export type CategoryType = {
|
|
|
15
32
|
id?: string | number;
|
|
16
33
|
children?: CategoryType[];
|
|
17
34
|
} & OptionType;
|
|
35
|
+
export type ProtocolType = 'http' | 'https';
|
|
36
|
+
export type SizeType = 'large' | 'default' | 'small';
|
|
37
|
+
export type ThemeMode = 'light' | 'dark' | 'auto';
|
|
38
|
+
export type DeviceType = 'desktop' | 'mobile';
|