export type Predicate = (value: unknown, ...rest: ReadonlyArray) => value is T export type Static> = T extends Predicate ? R : never export type Constructor< T extends object, U extends ReadonlyArray = ReadonlyArray, > = { new (...rest: U): T } // see https://github.com/Microsoft/TypeScript/issues/29594#issuecomment-507673155 export type Intersect = (T extends any ? (k: T) => void : never) extends (k: infer I) => void ? I : never export type None = null | undefined export type Unknown = Function | Primitive | object export type Some = Exclude export type Maybe = T | None export type Optional = T | undefined export type Nullable = T | null export type PlainObjectKey = string | symbol export type PlainObject = Record export type UnknownObject = Record export type EmptyObject = Record export type Dictionary = Record export type Primitive = SerializablePrimitive | undefined | symbol | bigint export type SerializableArray = Array | ReadonlyArray export type SerializablePrimitive = null | boolean | number | string export type SerializableObject = { [key: string]: Serializable | undefined } export type Serializable = SerializablePrimitive | SerializableObject | SerializableArray