@hatiolab/things-scene 2.7.32 → 2.8.0

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
@@ -49,6 +49,17 @@ declare module '@hatiolab/things-scene' {
49
49
  help?: string
50
50
  }
51
51
 
52
+ type ReferenceProvider = {
53
+ get ids(): string[]
54
+ add(id: string, target?: any): Promise<{ release: () => void }>
55
+ get(id: string, createIf?: boolean): Promise<{ release: () => void }>
56
+ }
57
+
58
+ type DataSubscriptionProvider = {
59
+ subscribe(tag: string, component: Component): Promise<{ unsubscribe: () => void }>
60
+ dispose(): void
61
+ }
62
+
52
63
  interface LAYOUT {
53
64
  reflow: (container: Container) => void
54
65
  capturables?: (container: Container) => Component[]
@@ -102,6 +113,7 @@ declare module '@hatiolab/things-scene' {
102
113
  handlers,
103
114
  mode,
104
115
  refProvider,
116
+ dataSubscriptionProvider,
105
117
  baseUrl,
106
118
  fitMode
107
119
  }: {
@@ -111,7 +123,8 @@ declare module '@hatiolab/things-scene' {
111
123
  layers?: Array<any>
112
124
  handlers?: Array<any>
113
125
  mode?: SCENE_MODE
114
- refProvider?: any
126
+ refProvider?: ReferenceProvider
127
+ dataSubscriptionProvider?: DataSubscriptionProvider
115
128
  baseUrl?: string | undefined
116
129
  fitMode?: FITMODE
117
130
  }): Scene
@@ -138,7 +151,8 @@ declare module '@hatiolab/things-scene' {
138
151
  }
139
152
 
140
153
  class ApplicationContext {
141
- readonly refProvider: any
154
+ readonly refProvider: ReferenceProvider
155
+ readonly dataSubscriptionProvider: DataSubscriptionProvider
142
156
  readonly isViewMode: boolean
143
157
  readonly isEditMode: boolean
144
158
 
@@ -167,6 +181,7 @@ declare module '@hatiolab/things-scene' {
167
181
  ): {
168
182
  new (...args: any[]): {
169
183
  isDataSource(): boolean
184
+ _convertDataFormat(data: any, format: 'json' | 'text' | 'jsonp' | string): any
170
185
  }
171
186
  } & TBase
172
187
 
@@ -208,6 +223,7 @@ declare module '@hatiolab/things-scene' {
208
223
  component: Component,
209
224
  customObjToVal?: (obj: any) => any
210
225
  ): () => string | undefined
226
+ static reposition(component: Component): void
211
227
 
212
228
  state: Properties
213
229
  bounds: BOUNDS
@@ -215,7 +231,7 @@ declare module '@hatiolab/things-scene' {
215
231
  root: RootContainer
216
232
  rootModel: ModelLayer
217
233
  parent: Container
218
- app: ApplicationContext /* application context */
234
+ app: ApplicationContext
219
235
  model: Model
220
236
  hierarchy: Model
221
237
  path: Array<DIMENSION>
@@ -224,20 +240,27 @@ declare module '@hatiolab/things-scene' {
224
240
 
225
241
  get nature(): ComponentNature
226
242
 
243
+ get font(): string
244
+
227
245
  get data(): any
228
246
  set data(data: any)
229
247
 
248
+ get text(): string
249
+ set text(text: string)
250
+
230
251
  get center(): POINT
231
252
  set center(point: POINT)
232
253
 
233
254
  get controls(): Array<Control> | undefined
234
255
  get hasTextProperty(): boolean
256
+ get textSubstitutor(): () => string
235
257
 
236
258
  isRootModel(): boolean
237
259
  isContainer(): boolean
238
260
  isLine(): boolean
239
261
  isLayer(): boolean
240
262
  is3dish(): boolean
263
+ isHTMLElement(): boolean
241
264
 
242
265
  ready(): void
243
266
  dispose(): void
@@ -259,8 +282,8 @@ declare module '@hatiolab/things-scene' {
259
282
  executeMappings(force?: boolean): void
260
283
  invalidate(): void
261
284
  animate(config: AnimationConfig): {
262
- start: Function /* start function */
263
- stop: Function /* stop function */
285
+ start: Function
286
+ stop: Function
264
287
  }
265
288
 
266
289
  access(expression: string): any