UNPKG

1.48 kBTypeScriptView Raw
1import { BBox, IGroup, IShape } from '../../dependents';
2import { LooseObject } from '../../interface';
3import { GeometryLabelConstructor } from './base';
4import { LabelItem } from './interface';
5/**
6 * label 布局函数定义
7 * @param items 存储每个 label 的详细信息
8 * @param labels 所有的 labels 图形实例
9 * @param shapes 所有 label 对应的图形元素实例
10 * @param region 画布区域
11 * @param cfg 用于存储各个布局函数开放给用户的配置数据
12 */
13declare type GeometryLabelsLayoutFn = (items: LabelItem[], labels: IGroup[], shapes: IShape[] | IGroup[], region: BBox, cfg?: LooseObject) => void;
14/**
15 * 获取 `type` 对应的 [[GeometryLabel]] 类
16 * @param type
17 * @returns
18 */
19export declare function getGeometryLabel(type: string): GeometryLabelConstructor;
20/**
21 * 注册定义的 GeometryLabel 类
22 * @param type GeometryLabel 类型名称
23 * @param ctor GeometryLabel 类
24 */
25export declare function registerGeometryLabel(type: string, ctor: GeometryLabelConstructor): void;
26/**
27 * 获取 `type` 对应的 [[GeometryLabelsLayoutFn]] label 布局函数
28 * @param type 布局函数名称
29 * @returns
30 */
31export declare function getGeometryLabelLayout(type: string): GeometryLabelsLayoutFn;
32/**
33 * 注册定义的 label 布局函数
34 * @param type label 布局函数名称
35 * @param layoutFn label 布局函数
36 */
37export declare function registerGeometryLabelLayout(type: string, layoutFn: GeometryLabelsLayoutFn): void;
38export {};