@snaptrude/plugin-client 0.0.3 → 0.0.4

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.
Files changed (54) hide show
  1. package/dist/api/core/geom/arc.d.ts +5 -0
  2. package/dist/api/core/geom/arc.d.ts.map +1 -0
  3. package/dist/api/core/geom/curve.d.ts +5 -0
  4. package/dist/api/core/geom/curve.d.ts.map +1 -0
  5. package/dist/api/core/geom/index.d.ts +17 -0
  6. package/dist/api/core/geom/index.d.ts.map +1 -0
  7. package/dist/api/core/geom/line.d.ts +5 -0
  8. package/dist/api/core/geom/line.d.ts.map +1 -0
  9. package/dist/api/core/geom/profile.d.ts +7 -0
  10. package/dist/api/core/geom/profile.d.ts.map +1 -0
  11. package/dist/api/core/index.d.ts +11 -0
  12. package/dist/api/core/index.d.ts.map +1 -0
  13. package/dist/api/core/math/index.d.ts +11 -0
  14. package/dist/api/core/math/index.d.ts.map +1 -0
  15. package/dist/api/core/math/quat.d.ts +5 -0
  16. package/dist/api/core/math/quat.d.ts.map +1 -0
  17. package/dist/api/core/math/vec3.d.ts +5 -0
  18. package/dist/api/core/math/vec3.d.ts.map +1 -0
  19. package/dist/api/entity/index.d.ts +3 -0
  20. package/dist/api/entity/index.d.ts.map +1 -1
  21. package/dist/api/entity/space.d.ts +3 -2
  22. package/dist/api/entity/space.d.ts.map +1 -1
  23. package/dist/api/entity/story.d.ts +9 -0
  24. package/dist/api/entity/story.d.ts.map +1 -0
  25. package/dist/api/index.d.ts +6 -0
  26. package/dist/api/index.d.ts.map +1 -1
  27. package/dist/api/units/index.d.ts +7 -0
  28. package/dist/api/units/index.d.ts.map +1 -0
  29. package/dist/index.cjs +274 -15
  30. package/dist/index.cjs.map +1 -1
  31. package/dist/index.d.ts +1 -0
  32. package/dist/index.d.ts.map +1 -1
  33. package/dist/index.js +259 -8
  34. package/dist/index.js.map +1 -1
  35. package/dist/plugin-worker.d.ts +48 -0
  36. package/dist/plugin-worker.d.ts.map +1 -0
  37. package/package.json +2 -2
  38. package/src/api/core/geom/arc.ts +7 -0
  39. package/src/api/core/geom/curve.ts +7 -0
  40. package/src/api/core/geom/index.ts +25 -0
  41. package/src/api/core/geom/line.ts +7 -0
  42. package/src/api/core/geom/profile.ts +17 -0
  43. package/src/api/core/index.ts +17 -0
  44. package/src/api/core/math/index.ts +17 -0
  45. package/src/api/core/math/quat.ts +7 -0
  46. package/src/api/core/math/vec3.ts +7 -0
  47. package/src/api/entity/index.ts +4 -0
  48. package/src/api/entity/space.ts +23 -5
  49. package/src/api/entity/story.ts +66 -0
  50. package/src/api/index.ts +8 -0
  51. package/src/api/units/index.ts +34 -0
  52. package/src/index.ts +1 -0
  53. package/src/plugin-worker.ts +91 -0
  54. package/tsconfig.json +1 -1
