export type Optional = T | undefined; export type Nullable = T | null; export type OptionalProperty = Pick, K> & Omit; export type ValueOf = T[keyof T]; export type DeepPartial = { [P in keyof T]?: T[P] extends object ? DeepPartial : T[P]; }; export type ObjectOrArrayType = T | T[]; export declare const ObjectOrArray: { first: (item: ObjectOrArrayType) => T; array: (item: ObjectOrArrayType) => T[]; }; export declare const Omit: >(properties: P[], object: T) => R; export declare const whenDefined: (fn: (input: I) => O) => (value?: I) => O | undefined; /** * Comparator function which defines the sort order * @example * ``` * // sorts objects by `id` property * [{ id: 3 }, { id: 2 }, { id: 1 }].sort(compare(['id'])) * * // sorts objects by `id` and `name` properties * [{ id: 3, name: 'b' }, { id: 2, name: 'a' }, { id: 1, name: 'b' }].sort(compare(['id', 'name'])) * ``` * * @param {Array} properties * @return {number} */ export declare const compare: (properties: Array) => (a: T, b: T) => number; export declare const is: (value: T | undefined | null) => value is T; export declare const has: (property: P) => (object: OptionalProperty) => object is T; export declare const equals: (a?: A) => (b?: A) => boolean; export declare const prop: (property: P) => (object: T) => T[P]; export declare const propOptional: (property: P) => (object?: T) => Optional; export declare const hasOwnProperty: (obj: X, prop: Y) => obj is X & Record>; export declare const isObject: (obj: unknown) => obj is T; export declare const isString: (input: unknown) => input is string; export declare const isNumber: (input: unknown) => input is string; type Entries = { [K in keyof T]: [K, T[K]]; }[keyof T][]; export declare const getEntries: (obj: T) => Entries; export declare const getKeys: (obj: T) => Array; export declare const getValues: (obj: T) => Array>; export declare const first: (array: T[]) => Optional; export declare const pairs: (arr: T[]) => Array<[string, string]>; export declare const find: (predicate: (item: T) => item is S) => (array?: T[]) => Optional; export declare const filter: (predicate: (item: T) => item is S) => (array?: T[]) => S[]; export {};