UNPKG

@schema-render/core-react

Version:

Through a set of simple JSON Schema, efficiently build a set of forms.

33 lines (32 loc) 1.88 kB
import type { IDictionary, IObjectAny } from '../typings/common'; /** * fork from https://github.com/lukeed/klona/blob/master/src/json.js * @param val input JSON Value * @returns cloned JSON Value */ export declare function cloneDeep<T extends IObjectAny | any[]>(val: T): T; export declare function mapKeys<T extends IObjectAny>(obj: T | undefined, fn: (value: T[keyof T], key: string) => string): IDictionary<T[keyof T]>; export declare function pick<T extends IObjectAny, U extends keyof T>(obj: T | undefined | null, ...keys: U[]): Pick<T, U>; export declare function omit<T extends IObjectAny, U extends keyof T>(obj: T | undefined, ...keys: U[]): Omit<T, U>; export declare function dropRight<T>(arr: Array<T> | undefined, n?: number): T[]; /** * ref https://lodash.com/docs/4.17.15#find * e.g. find(users, function(o) { return o.age < 40 }) */ export declare function find<T extends IObjectAny>(arr: ArrayLike<T> | undefined, predicate: (item: T) => boolean, fromIndex?: number): T | undefined; /** * ref https://lodash.com/docs/4.17.15#find * e.g. find(users, { 'age': 1, 'active': true }) */ export declare function find<T extends IObjectAny>(arr: ArrayLike<T> | undefined, predicate: Partial<T>, fromIndex?: number): T | undefined; export declare function isMatch(obj: IObjectAny | undefined, source: IObjectAny): boolean; export declare function get<T extends any = any>(obj: IObjectAny | undefined, path: Array<string | number>): T | undefined; /** * fork from https://github.com/lodash/lodash/blob/4.17.21-es/_baseSet.js */ export declare function set<T extends IObjectAny>(obj: IObjectAny, path: Array<string | number>, value: any): T; export declare function debounce<T extends (...args: any) => any>(func: T, wait: number): { (this: unknown, ...args: unknown[]): void; cancel(): void; }; export declare function toLower(str?: string): string;