@@ -0,0 +1,5 @@
1
+ import { PluginArcApi } from "@snaptrude/plugin-core";
2
+ export declare class ClientArcApi extends PluginArcApi {
3
+ constructor();
4
+ }
5
+ //# sourceMappingURL=arc.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"arc.d.ts","sourceRoot":"","sources":["../../../../src/api/core/geom/arc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AAErD,qBAAa,YAAa,SAAQ,YAAY;;CAI7C"}
@@ -0,0 +1,5 @@
1
+ import { PluginCurveApi } from "@snaptrude/plugin-core";
2
+ export declare class ClientCurveApi extends PluginCurveApi {
3
+ constructor();
4
+ }
5
+ //# sourceMappingURL=curve.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"curve.d.ts","sourceRoot":"","sources":["../../../../src/api/core/geom/curve.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAEvD,qBAAa,cAAe,SAAQ,cAAc;;CAIjD"}
@@ -0,0 +1,17 @@
1
+ import { PluginGeomApi } from "@snaptrude/plugin-core";
2
+ import { ClientLineApi } from "./line";
3
+ import { ClientArcApi } from "./arc";
4
+ import { ClientCurveApi } from "./curve";
5
+ import { ClientProfileApi } from "./profile";
6
+ export declare class ClientGeomApi extends PluginGeomApi {
7
+ line: ClientLineApi;
8
+ arc: ClientArcApi;
9
+ curve: ClientCurveApi;
10
+ profile: ClientProfileApi;
11
+ constructor();
12
+ }
13
+ export * from "./line";
14
+ export * from "./arc";
15
+ export * from "./curve";
16
+ export * from "./profile";
17
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/api/core/geom/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAA;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAA;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAA;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AACxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAA;AAE5C,qBAAa,aAAc,SAAQ,aAAa;IACvC,IAAI,EAAE,aAAa,CAAA;IACnB,GAAG,EAAE,YAAY,CAAA;IACjB,KAAK,EAAE,cAAc,CAAA;IACrB,OAAO,EAAE,gBAAgB,CAAA;;CASjC;AAED,cAAc,QAAQ,CAAA;AACtB,cAAc,OAAO,CAAA;AACrB,cAAc,SAAS,CAAA;AACvB,cAAc,WAAW,CAAA"}
@@ -0,0 +1,5 @@
1
+ import { PluginLineApi } from "@snaptrude/plugin-core";
2
+ export declare class ClientLineApi extends PluginLineApi {
3
+ constructor();
4
+ }
5
+ //# sourceMappingURL=line.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"line.d.ts","sourceRoot":"","sources":["../../../../src/api/core/geom/line.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAA;AAEtD,qBAAa,aAAc,SAAQ,aAAa;;CAI/C"}
@@ -0,0 +1,7 @@
1
+ import { PluginProfileApi } from "@snaptrude/plugin-core";
2
+ import type { PProfile, PluginProfileFromLinePointsArgs } from "@snaptrude/plugin-core";
3
+ export declare class ClientProfileApi extends PluginProfileApi {
4
+ constructor();
5
+ fromLinePoints(args: PluginProfileFromLinePointsArgs): Promise<PProfile>;
6
+ }
7
+ //# sourceMappingURL=profile.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"profile.d.ts","sourceRoot":"","sources":["../../../../src/api/core/geom/profile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AACzD,OAAO,KAAK,EAAE,QAAQ,EAAE,+BAA+B,EAAE,MAAM,wBAAwB,CAAA;AAGvF,qBAAa,gBAAiB,SAAQ,gBAAgB;;IAKvC,cAAc,CAAC,IAAI,EAAE,+BAA+B,GAAG,OAAO,CAAC,QAAQ,CAAC;CAOtF"}
@@ -0,0 +1,11 @@
1
+ import { PluginCoreApi } from "@snaptrude/plugin-core";
2
+ import { ClientMathApi } from "./math";
3
+ import { ClientGeomApi } from "./geom";
4
+ export declare class ClientCoreApi extends PluginCoreApi {
5
+ math: ClientMathApi;
6
+ geom: ClientGeomApi;
7
+ constructor();
8
+ }
9
+ export * from "./math";
10
+ export * from "./geom";
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/core/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAA;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAA;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAA;AAEtC,qBAAa,aAAc,SAAQ,aAAa;IACvC,IAAI,EAAE,aAAa,CAAA;IACnB,IAAI,EAAE,aAAa,CAAA;;CAO3B;AAED,cAAc,QAAQ,CAAA;AACtB,cAAc,QAAQ,CAAA"}
@@ -0,0 +1,11 @@
1
+ import { PluginMathApi } from "@snaptrude/plugin-core";
2
+ import { ClientVec3Api } from "./vec3";
3
+ import { ClientQuatApi } from "./quat";
4
+ export declare class ClientMathApi extends PluginMathApi {
5
+ vec3: ClientVec3Api;
6
+ quat: ClientQuatApi;
7
+ constructor();
8
+ }
9
+ export * from "./vec3";
10
+ export * from "./quat";
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/api/core/math/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAA;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAA;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAA;AAEtC,qBAAa,aAAc,SAAQ,aAAa;IACvC,IAAI,EAAE,aAAa,CAAA;IACnB,IAAI,EAAE,aAAa,CAAA;;CAO3B;AAED,cAAc,QAAQ,CAAA;AACtB,cAAc,QAAQ,CAAA"}
@@ -0,0 +1,5 @@
1
+ import { PluginQuatApi } from "@snaptrude/plugin-core";
2
+ export declare class ClientQuatApi extends PluginQuatApi {
3
+ constructor();
4
+ }
5
+ //# sourceMappingURL=quat.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"quat.d.ts","sourceRoot":"","sources":["../../../../src/api/core/math/quat.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAA;AAEtD,qBAAa,aAAc,SAAQ,aAAa;;CAI/C"}
@@ -0,0 +1,5 @@
1
+ import { PluginVec3Api } from "@snaptrude/plugin-core";
2
+ export declare class ClientVec3Api extends PluginVec3Api {
3
+ constructor();
4
+ }
5
+ //# sourceMappingURL=vec3.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vec3.d.ts","sourceRoot":"","sources":["../../../../src/api/core/math/vec3.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAA;AAEtD,qBAAa,aAAc,SAAQ,aAAa;;CAI/C"}
@@ -1,8 +1,11 @@
1
1
  import { PluginEntityApi } from "@snaptrude/plugin-core";
