@mulsense/xnew 0.1.5 → 0.1.7
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/types/audio/audio.d.ts +16 -10
- package/dist/types/audio/loader.d.ts +16 -0
- package/dist/types/audio/synthesizer.d.ts +10 -24
- package/dist/types/basics/Accordion.d.ts +11 -11
- package/dist/types/basics/Controller.d.ts +18 -16
- package/dist/types/basics/Drag.d.ts +6 -0
- package/dist/types/basics/KeyEvent.d.ts +2 -0
- package/dist/types/basics/KeyboardEvent.d.ts +2 -0
- package/dist/types/basics/Modal.d.ts +11 -5
- package/dist/types/basics/PointerEvent.d.ts +2 -0
- package/dist/types/basics/Screen.d.ts +0 -4
- package/dist/types/basics/Tab.d.ts +19 -7
- package/dist/types/basics/UserEvent.d.ts +1 -1
- package/dist/types/core/unit.d.ts +7 -7
- package/dist/types/index.d.ts +10 -7
- package/dist/xnew.d.ts +97 -81
- package/dist/xnew.js +453 -412
- package/dist/xnew.mjs +453 -412
- package/package.json +1 -1
|
@@ -1,13 +1,19 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
export declare const context: AudioContext;
|
|
2
|
+
export declare const master: GainNode;
|
|
3
|
+
export declare class AudioNodeClass {
|
|
4
|
+
nodes: {
|
|
5
|
+
[key: string]: AudioNode & {
|
|
6
|
+
[key: string]: any;
|
|
7
|
+
};
|
|
4
8
|
};
|
|
5
|
-
|
|
6
|
-
export declare class Audio {
|
|
7
|
-
static context: AudioContext | null;
|
|
8
|
-
static master: GainNode | null;
|
|
9
|
-
static initialize(): void;
|
|
10
|
-
static connect(params: {
|
|
9
|
+
constructor(params: {
|
|
11
10
|
[key: string]: any[];
|
|
12
|
-
})
|
|
11
|
+
});
|
|
12
|
+
cleanup(): void;
|
|
13
13
|
}
|
|
14
|
+
export type AudioNodeMap = {
|
|
15
|
+
[key: string]: AudioNode;
|
|
16
|
+
};
|
|
17
|
+
export declare function connect(params: {
|
|
18
|
+
[key: string]: any[];
|
|
19
|
+
}): AudioNodeMap;
|
|
@@ -1 +1,17 @@
|
|
|
1
|
+
import { AudioNodeMap } from './audio';
|
|
2
|
+
export declare function load(path: string): AudioFile;
|
|
3
|
+
declare class AudioFile {
|
|
4
|
+
data: any;
|
|
5
|
+
startTime: number | null;
|
|
6
|
+
nodes: AudioNodeMap;
|
|
7
|
+
constructor(path: string);
|
|
8
|
+
isReady(): boolean;
|
|
9
|
+
get promise(): Promise<void>;
|
|
10
|
+
set volume(value: number);
|
|
11
|
+
get volume(): number;
|
|
12
|
+
set loop(value: boolean);
|
|
13
|
+
get loop(): boolean;
|
|
14
|
+
play(offset?: number): void;
|
|
15
|
+
pause(): number | undefined;
|
|
16
|
+
}
|
|
1
17
|
export {};
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
type SynthProps = {
|
|
2
|
+
oscillator?: OscillatorOptions | null;
|
|
3
|
+
filter?: FilterOptions | null;
|
|
4
|
+
amp?: AmpOptions | null;
|
|
5
|
+
};
|
|
6
|
+
type SynthEffects = {
|
|
7
|
+
bmp?: number | null;
|
|
8
|
+
reverb?: ReverbOptions | null;
|
|
9
|
+
};
|
|
1
10
|
type Envelope = {
|
|
2
11
|
amount: number;
|
|
3
12
|
ADSR: [number, number, number, number];
|
|
@@ -14,34 +23,15 @@ type OscillatorOptions = {
|
|
|
14
23
|
};
|
|
15
24
|
type FilterOptions = {
|
|
16
25
|
type?: BiquadFilterType;
|
|
17
|
-
Q?: number;
|
|
18
26
|
cutoff?: number;
|
|
19
|
-
envelope?: Envelope | null;
|
|
20
|
-
LFO?: LFO | null;
|
|
21
27
|
};
|
|
22
28
|
type AmpOptions = {
|
|
23
29
|
envelope?: Envelope | null;
|
|
24
|
-
LFO?: LFO | null;
|
|
25
30
|
};
|
|
26
31
|
type ReverbOptions = {
|
|
27
32
|
time?: number;
|
|
28
33
|
mix?: number;
|
|
29
34
|
};
|
|
30
|
-
type DelayOptions = {
|
|
31
|
-
time?: number;
|
|
32
|
-
feedback?: number;
|
|
33
|
-
mix?: number;
|
|
34
|
-
};
|
|
35
|
-
type SynthProps = {
|
|
36
|
-
oscillator?: OscillatorOptions | null;
|
|
37
|
-
filter?: FilterOptions | null;
|
|
38
|
-
amp?: AmpOptions | null;
|
|
39
|
-
};
|
|
40
|
-
type SynthEffects = {
|
|
41
|
-
bmp?: number | null;
|
|
42
|
-
reverb?: ReverbOptions | null;
|
|
43
|
-
delay?: DelayOptions | null;
|
|
44
|
-
};
|
|
45
35
|
export declare function synthesizer(props?: SynthProps, effects?: SynthEffects): Synthesizer;
|
|
46
36
|
declare class Synthesizer {
|
|
47
37
|
oscillator: OscillatorOptions;
|
|
@@ -49,12 +39,8 @@ declare class Synthesizer {
|
|
|
49
39
|
amp: AmpOptions;
|
|
50
40
|
bmp: number;
|
|
51
41
|
reverb: ReverbOptions;
|
|
52
|
-
delay: DelayOptions;
|
|
53
|
-
options: {
|
|
54
|
-
bmp: number;
|
|
55
|
-
};
|
|
56
42
|
static initialize(): void;
|
|
57
|
-
constructor({ oscillator, filter, amp }?: SynthProps, { bmp, reverb
|
|
43
|
+
constructor({ oscillator, filter, amp }?: SynthProps, { bmp, reverb }?: SynthEffects);
|
|
58
44
|
static keymap: {
|
|
59
45
|
[key: string]: number;
|
|
60
46
|
};
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { xnew } from '../core/xnew';
|
|
2
|
-
export declare function AccordionFrame(frame: xnew.Unit, {}?: {
|
|
2
|
+
export declare function AccordionFrame(frame: xnew.Unit, { open, duration, easing }?: {
|
|
3
|
+
open?: boolean;
|
|
4
|
+
duration?: number;
|
|
5
|
+
easing?: string;
|
|
6
|
+
}): {
|
|
3
7
|
toggle(): void;
|
|
4
8
|
open(): void;
|
|
5
9
|
close(): void;
|
|
@@ -7,14 +11,10 @@ export declare function AccordionFrame(frame: xnew.Unit, {}?: {}): {
|
|
|
7
11
|
export declare function AccordionHeader(header: xnew.Unit, {}?: {}): void;
|
|
8
12
|
export declare function AccordionBullet(bullet: xnew.Unit, { type }?: {
|
|
9
13
|
type?: string;
|
|
10
|
-
}):
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
easing?: string;
|
|
17
|
-
}): {
|
|
18
|
-
readonly status: number;
|
|
19
|
-
transition(status: number): void;
|
|
14
|
+
}): void;
|
|
15
|
+
export declare function AccordionContent(content: xnew.Unit, {}?: {}): {
|
|
16
|
+
transition({ element, rate }: {
|
|
17
|
+
element: HTMLElement;
|
|
18
|
+
rate: number;
|
|
19
|
+
}): void;
|
|
20
20
|
};
|
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
import { xnew } from '../core/xnew';
|
|
2
|
-
export declare function
|
|
3
|
-
size?: number
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
export declare function AnalogStick(self: xnew.Unit, { size, fill, fillOpacity, stroke, strokeOpacity, strokeWidth, strokeLinejoin }?: {
|
|
3
|
+
size?: number;
|
|
4
|
+
diagonal?: boolean;
|
|
5
|
+
fill?: string;
|
|
6
|
+
fillOpacity?: number;
|
|
7
|
+
stroke?: string;
|
|
8
|
+
strokeOpacity?: number;
|
|
9
|
+
strokeWidth?: number;
|
|
10
|
+
strokeLinejoin?: string;
|
|
10
11
|
}): void;
|
|
11
|
-
export declare function
|
|
12
|
-
size?: number
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
12
|
+
export declare function DirectionalPad(self: xnew.Unit, { size, diagonal, fill, fillOpacity, stroke, strokeOpacity, strokeWidth, strokeLinejoin }?: {
|
|
13
|
+
size?: number;
|
|
14
|
+
diagonal?: boolean;
|
|
15
|
+
fill?: string;
|
|
16
|
+
fillOpacity?: number;
|
|
17
|
+
stroke?: string;
|
|
18
|
+
strokeOpacity?: number;
|
|
19
|
+
strokeWidth?: number;
|
|
20
|
+
strokeLinejoin?: string;
|
|
19
21
|
}): void;
|
|
20
22
|
export declare function TouchButton(self: xnew.Unit, { size, fill, fillOpacity, stroke, strokeOpacity, strokeWidth, strokeLinejoin }?: {
|
|
21
23
|
size?: number | undefined;
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import { xnew } from '../core/xnew';
|
|
2
|
-
export declare function ModalFrame(frame: xnew.Unit, {}?: {
|
|
3
|
-
close(): void;
|
|
4
|
-
};
|
|
5
|
-
export declare function ModalContent(content: xnew.Unit, { duration, easing, background }?: {
|
|
2
|
+
export declare function ModalFrame(frame: xnew.Unit, { duration, easing }?: {
|
|
6
3
|
duration?: number;
|
|
7
4
|
easing?: string;
|
|
5
|
+
}): {
|
|
6
|
+
close(): void;
|
|
7
|
+
};
|
|
8
|
+
export declare function ModalContent(content: xnew.Unit, { background }?: {
|
|
8
9
|
background?: string;
|
|
9
|
-
}):
|
|
10
|
+
}): {
|
|
11
|
+
transition({ element, rate }: {
|
|
12
|
+
element: HTMLElement;
|
|
13
|
+
rate: number;
|
|
14
|
+
}): void;
|
|
15
|
+
};
|
|
@@ -1,12 +1,24 @@
|
|
|
1
1
|
import { xnew } from '../core/xnew';
|
|
2
2
|
export declare function TabFrame(frame: xnew.Unit, { select }?: {
|
|
3
|
-
select?:
|
|
3
|
+
select?: string;
|
|
4
4
|
}): void;
|
|
5
|
-
export declare function TabButton(button: xnew.Unit, {}?: {
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
export declare function TabButton(button: xnew.Unit, { key }?: {
|
|
6
|
+
key?: string;
|
|
7
|
+
}): {
|
|
8
|
+
select({ element }: {
|
|
9
|
+
element: HTMLElement;
|
|
10
|
+
}): void;
|
|
11
|
+
deselect({ element }: {
|
|
12
|
+
element: HTMLElement;
|
|
13
|
+
}): void;
|
|
8
14
|
};
|
|
9
|
-
export declare function TabContent(
|
|
10
|
-
|
|
11
|
-
|
|
15
|
+
export declare function TabContent(content: xnew.Unit, { key }?: {
|
|
16
|
+
key?: string;
|
|
17
|
+
}): {
|
|
18
|
+
select({ element }: {
|
|
19
|
+
element: HTMLElement;
|
|
20
|
+
}): void;
|
|
21
|
+
deselect({ element }: {
|
|
22
|
+
element: HTMLElement;
|
|
23
|
+
}): void;
|
|
12
24
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { xnew } from '../core/xnew';
|
|
2
|
-
export declare function UserEvent(
|
|
2
|
+
export declare function UserEvent(unit: xnew.Unit): void;
|
|
@@ -14,13 +14,6 @@ interface Capture {
|
|
|
14
14
|
checker: (unit: Unit) => boolean;
|
|
15
15
|
execute: (unit: Unit) => any;
|
|
16
16
|
}
|
|
17
|
-
export declare class UnitPromise {
|
|
18
|
-
private promise;
|
|
19
|
-
constructor(promise: Promise<any>);
|
|
20
|
-
then(callback: Function): UnitPromise;
|
|
21
|
-
catch(callback: Function): UnitPromise;
|
|
22
|
-
finally(callback: Function): UnitPromise;
|
|
23
|
-
}
|
|
24
17
|
interface UnitInternal {
|
|
25
18
|
parent: Unit | null;
|
|
26
19
|
target: Object | null;
|
|
@@ -43,6 +36,13 @@ interface UnitInternal {
|
|
|
43
36
|
defines: Record<string, any>;
|
|
44
37
|
systems: Record<string, Function[]>;
|
|
45
38
|
}
|
|
39
|
+
export declare class UnitPromise {
|
|
40
|
+
private promise;
|
|
41
|
+
constructor(promise: Promise<any>);
|
|
42
|
+
then(callback: Function): UnitPromise;
|
|
43
|
+
catch(callback: Function): UnitPromise;
|
|
44
|
+
finally(callback: Function): UnitPromise;
|
|
45
|
+
}
|
|
46
46
|
export declare class Unit {
|
|
47
47
|
[key: string]: any;
|
|
48
48
|
_: UnitInternal;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
import { ResizeEvent } from './basics/ResizeEvent';
|
|
2
|
-
import {
|
|
2
|
+
import { PointerEvent } from './basics/PointerEvent';
|
|
3
|
+
import { KeyboardEvent } from './basics/KeyboardEvent';
|
|
3
4
|
import { Screen } from './basics/Screen';
|
|
4
5
|
import { InputFrame } from './basics/Input';
|
|
5
6
|
import { ModalFrame, ModalContent } from './basics/Modal';
|
|
6
7
|
import { TabFrame, TabButton, TabContent } from './basics/Tab';
|
|
7
8
|
import { AccordionFrame, AccordionHeader, AccordionBullet, AccordionContent } from './basics/Accordion';
|
|
8
|
-
import { DragFrame, DragTarget } from './basics/
|
|
9
|
-
import {
|
|
9
|
+
import { DragFrame, DragTarget } from './basics/Drag';
|
|
10
|
+
import { AnalogStick, DirectionalPad } from './basics/Controller';
|
|
10
11
|
import { Unit } from './core/unit';
|
|
12
|
+
import { load } from './audio/loader';
|
|
11
13
|
import { synthesizer } from './audio/synthesizer';
|
|
12
14
|
declare const basics: {
|
|
13
15
|
Screen: typeof Screen;
|
|
14
|
-
|
|
16
|
+
PointerEvent: typeof PointerEvent;
|
|
15
17
|
ResizeEvent: typeof ResizeEvent;
|
|
18
|
+
KeyboardEvent: typeof KeyboardEvent;
|
|
16
19
|
ModalFrame: typeof ModalFrame;
|
|
17
20
|
ModalContent: typeof ModalContent;
|
|
18
21
|
AccordionFrame: typeof AccordionFrame;
|
|
@@ -25,12 +28,12 @@ declare const basics: {
|
|
|
25
28
|
InputFrame: typeof InputFrame;
|
|
26
29
|
DragFrame: typeof DragFrame;
|
|
27
30
|
DragTarget: typeof DragTarget;
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
TouchButton: typeof TouchButton;
|
|
31
|
+
AnalogStick: typeof AnalogStick;
|
|
32
|
+
DirectionalPad: typeof DirectionalPad;
|
|
31
33
|
};
|
|
32
34
|
declare const audio: {
|
|
33
35
|
synthesizer: typeof synthesizer;
|
|
36
|
+
load: typeof load;
|
|
34
37
|
};
|
|
35
38
|
export interface xnew_interface {
|
|
36
39
|
(...args: any[]): Unit;
|
package/dist/xnew.d.ts
CHANGED
|
@@ -100,7 +100,9 @@ declare namespace xnew$1 {
|
|
|
100
100
|
}
|
|
101
101
|
declare const xnew$1: any;
|
|
102
102
|
|
|
103
|
-
declare function
|
|
103
|
+
declare function PointerEvent(unit: xnew$1.Unit): void;
|
|
104
|
+
|
|
105
|
+
declare function KeyboardEvent(unit: xnew$1.Unit): void;
|
|
104
106
|
|
|
105
107
|
declare function Screen(screen: xnew$1.Unit, { width, height, fit }?: {
|
|
106
108
|
width?: number | undefined;
|
|
@@ -109,36 +111,54 @@ declare function Screen(screen: xnew$1.Unit, { width, height, fit }?: {
|
|
|
109
111
|
}): {
|
|
110
112
|
readonly canvas: any;
|
|
111
113
|
resize(width: number, height: number): void;
|
|
112
|
-
readonly scale: {
|
|
113
|
-
x: number;
|
|
114
|
-
y: number;
|
|
115
|
-
};
|
|
116
114
|
};
|
|
117
115
|
|
|
118
116
|
declare function InputFrame(frame: xnew$1.Unit, {}?: {}): void;
|
|
119
117
|
|
|
120
|
-
declare function ModalFrame(frame: xnew$1.Unit, {}?: {
|
|
121
|
-
close(): void;
|
|
122
|
-
};
|
|
123
|
-
declare function ModalContent(content: xnew$1.Unit, { duration, easing, background }?: {
|
|
118
|
+
declare function ModalFrame(frame: xnew$1.Unit, { duration, easing }?: {
|
|
124
119
|
duration?: number;
|
|
125
120
|
easing?: string;
|
|
121
|
+
}): {
|
|
122
|
+
close(): void;
|
|
123
|
+
};
|
|
124
|
+
declare function ModalContent(content: xnew$1.Unit, { background }?: {
|
|
126
125
|
background?: string;
|
|
127
|
-
}):
|
|
126
|
+
}): {
|
|
127
|
+
transition({ element, rate }: {
|
|
128
|
+
element: HTMLElement;
|
|
129
|
+
rate: number;
|
|
130
|
+
}): void;
|
|
131
|
+
};
|
|
128
132
|
|
|
129
133
|
declare function TabFrame(frame: xnew$1.Unit, { select }?: {
|
|
130
|
-
select?:
|
|
134
|
+
select?: string;
|
|
131
135
|
}): void;
|
|
132
|
-
declare function TabButton(button: xnew$1.Unit, {}?: {
|
|
133
|
-
|
|
134
|
-
|
|
136
|
+
declare function TabButton(button: xnew$1.Unit, { key }?: {
|
|
137
|
+
key?: string;
|
|
138
|
+
}): {
|
|
139
|
+
select({ element }: {
|
|
140
|
+
element: HTMLElement;
|
|
141
|
+
}): void;
|
|
142
|
+
deselect({ element }: {
|
|
143
|
+
element: HTMLElement;
|
|
144
|
+
}): void;
|
|
135
145
|
};
|
|
136
|
-
declare function TabContent(
|
|
137
|
-
|
|
138
|
-
|
|
146
|
+
declare function TabContent(content: xnew$1.Unit, { key }?: {
|
|
147
|
+
key?: string;
|
|
148
|
+
}): {
|
|
149
|
+
select({ element }: {
|
|
150
|
+
element: HTMLElement;
|
|
151
|
+
}): void;
|
|
152
|
+
deselect({ element }: {
|
|
153
|
+
element: HTMLElement;
|
|
154
|
+
}): void;
|
|
139
155
|
};
|
|
140
156
|
|
|
141
|
-
declare function AccordionFrame(frame: xnew$1.Unit, {}?: {
|
|
157
|
+
declare function AccordionFrame(frame: xnew$1.Unit, { open, duration, easing }?: {
|
|
158
|
+
open?: boolean;
|
|
159
|
+
duration?: number;
|
|
160
|
+
easing?: string;
|
|
161
|
+
}): {
|
|
142
162
|
toggle(): void;
|
|
143
163
|
open(): void;
|
|
144
164
|
close(): void;
|
|
@@ -146,16 +166,12 @@ declare function AccordionFrame(frame: xnew$1.Unit, {}?: {}): {
|
|
|
146
166
|
declare function AccordionHeader(header: xnew$1.Unit, {}?: {}): void;
|
|
147
167
|
declare function AccordionBullet(bullet: xnew$1.Unit, { type }?: {
|
|
148
168
|
type?: string;
|
|
149
|
-
}):
|
|
150
|
-
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
easing?: string;
|
|
156
|
-
}): {
|
|
157
|
-
readonly status: number;
|
|
158
|
-
transition(status: number): void;
|
|
169
|
+
}): void;
|
|
170
|
+
declare function AccordionContent(content: xnew$1.Unit, {}?: {}): {
|
|
171
|
+
transition({ element, rate }: {
|
|
172
|
+
element: HTMLElement;
|
|
173
|
+
rate: number;
|
|
174
|
+
}): void;
|
|
159
175
|
};
|
|
160
176
|
|
|
161
177
|
declare function DragFrame(frame: xnew$1.Unit, { x, y }?: {
|
|
@@ -164,34 +180,56 @@ declare function DragFrame(frame: xnew$1.Unit, { x, y }?: {
|
|
|
164
180
|
}): void;
|
|
165
181
|
declare function DragTarget(target: xnew$1.Unit, {}?: {}): void;
|
|
166
182
|
|
|
167
|
-
declare function
|
|
168
|
-
size?: number
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
183
|
+
declare function AnalogStick(self: xnew$1.Unit, { size, fill, fillOpacity, stroke, strokeOpacity, strokeWidth, strokeLinejoin }?: {
|
|
184
|
+
size?: number;
|
|
185
|
+
diagonal?: boolean;
|
|
186
|
+
fill?: string;
|
|
187
|
+
fillOpacity?: number;
|
|
188
|
+
stroke?: string;
|
|
189
|
+
strokeOpacity?: number;
|
|
190
|
+
strokeWidth?: number;
|
|
191
|
+
strokeLinejoin?: string;
|
|
175
192
|
}): void;
|
|
176
|
-
declare function
|
|
177
|
-
size?: number
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
declare function TouchButton(self: xnew$1.Unit, { size, fill, fillOpacity, stroke, strokeOpacity, strokeWidth, strokeLinejoin }?: {
|
|
186
|
-
size?: number | undefined;
|
|
187
|
-
fill?: string | undefined;
|
|
188
|
-
fillOpacity?: number | undefined;
|
|
189
|
-
stroke?: string | undefined;
|
|
190
|
-
strokeOpacity?: number | undefined;
|
|
191
|
-
strokeWidth?: number | undefined;
|
|
192
|
-
strokeLinejoin?: string | undefined;
|
|
193
|
+
declare function DirectionalPad(self: xnew$1.Unit, { size, diagonal, fill, fillOpacity, stroke, strokeOpacity, strokeWidth, strokeLinejoin }?: {
|
|
194
|
+
size?: number;
|
|
195
|
+
diagonal?: boolean;
|
|
196
|
+
fill?: string;
|
|
197
|
+
fillOpacity?: number;
|
|
198
|
+
stroke?: string;
|
|
199
|
+
strokeOpacity?: number;
|
|
200
|
+
strokeWidth?: number;
|
|
201
|
+
strokeLinejoin?: string;
|
|
193
202
|
}): void;
|
|
194
203
|
|
|
204
|
+
type AudioNodeMap = {
|
|
205
|
+
[key: string]: AudioNode;
|
|
206
|
+
};
|
|
207
|
+
|
|
208
|
+
declare function load(path: string): AudioFile;
|
|
209
|
+
declare class AudioFile {
|
|
210
|
+
data: any;
|
|
211
|
+
startTime: number | null;
|
|
212
|
+
nodes: AudioNodeMap;
|
|
213
|
+
constructor(path: string);
|
|
214
|
+
isReady(): boolean;
|
|
215
|
+
get promise(): Promise<void>;
|
|
216
|
+
set volume(value: number);
|
|
217
|
+
get volume(): number;
|
|
218
|
+
set loop(value: boolean);
|
|
219
|
+
get loop(): boolean;
|
|
220
|
+
play(offset?: number): void;
|
|
221
|
+
pause(): number | undefined;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
type SynthProps = {
|
|
225
|
+
oscillator?: OscillatorOptions | null;
|
|
226
|
+
filter?: FilterOptions | null;
|
|
227
|
+
amp?: AmpOptions | null;
|
|
228
|
+
};
|
|
229
|
+
type SynthEffects = {
|
|
230
|
+
bmp?: number | null;
|
|
231
|
+
reverb?: ReverbOptions | null;
|
|
232
|
+
};
|
|
195
233
|
type Envelope = {
|
|
196
234
|
amount: number;
|
|
197
235
|
ADSR: [number, number, number, number];
|
|
@@ -208,34 +246,15 @@ type OscillatorOptions = {
|
|
|
208
246
|
};
|
|
209
247
|
type FilterOptions = {
|
|
210
248
|
type?: BiquadFilterType;
|
|
211
|
-
Q?: number;
|
|
212
249
|
cutoff?: number;
|
|
213
|
-
envelope?: Envelope | null;
|
|
214
|
-
LFO?: LFO | null;
|
|
215
250
|
};
|
|
216
251
|
type AmpOptions = {
|
|
217
252
|
envelope?: Envelope | null;
|
|
218
|
-
LFO?: LFO | null;
|
|
219
253
|
};
|
|
220
254
|
type ReverbOptions = {
|
|
221
255
|
time?: number;
|
|
222
256
|
mix?: number;
|
|
223
257
|
};
|
|
224
|
-
type DelayOptions = {
|
|
225
|
-
time?: number;
|
|
226
|
-
feedback?: number;
|
|
227
|
-
mix?: number;
|
|
228
|
-
};
|
|
229
|
-
type SynthProps = {
|
|
230
|
-
oscillator?: OscillatorOptions | null;
|
|
231
|
-
filter?: FilterOptions | null;
|
|
232
|
-
amp?: AmpOptions | null;
|
|
233
|
-
};
|
|
234
|
-
type SynthEffects = {
|
|
235
|
-
bmp?: number | null;
|
|
236
|
-
reverb?: ReverbOptions | null;
|
|
237
|
-
delay?: DelayOptions | null;
|
|
238
|
-
};
|
|
239
258
|
declare function synthesizer(props?: SynthProps, effects?: SynthEffects): Synthesizer;
|
|
240
259
|
declare class Synthesizer {
|
|
241
260
|
oscillator: OscillatorOptions;
|
|
@@ -243,12 +262,8 @@ declare class Synthesizer {
|
|
|
243
262
|
amp: AmpOptions;
|
|
244
263
|
bmp: number;
|
|
245
264
|
reverb: ReverbOptions;
|
|
246
|
-
delay: DelayOptions;
|
|
247
|
-
options: {
|
|
248
|
-
bmp: number;
|
|
249
|
-
};
|
|
250
265
|
static initialize(): void;
|
|
251
|
-
constructor({ oscillator, filter, amp }?: SynthProps, { bmp, reverb
|
|
266
|
+
constructor({ oscillator, filter, amp }?: SynthProps, { bmp, reverb }?: SynthEffects);
|
|
252
267
|
static keymap: {
|
|
253
268
|
[key: string]: number;
|
|
254
269
|
};
|
|
@@ -262,8 +277,9 @@ declare class Synthesizer {
|
|
|
262
277
|
|
|
263
278
|
declare const basics: {
|
|
264
279
|
Screen: typeof Screen;
|
|
265
|
-
|
|
280
|
+
PointerEvent: typeof PointerEvent;
|
|
266
281
|
ResizeEvent: typeof ResizeEvent;
|
|
282
|
+
KeyboardEvent: typeof KeyboardEvent;
|
|
267
283
|
ModalFrame: typeof ModalFrame;
|
|
268
284
|
ModalContent: typeof ModalContent;
|
|
269
285
|
AccordionFrame: typeof AccordionFrame;
|
|
@@ -276,12 +292,12 @@ declare const basics: {
|
|
|
276
292
|
InputFrame: typeof InputFrame;
|
|
277
293
|
DragFrame: typeof DragFrame;
|
|
278
294
|
DragTarget: typeof DragTarget;
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
TouchButton: typeof TouchButton;
|
|
295
|
+
AnalogStick: typeof AnalogStick;
|
|
296
|
+
DirectionalPad: typeof DirectionalPad;
|
|
282
297
|
};
|
|
283
298
|
declare const audio: {
|
|
284
299
|
synthesizer: typeof synthesizer;
|
|
300
|
+
load: typeof load;
|
|
285
301
|
};
|
|
286
302
|
interface xnew_interface {
|
|
287
303
|
(...args: any[]): Unit;
|