@mulsense/xnew 0.6.0 → 0.6.2
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/addons/xpixi.js +1 -1
- package/dist/addons/xpixi.mjs +1 -1
- package/dist/addons/xrapier2d.js +1 -1
- package/dist/addons/xrapier2d.mjs +1 -1
- package/dist/addons/xthree.js +3 -0
- package/dist/addons/xthree.mjs +3 -0
- package/dist/xnew.d.ts +31 -4
- package/dist/xnew.js +261 -89
- package/dist/xnew.mjs +261 -89
- package/package.json +1 -1
package/dist/addons/xpixi.js
CHANGED
package/dist/addons/xpixi.mjs
CHANGED
package/dist/addons/xrapier2d.js
CHANGED
package/dist/addons/xthree.js
CHANGED
package/dist/addons/xthree.mjs
CHANGED
package/dist/xnew.d.ts
CHANGED
|
@@ -34,6 +34,8 @@ declare class Eventor {
|
|
|
34
34
|
remove(type: string, listener: Function): void;
|
|
35
35
|
private basic;
|
|
36
36
|
private resize;
|
|
37
|
+
private change;
|
|
38
|
+
private input;
|
|
37
39
|
private click;
|
|
38
40
|
private click_outside;
|
|
39
41
|
private pointer;
|
|
@@ -147,7 +149,7 @@ declare class Unit {
|
|
|
147
149
|
off(type?: string, listener?: Function): void;
|
|
148
150
|
static on(unit: Unit, type: string, listener: Function, options?: boolean | AddEventListenerOptions): void;
|
|
149
151
|
static off(unit: Unit, type: string, listener?: Function): void;
|
|
150
|
-
static emit(type: string,
|
|
152
|
+
static emit(type: string, props?: object): void;
|
|
151
153
|
}
|
|
152
154
|
|
|
153
155
|
interface CreateUnit {
|
|
@@ -173,13 +175,15 @@ interface CreateUnit {
|
|
|
173
175
|
(target: HTMLElement | SVGElement | string, Component?: Function | string, props?: Object): Unit;
|
|
174
176
|
}
|
|
175
177
|
|
|
176
|
-
declare function OpenAndClose(unit: Unit, {
|
|
177
|
-
|
|
178
|
+
declare function OpenAndClose(unit: Unit, { open }: {
|
|
179
|
+
open?: boolean;
|
|
178
180
|
}): {
|
|
179
181
|
toggle(duration?: number, easing?: string): void;
|
|
180
182
|
open(duration?: number, easing?: string): void;
|
|
181
183
|
close(duration?: number, easing?: string): void;
|
|
182
184
|
};
|
|
185
|
+
declare function Accordion(unit: Unit): void;
|
|
186
|
+
declare function Modal(unit: Unit): void;
|
|
183
187
|
|
|
184
188
|
type ScreenFit = 'contain' | 'cover';
|
|
185
189
|
declare function Screen(unit: Unit, { aspect, fit }?: {
|
|
@@ -206,6 +210,26 @@ declare function DPad(unit: Unit, { diagonal, stroke, strokeOpacity, strokeWidth
|
|
|
206
210
|
fillOpacity?: number;
|
|
207
211
|
}): void;
|
|
208
212
|
|
|
213
|
+
interface PanelOptions {
|
|
214
|
+
name?: string;
|
|
215
|
+
open?: boolean;
|
|
216
|
+
params?: Record<string, any>;
|
|
217
|
+
}
|
|
218
|
+
declare function Panel(unit: Unit, { name, open, params }: PanelOptions): {
|
|
219
|
+
group({ name, open, params }: PanelOptions, inner: Function): Unit;
|
|
220
|
+
button(key: string): Unit;
|
|
221
|
+
select(key: string, { options }?: {
|
|
222
|
+
options?: string[];
|
|
223
|
+
}): Unit;
|
|
224
|
+
range(key: string, options?: {
|
|
225
|
+
min?: number;
|
|
226
|
+
max?: number;
|
|
227
|
+
step?: number;
|
|
228
|
+
}): Unit;
|
|
229
|
+
checkbox(key: string): Unit;
|
|
230
|
+
separator(): void;
|
|
231
|
+
};
|
|
232
|
+
|
|
209
233
|
type SynthesizerOptions = {
|
|
210
234
|
oscillator: OscillatorOptions;
|
|
211
235
|
amp: AmpOptions;
|
|
@@ -255,7 +279,7 @@ declare const xnew: CreateUnit & {
|
|
|
255
279
|
extend(component: Function, props?: Object): {
|
|
256
280
|
[key: string]: any;
|
|
257
281
|
};
|
|
258
|
-
context(
|
|
282
|
+
context(component: Function): any;
|
|
259
283
|
promise(promise: Promise<any>): UnitPromise;
|
|
260
284
|
then(callback: Function): UnitPromise;
|
|
261
285
|
catch(callback: Function): UnitPromise;
|
|
@@ -273,6 +297,9 @@ declare const xnew: CreateUnit & {
|
|
|
273
297
|
OpenAndClose: typeof OpenAndClose;
|
|
274
298
|
AnalogStick: typeof AnalogStick;
|
|
275
299
|
DPad: typeof DPad;
|
|
300
|
+
Panel: typeof Panel;
|
|
301
|
+
Accordion: typeof Accordion;
|
|
302
|
+
Modal: typeof Modal;
|
|
276
303
|
};
|
|
277
304
|
audio: {
|
|
278
305
|
load(path: string): UnitPromise;
|