@buerli.io/core 0.3.0 → 0.4.0-beta.2

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.
@@ -40,10 +40,10 @@ declare const generalApi: (set: SetState<BuerliState>, get: GetState<BuerliState
40
40
  *
41
41
  * @param options - options which will be set into state.options
42
42
  */
43
- init(options?: Partial<BuerliOptions>): void;
43
+ init(options?: Partial<BuerliOptions> | undefined): void;
44
44
  };
45
45
  declare const drawingManagementApi: (set: SetState<BuerliState>, get: GetState<BuerliState>, buerliApi: BuerliStoreApi) => {
46
- createDrawing(name?: string): Promise<DrawingState>;
46
+ createDrawing(name?: string | undefined): Promise<DrawingState>;
47
47
  removeDrawing(id: DrawingID): void;
48
48
  setActiveDrawing(id: DrawingID | null): void;
49
49
  };
@@ -33,7 +33,7 @@ export declare const cadApi: (set: SetState<DrawingState>, get: GetState<Drawing
33
33
  }>) => void;
34
34
  addPending: (name: string, options?: {
35
35
  args?: any;
36
- }) => string;
36
+ } | undefined) => string;
37
37
  removePending: (id: string) => void;
38
38
  setConnected: (connected: boolean) => void;
39
39
  };
@@ -41,14 +41,14 @@ export declare const geometryApi: (set: SetState<DrawingState>, get: GetState<Dr
41
41
  * The update will only happen, if at least one solid of one product is available.
42
42
  */
43
43
  updateBounds: () => void;
44
- createGeometryIfNotCached: (containerId: number, color?: number[]) => ContainerGeometryT | undefined;
44
+ createGeometryIfNotCached: (containerId: number, color?: number[] | undefined) => ContainerGeometryT | undefined;
45
45
  setColor: (containerId: GraphicID, r: number, g: number, b: number) => void;
46
46
  setOpacity: (containerId: GraphicID, opacity: number) => void;
47
47
  setConfig: (objId: ObjectID | GraphicID, config: Partial<GeometryConfig> | null) => void;
48
48
  findDecorated: () => GeometryElement[];
49
49
  filter: (cb: (elem: GeometryElement) => boolean, options?: {
50
- onlyOne?: boolean;
51
- containerId?: ObjectID;
52
- }) => GeometryElement[];
50
+ onlyOne?: boolean | undefined;
51
+ containerId?: number | undefined;
52
+ } | undefined) => GeometryElement[];
53
53
  };
54
54
  export {};
