@mulsense/xnew 0.2.2 → 0.3.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/README.md +3 -3
- package/dist/addons/xmatter.d.ts +1 -1
- package/dist/addons/xmatter.js +7 -19
- package/dist/addons/xmatter.mjs +7 -19
- package/dist/addons/xpixi.d.ts +0 -3
- package/dist/addons/xpixi.js +3 -8
- package/dist/addons/xpixi.mjs +3 -8
- package/dist/addons/xrapier2d.js +2 -2
- package/dist/addons/xrapier2d.mjs +2 -2
- package/dist/addons/xthree.js +4 -4
- package/dist/addons/xthree.mjs +4 -4
- package/dist/types/basics/Controller.d.ts +6 -17
- package/dist/types/basics/Text.d.ts +6 -0
- package/dist/types/core/unit.d.ts +3 -1
- package/dist/types/core/xnew.d.ts +2 -9
- package/dist/types/index.d.ts +2 -0
- package/dist/xnew.d.ts +18 -18
- package/dist/xnew.js +1862 -837
- package/dist/xnew.mjs +1862 -837
- package/package.json +6 -1
package/README.md
CHANGED
|
@@ -13,7 +13,7 @@ providing a flexible architecture well-suited for applications with dynamic scen
|
|
|
13
13
|
### Via CDN
|
|
14
14
|
Include the following script in your HTML file:
|
|
15
15
|
```html
|
|
16
|
-
<script src="https://unpkg.com/@mulsense/xnew@0.
|
|
16
|
+
<script src="https://unpkg.com/@mulsense/xnew@0.3.x/dist/xnew.js"></script>
|
|
17
17
|
```
|
|
18
18
|
|
|
19
19
|
### Via CDN (ESM)
|
|
@@ -22,7 +22,7 @@ Use the ES module version with an import map:
|
|
|
22
22
|
<script type="importmap">
|
|
23
23
|
{
|
|
24
24
|
"imports": {
|
|
25
|
-
"@mulsense/xnew": "https://unpkg.com/@mulsense/xnew@0.
|
|
25
|
+
"@mulsense/xnew": "https://unpkg.com/@mulsense/xnew@0.3.x/dist/xnew.mjs"
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
</script>
|
|
@@ -37,7 +37,7 @@ import xnew from '@mulsense/xnew';
|
|
|
37
37
|
### Via npm
|
|
38
38
|
Install `xnew` using npm:
|
|
39
39
|
```bash
|
|
40
|
-
npm install @mulsense/xnew@0.
|
|
40
|
+
npm install @mulsense/xnew@0.3.x
|
|
41
41
|
```
|
|
42
42
|
|
|
43
43
|
Then import it in your JavaScript file:
|
package/dist/addons/xmatter.d.ts
CHANGED
package/dist/addons/xmatter.js
CHANGED
|
@@ -8,33 +8,21 @@
|
|
|
8
8
|
initialize({ engine = null } = {}) {
|
|
9
9
|
xnew.extend(Root, { engine });
|
|
10
10
|
},
|
|
11
|
-
nest(object) {
|
|
12
|
-
xnew.extend(Nest, { object });
|
|
13
|
-
return object;
|
|
14
|
-
},
|
|
15
11
|
get engine() {
|
|
16
12
|
var _a;
|
|
17
13
|
return (_a = xnew.context('xmatter.root')) === null || _a === void 0 ? void 0 : _a.engine;
|
|
18
14
|
},
|
|
15
|
+
get world() {
|
|
16
|
+
var _a;
|
|
17
|
+
return (_a = xnew.context('xmatter.root')) === null || _a === void 0 ? void 0 : _a.engine.world;
|
|
18
|
+
},
|
|
19
19
|
};
|
|
20
|
-
function Root(
|
|
20
|
+
function Root(unit, { engine }) {
|
|
21
21
|
const root = {};
|
|
22
22
|
xnew.context('xmatter.root', root);
|
|
23
|
-
root.isActive = true;
|
|
24
23
|
root.engine = engine !== null && engine !== void 0 ? engine : Matter.Engine.create();
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
if (root.isActive) {
|
|
28
|
-
Matter.Engine.update(root.engine);
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
function Nest(self, { object }) {
|
|
33
|
-
const parent = xnew.context('xmatter.object');
|
|
34
|
-
xnew.context('xmatter.object', object);
|
|
35
|
-
Matter.Composite.add(parent, object);
|
|
36
|
-
self.on('-finalize', () => {
|
|
37
|
-
Matter.Composite.remove(parent, object);
|
|
24
|
+
unit.on('update', () => {
|
|
25
|
+
Matter.Engine.update(root.engine);
|
|
38
26
|
});
|
|
39
27
|
}
|
|
40
28
|
|
package/dist/addons/xmatter.mjs
CHANGED
|
@@ -5,33 +5,21 @@ var xmatter = {
|
|
|
5
5
|
initialize({ engine = null } = {}) {
|
|
6
6
|
xnew.extend(Root, { engine });
|
|
7
7
|
},
|
|
8
|
-
nest(object) {
|
|
9
|
-
xnew.extend(Nest, { object });
|
|
10
|
-
return object;
|
|
11
|
-
},
|
|
12
8
|
get engine() {
|
|
13
9
|
var _a;
|
|
14
10
|
return (_a = xnew.context('xmatter.root')) === null || _a === void 0 ? void 0 : _a.engine;
|
|
15
11
|
},
|
|
12
|
+
get world() {
|
|
13
|
+
var _a;
|
|
14
|
+
return (_a = xnew.context('xmatter.root')) === null || _a === void 0 ? void 0 : _a.engine.world;
|
|
15
|
+
},
|
|
16
16
|
};
|
|
17
|
-
function Root(
|
|
17
|
+
function Root(unit, { engine }) {
|
|
18
18
|
const root = {};
|
|
19
19
|
xnew.context('xmatter.root', root);
|
|
20
|
-
root.isActive = true;
|
|
21
20
|
root.engine = engine !== null && engine !== void 0 ? engine : Matter.Engine.create();
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
if (root.isActive) {
|
|
25
|
-
Matter.Engine.update(root.engine);
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
function Nest(self, { object }) {
|
|
30
|
-
const parent = xnew.context('xmatter.object');
|
|
31
|
-
xnew.context('xmatter.object', object);
|
|
32
|
-
Matter.Composite.add(parent, object);
|
|
33
|
-
self.on('-finalize', () => {
|
|
34
|
-
Matter.Composite.remove(parent, object);
|
|
21
|
+
unit.on('update', () => {
|
|
22
|
+
Matter.Engine.update(root.engine);
|
|
35
23
|
});
|
|
36
24
|
}
|
|
37
25
|
|
package/dist/addons/xpixi.d.ts
CHANGED
package/dist/addons/xpixi.js
CHANGED
|
@@ -50,11 +50,6 @@
|
|
|
50
50
|
var _a;
|
|
51
51
|
return (_a = xnew.context('xpixi.root')) === null || _a === void 0 ? void 0 : _a.canvas;
|
|
52
52
|
},
|
|
53
|
-
capture({ rect } = {}) {
|
|
54
|
-
const root = xnew.context('xpixi.root');
|
|
55
|
-
const frame = rect ? new PIXI__namespace.Rectangle(rect[0], rect[1], rect[2], rect[3]) : new PIXI__namespace.Rectangle(0, 0, root.canvas.width, root.canvas.height);
|
|
56
|
-
return root.renderer.extract.base64({ target: root.scene, frame });
|
|
57
|
-
}
|
|
58
53
|
};
|
|
59
54
|
function Root(self, { canvas }) {
|
|
60
55
|
const root = {};
|
|
@@ -74,7 +69,7 @@
|
|
|
74
69
|
root.updates = [];
|
|
75
70
|
root.scene = new PIXI__namespace.Container();
|
|
76
71
|
xnew.context('xpixi.object', root.scene);
|
|
77
|
-
self.on('
|
|
72
|
+
self.on('update', () => {
|
|
78
73
|
root.updates.forEach((update) => {
|
|
79
74
|
update();
|
|
80
75
|
});
|
|
@@ -87,14 +82,14 @@
|
|
|
87
82
|
const parent = xnew.context('xpixi.object');
|
|
88
83
|
xnew.context('xpixi.object', object);
|
|
89
84
|
parent.addChild(object);
|
|
90
|
-
self.on('
|
|
85
|
+
self.on('finalize', () => {
|
|
91
86
|
parent.removeChild(object);
|
|
92
87
|
});
|
|
93
88
|
}
|
|
94
89
|
function PreUpdate(self, callback) {
|
|
95
90
|
const root = xnew.context('xpixi.root');
|
|
96
91
|
root.updates.push(callback);
|
|
97
|
-
self.on('
|
|
92
|
+
self.on('finalize', () => {
|
|
98
93
|
root.updates = root.updates.filter((update) => update !== callback);
|
|
99
94
|
});
|
|
100
95
|
}
|
package/dist/addons/xpixi.mjs
CHANGED
|
@@ -28,11 +28,6 @@ var xpixi = {
|
|
|
28
28
|
var _a;
|
|
29
29
|
return (_a = xnew.context('xpixi.root')) === null || _a === void 0 ? void 0 : _a.canvas;
|
|
30
30
|
},
|
|
31
|
-
capture({ rect } = {}) {
|
|
32
|
-
const root = xnew.context('xpixi.root');
|
|
33
|
-
const frame = rect ? new PIXI.Rectangle(rect[0], rect[1], rect[2], rect[3]) : new PIXI.Rectangle(0, 0, root.canvas.width, root.canvas.height);
|
|
34
|
-
return root.renderer.extract.base64({ target: root.scene, frame });
|
|
35
|
-
}
|
|
36
31
|
};
|
|
37
32
|
function Root(self, { canvas }) {
|
|
38
33
|
const root = {};
|
|
@@ -52,7 +47,7 @@ function Root(self, { canvas }) {
|
|
|
52
47
|
root.updates = [];
|
|
53
48
|
root.scene = new PIXI.Container();
|
|
54
49
|
xnew.context('xpixi.object', root.scene);
|
|
55
|
-
self.on('
|
|
50
|
+
self.on('update', () => {
|
|
56
51
|
root.updates.forEach((update) => {
|
|
57
52
|
update();
|
|
58
53
|
});
|
|
@@ -65,14 +60,14 @@ function Nest(self, { object }) {
|
|
|
65
60
|
const parent = xnew.context('xpixi.object');
|
|
66
61
|
xnew.context('xpixi.object', object);
|
|
67
62
|
parent.addChild(object);
|
|
68
|
-
self.on('
|
|
63
|
+
self.on('finalize', () => {
|
|
69
64
|
parent.removeChild(object);
|
|
70
65
|
});
|
|
71
66
|
}
|
|
72
67
|
function PreUpdate(self, callback) {
|
|
73
68
|
const root = xnew.context('xpixi.root');
|
|
74
69
|
root.updates.push(callback);
|
|
75
|
-
self.on('
|
|
70
|
+
self.on('finalize', () => {
|
|
76
71
|
root.updates = root.updates.filter((update) => update !== callback);
|
|
77
72
|
});
|
|
78
73
|
}
|
package/dist/addons/xrapier2d.js
CHANGED
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
}
|
|
28
28
|
// xnew.extend(Nest, root.world);
|
|
29
29
|
});
|
|
30
|
-
self.on('
|
|
30
|
+
self.on('update', () => {
|
|
31
31
|
if (root.world) {
|
|
32
32
|
root.world.step();
|
|
33
33
|
}
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
console.log(temp, type, object);
|
|
41
41
|
// Rapier2D objects (RigidBody, Collider, etc.) are already added to the world
|
|
42
42
|
// when created, so we only need to handle removal on finalize
|
|
43
|
-
self.on('
|
|
43
|
+
self.on('finalize', () => {
|
|
44
44
|
try {
|
|
45
45
|
// Check if object is a RigidBody
|
|
46
46
|
if (type === 'rigidBody') {
|
|
@@ -24,7 +24,7 @@ function Root(self, { gravity, timestep }) {
|
|
|
24
24
|
}
|
|
25
25
|
// xnew.extend(Nest, root.world);
|
|
26
26
|
});
|
|
27
|
-
self.on('
|
|
27
|
+
self.on('update', () => {
|
|
28
28
|
if (root.world) {
|
|
29
29
|
root.world.step();
|
|
30
30
|
}
|
|
@@ -37,7 +37,7 @@ function Connect(self, { type, object }) {
|
|
|
37
37
|
console.log(temp, type, object);
|
|
38
38
|
// Rapier2D objects (RigidBody, Collider, etc.) are already added to the world
|
|
39
39
|
// when created, so we only need to handle removal on finalize
|
|
40
|
-
self.on('
|
|
40
|
+
self.on('finalize', () => {
|
|
41
41
|
try {
|
|
42
42
|
// Check if object is a RigidBody
|
|
43
43
|
if (type === 'rigidBody') {
|
package/dist/addons/xthree.js
CHANGED
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
return (_a = xnew.context('xthree.root')) === null || _a === void 0 ? void 0 : _a.canvas;
|
|
49
49
|
}
|
|
50
50
|
};
|
|
51
|
-
function Root(
|
|
51
|
+
function Root(unit, { canvas, camera }) {
|
|
52
52
|
const root = {};
|
|
53
53
|
xnew.context('xthree.root', root);
|
|
54
54
|
root.canvas = canvas;
|
|
@@ -57,16 +57,16 @@
|
|
|
57
57
|
root.camera = camera !== null && camera !== void 0 ? camera : new THREE__namespace.PerspectiveCamera(45, root.renderer.domElement.width / root.renderer.domElement.height);
|
|
58
58
|
root.scene = new THREE__namespace.Scene();
|
|
59
59
|
xnew.context('xthree.object', root.scene);
|
|
60
|
-
|
|
60
|
+
unit.on('update', () => {
|
|
61
61
|
root.renderer.render(root.scene, root.camera);
|
|
62
62
|
});
|
|
63
63
|
}
|
|
64
|
-
function Nest(
|
|
64
|
+
function Nest(unit, { object }) {
|
|
65
65
|
const parent = xnew.context('xthree.object');
|
|
66
66
|
xnew.context('xthree.object', object);
|
|
67
67
|
if (parent) {
|
|
68
68
|
parent === null || parent === void 0 ? void 0 : parent.add(object);
|
|
69
|
-
|
|
69
|
+
unit.on('finalize', () => {
|
|
70
70
|
parent === null || parent === void 0 ? void 0 : parent.remove(object);
|
|
71
71
|
});
|
|
72
72
|
}
|
package/dist/addons/xthree.mjs
CHANGED
|
@@ -26,7 +26,7 @@ var xthree = {
|
|
|
26
26
|
return (_a = xnew.context('xthree.root')) === null || _a === void 0 ? void 0 : _a.canvas;
|
|
27
27
|
}
|
|
28
28
|
};
|
|
29
|
-
function Root(
|
|
29
|
+
function Root(unit, { canvas, camera }) {
|
|
30
30
|
const root = {};
|
|
31
31
|
xnew.context('xthree.root', root);
|
|
32
32
|
root.canvas = canvas;
|
|
@@ -35,16 +35,16 @@ function Root(self, { canvas, camera }) {
|
|
|
35
35
|
root.camera = camera !== null && camera !== void 0 ? camera : new THREE.PerspectiveCamera(45, root.renderer.domElement.width / root.renderer.domElement.height);
|
|
36
36
|
root.scene = new THREE.Scene();
|
|
37
37
|
xnew.context('xthree.object', root.scene);
|
|
38
|
-
|
|
38
|
+
unit.on('update', () => {
|
|
39
39
|
root.renderer.render(root.scene, root.camera);
|
|
40
40
|
});
|
|
41
41
|
}
|
|
42
|
-
function Nest(
|
|
42
|
+
function Nest(unit, { object }) {
|
|
43
43
|
const parent = xnew.context('xthree.object');
|
|
44
44
|
xnew.context('xthree.object', object);
|
|
45
45
|
if (parent) {
|
|
46
46
|
parent === null || parent === void 0 ? void 0 : parent.add(object);
|
|
47
|
-
|
|
47
|
+
unit.on('finalize', () => {
|
|
48
48
|
parent === null || parent === void 0 ? void 0 : parent.remove(object);
|
|
49
49
|
});
|
|
50
50
|
}
|
|
@@ -1,30 +1,19 @@
|
|
|
1
1
|
import { Unit } from '../core/unit';
|
|
2
|
-
export declare function AnalogStick(
|
|
3
|
-
size?: number;
|
|
4
|
-
diagonal?: boolean;
|
|
5
|
-
fill?: string;
|
|
6
|
-
fillOpacity?: number;
|
|
2
|
+
export declare function AnalogStick(unit: Unit, { stroke, strokeOpacity, strokeWidth, strokeLinejoin, fill, fillOpacity }?: {
|
|
7
3
|
stroke?: string;
|
|
8
4
|
strokeOpacity?: number;
|
|
9
5
|
strokeWidth?: number;
|
|
10
6
|
strokeLinejoin?: string;
|
|
11
|
-
}): void;
|
|
12
|
-
export declare function DirectionalPad(self: Unit, { size, diagonal, fill, fillOpacity, stroke, strokeOpacity, strokeWidth, strokeLinejoin }?: {
|
|
13
|
-
size?: number;
|
|
14
7
|
diagonal?: boolean;
|
|
15
8
|
fill?: string;
|
|
16
9
|
fillOpacity?: number;
|
|
10
|
+
}): void;
|
|
11
|
+
export declare function DirectionalPad(unit: Unit, { diagonal, stroke, strokeOpacity, strokeWidth, strokeLinejoin, fill, fillOpacity }?: {
|
|
12
|
+
diagonal?: boolean;
|
|
17
13
|
stroke?: string;
|
|
18
14
|
strokeOpacity?: number;
|
|
19
15
|
strokeWidth?: number;
|
|
20
16
|
strokeLinejoin?: string;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
size?: number | undefined;
|
|
24
|
-
fill?: string | undefined;
|
|
25
|
-
fillOpacity?: number | undefined;
|
|
26
|
-
stroke?: string | undefined;
|
|
27
|
-
strokeOpacity?: number | undefined;
|
|
28
|
-
strokeWidth?: number | undefined;
|
|
29
|
-
strokeLinejoin?: string | undefined;
|
|
17
|
+
fill?: string;
|
|
18
|
+
fillOpacity?: number;
|
|
30
19
|
}): void;
|
|
@@ -23,6 +23,8 @@ interface UnitInternal {
|
|
|
23
23
|
anchor: UnitElement | null;
|
|
24
24
|
state: string;
|
|
25
25
|
tostart: boolean;
|
|
26
|
+
protected: boolean;
|
|
27
|
+
ancestors: Unit[];
|
|
26
28
|
children: Unit[];
|
|
27
29
|
promises: Promise<any>[];
|
|
28
30
|
elements: UnitElement[];
|
|
@@ -66,7 +68,7 @@ export declare class Unit {
|
|
|
66
68
|
static type2units: MapSet<string, Unit>;
|
|
67
69
|
on(type: string, listener: Function, options?: boolean | AddEventListenerOptions): void;
|
|
68
70
|
off(type?: string, listener?: Function): void;
|
|
69
|
-
emit(type: string, ...args: any[]): void;
|
|
71
|
+
static emit(type: string, ...args: any[]): void;
|
|
70
72
|
}
|
|
71
73
|
export declare class UnitPromise {
|
|
72
74
|
private promise;
|
|
@@ -90,15 +90,6 @@ export declare const xnew: CreateUnit & {
|
|
|
90
90
|
* xnew.finally(() => console.log('All promises settled'))
|
|
91
91
|
*/
|
|
92
92
|
finally(callback: Function): UnitPromise;
|
|
93
|
-
/**
|
|
94
|
-
* Fetches a resource and registers the promise with the current component
|
|
95
|
-
* @param url - URL to fetch
|
|
96
|
-
* @param options - Optional fetch options (method, headers, body, etc.)
|
|
97
|
-
* @returns UnitPromise wrapping the fetch promise
|
|
98
|
-
* @example
|
|
99
|
-
* xnew.fetch('/api/users').then(res => res.json()).then(data => console.log(data))
|
|
100
|
-
*/
|
|
101
|
-
fetch(url: string, options?: object): UnitPromise;
|
|
102
93
|
/**
|
|
103
94
|
* Creates a scoped callback that captures the current component context
|
|
104
95
|
* @param callback - Function to wrap with current scope
|
|
@@ -119,6 +110,7 @@ export declare const xnew: CreateUnit & {
|
|
|
119
110
|
* buttons.forEach(btn => btn.finalize())
|
|
120
111
|
*/
|
|
121
112
|
find(component: Function): Unit[];
|
|
113
|
+
emit(type: string, ...args: any[]): void;
|
|
122
114
|
/**
|
|
123
115
|
* Executes a callback once after a delay, managed by component lifecycle
|
|
124
116
|
* @param timeout - Function to execute after Duration
|
|
@@ -153,5 +145,6 @@ export declare const xnew: CreateUnit & {
|
|
|
153
145
|
* }, 300)
|
|
154
146
|
*/
|
|
155
147
|
transition(transition: Function, duration?: number, easing?: string): any;
|
|
148
|
+
protect(): void;
|
|
156
149
|
};
|
|
157
150
|
export {};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ import { ModalFrame, ModalContent } from './basics/Modal';
|
|
|
7
7
|
import { TabFrame, TabButton, TabContent } from './basics/Tab';
|
|
8
8
|
import { DragFrame, DragTarget } from './basics/Drag';
|
|
9
9
|
import { AnalogStick, DirectionalPad } from './basics/Controller';
|
|
10
|
+
import { TextStream } from './basics/Text';
|
|
10
11
|
import { VolumeController } from './basics/Audio';
|
|
11
12
|
import { icons } from './icons/icons';
|
|
12
13
|
declare const basics: {
|
|
@@ -23,6 +24,7 @@ declare const basics: {
|
|
|
23
24
|
TabFrame: typeof TabFrame;
|
|
24
25
|
TabButton: typeof TabButton;
|
|
25
26
|
TabContent: typeof TabContent;
|
|
27
|
+
TextStream: typeof TextStream;
|
|
26
28
|
DragFrame: typeof DragFrame;
|
|
27
29
|
DragTarget: typeof DragTarget;
|
|
28
30
|
AnalogStick: typeof AnalogStick;
|
package/dist/xnew.d.ts
CHANGED
|
@@ -49,6 +49,8 @@ interface UnitInternal {
|
|
|
49
49
|
anchor: UnitElement | null;
|
|
50
50
|
state: string;
|
|
51
51
|
tostart: boolean;
|
|
52
|
+
protected: boolean;
|
|
53
|
+
ancestors: Unit[];
|
|
52
54
|
children: Unit[];
|
|
53
55
|
promises: Promise<any>[];
|
|
54
56
|
elements: UnitElement[];
|
|
@@ -92,7 +94,7 @@ declare class Unit {
|
|
|
92
94
|
static type2units: MapSet<string, Unit>;
|
|
93
95
|
on(type: string, listener: Function, options?: boolean | AddEventListenerOptions): void;
|
|
94
96
|
off(type?: string, listener?: Function): void;
|
|
95
|
-
emit(type: string, ...args: any[]): void;
|
|
97
|
+
static emit(type: string, ...args: any[]): void;
|
|
96
98
|
}
|
|
97
99
|
declare class UnitPromise {
|
|
98
100
|
private promise;
|
|
@@ -193,15 +195,6 @@ declare const xnew$1: CreateUnit & {
|
|
|
193
195
|
* xnew.finally(() => console.log('All promises settled'))
|
|
194
196
|
*/
|
|
195
197
|
finally(callback: Function): UnitPromise;
|
|
196
|
-
/**
|
|
197
|
-
* Fetches a resource and registers the promise with the current component
|
|
198
|
-
* @param url - URL to fetch
|
|
199
|
-
* @param options - Optional fetch options (method, headers, body, etc.)
|
|
200
|
-
* @returns UnitPromise wrapping the fetch promise
|
|
201
|
-
* @example
|
|
202
|
-
* xnew.fetch('/api/users').then(res => res.json()).then(data => console.log(data))
|
|
203
|
-
*/
|
|
204
|
-
fetch(url: string, options?: object): UnitPromise;
|
|
205
198
|
/**
|
|
206
199
|
* Creates a scoped callback that captures the current component context
|
|
207
200
|
* @param callback - Function to wrap with current scope
|
|
@@ -222,6 +215,7 @@ declare const xnew$1: CreateUnit & {
|
|
|
222
215
|
* buttons.forEach(btn => btn.finalize())
|
|
223
216
|
*/
|
|
224
217
|
find(component: Function): Unit[];
|
|
218
|
+
emit(type: string, ...args: any[]): void;
|
|
225
219
|
/**
|
|
226
220
|
* Executes a callback once after a delay, managed by component lifecycle
|
|
227
221
|
* @param timeout - Function to execute after Duration
|
|
@@ -256,6 +250,7 @@ declare const xnew$1: CreateUnit & {
|
|
|
256
250
|
* }, 300)
|
|
257
251
|
*/
|
|
258
252
|
transition(transition: Function, duration?: number, easing?: string): any;
|
|
253
|
+
protect(): void;
|
|
259
254
|
};
|
|
260
255
|
|
|
261
256
|
declare function AccordionFrame(frame: Unit, { open, duration, easing }?: {
|
|
@@ -336,25 +331,29 @@ declare function DragFrame(frame: Unit, { x, y }?: {
|
|
|
336
331
|
}): void;
|
|
337
332
|
declare function DragTarget(target: Unit, {}?: {}): void;
|
|
338
333
|
|
|
339
|
-
declare function AnalogStick(
|
|
340
|
-
size?: number;
|
|
341
|
-
diagonal?: boolean;
|
|
342
|
-
fill?: string;
|
|
343
|
-
fillOpacity?: number;
|
|
334
|
+
declare function AnalogStick(unit: Unit, { stroke, strokeOpacity, strokeWidth, strokeLinejoin, fill, fillOpacity }?: {
|
|
344
335
|
stroke?: string;
|
|
345
336
|
strokeOpacity?: number;
|
|
346
337
|
strokeWidth?: number;
|
|
347
338
|
strokeLinejoin?: string;
|
|
348
|
-
}): void;
|
|
349
|
-
declare function DirectionalPad(self: Unit, { size, diagonal, fill, fillOpacity, stroke, strokeOpacity, strokeWidth, strokeLinejoin }?: {
|
|
350
|
-
size?: number;
|
|
351
339
|
diagonal?: boolean;
|
|
352
340
|
fill?: string;
|
|
353
341
|
fillOpacity?: number;
|
|
342
|
+
}): void;
|
|
343
|
+
declare function DirectionalPad(unit: Unit, { diagonal, stroke, strokeOpacity, strokeWidth, strokeLinejoin, fill, fillOpacity }?: {
|
|
344
|
+
diagonal?: boolean;
|
|
354
345
|
stroke?: string;
|
|
355
346
|
strokeOpacity?: number;
|
|
356
347
|
strokeWidth?: number;
|
|
357
348
|
strokeLinejoin?: string;
|
|
349
|
+
fill?: string;
|
|
350
|
+
fillOpacity?: number;
|
|
351
|
+
}): void;
|
|
352
|
+
|
|
353
|
+
declare function TextStream(unit: Unit, { text, speed, fade }?: {
|
|
354
|
+
text?: string;
|
|
355
|
+
speed?: number;
|
|
356
|
+
fade?: number;
|
|
358
357
|
}): void;
|
|
359
358
|
|
|
360
359
|
declare function VolumeController(unit: Unit, {}?: {}): void;
|
|
@@ -740,6 +739,7 @@ declare const basics: {
|
|
|
740
739
|
TabFrame: typeof TabFrame;
|
|
741
740
|
TabButton: typeof TabButton;
|
|
742
741
|
TabContent: typeof TabContent;
|
|
742
|
+
TextStream: typeof TextStream;
|
|
743
743
|
DragFrame: typeof DragFrame;
|
|
744
744
|
DragTarget: typeof DragTarget;
|
|
745
745
|
AnalogStick: typeof AnalogStick;
|