@mulsense/xnew 0.1.0
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/LICENSE +21 -0
- package/README.md +46 -0
- package/dist/addons/xmatter.d.ts +6 -0
- package/dist/addons/xmatter.js +45 -0
- package/dist/addons/xmatter.mjs +40 -0
- package/dist/addons/xpixi.d.ts +10 -0
- package/dist/addons/xpixi.js +101 -0
- package/dist/addons/xpixi.mjs +77 -0
- package/dist/addons/xrapier2d.d.ts +6 -0
- package/dist/addons/xrapier2d.js +66 -0
- package/dist/addons/xrapier2d.mjs +61 -0
- package/dist/addons/xthree.d.ts +9 -0
- package/dist/addons/xthree.js +77 -0
- package/dist/addons/xthree.mjs +53 -0
- package/dist/types/audio/audio.d.ts +13 -0
- package/dist/types/audio/loader.d.ts +1 -0
- package/dist/types/audio/synthesizer.d.ts +68 -0
- package/dist/types/basics/Accordion.d.ts +20 -0
- package/dist/types/basics/Block.d.ts +24 -0
- package/dist/types/basics/Bullet.d.ts +7 -0
- package/dist/types/basics/ControlPanel.d.ts +7 -0
- package/dist/types/basics/Controller.d.ts +28 -0
- package/dist/types/basics/Event.d.ts +3 -0
- package/dist/types/basics/File.d.ts +1 -0
- package/dist/types/basics/Input.d.ts +2 -0
- package/dist/types/basics/Modal.d.ts +11 -0
- package/dist/types/basics/Navigation.d.ts +1 -0
- package/dist/types/basics/Panel.d.ts +6 -0
- package/dist/types/basics/Popup.d.ts +8 -0
- package/dist/types/basics/ResizeEvent.d.ts +1 -0
- package/dist/types/basics/Screen.d.ts +13 -0
- package/dist/types/basics/SubWIndow.d.ts +6 -0
- package/dist/types/basics/Tab.d.ts +12 -0
- package/dist/types/basics/TabView.d.ts +18 -0
- package/dist/types/basics/Tabs.d.ts +8 -0
- package/dist/types/basics/Transition.d.ts +17 -0
- package/dist/types/basics/UserEvent.d.ts +2 -0
- package/dist/types/basics/WorkSpace.d.ts +16 -0
- package/dist/types/core/map.d.ts +34 -0
- package/dist/types/core/time.d.ts +27 -0
- package/dist/types/core/unit.d.ts +105 -0
- package/dist/types/core/util.d.ts +1 -0
- package/dist/types/core/xnew.d.ts +9 -0
- package/dist/types/index.d.ts +47 -0
- package/dist/types/xnew.d.ts +8 -0
- package/dist/xnew.d.ts +273 -0
- package/dist/xnew.js +2013 -0
- package/dist/xnew.mjs +2005 -0
- package/package.json +85 -0
package/dist/xnew.d.ts
ADDED
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
declare function ResizeEvent(self: any): void;
|
|
2
|
+
|
|
3
|
+
declare const LIFECYCLE_EVENTS: readonly ["start", "update", "stop", "finalize"];
|
|
4
|
+
type LifecycleEvent = typeof LIFECYCLE_EVENTS[number];
|
|
5
|
+
interface Context {
|
|
6
|
+
stack: Context | null;
|
|
7
|
+
key: string;
|
|
8
|
+
value: any;
|
|
9
|
+
}
|
|
10
|
+
interface Capture {
|
|
11
|
+
checker: (unit: Unit) => boolean;
|
|
12
|
+
execute: (unit: Unit) => any;
|
|
13
|
+
}
|
|
14
|
+
interface UnitInternal {
|
|
15
|
+
root: Unit;
|
|
16
|
+
parent: Unit | null;
|
|
17
|
+
children: Unit[];
|
|
18
|
+
target: Object | null;
|
|
19
|
+
props?: Object;
|
|
20
|
+
nextNest: {
|
|
21
|
+
element: HTMLElement | SVGElement;
|
|
22
|
+
position: InsertPosition;
|
|
23
|
+
};
|
|
24
|
+
baseElement: HTMLElement | SVGElement;
|
|
25
|
+
currentElement: HTMLElement | SVGElement;
|
|
26
|
+
baseContext: Context | null;
|
|
27
|
+
baseComponent: Function | null;
|
|
28
|
+
components: Function[];
|
|
29
|
+
captures: Capture[];
|
|
30
|
+
state: string;
|
|
31
|
+
tostart: boolean;
|
|
32
|
+
upcount: number;
|
|
33
|
+
resolved: boolean;
|
|
34
|
+
defines: Record<string, any>;
|
|
35
|
+
system: Record<LifecycleEvent, Function[]>;
|
|
36
|
+
}
|
|
37
|
+
declare class Unit {
|
|
38
|
+
[key: string]: any;
|
|
39
|
+
_: UnitInternal;
|
|
40
|
+
static roots: Unit[];
|
|
41
|
+
constructor(target: Object | null, component?: Function | string, props?: Object);
|
|
42
|
+
get element(): HTMLElement | SVGElement;
|
|
43
|
+
start(): void;
|
|
44
|
+
stop(): void;
|
|
45
|
+
finalize(): void;
|
|
46
|
+
reboot(): void;
|
|
47
|
+
get components(): Function[];
|
|
48
|
+
on(type: string, listener: Function, options?: boolean | AddEventListenerOptions): Unit;
|
|
49
|
+
off(type?: string, listener?: Function): Unit;
|
|
50
|
+
emit(type: string, ...args: any[]): void;
|
|
51
|
+
static initialize(unit: Unit): void;
|
|
52
|
+
static finalize(unit: Unit): void;
|
|
53
|
+
static nest(unit: Unit, tag: string): HTMLElement | SVGElement | null;
|
|
54
|
+
static extend(unit: Unit, component: Function, props?: Object): void;
|
|
55
|
+
static start(unit: Unit, time: number): void;
|
|
56
|
+
static stop(unit: Unit): void;
|
|
57
|
+
static update(unit: Unit, time: number): void;
|
|
58
|
+
static ticker(time: number): void;
|
|
59
|
+
static reset(): void;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
interface xnewtype$1 {
|
|
63
|
+
(...args: any[]): Unit;
|
|
64
|
+
[key: string]: any;
|
|
65
|
+
}
|
|
66
|
+
declare namespace xnew$1 {
|
|
67
|
+
type Unit = InstanceType<typeof Unit>;
|
|
68
|
+
}
|
|
69
|
+
declare const xnew$1: xnewtype$1;
|
|
70
|
+
|
|
71
|
+
declare function UserEvent(self: xnew$1.Unit): void;
|
|
72
|
+
|
|
73
|
+
declare function Screen(screen: xnew$1.Unit, { width, height, fit }?: {
|
|
74
|
+
width?: number | undefined;
|
|
75
|
+
height?: number | undefined;
|
|
76
|
+
fit?: string | undefined;
|
|
77
|
+
}): {
|
|
78
|
+
readonly canvas: any;
|
|
79
|
+
resize(width: number, height: number): void;
|
|
80
|
+
readonly scale: {
|
|
81
|
+
x: number;
|
|
82
|
+
y: number;
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
declare function InputFrame(frame: xnew$1.Unit, {}?: {}): void;
|
|
87
|
+
|
|
88
|
+
declare function ModalFrame(frame: xnew$1.Unit, {}?: {}): {
|
|
89
|
+
close(): void;
|
|
90
|
+
};
|
|
91
|
+
declare function ModalContent(content: xnew$1.Unit, { duration, easing, background }?: {
|
|
92
|
+
duration?: number;
|
|
93
|
+
easing?: string;
|
|
94
|
+
background?: string;
|
|
95
|
+
}): {
|
|
96
|
+
transition(status: number): void;
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
declare function TabFrame(frame: xnew$1.Unit, { select }?: {
|
|
100
|
+
select?: number | undefined;
|
|
101
|
+
}): void;
|
|
102
|
+
declare function TabButton(button: xnew$1.Unit, {}?: {}): {
|
|
103
|
+
select(): void;
|
|
104
|
+
deselect(): void;
|
|
105
|
+
};
|
|
106
|
+
declare function TabContent(self: xnew$1.Unit, {}?: {}): {
|
|
107
|
+
select(): void;
|
|
108
|
+
deselect(): void;
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
declare function AccordionFrame(frame: xnew$1.Unit, {}?: {}): {
|
|
112
|
+
toggle(): void;
|
|
113
|
+
open(): void;
|
|
114
|
+
close(): void;
|
|
115
|
+
};
|
|
116
|
+
declare function AccordionButton(button: xnew$1.Unit, {}?: {}): void;
|
|
117
|
+
declare function AccordionBullet(bullet: xnew$1.Unit, { type }?: {
|
|
118
|
+
type?: string;
|
|
119
|
+
}): {
|
|
120
|
+
transition(status: number): void;
|
|
121
|
+
} | undefined;
|
|
122
|
+
declare function AccordionContent(content: xnew$1.Unit, { open, duration, easing }?: {
|
|
123
|
+
open?: boolean;
|
|
124
|
+
duration?: number;
|
|
125
|
+
easing?: string;
|
|
126
|
+
}): {
|
|
127
|
+
readonly status: number;
|
|
128
|
+
transition(status: number): void;
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
declare function PanelFrame(frame: xnew$1.Unit): void;
|
|
132
|
+
declare function PanelGroup(group: xnew$1.Unit, { name, open }?: {
|
|
133
|
+
name?: string;
|
|
134
|
+
open?: boolean;
|
|
135
|
+
}): void;
|
|
136
|
+
|
|
137
|
+
declare function DragFrame(frame: xnew$1.Unit, { x, y }?: {
|
|
138
|
+
x?: number;
|
|
139
|
+
y?: number;
|
|
140
|
+
}): void;
|
|
141
|
+
declare function DragTarget(target: xnew$1.Unit, {}?: {}): void;
|
|
142
|
+
|
|
143
|
+
declare function VirtualStick(self: xnew$1.Unit, { size, fill, fillOpacity, stroke, strokeOpacity, strokeWidth, strokeLinejoin }?: {
|
|
144
|
+
size?: number | undefined;
|
|
145
|
+
fill?: string | undefined;
|
|
146
|
+
fillOpacity?: number | undefined;
|
|
147
|
+
stroke?: string | undefined;
|
|
148
|
+
strokeOpacity?: number | undefined;
|
|
149
|
+
strokeWidth?: number | undefined;
|
|
150
|
+
strokeLinejoin?: string | undefined;
|
|
151
|
+
}): void;
|
|
152
|
+
declare function VirtualDPad(self: xnew$1.Unit, { size, fill, fillOpacity, stroke, strokeOpacity, strokeWidth, strokeLinejoin }?: {
|
|
153
|
+
size?: number | undefined;
|
|
154
|
+
fill?: string | undefined;
|
|
155
|
+
fillOpacity?: number | undefined;
|
|
156
|
+
stroke?: string | undefined;
|
|
157
|
+
strokeOpacity?: number | undefined;
|
|
158
|
+
strokeWidth?: number | undefined;
|
|
159
|
+
strokeLinejoin?: string | undefined;
|
|
160
|
+
}): void;
|
|
161
|
+
declare function VirtualButton(self: xnew$1.Unit, { size, fill, fillOpacity, stroke, strokeOpacity, strokeWidth, strokeLinejoin }?: {
|
|
162
|
+
size?: number | undefined;
|
|
163
|
+
fill?: string | undefined;
|
|
164
|
+
fillOpacity?: number | undefined;
|
|
165
|
+
stroke?: string | undefined;
|
|
166
|
+
strokeOpacity?: number | undefined;
|
|
167
|
+
strokeWidth?: number | undefined;
|
|
168
|
+
strokeLinejoin?: string | undefined;
|
|
169
|
+
}): void;
|
|
170
|
+
|
|
171
|
+
type Envelope = {
|
|
172
|
+
amount: number;
|
|
173
|
+
ADSR: [number, number, number, number];
|
|
174
|
+
};
|
|
175
|
+
type LFO = {
|
|
176
|
+
amount: number;
|
|
177
|
+
type: OscillatorType;
|
|
178
|
+
rate: number;
|
|
179
|
+
};
|
|
180
|
+
type OscillatorOptions = {
|
|
181
|
+
type?: OscillatorType;
|
|
182
|
+
envelope?: Envelope | null;
|
|
183
|
+
LFO?: LFO | null;
|
|
184
|
+
};
|
|
185
|
+
type FilterOptions = {
|
|
186
|
+
type?: BiquadFilterType;
|
|
187
|
+
Q?: number;
|
|
188
|
+
cutoff?: number;
|
|
189
|
+
envelope?: Envelope | null;
|
|
190
|
+
LFO?: LFO | null;
|
|
191
|
+
};
|
|
192
|
+
type AmpOptions = {
|
|
193
|
+
envelope?: Envelope | null;
|
|
194
|
+
LFO?: LFO | null;
|
|
195
|
+
};
|
|
196
|
+
type ReverbOptions = {
|
|
197
|
+
time?: number;
|
|
198
|
+
mix?: number;
|
|
199
|
+
};
|
|
200
|
+
type DelayOptions = {
|
|
201
|
+
time?: number;
|
|
202
|
+
feedback?: number;
|
|
203
|
+
mix?: number;
|
|
204
|
+
};
|
|
205
|
+
type SynthProps = {
|
|
206
|
+
oscillator?: OscillatorOptions | null;
|
|
207
|
+
filter?: FilterOptions | null;
|
|
208
|
+
amp?: AmpOptions | null;
|
|
209
|
+
};
|
|
210
|
+
type SynthEffects = {
|
|
211
|
+
bmp?: number | null;
|
|
212
|
+
reverb?: ReverbOptions | null;
|
|
213
|
+
delay?: DelayOptions | null;
|
|
214
|
+
};
|
|
215
|
+
declare function synthesizer(props?: SynthProps, effects?: SynthEffects): Synthesizer;
|
|
216
|
+
declare class Synthesizer {
|
|
217
|
+
oscillator: OscillatorOptions;
|
|
218
|
+
filter: FilterOptions;
|
|
219
|
+
amp: AmpOptions;
|
|
220
|
+
bmp: number;
|
|
221
|
+
reverb: ReverbOptions;
|
|
222
|
+
delay: DelayOptions;
|
|
223
|
+
options: {
|
|
224
|
+
bmp: number;
|
|
225
|
+
};
|
|
226
|
+
static initialize(): void;
|
|
227
|
+
constructor({ oscillator, filter, amp }?: SynthProps, { bmp, reverb, delay }?: SynthEffects);
|
|
228
|
+
static keymap: {
|
|
229
|
+
[key: string]: number;
|
|
230
|
+
};
|
|
231
|
+
static notemap: {
|
|
232
|
+
[key: string]: number;
|
|
233
|
+
};
|
|
234
|
+
press(frequency: number | string, duration?: number | string | null, wait?: number): {
|
|
235
|
+
release: () => void;
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
declare const basics: {
|
|
240
|
+
Screen: typeof Screen;
|
|
241
|
+
UserEvent: typeof UserEvent;
|
|
242
|
+
ResizeEvent: typeof ResizeEvent;
|
|
243
|
+
ModalFrame: typeof ModalFrame;
|
|
244
|
+
ModalContent: typeof ModalContent;
|
|
245
|
+
AccordionFrame: typeof AccordionFrame;
|
|
246
|
+
AccordionButton: typeof AccordionButton;
|
|
247
|
+
AccordionBullet: typeof AccordionBullet;
|
|
248
|
+
AccordionContent: typeof AccordionContent;
|
|
249
|
+
TabFrame: typeof TabFrame;
|
|
250
|
+
TabButton: typeof TabButton;
|
|
251
|
+
TabContent: typeof TabContent;
|
|
252
|
+
PanelFrame: typeof PanelFrame;
|
|
253
|
+
PanelGroup: typeof PanelGroup;
|
|
254
|
+
InputFrame: typeof InputFrame;
|
|
255
|
+
DragFrame: typeof DragFrame;
|
|
256
|
+
DragTarget: typeof DragTarget;
|
|
257
|
+
VirtualStick: typeof VirtualStick;
|
|
258
|
+
VirtualDPad: typeof VirtualDPad;
|
|
259
|
+
VirtualButton: typeof VirtualButton;
|
|
260
|
+
};
|
|
261
|
+
declare const audio: {
|
|
262
|
+
synthesizer: typeof synthesizer;
|
|
263
|
+
};
|
|
264
|
+
interface xnewtype extends xnewtype$1 {
|
|
265
|
+
basics: typeof basics;
|
|
266
|
+
audio: typeof audio;
|
|
267
|
+
}
|
|
268
|
+
declare namespace xnew {
|
|
269
|
+
type Unit = InstanceType<typeof Unit>;
|
|
270
|
+
}
|
|
271
|
+
declare const xnew: xnewtype;
|
|
272
|
+
|
|
273
|
+
export { xnew as default };
|