2
2
  import { ClientSpaceApi } from "./space";
3
+ import { ClientStoryApi } from "./story";
3
4
  export declare class ClientEntityApi extends PluginEntityApi {
4
5
  space: ClientSpaceApi;
6
+ story: ClientStoryApi;
5
7
  constructor();
6
8
  }
7
9
  export * from "./space";
10
+ export * from "./story";
8
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/entity/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAExC,qBAAa,eAAgB,SAAQ,eAAe;IAC3C,KAAK,EAAE,cAAc,CAAA;;CAM7B;AAED,cAAc,SAAS,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/entity/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAExC,qBAAa,eAAgB,SAAQ,eAAe;IAC3C,KAAK,EAAE,cAAc,CAAA;IACrB,KAAK,EAAE,cAAc,CAAA;;CAO7B;AAED,cAAc,SAAS,CAAA;AACvB,cAAc,SAAS,CAAA"}
@@ -1,8 +1,9 @@
1
- import { PluginSpaceApi, PluginSpaceCreateRectangularArgs, PluginSpaceCreateRectangularResult, PluginSpaceDeleteByIdArgs, PluginSpaceDeleteByIdResult, PluginSpaceGetByIdArgs, PluginSpaceGetByIdResult, PluginSpaceGetAllResult } from "@snaptrude/plugin-core";
1
+ import { PluginSpaceApi, PluginSpaceCreateRectangularArgs, PluginSpaceCreateRectangularResult, PluginSpaceCreateFromProfileArgs, PluginSpaceCreateFromProfileResult, PluginSpaceDeleteByIdArgs, PluginSpaceDeleteByIdResult, PluginSpaceGetArgs, PluginSpaceGetResult, PluginSpaceGetAllResult } from "@snaptrude/plugin-core";
2
2
  export declare class ClientSpaceApi extends PluginSpaceApi {
3
3
  constructor();
4
4
  createRectangular({ position, dimensions, }: PluginSpaceCreateRectangularArgs): Promise<PluginSpaceCreateRectangularResult>;
5
- getById({ spaceId, properties, }: PluginSpaceGetByIdArgs): Promise<PluginSpaceGetByIdResult>;
5
+ createFromProfile({ profile, extrudeHeight, position, }: PluginSpaceCreateFromProfileArgs): Promise<PluginSpaceCreateFromProfileResult>;
6
+ get({ spaceId, properties, }: PluginSpaceGetArgs): Promise<PluginSpaceGetResult>;
6
7
  getAll(): Promise<PluginSpaceGetAllResult>;
7
8
  deleteById({ spaceId, }: PluginSpaceDeleteByIdArgs): Promise<PluginSpaceDeleteByIdResult>;
8
9
  }
