@hatiolab/things-scene 2.7.22 → 3.0.0-beta.1

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/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
@@ -157,7 +172,8 @@ declare module '@hatiolab/things-scene' {
157
172
  hierarchy: Model
158
173
  path: Array<DIMENSION>
159
174
  anchors: Array<Anchor>
160
- data: any
175
+ get data(): any
176
+ set data(data: any)
161
177
 
162
178
  get controls(): Array<Control> | undefined
163
179
  get hasTextProperty(): boolean
@@ -200,6 +216,11 @@ declare module '@hatiolab/things-scene' {
200
216
  indexOf(component: Component): number
201
217
  insertComponentAt(target: Component, idx: number): void
202
218
  findById(id: string): Component
219
+
220
+ add(components: Component[] | Component): Container
221
+ remove(components: Component[] | Component): Container
222
+
223
+ components: Component[]
203
224
  }
204
225
  class RootContainer extends Container {}
205
226