@hatiolab/things-scene 2.7.22 → 2.7.23

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hatiolab/things-scene",
3
- "version": "2.7.22",
3
+ "version": "2.7.23",
4
4
  "description": "2D graphic library",
5
5
  "main": "src/index.js",
6
6
  "module": "things-scene.mjs",
package/things-scene.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  declare module '@hatiolab/things-scene' {
2
2
  type Constructor<T = {}> = new (...args: any[]) => T
3
3
  type Class = { new (...args: any[]): any }
4
+ type Properties = { [key: string]: any }
4
5
 
5
6
  const MODE_VIEW = 0
6
7
  const MODE_EDIT = 1
@@ -17,7 +18,21 @@ declare module '@hatiolab/things-scene' {
17
18
  type TRANSLATE = DIMENSION
18
19
  type POSITION = DIMENSION
19
20
 
20
- type Properties = { [key: string]: any }
21
+ type LAYOUT = {
22
+ reflow: (container: Container) => void
23
+ capturables?: (container: Container) => boolean
24
+ drawables?: (container: Container) => boolean
25
+ isStuck?: (component: Container) => boolean
26
+ keyNavigate?: (container: Container, component: Component, e: KeyboardEvent) => Component
27
+ joinType?: boolean
28
+ }
29
+
30
+ const AbsoluteLayout: LAYOUT & { ABSOLUTE: boolean }
31
+ const TableLayout: LAYOUT
32
+ const CardLayout: LAYOUT
33
+ const HTMLAbsoluteLayout: LAYOUT
34
+ const LinearHorizontal: LAYOUT
35
+ const LinearVertical: LAYOUT
21
36
 
22
37
  type AnimationConfig = {
23
38
  duration?: number
@@ -76,7 +91,7 @@ declare module '@hatiolab/things-scene' {
76
91
  }
77
92
 
78
93
  class Model {
79
- static compile(model: Model, context: any): Component
94
+ static compile(model: Model, context?: any): Component
80
95
 
81
96
  type: string;
82
97
  [key: string]: any
@@ -200,6 +215,11 @@ declare module '@hatiolab/things-scene' {
200
215
  indexOf(component: Component): number
201
216
  insertComponentAt(target: Component, idx: number): void
202
217
  findById(id: string): Component
218
+
219
+ add(components: Component[] | Component): Container
220
+ remove(components: Component[] | Component): Container
221
+
222
+ components: Component[]
203
223
  }
204
224
  class RootContainer extends Container {}
205
225