@@ -1 +1 @@
1
- {"version":3,"file":"space.d.ts","sourceRoot":"","sources":["../../../src/api/entity/space.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,gCAAgC,EAChC,kCAAkC,EAClC,yBAAyB,EACzB,2BAA2B,EAC3B,sBAAsB,EACtB,wBAAwB,EACxB,uBAAuB,EACxB,MAAM,wBAAwB,CAAA;AAG/B,qBAAa,cAAe,SAAQ,cAAc;;IAKnC,iBAAiB,CAAC,EAC7B,QAAQ,EACR,UAAU,GACX,EAAE,gCAAgC,GAAG,OAAO,CAAC,kCAAkC,CAAC;IAWpE,OAAO,CAAC,EACnB,OAAO,EACP,UAAU,GACX,EAAE,sBAAsB,GAAG,OAAO,CAAC,wBAAwB,CAAC;IAWhD,MAAM,IAAI,OAAO,CAAC,uBAAuB,CAAC;IAO1C,UAAU,CAAC,EACtB,OAAO,GACR,EAAE,yBAAyB,GAAG,OAAO,CAAC,2BAA2B,CAAC;CASpE"}
1
+ {"version":3,"file":"space.d.ts","sourceRoot":"","sources":["../../../src/api/entity/space.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,gCAAgC,EAChC,kCAAkC,EAClC,gCAAgC,EAChC,kCAAkC,EAClC,yBAAyB,EACzB,2BAA2B,EAC3B,kBAAkB,EAClB,oBAAoB,EACpB,uBAAuB,EACxB,MAAM,wBAAwB,CAAA;AAG/B,qBAAa,cAAe,SAAQ,cAAc;;IAKnC,iBAAiB,CAAC,EAC7B,QAAQ,EACR,UAAU,GACX,EAAE,gCAAgC,GAAG,OAAO,CAAC,kCAAkC,CAAC;IAWpE,iBAAiB,CAAC,EAC7B,OAAO,EACP,aAAa,EACb,QAAQ,GACT,EAAE,gCAAgC,GAAG,OAAO,CAAC,kCAAkC,CAAC;IAYpE,GAAG,CAAC,EACf,OAAO,EACP,UAAU,GACX,EAAE,kBAAkB,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAWxC,MAAM,IAAI,OAAO,CAAC,uBAAuB,CAAC;IAO1C,UAAU,CAAC,EACtB,OAAO,GACR,EAAE,yBAAyB,GAAG,OAAO,CAAC,2BAA2B,CAAC;CASpE"}
@@ -0,0 +1,9 @@
1
+ import { PluginStoryApi, PluginStoryGetArgs, PluginStoryGetResult, PluginStoryGetAllResult, PluginStoryCreateArgs, PluginStoryCreateResult, PluginStoryUpdateArgs, PluginStoryUpdateResult } from "@snaptrude/plugin-core";
2
+ export declare class ClientStoryApi extends PluginStoryApi {
3
+ constructor();
4
+ get({ storyValue, properties, }: PluginStoryGetArgs): Promise<PluginStoryGetResult>;
5
+ getAll(): Promise<PluginStoryGetAllResult>;
6
+ create({ storyValue, height, }: PluginStoryCreateArgs): Promise<PluginStoryCreateResult>;
7
+ update({ storyValue, height, }: PluginStoryUpdateArgs): Promise<PluginStoryUpdateResult>;
8
+ }
9
+ //# sourceMappingURL=story.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"story.d.ts","sourceRoot":"","sources":["../../../src/api/entity/story.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,oBAAoB,EACpB,uBAAuB,EACvB,qBAAqB,EACrB,uBAAuB,EACvB,qBAAqB,EACrB,uBAAuB,EACxB,MAAM,wBAAwB,CAAA;AAG/B,qBAAa,cAAe,SAAQ,cAAc;;IAKnC,GAAG,CAAC,EACf,UAAU,EACV,UAAU,GACX,EAAE,kBAAkB,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAWxC,MAAM,IAAI,OAAO,CAAC,uBAAuB,CAAC;IAO1C,MAAM,CAAC,EAClB,UAAU,EACV,MAAM,GACP,EAAE,qBAAqB,GAAG,OAAO,CAAC,uBAAuB,CAAC;IAW9C,MAAM,CAAC,EAClB,UAAU,EACV,MAAM,GACP,EAAE,qBAAqB,GAAG,OAAO,CAAC,uBAAuB,CAAC;CAU5D"}
@@ -1,13 +1,19 @@
1
+ import { ClientCoreApi } from "./core";
1
2
  import { ClientEntityApi } from "./entity";
2
3
  import { ClientToolsApi } from "./tools";
4
+ import { ClientUnitsApi } from "./units";
3
5
  import { PluginApi } from "@snaptrude/plugin-core";
4
6
  export declare class ClientPluginApi extends PluginApi {
5
7
  private static instance;
8
+ core: ClientCoreApi;
6
9
  tools: ClientToolsApi;
7
10
  entity: ClientEntityApi;
11
+ units: ClientUnitsApi;
8
12
  private constructor();
9
13
  static getInstance(): ClientPluginApi;
10
14
  }
15
+ export * from "./core";
11
16
  export * from "./entity";
12
17
  export * from "./tools";
18
+ export * from "./units";
13
19
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAElD,qBAAa,eAAgB,SAAQ,SAAS;IAC5C,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAiB;IAEjC,KAAK,EAAE,cAAc,CAAA;IACrB,MAAM,EAAE,eAAe,CAAA;IAE9B,OAAO;IAMP,MAAM,CAAC,WAAW,IAAI,eAAe;CAMtC;AAED,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAA;AACtC,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAElD,qBAAa,eAAgB,SAAQ,SAAS;IAC5C,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAiB;IAEjC,IAAI,EAAE,aAAa,CAAA;IACnB,KAAK,EAAE,cAAc,CAAA;IACrB,MAAM,EAAE,eAAe,CAAA;IACvB,KAAK,EAAE,cAAc,CAAA;IAE5B,OAAO;IAQP,MAAM,CAAC,WAAW,IAAI,eAAe;CAMtC;AAED,cAAc,QAAQ,CAAA;AACtB,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AACvB,cAAc,SAAS,CAAA"}
@@ -0,0 +1,7 @@
1
+ import { PluginUnitsApi, PluginUnitsConvertFromArgs, PluginUnitsConvertFromResult, PluginUnitsConvertToArgs, PluginUnitsConvertToResult } from "@snaptrude/plugin-core";
2
+ export declare class ClientUnitsApi extends PluginUnitsApi {
3
+ constructor();
4
+ convertFrom(args: PluginUnitsConvertFromArgs): Promise<PluginUnitsConvertFromResult>;
5
+ convertTo(args: PluginUnitsConvertToArgs): Promise<PluginUnitsConvertToResult>;
6
+ }
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/units/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,0BAA0B,EAC1B,4BAA4B,EAC5B,wBAAwB,EACxB,0BAA0B,EAC3B,MAAM,wBAAwB,CAAA;AAG/B,qBAAa,cAAe,SAAQ,cAAc;;IAKnC,WAAW,CACtB,IAAI,EAAE,0BAA0B,GAC/B,OAAO,CAAC,4BAA4B,CAAC;IAQ3B,SAAS,CACpB,IAAI,EAAE,wBAAwB,GAC7B,OAAO,CAAC,0BAA0B,CAAC;CAOvC"}
package/dist/index.cjs CHANGED
@@ -30,23 +30,90 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
30
30
  // src/index.ts
31
31
  var index_exports = {};
32
32
  __export(index_exports, {
33
+ ClientArcApi: () => ClientArcApi,
34
+ ClientCoreApi: () => ClientCoreApi,
35
+ ClientCurveApi: () => ClientCurveApi,
33
36
  ClientEntityApi: () => ClientEntityApi,
37
+ ClientGeomApi: () => ClientGeomApi,
38
+ ClientLineApi: () => ClientLineApi,
39
+ ClientMathApi: () => ClientMathApi,
34
40
  ClientPluginApi: () => ClientPluginApi,
41
+ ClientProfileApi: () => ClientProfileApi,
42
+ ClientQuatApi: () => ClientQuatApi,
35
43
  ClientSelectionApi: () => ClientSelectionApi,
36
44
  ClientSpaceApi: () => ClientSpaceApi,
45
+ ClientStoryApi: () => ClientStoryApi,
37
46
  ClientToolsApi: () => ClientToolsApi,
38
47
  ClientTransformApi: () => ClientTransformApi,
48
+ ClientUnitsApi: () => ClientUnitsApi,
49
+ ClientVec3Api: () => ClientVec3Api,
50
+ PluginWorker: () => PluginWorker,
39
51
  createHostApi: () => createHostApi,
40
52
  getHostApi: () => getHostApi,
41
53
  snaptrude: () => snaptrude
42
54
  });
43
55
  module.exports = __toCommonJS(index_exports);
44
56
 
45
- // src/api/entity/index.ts
46
- var import_plugin_core2 = require("@snaptrude/plugin-core");
57
+ // src/api/core/index.ts
58
+ var import_plugin_core9 = require("@snaptrude/plugin-core");
47
59
 
48
- // src/api/entity/space.ts
60
+ // src/api/core/math/index.ts
61
+ var import_plugin_core3 = require("@snaptrude/plugin-core");
62
+
63
+ // src/api/core/math/vec3.ts
49
64
  var import_plugin_core = require("@snaptrude/plugin-core");
65
+ var ClientVec3Api = class extends import_plugin_core.PluginVec3Api {
66
+ constructor() {
67
+ super();
68
+ }
69
+ };
70
+
71
+ // src/api/core/math/quat.ts
72
+ var import_plugin_core2 = require("@snaptrude/plugin-core");
73
+ var ClientQuatApi = class extends import_plugin_core2.PluginQuatApi {
74
+ constructor() {
75
+ super();
76
+ }
77
+ };
78
+
79
+ // src/api/core/math/index.ts
80
+ var ClientMathApi = class extends import_plugin_core3.PluginMathApi {
81
+ constructor() {
82
+ super();
83
+ this.vec3 = new ClientVec3Api();
84
+ this.quat = new ClientQuatApi();
85
+ }
86
+ };
87
+
88
+ // src/api/core/geom/index.ts
89
+ var import_plugin_core8 = require("@snaptrude/plugin-core");
90
+
91
+ // src/api/core/geom/line.ts
92
+ var import_plugin_core4 = require("@snaptrude/plugin-core");
93
+ var ClientLineApi = class extends import_plugin_core4.PluginLineApi {
94
+ constructor() {
95
+ super();
96
+ }
97
+ };
98
+
99
+ // src/api/core/geom/arc.ts
100
+ var import_plugin_core5 = require("@snaptrude/plugin-core");
101
+ var ClientArcApi = class extends import_plugin_core5.PluginArcApi {
102
+ constructor() {
103
+ super();
104
+ }
105
+ };
106
+
107
+ // src/api/core/geom/curve.ts
108
+ var import_plugin_core6 = require("@snaptrude/plugin-core");
109
+ var ClientCurveApi = class extends import_plugin_core6.PluginCurveApi {
110
+ constructor() {
111
+ super();
112
+ }
113
+ };
114
+
115
+ // src/api/core/geom/profile.ts
116
+ var import_plugin_core7 = require("@snaptrude/plugin-core");
50
117
 
51
118
  // src/host-api.ts
52
119
  var Comlink = __toESM(require("comlink"), 1);
@@ -76,8 +143,46 @@ function getHostApi() {
76
143
  };
77
144
  }
78
145
 
146
+ // src/api/core/geom/profile.ts
147
+ var ClientProfileApi = class extends import_plugin_core7.PluginProfileApi {
148
+ constructor() {
149
+ super();
150
+ }
151
+ async fromLinePoints(args) {
152
+ const hostApi = getHostApi();
153
+ return hostApi.call({
154
+ method: "core.geom.profile.fromLinePoints",
155
+ args
156
+ });
157
+ }
158
+ };
159
+
160
+ // src/api/core/geom/index.ts
161
+ var ClientGeomApi = class extends import_plugin_core8.PluginGeomApi {
162
+ constructor() {
163
+ super();
164
+ this.line = new ClientLineApi();
165
+ this.arc = new ClientArcApi();
166
+ this.curve = new ClientCurveApi();
167
+ this.profile = new ClientProfileApi();
168
+ }
169
+ };
170
+
171
+ // src/api/core/index.ts
172
+ var ClientCoreApi = class extends import_plugin_core9.PluginCoreApi {
173
+ constructor() {
174
+ super();
175
+ this.math = new ClientMathApi();
176
+ this.geom = new ClientGeomApi();
177
+ }
178
+ };
179
+
180
+ // src/api/entity/index.ts
181
+ var import_plugin_core12 = require("@snaptrude/plugin-core");
182
+
79
183
  // src/api/entity/space.ts
80
- var ClientSpaceApi = class extends import_plugin_core.PluginSpaceApi {
184
+ var import_plugin_core10 = require("@snaptrude/plugin-core");
185
+ var ClientSpaceApi = class extends import_plugin_core10.PluginSpaceApi {
81
186
  constructor() {
82
187
  super();
83
188
  }
@@ -94,13 +199,28 @@ var ClientSpaceApi = class extends import_plugin_core.PluginSpaceApi {
94
199
  }
95
200
  });
96
201
  }
