import { Result } from './result'; /** * Helper type-guard function to report whether a specified key is present in * a supplied object. * @param key - The key to be tested. * @param item - The object to be tested. * @returns Returns `true` if the key is present, `false` otherwise. * @public */ export declare function isKeyOf(key: string | number | symbol, item: T): key is keyof T; /** * Simple implicit pick function, which picks a set of properties from a supplied * object. Ignores picked properties that do not exist regardless of type signature. * @param from - The object from which keys are to be picked. * @param include - The keys of the properties to be picked from `from`. * @returns A new object containing the requested properties from `from`, where present. * @public */ export declare function pick(from: T, include: K[]): Pick; /** * Simple implicit omit function, which picks all of the properties from a supplied * object except those specified for exclusion. * @param from - The object from which keys are to be picked. * @param exclude - The keys of the properties to be excluded from the returned object. * @returns A new object containing all of the properties from `from` that were not * explicitly excluded. * @public */ export declare function omit(from: T, exclude: K[]): Omit; /** * Gets the value of a property specified by key from an arbitrary object, * or a default value if the property does not exist. * @param key - The key specifying the property to be retrieved. * @param item - The object from which the property is to be retrieved. * @param defaultValue - An optional default value to be returned if the property * is not present (default `undefined`). * @returns The value of the requested property, or the default value if the * requested property does not exist. * @public */ export declare function getValueOfPropertyOrDefault(key: string | number | symbol, item: T, defaultValue?: unknown): unknown | undefined; /** * Gets the type of a property specified by key from an arbitrary object. * @param key - The key specifying the property to be tested. * @param item - The object from which the property is to be tested. * @returns The type of the requested property, or `undefined` if the * property does not exist. * @example * Returns `'undefined'` (a string) if the property exists but has the value * undefined but `undefined` (the literal) if the property does not exist. * @public */ export declare function getTypeOfProperty(key: string | number | symbol, item: T): 'string' | 'number' | 'bigint' | 'boolean' | 'symbol' | 'undefined' | 'undefined' | 'object' | 'function' | undefined; /** * Type for factory methods which convert a key-value pair to a new unique value. * @public */ type KeyedThingFactory = (key: TK, thing: TS) => Result; /** * Applies a factory method to convert a `Record` into a `Map`. * @param src - The `Record` to be converted. * @param factory - The factory method used to convert elements. * @returns {@link Success} with the resulting map on success, or {@link Failure} with a * message if an error occurs. * @public */ export declare function recordToMap(src: Record, factory: KeyedThingFactory): Result>; /** * Applies a factory method to convert an optional `Record` into a `Map`, or `undefined`. * @param src - The `Record` to be converted, or undefined. * @param factory - The factory method used to convert elements. * @returns {@link Success} with the resulting map if conversion succeeds, or {@link Success} with `undefined` * if `src` is `undefined`. Returns {@link Failure} with a message if an error occurs. * @public */ export declare function optionalRecordToMap(src: Record | undefined, factory: KeyedThingFactory): Result | undefined>; /** * Applies a factory method to convert an optional `Record` into a `Map` * @param src - The `Record` to be converted, or `undefined`. * @param factory - The factory method used to convert elements. * @returns {@link Success} with the resulting map (empty if `src` is `undefined`) if conversion succeeds. * Returns {@link Failure} with a message if an error occurs. * @public */ export declare function optionalRecordToPossiblyEmptyMap(src: Record | undefined, factory: KeyedThingFactory): Result>; /** * Applies a factory method to convert a `ReadonlyMap` into a `Record`. * @param src - The `Map` object to be converted. * @param factory - The factory method used to convert elements. * @returns {@link Success} with the resulting `Record` if conversion succeeds, or * {@link Failure} with an error message if an error occurs. * @public */ export declare function mapToRecord(src: ReadonlyMap, factory: KeyedThingFactory): Result>; /** * Applies a factory method to convert an optional `ReadonlyMap` into a `Record` or `undefined`. * @param src - The `Map` object to be converted, or `undefined`. * @param factory - The factory method used to convert elements. * @returns {@link Success} with the resulting record if conversion succeeds, or {@link Success} with `undefined` if * `src` is `undefined`. Returns {@link Failure} with a message if an error occurs. * @public */ export declare function optionalMapToRecord(src: ReadonlyMap | undefined, factory: KeyedThingFactory): Result | undefined>; /** * Applies a factory method to convert an optional `ReadonlyMap` into a `Record` * @param src - The `ReadonlyMap` object to be converted, or `undefined`. * @param factory - The factory method used to convert elements. * @returns {@link Success} with the resulting record (empty if `src` is `undefined`) if conversion succeeds. * Returns {@link Failure} with a message if an error occurs. * @public */ export declare function optionalMapToPossiblyEmptyRecord(src: ReadonlyMap | undefined, factory: KeyedThingFactory): Result>; export {}; //# sourceMappingURL=utils.d.ts.map