@mulsense/xnew 0.4.4 → 0.4.6
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 +55 -22
- package/dist/xnew.js +364 -216
- package/dist/xnew.mjs +364 -216
- package/package.json +1 -1
package/dist/xnew.d.ts
CHANGED
|
@@ -56,6 +56,9 @@ interface Internal {
|
|
|
56
56
|
parent: Unit | null;
|
|
57
57
|
target: Object | null;
|
|
58
58
|
props?: Object;
|
|
59
|
+
config: {
|
|
60
|
+
protect: boolean;
|
|
61
|
+
};
|
|
59
62
|
baseElement: UnitElement;
|
|
60
63
|
baseContext: Context;
|
|
61
64
|
baseComponent: Function;
|
|
@@ -65,7 +68,6 @@ interface Internal {
|
|
|
65
68
|
anchor: UnitElement | null;
|
|
66
69
|
state: string;
|
|
67
70
|
tostart: boolean;
|
|
68
|
-
protected: boolean;
|
|
69
71
|
ancestors: Unit[];
|
|
70
72
|
children: Unit[];
|
|
71
73
|
promises: UnitPromise[];
|
|
@@ -274,10 +276,9 @@ declare const xnew$1: CreateUnit & {
|
|
|
274
276
|
* }, 300)
|
|
275
277
|
*/
|
|
276
278
|
transition(transition: Function, duration?: number, easing?: string): any;
|
|
277
|
-
protect(): void;
|
|
278
279
|
};
|
|
279
280
|
|
|
280
|
-
declare function
|
|
281
|
+
declare function Accordion(unit: Unit, { open, duration, easing }?: {
|
|
281
282
|
open?: boolean;
|
|
282
283
|
duration?: number;
|
|
283
284
|
easing?: string;
|
|
@@ -287,7 +288,6 @@ declare function AccordionFrame(unit: Unit, { open, duration, easing }?: {
|
|
|
287
288
|
open(): void;
|
|
288
289
|
close(): void;
|
|
289
290
|
};
|
|
290
|
-
declare function AccordionContent(unit: Unit, {}?: {}): void;
|
|
291
291
|
|
|
292
292
|
declare function Screen(unit: Unit, { width, height, fit }?: {
|
|
293
293
|
width?: number | undefined;
|
|
@@ -298,23 +298,13 @@ declare function Screen(unit: Unit, { width, height, fit }?: {
|
|
|
298
298
|
resize(width: number, height: number): void;
|
|
299
299
|
};
|
|
300
300
|
|
|
301
|
-
declare function
|
|
301
|
+
declare function Modal(unit: Unit, { duration, easing }?: {
|
|
302
302
|
duration?: number;
|
|
303
303
|
easing?: string;
|
|
304
304
|
}): {
|
|
305
|
+
state: number;
|
|
305
306
|
close(): void;
|
|
306
307
|
};
|
|
307
|
-
declare function ModalContent(content: Unit, { background }?: {
|
|
308
|
-
background?: string;
|
|
309
|
-
}): void;
|
|
310
|
-
|
|
311
|
-
declare function DragFrame(unit: Unit, { x, y }?: {
|
|
312
|
-
x?: number;
|
|
313
|
-
y?: number;
|
|
314
|
-
}): {
|
|
315
|
-
absolute: HTMLElement | SVGElement;
|
|
316
|
-
};
|
|
317
|
-
declare function DragTarget(unit: Unit, {}?: {}): void;
|
|
318
308
|
|
|
319
309
|
declare function AnalogStick(unit: Unit, { stroke, strokeOpacity, strokeWidth, strokeLinejoin, fill, fillOpacity }?: {
|
|
320
310
|
stroke?: string;
|
|
@@ -341,23 +331,66 @@ declare function TextStream(unit: Unit, { text, speed, fade }?: {
|
|
|
341
331
|
fade?: number;
|
|
342
332
|
}): void;
|
|
343
333
|
|
|
334
|
+
type SynthesizerOptions = {
|
|
335
|
+
oscillator: OscillatorOptions;
|
|
336
|
+
amp: AmpOptions;
|
|
337
|
+
filter?: FilterOptions;
|
|
338
|
+
reverb?: ReverbOptions;
|
|
339
|
+
bpm?: number;
|
|
340
|
+
};
|
|
341
|
+
type OscillatorOptions = {
|
|
342
|
+
type: OscillatorType;
|
|
343
|
+
envelope?: Envelope;
|
|
344
|
+
LFO?: LFO;
|
|
345
|
+
};
|
|
346
|
+
type FilterOptions = {
|
|
347
|
+
type: BiquadFilterType;
|
|
348
|
+
cutoff: number;
|
|
349
|
+
};
|
|
350
|
+
type AmpOptions = {
|
|
351
|
+
envelope: Envelope;
|
|
352
|
+
};
|
|
353
|
+
type ReverbOptions = {
|
|
354
|
+
time: number;
|
|
355
|
+
mix: number;
|
|
356
|
+
};
|
|
357
|
+
type Envelope = {
|
|
358
|
+
amount: number;
|
|
359
|
+
ADSR: [number, number, number, number];
|
|
360
|
+
};
|
|
361
|
+
type LFO = {
|
|
362
|
+
amount: number;
|
|
363
|
+
type: OscillatorType;
|
|
364
|
+
rate: number;
|
|
365
|
+
};
|
|
366
|
+
declare class Synthesizer {
|
|
367
|
+
props: SynthesizerOptions;
|
|
368
|
+
constructor(props: SynthesizerOptions);
|
|
369
|
+
press(frequency: number | string, duration?: number | string, wait?: number): {
|
|
370
|
+
release: () => void;
|
|
371
|
+
} | undefined;
|
|
372
|
+
}
|
|
373
|
+
|
|
344
374
|
declare const basics: {
|
|
345
375
|
Screen: typeof Screen;
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
AccordionFrame: typeof AccordionFrame;
|
|
349
|
-
AccordionContent: typeof AccordionContent;
|
|
376
|
+
Modal: typeof Modal;
|
|
377
|
+
Accordion: typeof Accordion;
|
|
350
378
|
TextStream: typeof TextStream;
|
|
351
|
-
DragFrame: typeof DragFrame;
|
|
352
|
-
DragTarget: typeof DragTarget;
|
|
353
379
|
AnalogStick: typeof AnalogStick;
|
|
354
380
|
DirectionalPad: typeof DirectionalPad;
|
|
355
381
|
};
|
|
382
|
+
|
|
383
|
+
declare const audio: {
|
|
384
|
+
load(path: string): UnitPromise;
|
|
385
|
+
synthesizer(props: SynthesizerOptions): Synthesizer;
|
|
386
|
+
volume: number;
|
|
387
|
+
};
|
|
356
388
|
declare namespace xnew {
|
|
357
389
|
type Unit = InstanceType<typeof Unit>;
|
|
358
390
|
}
|
|
359
391
|
declare const xnew: (typeof xnew$1) & {
|
|
360
392
|
basics: typeof basics;
|
|
393
|
+
audio: typeof audio;
|
|
361
394
|
};
|
|
362
395
|
|
|
363
396
|
export { xnew as default };
|