UNPKG

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