@snaptrude/plugin-core 0.0.1 → 0.0.3
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/api/entity/space.d.ts +5 -1
- package/dist/api/entity/space.d.ts.map +1 -1
- package/dist/api/tools/selection.d.ts +1 -1
- package/dist/api/tools/selection.d.ts.map +1 -1
- package/dist/host-utils.d.ts +5 -0
- package/dist/host-utils.d.ts.map +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/api/entity/space.ts +7 -1
- package/src/api/tools/selection.ts +1 -1
- package/src/host-utils.ts +6 -0
- package/tsconfig.json +3 -2
|
@@ -2,6 +2,7 @@ import { ComponentId, PluginApiReturn } from "../../types";
|
|
|
2
2
|
export declare abstract class PluginSpaceApi {
|
|
3
3
|
constructor();
|
|
4
4
|
abstract createRectangular({ position, dimensions, }: PluginSpaceCreateRectangularArgs): PluginApiReturn<PluginSpaceCreateRectangularResult>;
|
|
5
|
+
abstract getAll(): PluginApiReturn<PluginSpaceGetAllResult>;
|
|
5
6
|
abstract getById({ spaceId, properties, }: PluginSpaceGetByIdArgs): PluginApiReturn<PluginSpaceGetByIdResult>;
|
|
6
7
|
abstract deleteById({ spaceId, }: PluginSpaceDeleteByIdArgs): PluginApiReturn<PluginSpaceDeleteByIdResult>;
|
|
7
8
|
}
|
|
@@ -16,8 +17,11 @@ export type PluginSpaceGetByIdArgs = {
|
|
|
16
17
|
spaceId: ComponentId;
|
|
17
18
|
properties: PluginSpaceGetByIdProperty[];
|
|
18
19
|
};
|
|
19
|
-
export type PluginSpaceGetByIdProperty = "id" | "type" | "room_type";
|
|
20
|
+
export type PluginSpaceGetByIdProperty = "id" | "type" | "room_type" | "name" | "area" | "height" | "department";
|
|
20
21
|
export type PluginSpaceGetByIdResult = Partial<Record<PluginSpaceGetByIdProperty, any>>;
|
|
22
|
+
export type PluginSpaceGetAllResult = {
|
|
23
|
+
spacesIds: ComponentId[];
|
|
24
|
+
};
|
|
21
25
|
export type PluginSpaceDeleteByIdArgs = {
|
|
22
26
|
spaceId: ComponentId;
|
|
23
27
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"space.d.ts","sourceRoot":"","sources":["../../../src/api/entity/space.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAE1D,8BAAsB,cAAc;;aAGlB,iBAAiB,CAAC,EAChC,QAAQ,EACR,UAAU,GACX,EAAE,gCAAgC,GAAG,eAAe,CAAC,kCAAkC,CAAC;aAEzE,OAAO,CAAC,EACtB,OAAO,EACP,UAAU,GACX,EAAE,sBAAsB,GAAG,eAAe,CAAC,wBAAwB,CAAC;aAErD,UAAU,CAAC,EACzB,OAAO,GACR,EAAE,yBAAyB,GAAG,eAAe,CAAC,2BAA2B,CAAC;CAC5E;AAED,MAAM,MAAM,gCAAgC,GAAG;IAC7C,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA;IAClC,UAAU,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA;CACrC,CAAA;AAED,MAAM,MAAM,kCAAkC,GAAG;IAC/C,OAAO,EAAE,WAAW,CAAA;CACrB,CAAA;AAED,MAAM,MAAM,sBAAsB,GAAG;IACnC,OAAO,EAAE,WAAW,CAAA;IACpB,UAAU,EAAE,0BAA0B,EAAE,CAAA;CACzC,CAAA;AAED,MAAM,MAAM,0BAA0B,GAAG,IAAI,GAAG,MAAM,GAAG,WAAW,
|
|
1
|
+
{"version":3,"file":"space.d.ts","sourceRoot":"","sources":["../../../src/api/entity/space.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAE1D,8BAAsB,cAAc;;aAGlB,iBAAiB,CAAC,EAChC,QAAQ,EACR,UAAU,GACX,EAAE,gCAAgC,GAAG,eAAe,CAAC,kCAAkC,CAAC;aAEzE,MAAM,IAAI,eAAe,CAAC,uBAAuB,CAAC;aAElD,OAAO,CAAC,EACtB,OAAO,EACP,UAAU,GACX,EAAE,sBAAsB,GAAG,eAAe,CAAC,wBAAwB,CAAC;aAErD,UAAU,CAAC,EACzB,OAAO,GACR,EAAE,yBAAyB,GAAG,eAAe,CAAC,2BAA2B,CAAC;CAC5E;AAED,MAAM,MAAM,gCAAgC,GAAG;IAC7C,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA;IAClC,UAAU,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA;CACrC,CAAA;AAED,MAAM,MAAM,kCAAkC,GAAG;IAC/C,OAAO,EAAE,WAAW,CAAA;CACrB,CAAA;AAED,MAAM,MAAM,sBAAsB,GAAG;IACnC,OAAO,EAAE,WAAW,CAAA;IACpB,UAAU,EAAE,0BAA0B,EAAE,CAAA;CACzC,CAAA;AAED,MAAM,MAAM,0BAA0B,GAAG,IAAI,GAAG,MAAM,GAAG,WAAW,GAAG,MAAM,GAAG,MAAM,GAAG,QAAQ,GAAG,YAAY,CAAC;AAEjH,MAAM,MAAM,wBAAwB,GAAG,OAAO,CAC5C,MAAM,CAAC,0BAA0B,EAAE,GAAG,CAAC,CACxC,CAAA;AAED,MAAM,MAAM,uBAAuB,GAAG;IACpC,SAAS,EAAE,WAAW,EAAE,CAAA;CACzB,CAAA;AAED,MAAM,MAAM,yBAAyB,GAAG;IACtC,OAAO,EAAE,WAAW,CAAA;CACrB,CAAA;AAED,MAAM,MAAM,2BAA2B,GAAG,IAAI,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selection.d.ts","sourceRoot":"","sources":["../../../src/api/tools/selection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"selection.d.ts","sourceRoot":"","sources":["../../../src/api/tools/selection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAE/D,8BAAsB,kBAAkB;;aAGtB,GAAG,IAAI,eAAe,CAAC,wBAAwB,CAAC;CACjE;AAED,MAAM,MAAM,wBAAwB,GAAG;IACrC,QAAQ,EAAE,WAAW,EAAE,CAAA;CACxB,CAAA"}
|
package/dist/host-utils.d.ts
CHANGED
|
@@ -32,5 +32,10 @@ export type PluginApiCallPayload<M extends PluginApiMethod = PluginApiMethod> =
|
|
|
32
32
|
args: PluginApiMethodMap[M]["args"];
|
|
33
33
|
};
|
|
34
34
|
export type PluginApiCallResult<M extends PluginApiMethod> = PluginApiMethodMap[M]["return"];
|
|
35
|
+
export type PluginApiCallWrappedResult<M extends PluginApiMethod> = {
|
|
36
|
+
success: boolean;
|
|
37
|
+
data?: PluginApiCallResult<M>;
|
|
38
|
+
error?: string;
|
|
39
|
+
};
|
|
35
40
|
export {};
|
|
36
41
|
//# sourceMappingURL=host-utils.d.ts.map
|
package/dist/host-utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"host-utils.d.ts","sourceRoot":"","sources":["../src/host-utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAItC;;GAEG;AACH,KAAK,mBAAmB,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,GAAG,GAAG,CAAC,CAAC,EAAE,CAAC,KAAK,IAAI,GAAG,KAAK,CAAC,SAAS,CAC7E,CAAC,EAAE,MAAM,CAAC,KACP,IAAI,GACL,CAAC,GACD,KAAK,CAAA;AAET,KAAK,OAAO,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAE,CAAA;AAE1C,KAAK,UAAU,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,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../src/index.ts","../src/api/entity/space.ts","../src/api/entity/index.ts","../src/api/tools/selection.ts","../src/api/tools/transform.ts","../src/api/tools/index.ts","../src/api/index.ts"],"sourcesContent":["export * from \"./api\"\nexport * from \"./types\"\nexport * from \"./host-utils\"\n","import { ComponentId, PluginApiReturn } from \"../../types\"\n\nexport abstract class PluginSpaceApi {\n constructor() {}\n\n public abstract createRectangular({\n position,\n dimensions,\n }: PluginSpaceCreateRectangularArgs): PluginApiReturn<PluginSpaceCreateRectangularResult>\n\n public abstract getById({\n spaceId,\n properties,\n }: PluginSpaceGetByIdArgs): PluginApiReturn<PluginSpaceGetByIdResult>\n\n public abstract deleteById({\n spaceId,\n }: PluginSpaceDeleteByIdArgs): PluginApiReturn<PluginSpaceDeleteByIdResult>\n}\n\nexport type PluginSpaceCreateRectangularArgs = {\n position: [number, number, number]\n dimensions: [number, number, number]\n}\n\nexport type PluginSpaceCreateRectangularResult = {\n spaceId: ComponentId\n}\n\nexport type PluginSpaceGetByIdArgs = {\n spaceId: ComponentId\n properties: PluginSpaceGetByIdProperty[]\n}\n\nexport type PluginSpaceGetByIdProperty = \"id\" | \"type\" | \"room_type\"\n\nexport type PluginSpaceGetByIdResult = Partial<\n Record<PluginSpaceGetByIdProperty, any>\n>\n\nexport type PluginSpaceDeleteByIdArgs = {\n spaceId: ComponentId\n}\n\nexport type PluginSpaceDeleteByIdResult = void\n","import { PluginSpaceApi } from \"./space\"\n\nexport abstract class PluginEntityApi {\n public abstract space: PluginSpaceApi\n\n constructor() {}\n}\n\nexport * from \"./space\"\n","import { ComponentId, PluginApiReturn } from \"../../types\"\n\nexport abstract class PluginSelectionApi {\n constructor() {}\n\n public abstract get(): PluginApiReturn<PluginSelectionGetResult>\n}\n\nexport type PluginSelectionGetResult = {\n selected: ComponentId[]\n}\n","import { PluginApiReturn } from \"../../types\"\n\nexport abstract class PluginTransformApi {\n constructor() {}\n\n public abstract move({\n componentIds,\n displacement,\n }: PluginMoveArgs): PluginApiReturn<void>\n\n public abstract rotate({\n componentIds,\n angle,\n axis,\n pivot,\n }: PluginRotateArgs): PluginApiReturn<void>\n}\n\nexport type PluginMoveArgs = {\n componentIds: string[]\n displacement: [number, number, number]\n}\n\nexport type PluginRotateArgs = {\n componentIds: string[]\n angle: number\n axis: [number, number, number]\n pivot: [number, number, number]\n}\n","import { PluginSelectionApi } from \"./selection\"\nimport { PluginTransformApi } from \"./transform\"\n\nexport abstract class PluginToolsApi {\n public abstract selection: PluginSelectionApi\n public abstract transform: PluginTransformApi\n\n constructor() {}\n}\n\nexport * from \"./selection\"\nexport * from \"./transform\"\n","import { PluginEntityApi } from \"./entity\"\nimport { PluginToolsApi } from \"./tools\"\n\nexport abstract class PluginApi {\n public abstract tools: PluginToolsApi\n public abstract entity: PluginEntityApi\n\n constructor() {}\n}\n\nexport * from \"./entity\"\nexport * from \"./tools\"\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACEO,IAAe,iBAAf,MAA8B;AAAA,EACnC,cAAc;AAAA,EAAC;
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/api/entity/space.ts","../src/api/entity/index.ts","../src/api/tools/selection.ts","../src/api/tools/transform.ts","../src/api/tools/index.ts","../src/api/index.ts"],"sourcesContent":["export * from \"./api\"\nexport * from \"./types\"\nexport * from \"./host-utils\"\n","import { ComponentId, PluginApiReturn } from \"../../types\"\n\nexport abstract class PluginSpaceApi {\n constructor() {}\n\n public abstract createRectangular({\n position,\n dimensions,\n }: PluginSpaceCreateRectangularArgs): PluginApiReturn<PluginSpaceCreateRectangularResult>\n\n public abstract getAll(): PluginApiReturn<PluginSpaceGetAllResult>;\n \n public abstract getById({\n spaceId,\n properties,\n }: PluginSpaceGetByIdArgs): PluginApiReturn<PluginSpaceGetByIdResult>\n\n public abstract deleteById({\n spaceId,\n }: PluginSpaceDeleteByIdArgs): PluginApiReturn<PluginSpaceDeleteByIdResult>\n}\n\nexport type PluginSpaceCreateRectangularArgs = {\n position: [number, number, number]\n dimensions: [number, number, number]\n}\n\nexport type PluginSpaceCreateRectangularResult = {\n spaceId: ComponentId\n}\n\nexport type PluginSpaceGetByIdArgs = {\n spaceId: ComponentId\n properties: PluginSpaceGetByIdProperty[]\n}\n\nexport type PluginSpaceGetByIdProperty = \"id\" | \"type\" | \"room_type\" | \"name\" | \"area\" | \"height\" | \"department\";\n\nexport type PluginSpaceGetByIdResult = Partial<\n Record<PluginSpaceGetByIdProperty, any>\n>\n\nexport type PluginSpaceGetAllResult = {\n spacesIds: ComponentId[]\n}\n\nexport type PluginSpaceDeleteByIdArgs = {\n spaceId: ComponentId\n}\n\nexport type PluginSpaceDeleteByIdResult = void\n","import { PluginSpaceApi } from \"./space\"\n\nexport abstract class PluginEntityApi {\n public abstract space: PluginSpaceApi\n\n constructor() {}\n}\n\nexport * from \"./space\"\n","import type { ComponentId, PluginApiReturn } from \"../../types\"\n\nexport abstract class PluginSelectionApi {\n constructor() {}\n\n public abstract get(): PluginApiReturn<PluginSelectionGetResult>\n}\n\nexport type PluginSelectionGetResult = {\n selected: ComponentId[]\n}\n","import { PluginApiReturn } from \"../../types\"\n\nexport abstract class PluginTransformApi {\n constructor() {}\n\n public abstract move({\n componentIds,\n displacement,\n }: PluginMoveArgs): PluginApiReturn<void>\n\n public abstract rotate({\n componentIds,\n angle,\n axis,\n pivot,\n }: PluginRotateArgs): PluginApiReturn<void>\n}\n\nexport type PluginMoveArgs = {\n componentIds: string[]\n displacement: [number, number, number]\n}\n\nexport type PluginRotateArgs = {\n componentIds: string[]\n angle: number\n axis: [number, number, number]\n pivot: [number, number, number]\n}\n","import { PluginSelectionApi } from \"./selection\"\nimport { PluginTransformApi } from \"./transform\"\n\nexport abstract class PluginToolsApi {\n public abstract selection: PluginSelectionApi\n public abstract transform: PluginTransformApi\n\n constructor() {}\n}\n\nexport * from \"./selection\"\nexport * from \"./transform\"\n","import { PluginEntityApi } from \"./entity\"\nimport { PluginToolsApi } from \"./tools\"\n\nexport abstract class PluginApi {\n public abstract tools: PluginToolsApi\n public abstract entity: PluginEntityApi\n\n constructor() {}\n}\n\nexport * from \"./entity\"\nexport * from \"./tools\"\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACEO,IAAe,iBAAf,MAA8B;AAAA,EACnC,cAAc;AAAA,EAAC;AAiBjB;;;AClBO,IAAe,kBAAf,MAA+B;AAAA,EAGpC,cAAc;AAAA,EAAC;AACjB;;;ACJO,IAAe,qBAAf,MAAkC;AAAA,EACvC,cAAc;AAAA,EAAC;AAGjB;;;ACJO,IAAe,qBAAf,MAAkC;AAAA,EACvC,cAAc;AAAA,EAAC;AAajB;;;ACbO,IAAe,iBAAf,MAA8B;AAAA,EAInC,cAAc;AAAA,EAAC;AACjB;;;ACLO,IAAe,YAAf,MAAyB;AAAA,EAI9B,cAAc;AAAA,EAAC;AACjB;","names":[]}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/api/entity/space.ts","../src/api/entity/index.ts","../src/api/tools/selection.ts","../src/api/tools/transform.ts","../src/api/tools/index.ts","../src/api/index.ts"],"sourcesContent":["import { ComponentId, PluginApiReturn } from \"../../types\"\n\nexport abstract class PluginSpaceApi {\n constructor() {}\n\n public abstract createRectangular({\n position,\n dimensions,\n }: PluginSpaceCreateRectangularArgs): PluginApiReturn<PluginSpaceCreateRectangularResult>\n\n public abstract getById({\n spaceId,\n properties,\n }: PluginSpaceGetByIdArgs): PluginApiReturn<PluginSpaceGetByIdResult>\n\n public abstract deleteById({\n spaceId,\n }: PluginSpaceDeleteByIdArgs): PluginApiReturn<PluginSpaceDeleteByIdResult>\n}\n\nexport type PluginSpaceCreateRectangularArgs = {\n position: [number, number, number]\n dimensions: [number, number, number]\n}\n\nexport type PluginSpaceCreateRectangularResult = {\n spaceId: ComponentId\n}\n\nexport type PluginSpaceGetByIdArgs = {\n spaceId: ComponentId\n properties: PluginSpaceGetByIdProperty[]\n}\n\nexport type PluginSpaceGetByIdProperty = \"id\" | \"type\" | \"room_type\"\n\nexport type PluginSpaceGetByIdResult = Partial<\n Record<PluginSpaceGetByIdProperty, any>\n>\n\nexport type PluginSpaceDeleteByIdArgs = {\n spaceId: ComponentId\n}\n\nexport type PluginSpaceDeleteByIdResult = void\n","import { PluginSpaceApi } from \"./space\"\n\nexport abstract class PluginEntityApi {\n public abstract space: PluginSpaceApi\n\n constructor() {}\n}\n\nexport * from \"./space\"\n","import { ComponentId, PluginApiReturn } from \"../../types\"\n\nexport abstract class PluginSelectionApi {\n constructor() {}\n\n public abstract get(): PluginApiReturn<PluginSelectionGetResult>\n}\n\nexport type PluginSelectionGetResult = {\n selected: ComponentId[]\n}\n","import { PluginApiReturn } from \"../../types\"\n\nexport abstract class PluginTransformApi {\n constructor() {}\n\n public abstract move({\n componentIds,\n displacement,\n }: PluginMoveArgs): PluginApiReturn<void>\n\n public abstract rotate({\n componentIds,\n angle,\n axis,\n pivot,\n }: PluginRotateArgs): PluginApiReturn<void>\n}\n\nexport type PluginMoveArgs = {\n componentIds: string[]\n displacement: [number, number, number]\n}\n\nexport type PluginRotateArgs = {\n componentIds: string[]\n angle: number\n axis: [number, number, number]\n pivot: [number, number, number]\n}\n","import { PluginSelectionApi } from \"./selection\"\nimport { PluginTransformApi } from \"./transform\"\n\nexport abstract class PluginToolsApi {\n public abstract selection: PluginSelectionApi\n public abstract transform: PluginTransformApi\n\n constructor() {}\n}\n\nexport * from \"./selection\"\nexport * from \"./transform\"\n","import { PluginEntityApi } from \"./entity\"\nimport { PluginToolsApi } from \"./tools\"\n\nexport abstract class PluginApi {\n public abstract tools: PluginToolsApi\n public abstract entity: PluginEntityApi\n\n constructor() {}\n}\n\nexport * from \"./entity\"\nexport * from \"./tools\"\n"],"mappings":";AAEO,IAAe,iBAAf,MAA8B;AAAA,EACnC,cAAc;AAAA,EAAC;
|
|
1
|
+
{"version":3,"sources":["../src/api/entity/space.ts","../src/api/entity/index.ts","../src/api/tools/selection.ts","../src/api/tools/transform.ts","../src/api/tools/index.ts","../src/api/index.ts"],"sourcesContent":["import { ComponentId, PluginApiReturn } from \"../../types\"\n\nexport abstract class PluginSpaceApi {\n constructor() {}\n\n public abstract createRectangular({\n position,\n dimensions,\n }: PluginSpaceCreateRectangularArgs): PluginApiReturn<PluginSpaceCreateRectangularResult>\n\n public abstract getAll(): PluginApiReturn<PluginSpaceGetAllResult>;\n \n public abstract getById({\n spaceId,\n properties,\n }: PluginSpaceGetByIdArgs): PluginApiReturn<PluginSpaceGetByIdResult>\n\n public abstract deleteById({\n spaceId,\n }: PluginSpaceDeleteByIdArgs): PluginApiReturn<PluginSpaceDeleteByIdResult>\n}\n\nexport type PluginSpaceCreateRectangularArgs = {\n position: [number, number, number]\n dimensions: [number, number, number]\n}\n\nexport type PluginSpaceCreateRectangularResult = {\n spaceId: ComponentId\n}\n\nexport type PluginSpaceGetByIdArgs = {\n spaceId: ComponentId\n properties: PluginSpaceGetByIdProperty[]\n}\n\nexport type PluginSpaceGetByIdProperty = \"id\" | \"type\" | \"room_type\" | \"name\" | \"area\" | \"height\" | \"department\";\n\nexport type PluginSpaceGetByIdResult = Partial<\n Record<PluginSpaceGetByIdProperty, any>\n>\n\nexport type PluginSpaceGetAllResult = {\n spacesIds: ComponentId[]\n}\n\nexport type PluginSpaceDeleteByIdArgs = {\n spaceId: ComponentId\n}\n\nexport type PluginSpaceDeleteByIdResult = void\n","import { PluginSpaceApi } from \"./space\"\n\nexport abstract class PluginEntityApi {\n public abstract space: PluginSpaceApi\n\n constructor() {}\n}\n\nexport * from \"./space\"\n","import type { ComponentId, PluginApiReturn } from \"../../types\"\n\nexport abstract class PluginSelectionApi {\n constructor() {}\n\n public abstract get(): PluginApiReturn<PluginSelectionGetResult>\n}\n\nexport type PluginSelectionGetResult = {\n selected: ComponentId[]\n}\n","import { PluginApiReturn } from \"../../types\"\n\nexport abstract class PluginTransformApi {\n constructor() {}\n\n public abstract move({\n componentIds,\n displacement,\n }: PluginMoveArgs): PluginApiReturn<void>\n\n public abstract rotate({\n componentIds,\n angle,\n axis,\n pivot,\n }: PluginRotateArgs): PluginApiReturn<void>\n}\n\nexport type PluginMoveArgs = {\n componentIds: string[]\n displacement: [number, number, number]\n}\n\nexport type PluginRotateArgs = {\n componentIds: string[]\n angle: number\n axis: [number, number, number]\n pivot: [number, number, number]\n}\n","import { PluginSelectionApi } from \"./selection\"\nimport { PluginTransformApi } from \"./transform\"\n\nexport abstract class PluginToolsApi {\n public abstract selection: PluginSelectionApi\n public abstract transform: PluginTransformApi\n\n constructor() {}\n}\n\nexport * from \"./selection\"\nexport * from \"./transform\"\n","import { PluginEntityApi } from \"./entity\"\nimport { PluginToolsApi } from \"./tools\"\n\nexport abstract class PluginApi {\n public abstract tools: PluginToolsApi\n public abstract entity: PluginEntityApi\n\n constructor() {}\n}\n\nexport * from \"./entity\"\nexport * from \"./tools\"\n"],"mappings":";AAEO,IAAe,iBAAf,MAA8B;AAAA,EACnC,cAAc;AAAA,EAAC;AAiBjB;;;AClBO,IAAe,kBAAf,MAA+B;AAAA,EAGpC,cAAc;AAAA,EAAC;AACjB;;;ACJO,IAAe,qBAAf,MAAkC;AAAA,EACvC,cAAc;AAAA,EAAC;AAGjB;;;ACJO,IAAe,qBAAf,MAAkC;AAAA,EACvC,cAAc;AAAA,EAAC;AAajB;;;ACbO,IAAe,iBAAf,MAA8B;AAAA,EAInC,cAAc;AAAA,EAAC;AACjB;;;ACLO,IAAe,YAAf,MAAyB;AAAA,EAI9B,cAAc;AAAA,EAAC;AACjB;","names":[]}
|
package/package.json
CHANGED
package/src/api/entity/space.ts
CHANGED
|
@@ -8,6 +8,8 @@ export abstract class PluginSpaceApi {
|
|
|
8
8
|
dimensions,
|
|
9
9
|
}: PluginSpaceCreateRectangularArgs): PluginApiReturn<PluginSpaceCreateRectangularResult>
|
|
10
10
|
|
|
11
|
+
public abstract getAll(): PluginApiReturn<PluginSpaceGetAllResult>;
|
|
12
|
+
|
|
11
13
|
public abstract getById({
|
|
12
14
|
spaceId,
|
|
13
15
|
properties,
|
|
@@ -32,12 +34,16 @@ export type PluginSpaceGetByIdArgs = {
|
|
|
32
34
|
properties: PluginSpaceGetByIdProperty[]
|
|
33
35
|
}
|
|
34
36
|
|
|
35
|
-
export type PluginSpaceGetByIdProperty = "id" | "type" | "room_type"
|
|
37
|
+
export type PluginSpaceGetByIdProperty = "id" | "type" | "room_type" | "name" | "area" | "height" | "department";
|
|
36
38
|
|
|
37
39
|
export type PluginSpaceGetByIdResult = Partial<
|
|
38
40
|
Record<PluginSpaceGetByIdProperty, any>
|
|
39
41
|
>
|
|
40
42
|
|
|
43
|
+
export type PluginSpaceGetAllResult = {
|
|
44
|
+
spacesIds: ComponentId[]
|
|
45
|
+
}
|
|
46
|
+
|
|
41
47
|
export type PluginSpaceDeleteByIdArgs = {
|
|
42
48
|
spaceId: ComponentId
|
|
43
49
|
}
|
package/src/host-utils.ts
CHANGED
|
@@ -52,3 +52,9 @@ export type PluginApiCallPayload<M extends PluginApiMethod = PluginApiMethod> =
|
|
|
52
52
|
|
|
53
53
|
export type PluginApiCallResult<M extends PluginApiMethod> =
|
|
54
54
|
PluginApiMethodMap[M]["return"]
|
|
55
|
+
|
|
56
|
+
export type PluginApiCallWrappedResult<M extends PluginApiMethod> = {
|
|
57
|
+
success: boolean;
|
|
58
|
+
data?: PluginApiCallResult<M>;
|
|
59
|
+
error?: string;
|
|
60
|
+
}
|
package/tsconfig.json
CHANGED
|
@@ -7,10 +7,11 @@
|
|
|
7
7
|
"strict": true,
|
|
8
8
|
"esModuleInterop": true,
|
|
9
9
|
"skipLibCheck": true,
|
|
10
|
+
"typeRoots": [],
|
|
10
11
|
"emitDeclarationOnly": true,
|
|
11
12
|
"declaration": true,
|
|
12
13
|
"declarationMap": true,
|
|
13
|
-
"outDir": "dist"
|
|
14
|
+
"outDir": "dist"
|
|
14
15
|
},
|
|
15
|
-
"include": ["src/**/*.ts"]
|
|
16
|
+
"include": ["src/**/*.ts"]
|
|
16
17
|
}
|