@@ -12,9 +12,9 @@ export declare const graphicApi: (set: SetState<DrawingState>, get: GetState<Dra
12
12
  addPackages: (packages: IGraphicPackage[]) => void;
13
13
  cleanupGraphicRecords: () => void;
14
14
  filter: (cb: (elem: IGraphicElement) => boolean, options?: {
15
- onlyOne?: boolean;
16
- containerId?: ObjectID;
17
- }) => {
15
+ onlyOne?: boolean | undefined;
16
+ containerId?: number | undefined;
17
+ } | undefined) => {
18
18
  elem: IGraphicElement;
19
19
  containerId: ObjectID;
20
20
  solidId: ObjectID;
@@ -30,5 +30,5 @@ export declare const interactionApi: (set: SetState<DrawingState>, get: GetState
30
30
  * @param item The item to select.
31
31
  * @param multi Do multi select.
32
32
  */
33
- select: (item: InteractionInfo, multi?: boolean) => void;
33
+ select: (item: InteractionInfo, multi?: boolean | undefined) => void;
34
34
  };
@@ -47,7 +47,7 @@ export declare const pluginApi: (set: SetState<DrawingState>, get: GetState<Draw
47
47
  setActiveFeature: (id: ObjectID | null) => void;
48
48
  setVisiblePlugin: (id: PluginID, visible: boolean) => void;
49
49
  setActiveGlobal: (id: PluginID, active: boolean) => void;
50
- createPlugin: (def: PluginDef, defaultId?: ObjectID | string, drawingId?: DrawingID, objectId?: ObjectID) => (deactivate?: boolean) => void;
50
+ createPlugin: (def: PluginDef, defaultId?: string | number | undefined, drawingId?: string | number | undefined, objectId?: number | undefined) => (deactivate?: boolean) => void;
51
51
  };
52
52
  export declare function isPromisePlugin(def: PluginDef): def is Promise<Plugin>;
53
53
  export {};
@@ -41,22 +41,22 @@ export declare type SelectionData = {
41
41
  export declare type SelectionApi = ReturnType<typeof selectionApi>;
42
42
  export declare const selectionData: () => SelectionData;
43
43
  export declare const selectionApi: (set: SetState<DrawingState>, get: GetState<DrawingState>, buerliApi: BuerliStoreApi) => {
44
- unselectAll(selectorId?: SelectorID): void;
45
- unselect(items: SelectedItem | SelectedItem[], selectorId?: SelectorID): void;
46
- select(items: SelectedItem | SelectedItem[], selectorId?: SelectorID): void;
47
- setHovered(item: SelectedItem | null, selectorId?: SelectorID): void;
44
+ unselectAll(selectorId?: string | number | undefined): void;
45
+ unselect(items: SelectedItem | SelectedItem[], selectorId?: string | number | undefined): void;
46
+ select(items: SelectedItem | SelectedItem[], selectorId?: string | number | undefined): void;
47
+ setHovered(item: SelectedItem | null, selectorId?: string | number | undefined): void;
48
48
  activateSelector(selectorId: SelectorID | null): void;
49
- createSelector(selectorId: SelectorID, filter: SelectionFilter, activate?: boolean, initialItems?: SelectedItem[], maxLen?: number, customSelect?: CustomSelect, customUnSelect?: CustomSelect): () => void;
50
- areItemsSelected: (items: SelectedItem[], selectorId?: SelectorID) => boolean;
51
- isItemSelected: (item: SelectedItem, selectorId?: SelectorID) => boolean;
49
+ createSelector(selectorId: SelectorID, filter: SelectionFilter, activate?: boolean, initialItems?: SelectedItem[], maxLen?: number, customSelect?: CustomSelect | undefined, customUnSelect?: CustomSelect | undefined): () => void;
50
+ areItemsSelected: (items: SelectedItem[], selectorId?: string | number | undefined) => boolean;
51
+ isItemSelected: (item: SelectedItem, selectorId?: string | number | undefined) => boolean;
52
52
  setItems(id: SelectorID, items: SelectedItem[]): void;
53
53
  selectGraphic: (selectorId: SelectorID, items: {
54
54
  productId: ObjectID;
55
55
  containerId: GraphicID;
56
56
  graphicId?: GraphicID;
57
57
  }[], options?: {
58
- unselectExisting?: boolean;
59
- }) => void;
60
- getGraphicItem: (productId: ObjectID, containerId: GraphicID, graphicId?: GraphicID) => SelectedItem<ProductElement> | null;
58
+ unselectExisting?: boolean | undefined;
59
+ } | undefined) => void;
60
+ getGraphicItem: (productId: ObjectID, containerId: GraphicID, graphicId?: number | undefined) => SelectedItem<ProductElement> | null;
61
61
  };
62
62
  export declare const createGraphicItem: (productId: ObjectID, el: GeometryElement) => SelectedItem<ProductElement>;
@@ -29,7 +29,7 @@ export declare const structureApi: (set: SetState<DrawingState>, get: GetState<D
29
29
  calculateProductBounds: (productId: ObjectID, base?: {
30
30
  min: THREE.Vector3;
31
31
  max: THREE.Vector3;
32
- }) => {
32
+ } | undefined) => {
33
33
  center: THREE.Vector3;
34
34
  radius: number;
35
35
  max: THREE.Vector3;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@buerli.io/core",
3
- "version": "0.3.0",
3
+ "version": "0.4.0-beta.2",
4
4
  "description": "buerli state management",
5
5
  "author": "AWV Informatik AG <info@awv-informatik.ch>",
6
6
  "license": "ISC",
@@ -12,8 +12,8 @@
12
12
  "scripts": {
13
13
  "ver": "npm version",
14
14
  "prepack": "npm run clean && npm run build",
15
- "clean": "rimraf ./build && rimraf ./coverage",
16
- "build": "tsc",
15
+ "clean": "rimraf ./build && rimraf ./coverage && rimraf ./tsconfig.tsbuildinfo",
16
+ "build": "tsc -v && tsc",
17
17
  "build:dev": "tsc --sourceMap true --declarationMap true",
18
18
  "lint": "eslint \"./src/**/*.ts?(x)\"",
19
19
  "test": "jest",
@@ -29,7 +29,8 @@
29
29
  "babel-plugin-transform-class-properties": "^6.24.1",
30
30
  "jest": "^26.1.0",
31
31
  "rimraf": "^2.6.3",
32
- "three": "^0.138"
32
+ "three": "^0.138",
33
+ "typescript": "4.1.2"
33
34
  },
34
35
  "dependencies": {
35
36
  "fast-json-patch": "^3.1.1",