All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.build.lib.utils.d.ts Maven / Gradle / Ivy

The newest version!
import { TableState, Updater } from './types';
export type PartialKeys = Omit & Partial>;
export type RequiredKeys = Omit & Required>;
export type Overwrite = Omit & U;
export type UnionToIntersection = (T extends any ? (x: T) => any : never) extends (x: infer R) => any ? R : never;
export type IsAny = 1 extends 0 & T ? Y : N;
export type IsKnown = unknown extends T ? N : Y;
type ComputeRange = []> = Result['length'] extends N ? Result : ComputeRange;
type Index40 = ComputeRange<40>[number];
type IsTuple = T extends readonly any[] & {
    length: infer Length;
} ? Length extends Index40 ? T : never : never;
type AllowedIndexes, Keys extends number = never> = Tuple extends readonly [] ? Keys : Tuple extends readonly [infer _, ...infer Tail] ? AllowedIndexes : Keys;
export type DeepKeys = unknown extends T ? keyof T : object extends T ? string : T extends readonly any[] & IsTuple ? AllowedIndexes | DeepKeysPrefix> : T extends any[] ? never & 'Dynamic length array indexing is not supported' : T extends Date ? never : T extends object ? (keyof T & string) | DeepKeysPrefix : never;
type DeepKeysPrefix = TPrefix extends keyof T & (number | string) ? `${TPrefix}.${DeepKeys & string}` : never;
export type DeepValue = T extends Record ? TProp extends `${infer TBranch}.${infer TDeepProp}` ? DeepValue : T[TProp & string] : never;
export type NoInfer = [T][T extends any ? 0 : never];
export type Getter = () => NoInfer;
export declare function functionalUpdate(updater: Updater, input: T): T;
export declare function noop(): void;
export declare function makeStateUpdater(key: K, instance: unknown): (updater: Updater) => void;
type AnyFunction = (...args: any) => any;
export declare function isFunction(d: any): d is T;
export declare function isNumberArray(d: any): d is number[];
export declare function flattenBy(arr: TNode[], getChildren: (item: TNode) => TNode[]): TNode[];
export declare function memo(getDeps: () => [...TDeps], fn: (...args: NoInfer<[...TDeps]>) => TResult, opts: {
    key: any;
    debug?: () => any;
    onChange?: (result: TResult) => void;
}): () => TResult;
export {};




© 2015 - 2024 Weber Informatics LLC | Privacy Policy