/** * 任意函数类型。 */ export type CFunction = (...args: any[]) => any; /** * 任意对象类型。 */ export type Dictionary = Record; /** * 名义化类型。 * * @example * ```ts * type User = { id: Brand, name: string } * type Post = { id: Brand, title: string } * type UserIdIsNumber = User['id'] extends number ? true: false // => true * type PostIdIsNumber = Post['id'] extends number ? true: false // => true * type PostIdIsNotUserId = Post['id'] extends User['id'] ? false : true // => true * ``` */ export type CBrand = T & { __kind__?: B; }; /** * 字面量联合类型 */ export type CLiteralUnion = L | CBrand; /** * 从 `T` 中排除 `undefined` 类型。 * * @example * ```ts * interface User { * gender?: 'male' | 'female', * } * // before * type UserGender = Exclude * // after * type UserGender = Defined * ``` */ export type Defined = Exclude; export type CRoundType = 'default' | 'down' | 'up'; export type SortDirection = "asc" | "desc"; export type Callback = (e: Event) => void; export type StorageParameter = { type?: string; prefix: string; expire: number; isEncrypt: boolean; }; export type Data = { value: any; time: number; expire: number; }; export {};