nhanh-pure-function 3.0.6-beta.8 → 3.0.6-beta.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Canvas/OverlayGroup/arc.d.ts +1 -0
- package/dist/Canvas/OverlayGroup/arcTo.d.ts +1 -0
- package/dist/Canvas/OverlayGroup/line.d.ts +1 -0
- package/dist/Canvas/OverlayGroup/point.d.ts +1 -0
- package/dist/Canvas/OverlayGroup/polygon.d.ts +1 -0
- package/dist/Canvas/OverlayGroup/public/overlay.d.ts +1 -0
- package/dist/Canvas/OverlayGroup/text.d.ts +1 -0
- package/dist/Canvas/common.type.d.ts +117 -0
- package/dist/Canvas/core/basedata.d.ts +1 -0
- package/dist/Canvas/core/quikmethod.d.ts +1 -0
- package/dist/Canvas/core/style.d.ts +1 -0
- package/dist/Canvas/index.d.ts +1 -0
- package/package.json +2 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { default as Overlay } from './public/overlay';
|
|
2
2
|
import { OverlayType } from './index';
|
|
3
3
|
import { EventHandler } from '../public/eventController';
|
|
4
|
+
import { ArcStyleType, PolygonStyleType } from '../common.type';
|
|
4
5
|
type ConstructorOption = ConstructorParameters<typeof Overlay<ArcStyleType, [number, number]>>[0] & {
|
|
5
6
|
/** 是否填充 */
|
|
6
7
|
isFill?: boolean;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { default as Overlay } from './public/overlay';
|
|
2
2
|
import { OverlayType } from './index';
|
|
3
3
|
import { EventHandler } from '../public/eventController';
|
|
4
|
+
import { ArcToStyleType } from '../common.type';
|
|
4
5
|
type ConstructorOption = ConstructorParameters<typeof Overlay<ArcToStyleType, [number, number][]>>[0] & {
|
|
5
6
|
/** 是否可显示控制点 */
|
|
6
7
|
isHandlePointsVisible?: boolean;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { OverlayType } from './index';
|
|
2
2
|
import { default as GeometricBoundary } from './public/geometricBoundary';
|
|
3
|
+
import { LineStyleType } from '../common.type';
|
|
3
4
|
type ConstructorOption = ConstructorParameters<typeof GeometricBoundary<LineStyleType>>[0] & {
|
|
4
5
|
/** 是否是 两点相连向外延展的无限线 */
|
|
5
6
|
isInfinite?: boolean;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { default as Overlay } from './public/overlay';
|
|
2
2
|
import { OverlayType } from './index';
|
|
3
3
|
import { EventHandler } from '../public/eventController';
|
|
4
|
+
import { PointStyleType } from '../common.type';
|
|
4
5
|
type ConstructorOption = ConstructorParameters<typeof Overlay<PointStyleType, [number, number]>>[0];
|
|
5
6
|
export default class Point extends Overlay<PointStyleType, [number, number]> {
|
|
6
7
|
private angle;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { OverlayType } from './index';
|
|
2
2
|
import { default as GeometricBoundary } from './public/geometricBoundary';
|
|
3
|
+
import { PolygonStyleType } from '../common.type';
|
|
3
4
|
type ConstructorOption = ConstructorParameters<typeof GeometricBoundary<PolygonStyleType>>[0] & {
|
|
4
5
|
/** 是否为矩形 */
|
|
5
6
|
isRect?: boolean;
|
|
@@ -2,6 +2,7 @@ import { default as _Canvas } from '../..';
|
|
|
2
2
|
import { OverlayType } from '../index';
|
|
3
3
|
import { EventHandler, default as EventController } from '../../public/eventController';
|
|
4
4
|
import { _Type_DeepPartial } from '../../..';
|
|
5
|
+
import { BaseLineStyle, PointStyleType } from '../../common.type';
|
|
5
6
|
type ConstructorOption<T, V> = ConstructorParameters<typeof EventController>[0] & {
|
|
6
7
|
/** 样式 */
|
|
7
8
|
style?: _Type_DeepPartial<T> | string;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { default as Overlay } from './public/overlay';
|
|
2
2
|
import { OverlayType } from './index';
|
|
3
3
|
import { EventHandler } from '../public/eventController';
|
|
4
|
+
import { TextStyleType } from '../common.type';
|
|
4
5
|
type ConstructorOption = ConstructorParameters<typeof Overlay<TextStyleType, [number, number]>>[0] & {
|
|
5
6
|
/** 文字 */
|
|
6
7
|
text?: string;
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
/** 默认中心点 */
|
|
2
|
+
export type DefaultCenter = Partial<{
|
|
3
|
+
top: number | `${number}%` | "top" | "middle" | "bottom";
|
|
4
|
+
bottom: number | `${number}%`;
|
|
5
|
+
left: number | `${number}%` | "left" | "center" | "right";
|
|
6
|
+
right: number | `${number}%`;
|
|
7
|
+
}>;
|
|
8
|
+
export type KnownStyleKeys = "light" | "dark";
|
|
9
|
+
/** 文本样式 */
|
|
10
|
+
export type TextStyleType = {
|
|
11
|
+
/** 颜色 */
|
|
12
|
+
color: string;
|
|
13
|
+
/** secondary颜色 */
|
|
14
|
+
secondary: string;
|
|
15
|
+
/** 描边色 */
|
|
16
|
+
stroke: string;
|
|
17
|
+
/** 字体大小 */
|
|
18
|
+
size: number;
|
|
19
|
+
/** 字体族 */
|
|
20
|
+
family: string;
|
|
21
|
+
/** 是否加粗 */
|
|
22
|
+
bold: boolean;
|
|
23
|
+
};
|
|
24
|
+
/** 网格样式 */
|
|
25
|
+
export type GridStyleType = {
|
|
26
|
+
axis: string;
|
|
27
|
+
grid: string;
|
|
28
|
+
innerGrid: string;
|
|
29
|
+
};
|
|
30
|
+
/** 点位样式 */
|
|
31
|
+
export type PointStyleType = {
|
|
32
|
+
/** 半径 */
|
|
33
|
+
radius: number;
|
|
34
|
+
/** 边框颜色 */
|
|
35
|
+
stroke: string;
|
|
36
|
+
/** 边框大小 */
|
|
37
|
+
width: number;
|
|
38
|
+
/** 填充颜色 */
|
|
39
|
+
fill: string;
|
|
40
|
+
};
|
|
41
|
+
/** 基础线样式 */
|
|
42
|
+
export type BaseLineStyle = {
|
|
43
|
+
/** 颜色 */
|
|
44
|
+
color: string;
|
|
45
|
+
/** 颜色 - hover */
|
|
46
|
+
color_hover: string;
|
|
47
|
+
/** 宽度 */
|
|
48
|
+
width: number;
|
|
49
|
+
/** 虚线 */
|
|
50
|
+
dash: boolean;
|
|
51
|
+
/** 虚线间隔 */
|
|
52
|
+
dashGap: number[];
|
|
53
|
+
/** 偏移虚线 */
|
|
54
|
+
dashOffset: number;
|
|
55
|
+
/** 末端的形状 */
|
|
56
|
+
cap: "butt" | "round" | "square";
|
|
57
|
+
/** 路径中的相连部分的形状 */
|
|
58
|
+
join: "bevel" | "round" | "miter";
|
|
59
|
+
};
|
|
60
|
+
/** 线样式 */
|
|
61
|
+
export type LineStyleType = {
|
|
62
|
+
/** 描边 */
|
|
63
|
+
stroke: BaseLineStyle;
|
|
64
|
+
/** 点位样式 */
|
|
65
|
+
point: PointStyleType;
|
|
66
|
+
};
|
|
67
|
+
/** 圆弧样式 */
|
|
68
|
+
export type ArcStyleType = {
|
|
69
|
+
/** 填充色 */
|
|
70
|
+
fill: string;
|
|
71
|
+
/** 填充色 - hover */
|
|
72
|
+
fill_hover: string;
|
|
73
|
+
/** 描边 */
|
|
74
|
+
stroke: BaseLineStyle;
|
|
75
|
+
/** 点位样式 */
|
|
76
|
+
point: PointStyleType;
|
|
77
|
+
};
|
|
78
|
+
/** 圆角样式 */
|
|
79
|
+
export type ArcToStyleType = {
|
|
80
|
+
/** 描边 */
|
|
81
|
+
stroke: BaseLineStyle;
|
|
82
|
+
/** 点位样式 */
|
|
83
|
+
point: PointStyleType;
|
|
84
|
+
};
|
|
85
|
+
/** 面样式 */
|
|
86
|
+
export type PolygonStyleType = {
|
|
87
|
+
/** 填充色 */
|
|
88
|
+
fill: string;
|
|
89
|
+
/** 填充色 - hover */
|
|
90
|
+
fill_hover: string;
|
|
91
|
+
/** 描边 */
|
|
92
|
+
stroke: BaseLineStyle;
|
|
93
|
+
/** 点位样式 */
|
|
94
|
+
point: PointStyleType;
|
|
95
|
+
};
|
|
96
|
+
/** 主题样式 */
|
|
97
|
+
export type StyleItemType = {
|
|
98
|
+
/** 背景色 */
|
|
99
|
+
background: string;
|
|
100
|
+
/** 文本样式 */
|
|
101
|
+
text: TextStyleType;
|
|
102
|
+
/** 网格样式 */
|
|
103
|
+
grid: GridStyleType;
|
|
104
|
+
/** 点位样式 */
|
|
105
|
+
point: PointStyleType;
|
|
106
|
+
/** 线样式 */
|
|
107
|
+
line: LineStyleType;
|
|
108
|
+
/** 圆弧样式 */
|
|
109
|
+
arc: ArcStyleType;
|
|
110
|
+
/** 圆角样式 */
|
|
111
|
+
arcTo: ArcToStyleType;
|
|
112
|
+
/** 面样式 */
|
|
113
|
+
polygon: PolygonStyleType;
|
|
114
|
+
};
|
|
115
|
+
/** 主题样式 */
|
|
116
|
+
export type StyleType = Record<KnownStyleKeys, StyleItemType> & Record<string, StyleItemType>;
|
|
117
|
+
export type DeepArray<T> = T | T[] | DeepArray<T>[];
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { default as Axis } from './axis';
|
|
2
2
|
import { default as LayerGroup } from '../LayerGroup';
|
|
3
3
|
import { default as EventController } from '../public/eventController';
|
|
4
|
+
import { DefaultCenter } from '../common.type';
|
|
4
5
|
type ConstructorOption = ConstructorParameters<typeof EventController>[0] & {
|
|
5
6
|
/** 画布 id */
|
|
6
7
|
id: string;
|
|
@@ -4,6 +4,7 @@ import { default as Event } from './event';
|
|
|
4
4
|
import { default as OverlayGroup, OverlayType } from '../OverlayGroup';
|
|
5
5
|
import { default as LayerGroup } from '../LayerGroup';
|
|
6
6
|
import { default as Layer } from '../LayerGroup/layer';
|
|
7
|
+
import { KnownStyleKeys, StyleType } from '../common.type';
|
|
7
8
|
type NodeType = LayerGroup | Layer | OverlayGroup | OverlayType;
|
|
8
9
|
type SingleOrArray<T> = T | T[];
|
|
9
10
|
declare class QuickMethod_Get extends Event {
|
package/dist/Canvas/index.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ import { default as Polygon } from './OverlayGroup/polygon';
|
|
|
9
9
|
import { default as Custom } from './OverlayGroup/custom';
|
|
10
10
|
import { default as Arc } from './OverlayGroup/arc';
|
|
11
11
|
import { default as ArcTo } from './OverlayGroup/arcTo';
|
|
12
|
+
import { DeepArray } from './common.type';
|
|
12
13
|
export type * from './index.types';
|
|
13
14
|
type ConstructorOption = ConstructorParameters<typeof QuickMethod>[0] & {
|
|
14
15
|
/** 轴线显示属性 */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nhanh-pure-function",
|
|
3
|
-
"version": "3.0.6-beta.
|
|
3
|
+
"version": "3.0.6-beta.9",
|
|
4
4
|
"description": "纯函数工具",
|
|
5
5
|
"main": "./dist/index.cjs.js",
|
|
6
6
|
"module": "./dist/index.es.js",
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
"ts-node": "^10.9.2",
|
|
26
26
|
"typescript": "^5.7.3",
|
|
27
27
|
"vite": "^6.1.0",
|
|
28
|
+
"vite-plugin-checker": "^0.10.3",
|
|
28
29
|
"vite-plugin-css-injected-by-js": "^3.5.2",
|
|
29
30
|
"vite-plugin-dts": "^4.5.0",
|
|
30
31
|
"vite-tsconfig-paths": "^5.1.4"
|