@mulsense/xnew 0.6.2 → 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,15 +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): void;
195
+ declare function Popup(unit: Unit): void;
187
196
 
188
197
  type ScreenFit = 'contain' | 'cover';
189
198
  declare function Screen(unit: Unit, { aspect, fit }?: {
@@ -275,7 +284,7 @@ declare namespace xnew {
275
284
  type UnitTimer = InstanceType<typeof UnitTimer>;
276
285
  }
277
286
  declare const xnew: CreateUnit & {
278
- nest(tag: string): HTMLElement | SVGElement;
287
+ nest(target: UnitElement | string): HTMLElement | SVGElement;
279
288
  extend(component: Function, props?: Object): {
280
289
  [key: string]: any;
281
290
  };
@@ -299,7 +308,7 @@ declare const xnew: CreateUnit & {
299
308
  DPad: typeof DPad;
300
309
  Panel: typeof Panel;
301
310
  Accordion: typeof Accordion;
302
- Modal: typeof Modal;
311
+ Popup: typeof Popup;
303
312
  };
304
313
  audio: {
305
314
  load(path: string): UnitPromise;