UNPKG

1.81 kBTypeScriptView Raw
1import { DisplayObject } from '@antv/g';
2export declare function identity<T>(x: T): T;
3type Func<R> = (x: R, ...args: any[]) => R;
4/**
5 * Composes functions from left to right.
6 */
7export declare function compose<R>(fns: Func<R>[]): Func<R>;
8/**
9 * Composes single-argument async functions from left to right.
10 */
11export declare function composeAsync<R>(fns: ((x: R) => Promise<R> | R)[]): (x: R) => Promise<R> | R;
12export declare function capitalizeFirst(str: string): string;
13export declare function error(message?: string): never;
14export declare function copyAttributes(target: DisplayObject, source: DisplayObject): void;
15export declare function defined(x: any): boolean;
16export declare function random(a: number, b: number): number;
17export declare function useMemo<T = unknown, U = unknown>(compute: (key: T) => U): (key: T) => U;
18export declare function appendTransform(node: DisplayObject, transform: any): void;
19export declare function subObject(obj: Record<string, any>, prefix: string): Record<string, any>;
20export declare function maybeSubObject(obj: Record<string, any>, prefix: string): Record<string, any>;
21export declare function prefixObject(obj: Record<string, any>, prefix: string): Record<string, any>;
22export declare function filterPrefixObject(obj: Record<string, any>, prefix: string[]): Record<string, any>;
23export declare function omitPrefixObject(obj: Record<string, any>, ...prefixes: string[]): {
24 [k: string]: any;
25};
26export declare function maybePercentage(x: number | string, size: number): number;
27export declare function isStrictObject(d: any): boolean;
28export declare function isUnset(value: any): boolean;
29export declare function deepAssign(dist: Record<string, unknown>, src: Record<string, unknown>, maxLevel?: number, level?: number): Record<string, unknown>;
30export {};