declare module '*.sass' declare module 'picomatch' declare function isNaN(value: any): boolean declare function isFinite(value: any): boolean declare function parseInt(value: any, radix?: string): number declare function parseFloat(value: any): number interface URLSearchParams { append(key: string, value: any): void } type Fallish = undefined | null | false | 0 | '' type Primitive = string | number | bigint | boolean | symbol | undefined | null /** * Transforms values union into intersaction * @param U - Values union */ type UnionToIntersection = ( U extends any ? (k: U) => void : never ) extends ((k: infer I) => void) ? I : never /** * Recursively iterates over given object and makes its properties optional * @param T - Object to iterate over */ type DeepPartial = T extends object ? T extends AnyFunc ? T : { [P in keyof T]?: DeepPartial } : T // type __ExtractKeysWithOptionalValueObject> = keyof ExcludeObjectValueTypes< // { // [K in keyof NarrowObjectToValueTypes< // ExcludeObjectValueTypes< // Required, // undefined // >, // object // >]: undefined extends O[K] ? O[K] : never // }, // never // > // /** // * Recursively merges two objects // * @param O1 - Object // * @param O2 - Object // */ // type DeepMerge< // O1 extends Record, // O2 extends Record, // BothObjectKeys = keyof NarrowObjectToValueTypes, object> & keyof NarrowObjectToValueTypes, object> // > = // { // [K in ( // RequiredKeys> & RequiredKeys> // )]: DeepMerge // } & // { // [K in ( // __ExtractKeysWithOptionalValueObject & __ExtractKeysWithOptionalValueObject // )]?: DeepMerge>, Partial>> // } & // { // [K in ( // RequiredKeys> & __ExtractKeysWithOptionalValueObject // )]: DeepMerge>> // } & // { // [K in ( // __ExtractKeysWithOptionalValueObject & RequiredKeys> // )]: DeepMerge>, O2[K]> // } & // { [K in Exclude & OptionalKeys, BothObjectKeys>]: Exclude } & // { [K in Exclude, BothObjectKeys>]: O2[K] } & // { [K in Exclude & OptionalKeys, BothObjectKeys>]?: O1[K] | O2[K] } & // { [K in keyof Omit]: O1[K] } & // { [K in keyof Omit]: O2[K] } /** * Simple object that has string key and optional fields * @param V - Object values. Default: any */ type Obj = Partial> /** Any function with any parameters and return type */ type AnyFunc = (...args: any[]) => any /** * Extracts given object's values * @param O - Object */ type Values = O[keyof O] /** * Makes all the object properties optional with type never * @param O - Object */ type Never = { [k in keyof O]?: never } /** * Extracts only object's required properties keys * @param O - Object */ type RequiredKeys = { [K in keyof O]-?: object extends Pick ? never : K }[keyof O] /** * Extracts only object's optional properties keys * @param O - Object */ type OptionalKeys = { [K in keyof O]-?: object extends Pick ? K : never }[keyof O] /** * Exclude null and undefined from a properties of a given object * @param O - Object */ type NonNullableProps = { [k in keyof O]: NonNullable } /** * Makes fields to be partial in a given object * @param O - Object * @param K - Object fields */ type MakePartialFields< O extends Obj, K extends keyof O > = Omit & Partial> /** * Makes fields to be required in a given object * @param O - Object * @param K - Object fields */ type MakeRequiredFields< O extends Obj, K extends keyof O > = Omit & Required> type MakeReadonlyFields< O extends Obj, K extends keyof O > = Omit & Readonly> /** * Keeps only object properties thats are equal to a given value * @param O - Object * @param V - Value */ type NarrowObjectToValueTypes = { [K in keyof O as O[K] extends V ? K : never]: V } /** * From a given object excludes object properties thats are equal to a given value * @param O - Object * @param V - Value */ type ExcludeObjectValueTypes = { [K in keyof O as O[K] extends V ? never : K ]: O[K] } /** * Transforms object into an array of all possible property paths * @param O - Object */ type PathsOf> = Values<{ [P in keyof R]: NonNullable extends Obj ? [P] | [P, ...PathsOf>] : [P] }> /** * Takes array T and returns same array but without first element * @param T - Array */ type Tail = ((...t: T) => void) extends ((h: any, ...r: infer R) => void) ? R : never /** * Checks whether a _V is null | undefined * @return {true} if _V ex null | undefined */ type IsNullable<_V> = Extract<_V, undefined | null> extends never ? false : true /** * Represents all valid css properties */ type CSSWithVariables = { [key: `--${string}`]: any } & React.CSSProperties /** * Represents HTML Tag attributes for a given HTMLElement * @param E - HTMLElement * @param A - Optional React HTML Tag attributes. Default is React.HTMLAttributes */ type ReactTagAttributes< E = HTMLElement, A = React.HTMLAttributes > = { [key: `data-${string}`]: any } & A & React.RefAttributes /** * Represents react store created with useState() hook * @param S - Store's state */ type ReactStore = [ S, React.Dispatch> ]