@soonspacejs/plugin-drawing-shape 2.11.38 → 2.11.40

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/README.md CHANGED
@@ -1,5 +1,5 @@
1
- # @soonspacejs/plugin-drawing-shape
2
-
3
- > Drawing-shape plugin for SoonSpace.js
4
-
5
- Document: [http://www.xwbuilders.com:8800/plugin/drawing-shape.html](http://www.xwbuilders.com:8800/plugin/drawing-shape.html)
1
+ # @soonspacejs/plugin-drawing-shape
2
+
3
+ > Drawing-shape plugin for SoonSpace.js
4
+
5
+ Document: [http://www.xwbuilders.com:8800/plugin/drawing-shape.html](http://www.xwbuilders.com:8800/plugin/drawing-shape.html)
@@ -0,0 +1,45 @@
1
+ import SoonSpace from 'soonspacejs';
2
+ import type { SetOptionsPointInfo, SetOptionsLineInfo, SetOptionsPolygonInfo, SetOptionsCircleInfo } from 'soonspacejs/types/Library';
3
+ import type { Object3D } from 'three';
4
+ export type DrawingPointInfo = SetOptionsPointInfo;
5
+ export interface DrawingPointEvents {
6
+ onCancel?: () => void;
7
+ }
8
+ export type DrawingLineInfo = Omit<SetOptionsLineInfo, 'points'> & {
9
+ offsetY?: number;
10
+ };
11
+ export interface DrawingLineEvents {
12
+ onCancel?: () => void;
13
+ onCancelPrev?: () => void;
14
+ }
15
+ export type DrawingPolygonInfo = Omit<SetOptionsPolygonInfo, 'points' | 'yHeight'> & {
16
+ width?: number | undefined;
17
+ offsetY?: number;
18
+ };
19
+ export interface DrawingPolygonEvents {
20
+ onCancel?: () => void;
21
+ onCancelPrev?: () => void;
22
+ }
23
+ export type DrawingCircleInfo = Omit<SetOptionsCircleInfo, 'radius'> & {
24
+ offsetY?: number;
25
+ };
26
+ export interface DrawingCircleEvents {
27
+ onCancel?: () => void;
28
+ }
29
+ export default class DrawIngShapePlugin {
30
+ readonly ssp: SoonSpace;
31
+ readonly viewport: SoonSpace['viewport'];
32
+ constructor(ssp: SoonSpace);
33
+ getFirstIntersect(event: MouseEvent, drawingObj?: (Object3D | null)[] | Object3D | null): import("three").Intersection<Object3D<import("three").Object3DEventMap>>;
34
+ /**
35
+ * 绘图时使用的临时 layer
36
+ */
37
+ drawingLayer: number;
38
+ configLayer(drawingObj: Object3D[] | Object3D): void;
39
+ recoverLayer(drawingObj: Object3D[] | Object3D): void;
40
+ drawingPoint(options: DrawingPointInfo, events?: DrawingPointEvents): Promise<SetOptionsPointInfo>;
41
+ drawingLine(options: DrawingLineInfo, events?: DrawingLineEvents): Promise<SetOptionsLineInfo>;
42
+ drawingPolygon(options: DrawingPolygonInfo, events?: DrawingPolygonEvents): Promise<SetOptionsPolygonInfo>;
43
+ drawingCircle(options: DrawingCircleInfo, events?: DrawingCircleEvents): Promise<SetOptionsCircleInfo>;
44
+ clearDrawingCanvas3D(): void;
45
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@soonspacejs/plugin-drawing-shape",
3
3
  "pluginName": "DrawingShapePlugin",
4
- "version": "2.11.38",
4
+ "version": "2.11.40",
5
5
  "description": "DrawingShapePlugin plugin for SoonSpace.js",
6
6
  "main": "dist/index.esm.js",
7
7
  "module": "dist/index.esm.js",
@@ -13,8 +13,8 @@
13
13
  ],
14
14
  "author": "xunwei",
15
15
  "license": "UNLICENSED",
16
- "gitHead": "af8d864a695bc488b8625268189a1b07eecd9775",
16
+ "gitHead": "fb93438e409cbbd6930d3f8218c7c95db92e94d0",
17
17
  "peerDependencies": {
18
- "soonspacejs": "2.11.38"
18
+ "soonspacejs": "2.11.40"
19
19
  }
20
20
  }