97
- async getById({
202
+ async createFromProfile({
203
+ profile,
204
+ extrudeHeight,
205
+ position
206
+ }) {
207
+ const hostApi = getHostApi();
208
+ return hostApi.call({
209
+ method: "entity.space.createFromProfile",
210
+ args: {
211
+ profile,
212
+ extrudeHeight,
213
+ position
214
+ }
215
+ });
216
+ }
217
+ async get({
98
218
  spaceId,
99
219
  properties
100
220
  }) {
101
221
  const hostApi = getHostApi();
102
222
  return hostApi.call({
103
- method: "entity.space.getById",
223
+ method: "entity.space.get",
104
224
  args: {
105
225
  spaceId,
106
226
  properties
@@ -126,20 +246,74 @@ var ClientSpaceApi = class extends import_plugin_core.PluginSpaceApi {
126
246
  }
127
247
  };
128
248
 
249
+ // src/api/entity/story.ts
250
+ var import_plugin_core11 = require("@snaptrude/plugin-core");
251
+ var ClientStoryApi = class extends import_plugin_core11.PluginStoryApi {
252
+ constructor() {
253
+ super();
254
+ }
255
+ async get({
256
+ storyValue,
257
+ properties
258
+ }) {
259
+ const hostApi = getHostApi();
260
+ return hostApi.call({
261
+ method: "entity.story.get",
262
+ args: {
263
+ storyValue,
264
+ properties
265
+ }
266
+ });
267
+ }
268
+ async getAll() {
269
+ const hostApi = getHostApi();
270
+ return hostApi.call({
271
+ method: "entity.story.getAll"
272
+ });
273
+ }
274
+ async create({
275
+ storyValue,
276
+ height
277
+ }) {
278
+ const hostApi = getHostApi();
279
+ return hostApi.call({
280
+ method: "entity.story.create",
281
+ args: {
282
+ storyValue,
283
+ height
284
+ }
285
+ });
286
+ }
287
+ async update({
288
+ storyValue,
289
+ height
290
+ }) {
291
+ const hostApi = getHostApi();
292
+ return hostApi.call({
293
+ method: "entity.story.update",
294
+ args: {
295
+ storyValue,
296
+ height
297
+ }
298
+ });
299
+ }
300
+ };
301
+
129
302
  // src/api/entity/index.ts
130
- var ClientEntityApi = class extends import_plugin_core2.PluginEntityApi {
303
+ var ClientEntityApi = class extends import_plugin_core12.PluginEntityApi {
131
304
  constructor() {
132
305
  super();
133
306
  this.space = new ClientSpaceApi();
307
+ this.story = new ClientStoryApi();
134
308
  }
135
309
  };
136
310
 
137
311
  // src/api/tools/index.ts
138
- var import_plugin_core5 = require("@snaptrude/plugin-core");
312
+ var import_plugin_core15 = require("@snaptrude/plugin-core");
139
313
 
140
314
  // src/api/tools/selection.ts
141
- var import_plugin_core3 = require("@snaptrude/plugin-core");
142
- var ClientSelectionApi = class extends import_plugin_core3.PluginSelectionApi {
315
+ var import_plugin_core13 = require("@snaptrude/plugin-core");
316
+ var ClientSelectionApi = class extends import_plugin_core13.PluginSelectionApi {
143
317
  constructor() {
144
318
  super();
145
319
  }
@@ -152,8 +326,8 @@ var ClientSelectionApi = class extends import_plugin_core3.PluginSelectionApi {
152
326
  };
153
327
 
154
328
  // src/api/tools/transform.ts
155
- var import_plugin_core4 = require("@snaptrude/plugin-core");
156
- var ClientTransformApi = class extends import_plugin_core4.PluginTransformApi {
329
+ var import_plugin_core14 = require("@snaptrude/plugin-core");
330
+ var ClientTransformApi = class extends import_plugin_core14.PluginTransformApi {
157
331
  constructor() {
158
332
  super();
159
333
  }
@@ -190,7 +364,7 @@ var ClientTransformApi = class extends import_plugin_core4.PluginTransformApi {
190
364
  };
191
365
 
192
366
  // src/api/tools/index.ts
193
- var ClientToolsApi = class extends import_plugin_core5.PluginToolsApi {
367
+ var ClientToolsApi = class extends import_plugin_core15.PluginToolsApi {
194
368
  constructor() {
195
369
  super();
196
370
  this.selection = new ClientSelectionApi();
@@ -198,13 +372,37 @@ var ClientToolsApi = class extends import_plugin_core5.PluginToolsApi {
198
372
  }
199
373
  };
200
374
 
375
+ // src/api/units/index.ts
376
+ var import_plugin_core16 = require("@snaptrude/plugin-core");
377
+ var ClientUnitsApi = class extends import_plugin_core16.PluginUnitsApi {
378
+ constructor() {
379
+ super();
380
+ }
381
+ async convertFrom(args) {
382
+ const hostApi = getHostApi();
383
+ return hostApi.call({
384
+ method: "units.convertFrom",
385
+ args
386
+ });
387
+ }
388
+ async convertTo(args) {
389
+ const hostApi = getHostApi();
390
+ return hostApi.call({
391
+ method: "units.convertTo",
392
+ args
393
+ });
394
+ }
395
+ };
396
+
201
397
  // src/api/index.ts
202
- var import_plugin_core6 = require("@snaptrude/plugin-core");
203
- var ClientPluginApi = class _ClientPluginApi extends import_plugin_core6.PluginApi {
398
+ var import_plugin_core17 = require("@snaptrude/plugin-core");
399
+ var ClientPluginApi = class _ClientPluginApi extends import_plugin_core17.PluginApi {
204
400
  constructor() {
205
401
  super();
402
+ this.core = new ClientCoreApi();
206
403
  this.tools = new ClientToolsApi();
207
404
  this.entity = new ClientEntityApi();
405
+ this.units = new ClientUnitsApi();
208
406
  }
209
407
  static getInstance() {
210
408
  if (!_ClientPluginApi.instance) {
@@ -214,16 +412,77 @@ var ClientPluginApi = class _ClientPluginApi extends import_plugin_core6.PluginA
214
412
  }
215
413
  };
216
414
 
415
+ // src/plugin-worker.ts
416
+ var Comlink2 = __toESM(require("comlink"), 1);
417
+ var PluginWorker = class {
418
+ constructor() {
419
+ this.hostAPI = Comlink2.wrap(
420
+ self
421
+ );
422
+ }
423
+ sendToUI(action, payload) {
424
+ ;
425
+ this.hostAPI.ui.sendToUI({ action, payload });
426
+ }
427
+ async init() {
428
+ console.log(this.pluginId, "init() called");
429
+ console.log(this.pluginId, "Initialization complete");
430
+ }
431
+ async destroy() {
432
+ console.log(this.pluginId, "destroy() called \u2014 cleaning up");
433
+ }
434
+ async ping() {
435
+ return "pong";
436
+ }
437
+ async onUIMessage(_message) {
438
+ }
439
+ /**
440
+ * Expose the worker API via Comlink and start listening.
441
+ * Call this once after constructing the plugin instance.
442
+ *
443
+ * The host calls `init(config)` with `{ pluginId, permissions }`,
444
+ * which is captured here to set `this.pluginId` before the
445
+ * subclass's `init()` runs.
446
+ */
447
+ start() {
448
+ Comlink2.expose(
449
+ {
450
+ init: (config) => {
451
+ this.pluginId = config.pluginId;
452
+ return this.init();
453
+ },
454
+ destroy: () => this.destroy(),
455
+ ping: () => this.ping(),
456
+ onUIMessage: (message) => this.onUIMessage(message)
457
+ },
458
+ self
459
+ );
460
+ console.log("Worker loaded, API exposed via Comlink");
461
+ }
462
+ };
463
+
217
464
  // src/index.ts
218
465
  var snaptrude = ClientPluginApi.getInstance();
219
466
  // Annotate the CommonJS export names for ESM import in node:
220
467
  0 && (module.exports = {
468
+ ClientArcApi,
469
+ ClientCoreApi,
470
+ ClientCurveApi,
221
471
  ClientEntityApi,
472
+ ClientGeomApi,
473
+ ClientLineApi,
474
+ ClientMathApi,
222
475
  ClientPluginApi,
476
+ ClientProfileApi,
477
+ ClientQuatApi,
223
478
  ClientSelectionApi,
224
479
  ClientSpaceApi,
480
+ ClientStoryApi,
225
481
  ClientToolsApi,
226
482
  ClientTransformApi,
483
+ ClientUnitsApi,
484
+ ClientVec3Api,
485
+ PluginWorker,
227
486
  createHostApi,
228
487
  getHostApi,
229
488
  snaptrude