@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
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
type Envelope = {
|
|
2
|
+
amount: number;
|
|
3
|
+
ADSR: [number, number, number, number];
|
|
4
|
+
};
|
|
5
|
+
type LFO = {
|
|
6
|
+
amount: number;
|
|
7
|
+
type: OscillatorType;
|
|
8
|
+
rate: number;
|
|
9
|
+
};
|
|
10
|
+
type OscillatorOptions = {
|
|
11
|
+
type?: OscillatorType;
|
|
12
|
+
envelope?: Envelope | null;
|
|
13
|
+
LFO?: LFO | null;
|
|
14
|
+
};
|
|
15
|
+
type FilterOptions = {
|
|
16
|
+
type?: BiquadFilterType;
|
|
17
|
+
Q?: number;
|
|
18
|
+
cutoff?: number;
|
|
19
|
+
envelope?: Envelope | null;
|
|
20
|
+
LFO?: LFO | null;
|
|
21
|
+
};
|
|
22
|
+
type AmpOptions = {
|
|
23
|
+
envelope?: Envelope | null;
|
|
24
|
+
LFO?: LFO | null;
|
|
25
|
+
};
|
|
26
|
+
type ReverbOptions = {
|
|
27
|
+
time?: number;
|
|
28
|
+
mix?: number;
|
|
29
|
+
};
|
|
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
|
+
export declare function synthesizer(props?: SynthProps, effects?: SynthEffects): Synthesizer;
|
|
46
|
+
declare class Synthesizer {
|
|
47
|
+
oscillator: OscillatorOptions;
|
|
48
|
+
filter: FilterOptions;
|
|
49
|
+
amp: AmpOptions;
|
|
50
|
+
bmp: number;
|
|
51
|
+
reverb: ReverbOptions;
|
|
52
|
+
delay: DelayOptions;
|
|
53
|
+
options: {
|
|
54
|
+
bmp: number;
|
|
55
|
+
};
|
|
56
|
+
static initialize(): void;
|
|
57
|
+
constructor({ oscillator, filter, amp }?: SynthProps, { bmp, reverb, delay }?: SynthEffects);
|
|
58
|
+
static keymap: {
|
|
59
|
+
[key: string]: number;
|
|
60
|
+
};
|
|
61
|
+
static notemap: {
|
|
62
|
+
[key: string]: number;
|
|
63
|
+
};
|
|
64
|
+
press(frequency: number | string, duration?: number | string | null, wait?: number): {
|
|
65
|
+
release: () => void;
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { xnew } from '../core/xnew';
|
|
2
|
+
export declare function AccordionFrame(frame: xnew.Unit, {}?: {}): {
|
|
3
|
+
toggle(): void;
|
|
4
|
+
open(): void;
|
|
5
|
+
close(): void;
|
|
6
|
+
};
|
|
7
|
+
export declare function AccordionButton(button: xnew.Unit, {}?: {}): void;
|
|
8
|
+
export declare function AccordionBullet(bullet: xnew.Unit, { type }?: {
|
|
9
|
+
type?: string;
|
|
10
|
+
}): {
|
|
11
|
+
transition(status: number): void;
|
|
12
|
+
} | undefined;
|
|
13
|
+
export declare function AccordionContent(content: xnew.Unit, { open, duration, easing }?: {
|
|
14
|
+
open?: boolean;
|
|
15
|
+
duration?: number;
|
|
16
|
+
easing?: string;
|
|
17
|
+
}): {
|
|
18
|
+
readonly status: number;
|
|
19
|
+
transition(status: number): void;
|
|
20
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { xnew } from '../core/xnew';
|
|
2
|
+
export declare function Modal(self: xnew.Unit, { duration, easing }?: {
|
|
3
|
+
duration?: number | undefined;
|
|
4
|
+
easing?: string | undefined;
|
|
5
|
+
}): {
|
|
6
|
+
open(): void;
|
|
7
|
+
close(): void;
|
|
8
|
+
};
|
|
9
|
+
export declare function Accordion(self: xnew.Unit, { open, duration, easing }?: {
|
|
10
|
+
open?: boolean | undefined;
|
|
11
|
+
duration?: number | undefined;
|
|
12
|
+
easing?: string | undefined;
|
|
13
|
+
}): {
|
|
14
|
+
open(): void;
|
|
15
|
+
close(): void;
|
|
16
|
+
toggle(): void;
|
|
17
|
+
};
|
|
18
|
+
export declare function Tab(self: xnew.Unit, { duration, easing }?: {
|
|
19
|
+
duration?: number | undefined;
|
|
20
|
+
easing?: string | undefined;
|
|
21
|
+
}): {
|
|
22
|
+
assign(name: string, component: Function): void;
|
|
23
|
+
select(name: string): void;
|
|
24
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { xnew } from '../core/xnew';
|
|
2
|
+
export declare function ControlPanel(self: xnew.Unit, {}?: {}): {
|
|
3
|
+
group(name: string): void;
|
|
4
|
+
button(name: string, component: Function, props?: any): void;
|
|
5
|
+
range(name: string, component: Function, props?: any): void;
|
|
6
|
+
select(name: string): void;
|
|
7
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { xnew } from '../core/xnew';
|
|
2
|
+
export declare function VirtualStick(self: xnew.Unit, { size, fill, fillOpacity, stroke, strokeOpacity, strokeWidth, strokeLinejoin }?: {
|
|
3
|
+
size?: number | undefined;
|
|
4
|
+
fill?: string | undefined;
|
|
5
|
+
fillOpacity?: number | undefined;
|
|
6
|
+
stroke?: string | undefined;
|
|
7
|
+
strokeOpacity?: number | undefined;
|
|
8
|
+
strokeWidth?: number | undefined;
|
|
9
|
+
strokeLinejoin?: string | undefined;
|
|
10
|
+
}): void;
|
|
11
|
+
export declare function VirtualDPad(self: xnew.Unit, { size, fill, fillOpacity, stroke, strokeOpacity, strokeWidth, strokeLinejoin }?: {
|
|
12
|
+
size?: number | undefined;
|
|
13
|
+
fill?: string | undefined;
|
|
14
|
+
fillOpacity?: number | undefined;
|
|
15
|
+
stroke?: string | undefined;
|
|
16
|
+
strokeOpacity?: number | undefined;
|
|
17
|
+
strokeWidth?: number | undefined;
|
|
18
|
+
strokeLinejoin?: string | undefined;
|
|
19
|
+
}): void;
|
|
20
|
+
export declare function VirtualButton(self: xnew.Unit, { size, fill, fillOpacity, stroke, strokeOpacity, strokeWidth, strokeLinejoin }?: {
|
|
21
|
+
size?: number | undefined;
|
|
22
|
+
fill?: string | undefined;
|
|
23
|
+
fillOpacity?: number | undefined;
|
|
24
|
+
stroke?: string | undefined;
|
|
25
|
+
strokeOpacity?: number | undefined;
|
|
26
|
+
strokeWidth?: number | undefined;
|
|
27
|
+
strokeLinejoin?: string | undefined;
|
|
28
|
+
}): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function File(data: string, filename: string, mimeType?: string): void;
|
|
@@ -0,0 +1,11 @@
|
|
|
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 }?: {
|
|
6
|
+
duration?: number;
|
|
7
|
+
easing?: string;
|
|
8
|
+
background?: string;
|
|
9
|
+
}): {
|
|
10
|
+
transition(status: number): void;
|
|
11
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function ResizeEvent(self: any): void;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { xnew } from '../core/xnew';
|
|
2
|
+
export declare function Screen(screen: xnew.Unit, { width, height, fit }?: {
|
|
3
|
+
width?: number | undefined;
|
|
4
|
+
height?: number | undefined;
|
|
5
|
+
fit?: string | undefined;
|
|
6
|
+
}): {
|
|
7
|
+
readonly canvas: any;
|
|
8
|
+
resize(width: number, height: number): void;
|
|
9
|
+
readonly scale: {
|
|
10
|
+
x: number;
|
|
11
|
+
y: number;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { xnew } from '../core/xnew';
|
|
2
|
+
export declare function TabFrame(frame: xnew.Unit, { select }?: {
|
|
3
|
+
select?: number | undefined;
|
|
4
|
+
}): void;
|
|
5
|
+
export declare function TabButton(button: xnew.Unit, {}?: {}): {
|
|
6
|
+
select(): void;
|
|
7
|
+
deselect(): void;
|
|
8
|
+
};
|
|
9
|
+
export declare function TabContent(self: xnew.Unit, {}?: {}): {
|
|
10
|
+
select(): void;
|
|
11
|
+
deselect(): void;
|
|
12
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { xnew } from '../core/xnew';
|
|
2
|
+
export declare function TabFrame(frame: xnew.Unit, { select, duration, easing }?: {
|
|
3
|
+
select?: number | undefined;
|
|
4
|
+
duration?: number | undefined;
|
|
5
|
+
easing?: string | undefined;
|
|
6
|
+
}): {
|
|
7
|
+
tabs: import("../core/unit").Unit[];
|
|
8
|
+
contents: import("../core/unit").Unit[];
|
|
9
|
+
select(index: number): void;
|
|
10
|
+
};
|
|
11
|
+
export declare function TabButton(self: xnew.Unit): {
|
|
12
|
+
select(): void;
|
|
13
|
+
deselect(): void;
|
|
14
|
+
};
|
|
15
|
+
export declare function TabContent(self: xnew.Unit): {
|
|
16
|
+
select(): void;
|
|
17
|
+
deselect(): void;
|
|
18
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { xnew } from '../core/xnew';
|
|
2
|
+
export declare function Tabs(self: xnew.Unit, { duration, easing }?: {
|
|
3
|
+
duration?: number | undefined;
|
|
4
|
+
easing?: string | undefined;
|
|
5
|
+
}): {
|
|
6
|
+
content(name: string, component: Function, props?: any): void;
|
|
7
|
+
select(name: string): void;
|
|
8
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { xnew } from '../core/xnew';
|
|
2
|
+
export declare function Modal(self: xnew.Unit, { duration, easing }?: {
|
|
3
|
+
duration?: number | undefined;
|
|
4
|
+
easing?: string | undefined;
|
|
5
|
+
}): {
|
|
6
|
+
open(): void;
|
|
7
|
+
close(): void;
|
|
8
|
+
};
|
|
9
|
+
export declare function Accordion(self: xnew.Unit, { open, duration, easing }: {
|
|
10
|
+
open?: boolean | undefined;
|
|
11
|
+
duration?: number | undefined;
|
|
12
|
+
easing?: string | undefined;
|
|
13
|
+
}): {
|
|
14
|
+
open(): void;
|
|
15
|
+
close(): void;
|
|
16
|
+
toggle(): void;
|
|
17
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { xnew } from '../core/xnew';
|
|
2
|
+
interface Position {
|
|
3
|
+
x: number | null | undefined;
|
|
4
|
+
y: number | null | undefined;
|
|
5
|
+
}
|
|
6
|
+
interface Transform {
|
|
7
|
+
position: Position | null | undefined;
|
|
8
|
+
rotation: number | null | undefined;
|
|
9
|
+
scale: number | null | undefined;
|
|
10
|
+
}
|
|
11
|
+
export declare function WorkSpace(self: xnew.Unit, attributes?: any): {
|
|
12
|
+
readonly transform: Transform;
|
|
13
|
+
move(transform: Transform): void;
|
|
14
|
+
update(): void;
|
|
15
|
+
};
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
declare class MapEx<Key, Value> {
|
|
2
|
+
protected map: Map<Key, Value>;
|
|
3
|
+
get size(): number;
|
|
4
|
+
forEach(callback: (value: Value, key: Key, map: Map<Key, Value>) => any): void;
|
|
5
|
+
clear(): void;
|
|
6
|
+
}
|
|
7
|
+
export declare class MapSet<Key, Value> extends MapEx<Key, Set<Value>> {
|
|
8
|
+
has(key: Key, value?: Value): boolean;
|
|
9
|
+
get(key: Key): Set<Value> | undefined;
|
|
10
|
+
keys(): IterableIterator<Key>;
|
|
11
|
+
add(key: Key, value: Value): MapSet<Key, Value>;
|
|
12
|
+
delete(key: Key, value?: Value): boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare class MapMap<Key1, Key2, Value> extends MapEx<Key1, Map<Key2, Value>> {
|
|
15
|
+
has(key1: Key1, key2?: Key2): boolean;
|
|
16
|
+
set(key1: Key1, key2: Key2, value: Value): MapMap<Key1, Key2, Value>;
|
|
17
|
+
get(key1: Key1): Map<Key2, Value> | undefined;
|
|
18
|
+
get(key1: Key1, key2: Key2): Value | undefined;
|
|
19
|
+
keys(): IterableIterator<Key1>;
|
|
20
|
+
keys(key1: Key1): IterableIterator<Key2>;
|
|
21
|
+
delete(key1: Key1, key2?: Key2): boolean;
|
|
22
|
+
}
|
|
23
|
+
export declare class MapMapMap<Key1, Key2, Key3, Value> extends MapEx<Key1, MapMap<Key2, Key3, Value>> {
|
|
24
|
+
has(key1: Key1, key2?: Key2, key3?: Key3): boolean;
|
|
25
|
+
set(key1: Key1, key2: Key2, key3: Key3, value: Value): MapMapMap<Key1, Key2, Key3, Value>;
|
|
26
|
+
get(key1: Key1): MapMap<Key2, Key3, Value> | undefined;
|
|
27
|
+
get(key1: Key1, key2: Key2): Map<Key3, Value> | undefined;
|
|
28
|
+
get(key1: Key1, key2: Key2, key3: Key3): Value | undefined;
|
|
29
|
+
keys(): IterableIterator<Key1>;
|
|
30
|
+
keys(key1: Key1): IterableIterator<Key2>;
|
|
31
|
+
keys(key1: Key1, key2: Key2): IterableIterator<Key3>;
|
|
32
|
+
delete(key1: Key1, key2?: Key2, key3?: Key3): boolean;
|
|
33
|
+
}
|
|
34
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export declare class Ticker {
|
|
2
|
+
static animation: number | null;
|
|
3
|
+
static callbacks: Set<Function>;
|
|
4
|
+
static previous: number;
|
|
5
|
+
static ticker(): void;
|
|
6
|
+
static set(callback: (time: number) => void): void;
|
|
7
|
+
static clear(callback: (time: number) => void): void;
|
|
8
|
+
}
|
|
9
|
+
export declare class Timer {
|
|
10
|
+
private timeout;
|
|
11
|
+
private transition;
|
|
12
|
+
private delay;
|
|
13
|
+
private loop;
|
|
14
|
+
private id;
|
|
15
|
+
private time;
|
|
16
|
+
private offset;
|
|
17
|
+
private status;
|
|
18
|
+
private visibilitychange?;
|
|
19
|
+
private ticker;
|
|
20
|
+
constructor(timeout: Function, transition: Function | null, delay: number, loop?: boolean);
|
|
21
|
+
clear(): void;
|
|
22
|
+
elapsed(): number;
|
|
23
|
+
start(): void;
|
|
24
|
+
stop(): void;
|
|
25
|
+
private _start;
|
|
26
|
+
private _stop;
|
|
27
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { MapSet, MapMapMap } from './map';
|
|
2
|
+
declare const LIFECYCLE_EVENTS: readonly ["start", "update", "stop", "finalize"];
|
|
3
|
+
type LifecycleEvent = typeof LIFECYCLE_EVENTS[number];
|
|
4
|
+
interface Context {
|
|
5
|
+
stack: Context | null;
|
|
6
|
+
key: string;
|
|
7
|
+
value: any;
|
|
8
|
+
}
|
|
9
|
+
interface Snapshot {
|
|
10
|
+
unit: Unit | null;
|
|
11
|
+
context: Context | null;
|
|
12
|
+
element: HTMLElement | SVGElement | null;
|
|
13
|
+
}
|
|
14
|
+
interface Capture {
|
|
15
|
+
checker: (unit: Unit) => boolean;
|
|
16
|
+
execute: (unit: Unit) => any;
|
|
17
|
+
}
|
|
18
|
+
interface UnitInternal {
|
|
19
|
+
root: Unit;
|
|
20
|
+
parent: Unit | null;
|
|
21
|
+
children: Unit[];
|
|
22
|
+
target: Object | null;
|
|
23
|
+
props?: Object;
|
|
24
|
+
nextNest: {
|
|
25
|
+
element: HTMLElement | SVGElement;
|
|
26
|
+
position: InsertPosition;
|
|
27
|
+
};
|
|
28
|
+
baseElement: HTMLElement | SVGElement;
|
|
29
|
+
currentElement: HTMLElement | SVGElement;
|
|
30
|
+
baseContext: Context | null;
|
|
31
|
+
baseComponent: Function | null;
|
|
32
|
+
components: Function[];
|
|
33
|
+
captures: Capture[];
|
|
34
|
+
state: string;
|
|
35
|
+
tostart: boolean;
|
|
36
|
+
upcount: number;
|
|
37
|
+
resolved: boolean;
|
|
38
|
+
defines: Record<string, any>;
|
|
39
|
+
system: Record<LifecycleEvent, Function[]>;
|
|
40
|
+
}
|
|
41
|
+
export declare class Unit {
|
|
42
|
+
[key: string]: any;
|
|
43
|
+
_: UnitInternal;
|
|
44
|
+
static roots: Unit[];
|
|
45
|
+
constructor(target: Object | null, component?: Function | string, props?: Object);
|
|
46
|
+
get element(): HTMLElement | SVGElement;
|
|
47
|
+
start(): void;
|
|
48
|
+
stop(): void;
|
|
49
|
+
finalize(): void;
|
|
50
|
+
reboot(): void;
|
|
51
|
+
get components(): Function[];
|
|
52
|
+
on(type: string, listener: Function, options?: boolean | AddEventListenerOptions): Unit;
|
|
53
|
+
off(type?: string, listener?: Function): Unit;
|
|
54
|
+
emit(type: string, ...args: any[]): void;
|
|
55
|
+
static initialize(unit: Unit): void;
|
|
56
|
+
static finalize(unit: Unit): void;
|
|
57
|
+
static nest(unit: Unit, tag: string): HTMLElement | SVGElement | null;
|
|
58
|
+
static extend(unit: Unit, component: Function, props?: Object): void;
|
|
59
|
+
static start(unit: Unit, time: number): void;
|
|
60
|
+
static stop(unit: Unit): void;
|
|
61
|
+
static update(unit: Unit, time: number): void;
|
|
62
|
+
static ticker(time: number): void;
|
|
63
|
+
static reset(): void;
|
|
64
|
+
}
|
|
65
|
+
export declare class UnitScope {
|
|
66
|
+
static current: Unit | null;
|
|
67
|
+
static contexts: Map<Unit | null, Context>;
|
|
68
|
+
static initialize(unit: Unit | null, context: Context | null): void;
|
|
69
|
+
static finalize(unit: Unit): void;
|
|
70
|
+
static set(unit: Unit, context: Context): void;
|
|
71
|
+
static get(unit: Unit | null): Context | null;
|
|
72
|
+
static execute(snapshot: Snapshot | null, func: Function, ...args: any[]): any;
|
|
73
|
+
static snapshot(unit?: Unit | null): Snapshot | null;
|
|
74
|
+
static stack(unit: Unit, key: string, value: any): void;
|
|
75
|
+
static trace(unit: Unit, key: string): any;
|
|
76
|
+
}
|
|
77
|
+
export declare class UnitComponent {
|
|
78
|
+
static components: MapSet<Unit, Function>;
|
|
79
|
+
static units: MapSet<Function, Unit>;
|
|
80
|
+
static finalize(unit: Unit): void;
|
|
81
|
+
static add(unit: Unit, component: Function): void;
|
|
82
|
+
static find(component: Function): Unit[];
|
|
83
|
+
}
|
|
84
|
+
export declare class UnitEvent {
|
|
85
|
+
static units: MapSet<string, Unit>;
|
|
86
|
+
static listeners: MapMapMap<Unit, string, Function, [HTMLElement | SVGElement, (...args: any[]) => void]>;
|
|
87
|
+
static on(unit: Unit, type: string, listener: Function, options?: boolean | AddEventListenerOptions): void;
|
|
88
|
+
static off(unit: Unit, type?: string, listener?: Function): void;
|
|
89
|
+
static emit(unit: Unit, type: string, ...args: any[]): void;
|
|
90
|
+
static sublisteners: MapMapMap<Unit | null, string, Function, [HTMLElement | SVGElement | Window | Document, (...args: any[]) => void]>;
|
|
91
|
+
static subon(unit: Unit | null, target: HTMLElement | SVGElement | Window | Document, type: string, listener: Function, options?: boolean | AddEventListenerOptions): void;
|
|
92
|
+
static suboff(unit: Unit | null, target: HTMLElement | SVGElement | Window | Document | null, type?: string, listener?: Function): void;
|
|
93
|
+
}
|
|
94
|
+
export declare class UnitPromise {
|
|
95
|
+
private promise;
|
|
96
|
+
constructor(executor: (resolve: (value: any) => void, reject: (reason?: any) => void) => void);
|
|
97
|
+
then(callback: Function): UnitPromise;
|
|
98
|
+
catch(callback: Function): UnitPromise;
|
|
99
|
+
finally(callback: Function): UnitPromise;
|
|
100
|
+
static promises: MapSet<Unit, UnitPromise>;
|
|
101
|
+
static get(unit: Unit): Promise<any[]>;
|
|
102
|
+
static finalize(unit: Unit): void;
|
|
103
|
+
static execute(unit: Unit, promise?: Promise<any>): UnitPromise;
|
|
104
|
+
}
|
|
105
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function isPlainObject(object: any): boolean;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { ResizeEvent } from './basics/ResizeEvent';
|
|
2
|
+
import { UserEvent } from './basics/UserEvent';
|
|
3
|
+
import { Screen } from './basics/Screen';
|
|
4
|
+
import { InputFrame } from './basics/Input';
|
|
5
|
+
import { ModalFrame, ModalContent } from './basics/Modal';
|
|
6
|
+
import { TabFrame, TabButton, TabContent } from './basics/Tab';
|
|
7
|
+
import { AccordionFrame, AccordionButton, AccordionBullet, AccordionContent } from './basics/Accordion';
|
|
8
|
+
import { PanelFrame, PanelGroup } from './basics/Panel';
|
|
9
|
+
import { DragFrame, DragTarget } from './basics/SubWIndow';
|
|
10
|
+
import { VirtualStick, VirtualDPad, VirtualButton } from './basics/Controller';
|
|
11
|
+
import { Unit } from './core/unit';
|
|
12
|
+
import { xnewtype as basetype } from './core/xnew';
|
|
13
|
+
import { synthesizer } from './audio/synthesizer';
|
|
14
|
+
declare const basics: {
|
|
15
|
+
Screen: typeof Screen;
|
|
16
|
+
UserEvent: typeof UserEvent;
|
|
17
|
+
ResizeEvent: typeof ResizeEvent;
|
|
18
|
+
ModalFrame: typeof ModalFrame;
|
|
19
|
+
ModalContent: typeof ModalContent;
|
|
20
|
+
AccordionFrame: typeof AccordionFrame;
|
|
21
|
+
AccordionButton: typeof AccordionButton;
|
|
22
|
+
AccordionBullet: typeof AccordionBullet;
|
|
23
|
+
AccordionContent: typeof AccordionContent;
|
|
24
|
+
TabFrame: typeof TabFrame;
|
|
25
|
+
TabButton: typeof TabButton;
|
|
26
|
+
TabContent: typeof TabContent;
|
|
27
|
+
PanelFrame: typeof PanelFrame;
|
|
28
|
+
PanelGroup: typeof PanelGroup;
|
|
29
|
+
InputFrame: typeof InputFrame;
|
|
30
|
+
DragFrame: typeof DragFrame;
|
|
31
|
+
DragTarget: typeof DragTarget;
|
|
32
|
+
VirtualStick: typeof VirtualStick;
|
|
33
|
+
VirtualDPad: typeof VirtualDPad;
|
|
34
|
+
VirtualButton: typeof VirtualButton;
|
|
35
|
+
};
|
|
36
|
+
declare const audio: {
|
|
37
|
+
synthesizer: typeof synthesizer;
|
|
38
|
+
};
|
|
39
|
+
interface xnewtype extends basetype {
|
|
40
|
+
basics: typeof basics;
|
|
41
|
+
audio: typeof audio;
|
|
42
|
+
}
|
|
43
|
+
declare namespace xnew {
|
|
44
|
+
type Unit = InstanceType<typeof Unit>;
|
|
45
|
+
}
|
|
46
|
+
declare const xnew: xnewtype;
|
|
47
|
+
export default xnew;
|