UNPKG

9.59 kBTypeScriptView Raw
1/// <reference types="react" />
2import * as antUtils from '@antv/util';
3import * as Annotation from './components/Annotation';
4import * as G2 from './g2-all';
5import * as GComponents from './g-components';
6import * as bxUtil from './utils';
7export declare const Util: {
8 getLegendItems: typeof import("@antv/g2/lib/util/legend").getLegendItems;
9 translate: typeof import("@antv/g2/lib/util/transform").translate;
10 rotate: typeof import("@antv/g2/lib/util/transform").rotate;
11 zoom: typeof import("@antv/g2/lib/util/transform").zoom;
12 transform: (m: number[], actions: any[][]) => number[];
13 getAngle: typeof import("@antv/g2/lib/util/graphics").getAngle;
14 getSectorPath: typeof import("@antv/g2/lib/util/graphics").getSectorPath;
15 polarToCartesian: typeof import("@antv/g2/lib/util/graphics").polarToCartesian;
16 getDelegationObject: typeof import("@antv/g2/lib/interaction/action/util").getDelegationObject;
17 getTooltipItems: typeof import("@antv/g2/lib/util/tooltip").getTooltipItems;
18 fold: (data: any[], fields: string[], foldCate: string, foldValue: string) => any[];
19 percentage: (data: object[], field: string, as: string, groupBy?: string | string[]) => any[];
20 minifyNum: (num: any, decimal?: number) => any;
21 splitBySeparator: (num: any, separator?: string) => any;
22 visibleHelper: (cfg: any, defaultVisible?: boolean) => {
23 visible: boolean;
24 text: string | import("react").ReactElement<unknown, string | ((props: any) => import("react").ReactElement<any, any>) | (new (props: any) => import("react").Component<any, any, any>)>;
25 } | {
26 visible: boolean;
27 text?: undefined;
28 };
29 cloneDeep: (deepObject: any) => any;
30 shallowEqual: typeof bxUtil.shallowEqual;
31 contains: (arr: any[], value: any) => boolean;
32 includes: (arr: any[], value: any) => boolean;
33 difference: <T>(arr: T[], values?: T[]) => T[];
34 find: typeof antUtils.find;
35 findIndex: typeof antUtils.findIndex;
36 firstValue: (data: object[], name: string) => any;
37 flatten: <T_1>(arr: T_1[]) => T_1[];
38 flattenDeep: (arr: any[], result?: any[]) => any[];
39 getRange: (values: number[]) => import("@antv/util/lib/get-range").RangeType;
40 pull: <T_2>(arr: T_2[], ...values: any[]) => T_2[];
41 pullAt: <T_3>(arr: T_3[], indexes: number[]) => T_3[];
42 reduce: <T_4, G>(arr: import("@antv/util/lib/types").ObjectType<T_4> | G[], fn: (result: T_4, data: G, idx: string | number) => T_4, init: T_4) => T_4;
43 remove: <T_5>(arr: T_5[], predicate: (value: T_5, idx: number, arr?: T_5[]) => boolean) => T_5[];
44 sortBy: typeof antUtils.sortBy;
45 union: (...sources: any[]) => any[];
46 uniq: typeof antUtils.uniq;
47 valuesOfKey: (data: any[], name: string) => any[];
48 head: typeof antUtils.head;
49 last: typeof antUtils.last;
50 startsWith: typeof antUtils.startsWith;
51 endsWith: typeof antUtils.endsWith;
52 filter: <T_6>(arr: T_6[], func: (v: T_6, idx: number) => boolean) => T_6[];
53 every: <T_7>(arr: T_7[], func: (v: T_7, idx?: number) => any) => boolean;
54 some: <T_8>(arr: T_8[], func: (v: T_8, idx?: number) => any) => boolean;
55 group: <T_9>(data: T_9[], condition: string | string[] | ((v: T_9) => string)) => T_9[][];
56 groupBy: typeof antUtils.groupBy;
57 groupToMap: typeof antUtils.groupToMap;
58 getWrapBehavior: typeof antUtils.getWrapBehavior;
59 wrapBehavior: typeof antUtils.wrapBehavior;
60 number2color: typeof antUtils.number2color;
61 parseRadius: typeof antUtils.parseRadius;
62 clamp: (a: number, min: number, max: number) => number;
63 fixedBase: (v: number, base: string | number) => number;
64 isDecimal: (num: any) => boolean;
65 isEven: (num: any) => boolean;
66 isInteger: (number: unknown) => boolean;
67 isNegative: (num: any) => boolean;
68 isNumberEqual: typeof antUtils.isNumberEqual;
69 isOdd: (num: any) => boolean;
70 isPositive: (num: any) => boolean;
71 max: (arr: number[]) => number;
72 maxBy: <T_10>(arr: T_10[], fn: string | ((v: T_10) => number)) => T_10;
73 min: (arr: number[]) => number;
74 minBy: <T_11>(arr: T_11[], fn: string | ((v: T_11) => number)) => T_11;
75 mod: (n: number, m: number) => number;
76 toDegree: (radian: number) => number;
77 toInteger: typeof antUtils.toInteger;
78 toRadian: (degree: number) => number;
79 forIn: typeof antUtils.forIn;
80 has: (obj: object, key: any) => boolean;
81 hasKey: (obj: object, key: any) => boolean;
82 hasValue: (obj: object, value: any) => boolean;
83 keys: (obj: any) => any[];
84 isMatch: typeof antUtils.isMatch;
85 values: (obj: any) => any;
86 lowerCase: (str: string) => string;
87 lowerFirst: (value: string) => string;
88 substitute: typeof antUtils.substitute;
89 upperCase: (str: string) => string;
90 upperFirst: (value: string) => string;
91 getType: (value: any) => string;
92 isArguments: (value: any) => boolean;
93 isArray: (value: any) => value is any[];
94 isArrayLike: (value: any) => boolean;
95 isBoolean: (value: any) => value is boolean;
96 isDate: (value: any) => value is Date;
97 isError: (value: any) => value is Error;
98 isFunction: (value: any) => value is Function;
99 isFinite: typeof antUtils.isFinite;
100 isNil: (value: any) => value is null;
101 isNull: (value: any) => value is null;
102 isNumber: (value: any) => value is number;
103 isObject: <T_12 = object>(value: any) => value is T_12;
104 isObjectLike: (value: any) => value is object;
105 isPlainObject: (value: any) => value is object;
106 isPrototype: (value: any) => boolean;
107 isRegExp: (str: any) => str is RegExp;
108 isString: (str: any) => str is string;
109 isType: (value: any, type: string) => boolean;
110 isUndefined: (value: any) => value is undefined;
111 isElement: (o: any) => boolean;
112 requestAnimationFrame: typeof antUtils.requestAnimationFrame;
113 clearAnimationFrame: typeof antUtils.clearAnimationFrame;
114 augment: (...args: any[]) => void;
115 clone: (obj: any) => any;
116 debounce: typeof antUtils.debounce;
117 memoize: (f: Function, resolver?: (...args: any[]) => string) => {
118 (...args: any[]): any;
119 cache: Map<any, any>;
120 };
121 deepMix: (rst: any, ...args: any[]) => any;
122 each: typeof antUtils.forIn;
123 extend: (subclass: any, superclass: any, overrides?: any, staticOverrides?: any) => any;
124 indexOf: <T_13>(arr: T_13[], obj: T_13) => number;
125 isEmpty: typeof antUtils.isEmpty;
126 isEqual: (value: any, other: any) => boolean;
127 isEqualWith: <T_14>(value: T_14, other: T_14, fn: (v1: T_14, v2: T_14) => boolean) => boolean;
128 map: <T_15, G_1>(arr: T_15[], func: (v: T_15, idx: number) => G_1) => G_1[];
129 mapValues: <T_16>(object: {
130 [key: string]: T_16;
131 }, func?: (value: T_16, key: string) => any) => {
132 [key: string]: any;
133 };
134 mix: typeof antUtils.mix;
135 assign: typeof antUtils.mix;
136 get: (obj: any, key: string | any[], defaultValue?: any) => any;
137 set: (obj: any, path: string | any[], value: any) => any;
138 pick: <T_17>(object: import("@antv/util/lib/pick").ObjectType<T_17>, keys: string[]) => import("@antv/util/lib/pick").ObjectType<T_17>;
139 omit: <T_18>(obj: import("@antv/util/lib/types").ObjectType<T_18>, keys: string[]) => import("@antv/util/lib/types").ObjectType<T_18>;
140 throttle: (func: Function, wait: number, options: import("@antv/util/lib/throttle").OptionsType) => Function;
141 toArray: (value: any) => any[];
142 toString: (value: any) => string;
143 uniqueId: (prefix?: string) => string;
144 noop: () => void;
145 identity: <T_19>(v: T_19) => T_19;
146 size: typeof antUtils.size;
147 Cache: typeof antUtils.Cache;
148};
149export { Annotation, G2, GComponents };
150export { default as Chart } from './components/Chart';
151export { default as View } from './components/View';
152export { default as Tooltip } from './components/Tooltip';
153export { default as Legend } from './components/Legend';
154export { default as Coordinate } from './components/Coordinate';
155export { default as Axis } from './components/Axis';
156export { default as Facet } from './components/Facet';
157export { default as Slider } from './components/Slider';
158export { default as Area } from './geometry/Area';
159export { default as Edge } from './geometry/Edge';
160export { default as Heatmap } from './geometry/Heatmap';
161export { default as Interval } from './geometry/Interval';
162export { default as Line } from './geometry/Line';
163export { default as Point } from './geometry/Point';
164export { default as Polygon } from './geometry/Polygon';
165export { default as Schema } from './geometry/Schema';
166export { default as BaseGeom } from './geometry/Base';
167export { default as Label } from './geometry/Label';
168export { default as Path } from './geometry/Path';
169export { default as LineAdvance } from './geometry/LineAdvance';
170export { default as Geom } from './geometry';
171export { default as Coord } from './components/Coordinate/coord';
172export { default as Guide } from './adapter/Guide';
173export { default as Effects } from './components/Effects';
174export { default as Interaction } from './components/Interaction';
175export { default as createPlot } from './createPlot';
176export { default as createTooltipConnector } from './connector/createTooltipConnector';
177export { default as useView } from './hooks/useChartView';
178export { default as useRootChart } from './hooks/useChartInstance';
179export { default as useChartInstance } from './hooks/useChartInstance';
180export { default as useTheme } from './hooks/useTheme';
181export { withView } from './context/view';
182export { withChartInstance } from './context/root';
183export * from './core';
184export * from './plots';