/** * Copied from chakra-ui, license MIT * Accessed 2021-12-26, commit March 15th, 2021 * See also: https://github.com/chakra-ui/chakra-ui/blob/4db1f22/packages/utils/src/object.ts */ import type { Dict, Omit } from "./types"; export { default as mergeWith } from "lodash.mergewith"; export declare function omit(object: T, keys: K[]): Omit; export declare function pick(object: T, keys: K[]): { [P in K]: T[P]; }; export declare function split(object: T, keys: K[]): [{ [P in K]: T[P]; }, Omit]; /** * Get value from a deeply nested object using a string path. * Memoizes the value. * @param obj - the object * @param path - the string path * @param def - the fallback value */ export declare function get(obj: object, path: string | number, fallback?: any, index?: number): any; type Get = (obj: Readonly, path: string | number, fallback?: any, index?: number) => any; export declare const memoize: (fn: Get) => Get; export declare const memoizedGet: Get; /** * Get value from deeply nested object, based on path * It returns the path value if not found in object * * @param path - the string path or value * @param scale - the string path or value */ export declare function getWithDefault(path: any, scale: any): any; type FilterFn = (value: any, key: string, object: T) => boolean; /** * Returns the items of an object that meet the condition specified in a callback function. * * @param object the object to loop through * @param fn The filter function */ export declare function objectFilter(object: T, fn: FilterFn): Dict; export declare const filterUndefined: (object: Dict) => Dict; export declare const objectKeys: (obj: T) => (keyof T)[]; /** * Object.entries polyfill for Nodev10 compatibility */ export declare const fromEntries: (entries: [string, any][]) => T; /** * Get the CSS variable ref stored in the theme */ export declare const getCSSVar: (theme: Dict, scale: string, value: any) => any;