ranuts 0.1.0-alpha.14 → 0.1.0-alpha.15

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.
@@ -2,11 +2,13 @@ import { Container } from '@/utils/visual/vertex/container';
2
2
  import { Polygon } from '@/utils/visual/shape/polygon';
3
3
  import type { Shape } from '@/utils/visual/shape/shape';
4
4
  import type { CanvasRenderer } from '@/utils/visual/render/canvasRenderer';
5
+ import type { Point } from '@/utils/visual/vertex/point';
5
6
  export declare class Graphics extends Container {
6
7
  private _lineStyle;
7
8
  private _fillStyle;
8
9
  private _geometry;
9
10
  currentPath: Polygon | null;
11
+ type: string;
10
12
  constructor();
11
13
  protected drawShape(shape: Shape): Graphics;
12
14
  /**
@@ -16,4 +18,5 @@ export declare class Graphics extends Container {
16
18
  beginFill(color?: string, alpha?: number): Graphics;
17
19
  drawRect(x: number, y: number, width: number, height: number): Graphics;
18
20
  protected renderCanvas(render: CanvasRenderer): void;
21
+ containsPoint(p: Point): boolean;
19
22
  }
@@ -2,9 +2,15 @@ import type { Shape } from '@/utils/visual/shape/shape';
2
2
  import type { Fill } from '@/utils/visual/style/fill';
3
3
  import type { Line } from '@/utils/visual/style/line';
4
4
  import { GraphicsData } from '@/utils/visual/graphics/graphicsData';
5
+ import type { Point } from '@/utils/visual/vertex/point';
5
6
  export declare class GraphicsGeometry {
6
7
  graphicsData: GraphicsData[];
7
8
  constructor();
8
9
  drawShape(shape: Shape, fillStyle: Fill, lineStyle: Line): void;
9
10
  clear(): void;
11
+ /**
12
+ * @param p 待检测点
13
+ * @returns {boolean} 待检测点是否落在某一个子图形内
14
+ */
15
+ containsPoint(p: Point): boolean;
10
16
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ranuts",
3
- "version": "0.1.0-alpha.14",
3
+ "version": "0.1.0-alpha.15",
4
4
  "description": "lib",
5
5
  "main": "dist/index.umd.cjs",
6
6
  "module": "dist/index.js",
@@ -54,12 +54,6 @@
54
54
  "dist",
55
55
  "typings.d.ts"
56
56
  ],
57
- "scripts": {
58
- "build": "sh ./bin/build.sh",
59
- "test": "vitest run",
60
- "dev": "vite --host",
61
- "prepublish": "npm run build"
62
- },
63
57
  "keywords": [],
64
58
  "author": "",
65
59
  "license": "MIT",
@@ -75,5 +69,11 @@
75
69
  "dependencies": {
76
70
  "magic-string": "^0.27.0",
77
71
  "tesseract.js": "^5.1.0"
72
+ },
73
+ "scripts": {
74
+ "build": "sh ./bin/build.sh",
75
+ "test": "vitest run",
76
+ "dev": "vite --host",
77
+ "prepublish": "npm run build"
78
78
  }
79
- }
79
+ }
package/readme.md CHANGED
@@ -17,7 +17,7 @@ Some commonly used functions and tools
17
17
  Using npm:
18
18
 
19
19
  ```console
20
- npm install ranuts --save
20
+ npm install ranuts@latest --save
21
21
  ```
22
22
 
23
23
  ## Document