@mulsense/xnew 0.6.1 → 0.6.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/xnew.d.ts CHANGED
@@ -32,22 +32,23 @@ declare class Eventor {
32
32
  private map;
33
33
  add(element: HTMLElement | SVGElement, type: string, listener: Function, options?: boolean | AddEventListenerOptions): void;
34
34
  remove(type: string, listener: Function): void;
35
- private basic;
36
- private resize;
37
- private change;
38
- private input;
39
- private click;
40
- private click_outside;
41
- private pointer;
42
- private mouse;
43
- private touch;
44
- private pointer_outside;
45
- private wheel;
46
- private drag;
47
- private gesture;
48
- private key;
49
- private key_arrow;
50
- private key_wasd;
35
+ private element_basic;
36
+ private element_resize;
37
+ private element_change;
38
+ private element_input;
39
+ private element_click;
40
+ private element_click_outside;
41
+ private element_pointer;
42
+ private element_mouse;
43
+ private element_touch;
44
+ private element_pointer_outside;
45
+ private element_wheel;
46
+ private element_drag;
47
+ private window_basic;
48
+ private window_key;
49
+ private window_key_arrow;
50
+ private window_key_wasd;
51
+ private document_basic;
51
52
  }
52
53
 
53
54
  type UnitElement = HTMLElement | SVGElement;
@@ -102,7 +103,10 @@ interface Internal {
102
103
  ancestors: Unit[];
103
104
  children: Unit[];
104
105
  promises: UnitPromise[];
105
- elements: UnitElement[];
106
+ nestElements: {
107
+ element: UnitElement;
108
+ owned: boolean;
109
+ }[];
106
110
  components: Function[];
107
111
  listeners: MapMap<string, Function, {
108
112
  element: UnitElement;
@@ -127,7 +131,7 @@ declare class Unit {
127
131
  reboot(): void;
128
132
  static initialize(unit: Unit, anchor: UnitElement | null): void;
129
133
  static finalize(unit: Unit): void;
130
- static nest(unit: Unit, tag: string, textContent?: string | number): UnitElement;
134
+ static nest(unit: Unit, target: UnitElement | string, textContent?: string | number): UnitElement;
131
135
  static currentComponent: Function;
132
136
  static extend(unit: Unit, component: Function, props?: Object): {
133
137
  [key: string]: any;
@@ -175,17 +179,20 @@ interface CreateUnit {
175
179
  (target: HTMLElement | SVGElement | string, Component?: Function | string, props?: Object): Unit;
176
180
  }
177
181
 
178
- declare function OpenAndClose(unit: Unit, { open }?: {
182
+ interface TransitionOptions {
183
+ duration?: number;
184
+ easing?: string;
185
+ }
186
+ declare function OpenAndClose(unit: Unit, { open, transition }: {
179
187
  open?: boolean;
188
+ transition?: TransitionOptions;
180
189
  }): {
181
- toggle(duration?: number, easing?: string): void;
182
- open(duration?: number, easing?: string): void;
183
- close(duration?: number, easing?: string): void;
190
+ toggle(): void;
191
+ open(): void;
192
+ close(): void;
184
193
  };
185
194
  declare function Accordion(unit: Unit): void;
186
- declare function Modal(unit: Unit, { background }?: {
187
- background?: string;
188
- }): void;
195
+ declare function Popup(unit: Unit): void;
189
196
 
190
197
  type ScreenFit = 'contain' | 'cover';
191
198
  declare function Screen(unit: Unit, { aspect, fit }?: {
@@ -212,13 +219,13 @@ declare function DPad(unit: Unit, { diagonal, stroke, strokeOpacity, strokeWidth
212
219
  fillOpacity?: number;
213
220
  }): void;
214
221
 
215
- interface GUIPanelOptions {
222
+ interface PanelOptions {
216
223
  name?: string;
217
224
  open?: boolean;
218
225
  params?: Record<string, any>;
219
226
  }
220
- declare function GUIPanel(unit: Unit, { name, open, params }: GUIPanelOptions): {
221
- group({ name, open, params }: GUIPanelOptions, inner: Function): Unit;
227
+ declare function Panel(unit: Unit, { name, open, params }: PanelOptions): {
228
+ group({ name, open, params }: PanelOptions, inner: Function): Unit;
222
229
  button(key: string): Unit;
223
230
  select(key: string, { options }?: {
224
231
  options?: string[];
@@ -277,7 +284,7 @@ declare namespace xnew {
277
284
  type UnitTimer = InstanceType<typeof UnitTimer>;
278
285
  }
279
286
  declare const xnew: CreateUnit & {
280
- nest(tag: string): HTMLElement | SVGElement;
287
+ nest(target: UnitElement | string): HTMLElement | SVGElement;
281
288
  extend(component: Function, props?: Object): {
282
289
  [key: string]: any;
283
290
  };
@@ -299,9 +306,9 @@ declare const xnew: CreateUnit & {
299
306
  OpenAndClose: typeof OpenAndClose;
300
307
  AnalogStick: typeof AnalogStick;
301
308
  DPad: typeof DPad;
302
- GUIPanel: typeof GUIPanel;
309
+ Panel: typeof Panel;
303
310
  Accordion: typeof Accordion;
304
- Modal: typeof Modal;
311
+ Popup: typeof Popup;
305
312
  };
306
313
  audio: {
307
314
  load(path: string): UnitPromise;