@arcanejs/toolkit 0.1.1 → 0.2.1
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/backend/components/base.d.mts +69 -2
- package/dist/backend/components/base.d.ts +69 -2
- package/dist/backend/components/base.mjs +2 -1
- package/dist/backend/components/button.d.mts +5 -4
- package/dist/backend/components/button.d.ts +5 -4
- package/dist/backend/components/button.mjs +3 -2
- package/dist/backend/components/group.d.mts +9 -8
- package/dist/backend/components/group.d.ts +9 -8
- package/dist/backend/components/group.js +4 -7
- package/dist/backend/components/group.mjs +3 -2
- package/dist/backend/components/label.d.mts +5 -3
- package/dist/backend/components/label.d.ts +5 -3
- package/dist/backend/components/label.mjs +3 -2
- package/dist/backend/components/rect.d.mts +4 -3
- package/dist/backend/components/rect.d.ts +4 -3
- package/dist/backend/components/rect.mjs +3 -2
- package/dist/backend/components/slider-button.d.mts +5 -4
- package/dist/backend/components/slider-button.d.ts +5 -4
- package/dist/backend/components/slider-button.mjs +3 -2
- package/dist/backend/components/switch.d.mts +5 -4
- package/dist/backend/components/switch.d.ts +5 -4
- package/dist/backend/components/switch.mjs +3 -2
- package/dist/backend/components/tabs.d.mts +5 -4
- package/dist/backend/components/tabs.d.ts +5 -4
- package/dist/backend/components/tabs.mjs +3 -2
- package/dist/backend/components/text-input.d.mts +5 -4
- package/dist/backend/components/text-input.d.ts +5 -4
- package/dist/backend/components/text-input.mjs +3 -2
- package/dist/backend/components/timeline.d.mts +6 -5
- package/dist/backend/components/timeline.d.ts +6 -5
- package/dist/backend/components/timeline.mjs +3 -2
- package/dist/backend/util/index.d.mts +7 -0
- package/dist/backend/util/index.d.ts +7 -0
- package/dist/backend/util/index.js +43 -0
- package/dist/backend/util/index.mjs +7 -0
- package/dist/{chunk-S5DQIYC2.mjs → chunk-3O4P67DM.mjs} +3 -6
- package/dist/{chunk-37VNFO5S.mjs → chunk-APCR3ITH.mjs} +1 -1
- package/dist/{chunk-P6X5GIDT.mjs → chunk-HNEUZVCX.mjs} +1 -1
- package/dist/{chunk-6LL3X7ZZ.mjs → chunk-IXTM35YM.mjs} +1 -1
- package/dist/{chunk-HVFTRNLQ.mjs → chunk-JW4GXS54.mjs} +1 -1
- package/dist/chunk-RGHJEMWG.mjs +17 -0
- package/dist/{chunk-DBW4OPGN.mjs → chunk-SOC4TF3J.mjs} +1 -1
- package/dist/{chunk-DP3QFYSS.mjs → chunk-TAZH4BBH.mjs} +1 -1
- package/dist/{chunk-3ZBM7Q4A.mjs → chunk-TQ27Y7F4.mjs} +1 -1
- package/dist/chunk-Y6FXYEAI.mjs +10 -0
- package/dist/{chunk-HF77PS7J.mjs → chunk-ZCHM3JJJ.mjs} +0 -8
- package/dist/{chunk-GQZA5K4M.mjs → chunk-ZU5H6SVA.mjs} +1 -1
- package/dist/frontend.js +1345 -398
- package/dist/frontend.js.map +4 -4
- package/dist/index.d.mts +4 -2
- package/dist/index.d.ts +4 -2
- package/dist/index.js +2 -5
- package/dist/index.mjs +14 -24
- package/package.json +11 -3
- package/dist/base-BJAPu0O1.d.mts +0 -234
- package/dist/base-BJAPu0O1.d.ts +0 -234
|
@@ -1,2 +1,69 @@
|
|
|
1
|
-
|
|
2
|
-
import '
|
|
1
|
+
import * as proto from '@arcanejs/protocol';
|
|
2
|
+
import { IDMap } from '../util/index.mjs';
|
|
3
|
+
|
|
4
|
+
interface Component {
|
|
5
|
+
getProtoInfo(idMap: IDMap): proto.Component;
|
|
6
|
+
handleMessage(message: proto.ClientComponentMessage): void;
|
|
7
|
+
routeMessage(idMap: IDMap, message: proto.ClientComponentMessage): void;
|
|
8
|
+
setParent(parent: Parent | null): void;
|
|
9
|
+
}
|
|
10
|
+
declare abstract class Base<Props> implements Component {
|
|
11
|
+
/** @hidden */
|
|
12
|
+
private parent;
|
|
13
|
+
/** @hidden */
|
|
14
|
+
private readonly defaultProps;
|
|
15
|
+
/** @hidden */
|
|
16
|
+
private _props;
|
|
17
|
+
constructor(defaultProps: Props, props?: Partial<Props>);
|
|
18
|
+
get props(): Props;
|
|
19
|
+
set props(props: Partial<Props>);
|
|
20
|
+
setProps: (props: Partial<Props>) => void;
|
|
21
|
+
updateProps: (updates: Partial<Props>) => void;
|
|
22
|
+
/** @hidden */
|
|
23
|
+
setParent(parent: Parent | null): void;
|
|
24
|
+
/** @hidden */
|
|
25
|
+
updateTree(): void;
|
|
26
|
+
/** @hidden */
|
|
27
|
+
abstract getProtoInfo(idMap: IDMap): proto.Component;
|
|
28
|
+
/** @hidden */
|
|
29
|
+
handleMessage(message: proto.ClientComponentMessage): void;
|
|
30
|
+
routeMessage(_idMap: IDMap, _message: proto.ClientComponentMessage): void;
|
|
31
|
+
}
|
|
32
|
+
/** @hidden */
|
|
33
|
+
interface Parent {
|
|
34
|
+
updateTree(): void;
|
|
35
|
+
removeChild(component: Component): void;
|
|
36
|
+
}
|
|
37
|
+
declare abstract class BaseParent<T> extends Base<T> implements Parent {
|
|
38
|
+
/** @hidden */
|
|
39
|
+
private children;
|
|
40
|
+
abstract validateChildren(children: Component[]): void;
|
|
41
|
+
appendChildren: <CS extends Component[]>(...children: CS) => CS;
|
|
42
|
+
appendChild: <C extends Component>(child: C) => C;
|
|
43
|
+
removeChild: (component: Component) => void;
|
|
44
|
+
removeAllChildren: () => void;
|
|
45
|
+
/**
|
|
46
|
+
* Return all children components that messages need to be routed to
|
|
47
|
+
*/
|
|
48
|
+
getChildren: () => readonly Component[];
|
|
49
|
+
/**
|
|
50
|
+
* TODO: we can do this better, right now it broadcasts the message to all
|
|
51
|
+
* components of the tree
|
|
52
|
+
*
|
|
53
|
+
* @hidden
|
|
54
|
+
*/
|
|
55
|
+
routeMessage(idMap: IDMap, message: proto.ClientComponentMessage): void;
|
|
56
|
+
insertBefore(child: Component, beforeChild: Component): void;
|
|
57
|
+
}
|
|
58
|
+
interface Listenable<Map extends Record<string, (...args: any[]) => void>> {
|
|
59
|
+
addListener<T extends keyof Map>(type: T, listener: Map[T]): void;
|
|
60
|
+
removeListener<T extends keyof Map>(type: T, listener: Map[T]): void;
|
|
61
|
+
}
|
|
62
|
+
declare class EventEmitter<Map extends Record<string, (...args: any[]) => void>> implements Listenable<Map> {
|
|
63
|
+
private readonly listeners;
|
|
64
|
+
addListener: <T extends keyof Map>(type: T, listener: Map[T]) => void;
|
|
65
|
+
removeListener: <T extends keyof Map>(type: T, listener: Map[T]) => void;
|
|
66
|
+
emit: <T extends keyof Map>(type: T, ...args: Parameters<Map[T]>) => Promise<unknown>;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export { Base, BaseParent, type Component, EventEmitter, type Listenable, type Parent };
|
|
@@ -1,2 +1,69 @@
|
|
|
1
|
-
|
|
2
|
-
import '
|
|
1
|
+
import * as proto from '@arcanejs/protocol';
|
|
2
|
+
import { IDMap } from '../util/index.js';
|
|
3
|
+
|
|
4
|
+
interface Component {
|
|
5
|
+
getProtoInfo(idMap: IDMap): proto.Component;
|
|
6
|
+
handleMessage(message: proto.ClientComponentMessage): void;
|
|
7
|
+
routeMessage(idMap: IDMap, message: proto.ClientComponentMessage): void;
|
|
8
|
+
setParent(parent: Parent | null): void;
|
|
9
|
+
}
|
|
10
|
+
declare abstract class Base<Props> implements Component {
|
|
11
|
+
/** @hidden */
|
|
12
|
+
private parent;
|
|
13
|
+
/** @hidden */
|
|
14
|
+
private readonly defaultProps;
|
|
15
|
+
/** @hidden */
|
|
16
|
+
private _props;
|
|
17
|
+
constructor(defaultProps: Props, props?: Partial<Props>);
|
|
18
|
+
get props(): Props;
|
|
19
|
+
set props(props: Partial<Props>);
|
|
20
|
+
setProps: (props: Partial<Props>) => void;
|
|
21
|
+
updateProps: (updates: Partial<Props>) => void;
|
|
22
|
+
/** @hidden */
|
|
23
|
+
setParent(parent: Parent | null): void;
|
|
24
|
+
/** @hidden */
|
|
25
|
+
updateTree(): void;
|
|
26
|
+
/** @hidden */
|
|
27
|
+
abstract getProtoInfo(idMap: IDMap): proto.Component;
|
|
28
|
+
/** @hidden */
|
|
29
|
+
handleMessage(message: proto.ClientComponentMessage): void;
|
|
30
|
+
routeMessage(_idMap: IDMap, _message: proto.ClientComponentMessage): void;
|
|
31
|
+
}
|
|
32
|
+
/** @hidden */
|
|
33
|
+
interface Parent {
|
|
34
|
+
updateTree(): void;
|
|
35
|
+
removeChild(component: Component): void;
|
|
36
|
+
}
|
|
37
|
+
declare abstract class BaseParent<T> extends Base<T> implements Parent {
|
|
38
|
+
/** @hidden */
|
|
39
|
+
private children;
|
|
40
|
+
abstract validateChildren(children: Component[]): void;
|
|
41
|
+
appendChildren: <CS extends Component[]>(...children: CS) => CS;
|
|
42
|
+
appendChild: <C extends Component>(child: C) => C;
|
|
43
|
+
removeChild: (component: Component) => void;
|
|
44
|
+
removeAllChildren: () => void;
|
|
45
|
+
/**
|
|
46
|
+
* Return all children components that messages need to be routed to
|
|
47
|
+
*/
|
|
48
|
+
getChildren: () => readonly Component[];
|
|
49
|
+
/**
|
|
50
|
+
* TODO: we can do this better, right now it broadcasts the message to all
|
|
51
|
+
* components of the tree
|
|
52
|
+
*
|
|
53
|
+
* @hidden
|
|
54
|
+
*/
|
|
55
|
+
routeMessage(idMap: IDMap, message: proto.ClientComponentMessage): void;
|
|
56
|
+
insertBefore(child: Component, beforeChild: Component): void;
|
|
57
|
+
}
|
|
58
|
+
interface Listenable<Map extends Record<string, (...args: any[]) => void>> {
|
|
59
|
+
addListener<T extends keyof Map>(type: T, listener: Map[T]): void;
|
|
60
|
+
removeListener<T extends keyof Map>(type: T, listener: Map[T]): void;
|
|
61
|
+
}
|
|
62
|
+
declare class EventEmitter<Map extends Record<string, (...args: any[]) => void>> implements Listenable<Map> {
|
|
63
|
+
private readonly listeners;
|
|
64
|
+
addListener: <T extends keyof Map>(type: T, listener: Map[T]) => void;
|
|
65
|
+
removeListener: <T extends keyof Map>(type: T, listener: Map[T]) => void;
|
|
66
|
+
emit: <T extends keyof Map>(type: T, ...args: Parameters<Map[T]>) => Promise<unknown>;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export { Base, BaseParent, type Component, EventEmitter, type Listenable, type Parent };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import '
|
|
1
|
+
import * as proto from '@arcanejs/protocol';
|
|
2
|
+
import { IDMap } from '../util/index.mjs';
|
|
3
|
+
import { Base, Listenable } from './base.mjs';
|
|
3
4
|
|
|
4
5
|
type Events = {
|
|
5
6
|
click: () => void | Promise<void>;
|
|
@@ -22,9 +23,9 @@ declare class Button extends Base<InternalProps> implements Listenable<Events> {
|
|
|
22
23
|
setIcon: (icon: string | undefined | null) => this;
|
|
23
24
|
setMode: (mode: ButtonMode) => this;
|
|
24
25
|
/** @hidden */
|
|
25
|
-
getProtoInfo: (idMap: IDMap) => ButtonComponent;
|
|
26
|
+
getProtoInfo: (idMap: IDMap) => proto.ButtonComponent;
|
|
26
27
|
/** @hidden */
|
|
27
|
-
handleMessage: (message: ClientComponentMessage) => void;
|
|
28
|
+
handleMessage: (message: proto.ClientComponentMessage) => void;
|
|
28
29
|
}
|
|
29
30
|
|
|
30
31
|
export { Button, type ButtonMode, type Events, type InternalProps, type Props };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import '
|
|
1
|
+
import * as proto from '@arcanejs/protocol';
|
|
2
|
+
import { IDMap } from '../util/index.js';
|
|
3
|
+
import { Base, Listenable } from './base.js';
|
|
3
4
|
|
|
4
5
|
type Events = {
|
|
5
6
|
click: () => void | Promise<void>;
|
|
@@ -22,9 +23,9 @@ declare class Button extends Base<InternalProps> implements Listenable<Events> {
|
|
|
22
23
|
setIcon: (icon: string | undefined | null) => this;
|
|
23
24
|
setMode: (mode: ButtonMode) => this;
|
|
24
25
|
/** @hidden */
|
|
25
|
-
getProtoInfo: (idMap: IDMap) => ButtonComponent;
|
|
26
|
+
getProtoInfo: (idMap: IDMap) => proto.ButtonComponent;
|
|
26
27
|
/** @hidden */
|
|
27
|
-
handleMessage: (message: ClientComponentMessage) => void;
|
|
28
|
+
handleMessage: (message: proto.ClientComponentMessage) => void;
|
|
28
29
|
}
|
|
29
30
|
|
|
30
31
|
export { Button, type ButtonMode, type Events, type InternalProps, type Props };
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as proto from '@arcanejs/protocol';
|
|
2
|
+
import { GroupComponentStyle } from '@arcanejs/protocol/styles';
|
|
3
|
+
import { IDMap } from '../util/index.mjs';
|
|
4
|
+
import { BaseParent, Listenable } from './base.mjs';
|
|
2
5
|
import { Button } from './button.mjs';
|
|
3
|
-
import '@arcanejs/diff';
|
|
4
6
|
|
|
5
|
-
type Label = (GroupComponent['labels'] & Array<unknown>)[number];
|
|
7
|
+
type Label = (proto.GroupComponent['labels'] & Array<unknown>)[number];
|
|
6
8
|
type GroupOptions = {
|
|
7
9
|
editableTitle?: boolean;
|
|
8
|
-
defaultCollapsibleState?: GroupComponent['defaultCollapsibleState'];
|
|
10
|
+
defaultCollapsibleState?: proto.GroupComponent['defaultCollapsibleState'];
|
|
9
11
|
};
|
|
10
12
|
type Events = {
|
|
11
13
|
'title-changed': (title: string) => void;
|
|
@@ -13,13 +15,12 @@ type Events = {
|
|
|
13
15
|
type InternalProps = GroupComponentStyle & GroupOptions & {
|
|
14
16
|
title: string | null;
|
|
15
17
|
labels: Label[] | null;
|
|
16
|
-
headerComponents: Component[] | null;
|
|
17
18
|
};
|
|
18
19
|
type Props = Partial<InternalProps>;
|
|
19
20
|
declare class GroupHeader extends BaseParent<Record<never, never>> {
|
|
20
21
|
validateChildren: () => void;
|
|
21
22
|
/** @hidden */
|
|
22
|
-
getProtoInfo: (idMap: IDMap) => GroupHeaderComponent;
|
|
23
|
+
getProtoInfo: (idMap: IDMap) => proto.GroupHeaderComponent;
|
|
23
24
|
}
|
|
24
25
|
/**
|
|
25
26
|
* A collection of components, grouped in either a row or column. Can contain
|
|
@@ -43,9 +44,9 @@ declare class Group extends BaseParent<InternalProps> implements Listenable<Even
|
|
|
43
44
|
removeHeaderChild: (child: Button) => void;
|
|
44
45
|
removeAllHeaderChildren: () => void;
|
|
45
46
|
/** @hidden */
|
|
46
|
-
getProtoInfo: (idMap: IDMap) => GroupComponent;
|
|
47
|
+
getProtoInfo: (idMap: IDMap) => proto.GroupComponent;
|
|
47
48
|
/** @hidden */
|
|
48
|
-
handleMessage: (message: ClientComponentMessage) => void;
|
|
49
|
+
handleMessage: (message: proto.ClientComponentMessage) => void;
|
|
49
50
|
}
|
|
50
51
|
|
|
51
52
|
export { type Events, Group, GroupHeader, type InternalProps, type Props };
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as proto from '@arcanejs/protocol';
|
|
2
|
+
import { GroupComponentStyle } from '@arcanejs/protocol/styles';
|
|
3
|
+
import { IDMap } from '../util/index.js';
|
|
4
|
+
import { BaseParent, Listenable } from './base.js';
|
|
2
5
|
import { Button } from './button.js';
|
|
3
|
-
import '@arcanejs/diff';
|
|
4
6
|
|
|
5
|
-
type Label = (GroupComponent['labels'] & Array<unknown>)[number];
|
|
7
|
+
type Label = (proto.GroupComponent['labels'] & Array<unknown>)[number];
|
|
6
8
|
type GroupOptions = {
|
|
7
9
|
editableTitle?: boolean;
|
|
8
|
-
defaultCollapsibleState?: GroupComponent['defaultCollapsibleState'];
|
|
10
|
+
defaultCollapsibleState?: proto.GroupComponent['defaultCollapsibleState'];
|
|
9
11
|
};
|
|
10
12
|
type Events = {
|
|
11
13
|
'title-changed': (title: string) => void;
|
|
@@ -13,13 +15,12 @@ type Events = {
|
|
|
13
15
|
type InternalProps = GroupComponentStyle & GroupOptions & {
|
|
14
16
|
title: string | null;
|
|
15
17
|
labels: Label[] | null;
|
|
16
|
-
headerComponents: Component[] | null;
|
|
17
18
|
};
|
|
18
19
|
type Props = Partial<InternalProps>;
|
|
19
20
|
declare class GroupHeader extends BaseParent<Record<never, never>> {
|
|
20
21
|
validateChildren: () => void;
|
|
21
22
|
/** @hidden */
|
|
22
|
-
getProtoInfo: (idMap: IDMap) => GroupHeaderComponent;
|
|
23
|
+
getProtoInfo: (idMap: IDMap) => proto.GroupHeaderComponent;
|
|
23
24
|
}
|
|
24
25
|
/**
|
|
25
26
|
* A collection of components, grouped in either a row or column. Can contain
|
|
@@ -43,9 +44,9 @@ declare class Group extends BaseParent<InternalProps> implements Listenable<Even
|
|
|
43
44
|
removeHeaderChild: (child: Button) => void;
|
|
44
45
|
removeAllHeaderChildren: () => void;
|
|
45
46
|
/** @hidden */
|
|
46
|
-
getProtoInfo: (idMap: IDMap) => GroupComponent;
|
|
47
|
+
getProtoInfo: (idMap: IDMap) => proto.GroupComponent;
|
|
47
48
|
/** @hidden */
|
|
48
|
-
handleMessage: (message: ClientComponentMessage) => void;
|
|
49
|
+
handleMessage: (message: proto.ClientComponentMessage) => void;
|
|
49
50
|
}
|
|
50
51
|
|
|
51
52
|
export { type Events, Group, GroupHeader, type InternalProps, type Props };
|
|
@@ -25,11 +25,6 @@ __export(group_exports, {
|
|
|
25
25
|
});
|
|
26
26
|
module.exports = __toCommonJS(group_exports);
|
|
27
27
|
|
|
28
|
-
// src/shared/styles.ts
|
|
29
|
-
var GROUP_DEFAULT_STYLE = {
|
|
30
|
-
direction: "horizontal"
|
|
31
|
-
};
|
|
32
|
-
|
|
33
28
|
// src/backend/components/base.ts
|
|
34
29
|
var Base = class {
|
|
35
30
|
/** @hidden */
|
|
@@ -189,11 +184,13 @@ var EventEmitter = class {
|
|
|
189
184
|
};
|
|
190
185
|
|
|
191
186
|
// src/backend/components/group.ts
|
|
187
|
+
var GROUP_DEFAULT_STYLE = {
|
|
188
|
+
direction: "horizontal"
|
|
189
|
+
};
|
|
192
190
|
var DEFAULT_PROPS = {
|
|
193
191
|
...GROUP_DEFAULT_STYLE,
|
|
194
192
|
title: null,
|
|
195
|
-
labels: null
|
|
196
|
-
headerComponents: null
|
|
193
|
+
labels: null
|
|
197
194
|
};
|
|
198
195
|
var GroupHeader = class extends BaseParent {
|
|
199
196
|
validateChildren = () => {
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import '@arcanejs/
|
|
1
|
+
import * as proto from '@arcanejs/protocol';
|
|
2
|
+
import { LabelComponentStyle } from '@arcanejs/protocol/styles';
|
|
3
|
+
import { IDMap } from '../util/index.mjs';
|
|
4
|
+
import { Base } from './base.mjs';
|
|
3
5
|
|
|
4
6
|
type InternalProps = LabelComponentStyle & {
|
|
5
7
|
text: string | null;
|
|
@@ -14,7 +16,7 @@ type Props = InternalProps;
|
|
|
14
16
|
declare class Label extends Base<InternalProps> {
|
|
15
17
|
constructor(props?: Props);
|
|
16
18
|
/** @hidden */
|
|
17
|
-
getProtoInfo(idMap: IDMap): Component;
|
|
19
|
+
getProtoInfo(idMap: IDMap): proto.Component;
|
|
18
20
|
setText(text: string): Label;
|
|
19
21
|
}
|
|
20
22
|
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import '@arcanejs/
|
|
1
|
+
import * as proto from '@arcanejs/protocol';
|
|
2
|
+
import { LabelComponentStyle } from '@arcanejs/protocol/styles';
|
|
3
|
+
import { IDMap } from '../util/index.js';
|
|
4
|
+
import { Base } from './base.js';
|
|
3
5
|
|
|
4
6
|
type InternalProps = LabelComponentStyle & {
|
|
5
7
|
text: string | null;
|
|
@@ -14,7 +16,7 @@ type Props = InternalProps;
|
|
|
14
16
|
declare class Label extends Base<InternalProps> {
|
|
15
17
|
constructor(props?: Props);
|
|
16
18
|
/** @hidden */
|
|
17
|
-
getProtoInfo(idMap: IDMap): Component;
|
|
19
|
+
getProtoInfo(idMap: IDMap): proto.Component;
|
|
18
20
|
setText(text: string): Label;
|
|
19
21
|
}
|
|
20
22
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import '
|
|
1
|
+
import * as proto from '@arcanejs/protocol';
|
|
2
|
+
import { IDMap } from '../util/index.mjs';
|
|
3
|
+
import { Base } from './base.mjs';
|
|
3
4
|
|
|
4
5
|
type InternalProps = {
|
|
5
6
|
color: string;
|
|
@@ -13,7 +14,7 @@ type Props = Partial<InternalProps>;
|
|
|
13
14
|
declare class Rect extends Base<InternalProps> {
|
|
14
15
|
constructor(props?: Props);
|
|
15
16
|
/** @hidden */
|
|
16
|
-
getProtoInfo(idMap: IDMap): Component;
|
|
17
|
+
getProtoInfo(idMap: IDMap): proto.Component;
|
|
17
18
|
setColor(color: string): Rect;
|
|
18
19
|
}
|
|
19
20
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import '
|
|
1
|
+
import * as proto from '@arcanejs/protocol';
|
|
2
|
+
import { IDMap } from '../util/index.js';
|
|
3
|
+
import { Base } from './base.js';
|
|
3
4
|
|
|
4
5
|
type InternalProps = {
|
|
5
6
|
color: string;
|
|
@@ -13,7 +14,7 @@ type Props = Partial<InternalProps>;
|
|
|
13
14
|
declare class Rect extends Base<InternalProps> {
|
|
14
15
|
constructor(props?: Props);
|
|
15
16
|
/** @hidden */
|
|
16
|
-
getProtoInfo(idMap: IDMap): Component;
|
|
17
|
+
getProtoInfo(idMap: IDMap): proto.Component;
|
|
17
18
|
setColor(color: string): Rect;
|
|
18
19
|
}
|
|
19
20
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import '
|
|
1
|
+
import * as proto from '@arcanejs/protocol';
|
|
2
|
+
import { IDMap } from '../util/index.mjs';
|
|
3
|
+
import { Base, Listenable } from './base.mjs';
|
|
3
4
|
|
|
4
5
|
type Events = {
|
|
5
6
|
change: (value: number) => void | Promise<void>;
|
|
@@ -21,9 +22,9 @@ declare class SliderButton extends Base<InternalProps> implements Listenable<Eve
|
|
|
21
22
|
addListener: <T extends "change">(type: T, listener: Events[T]) => void;
|
|
22
23
|
removeListener: <T extends "change">(type: T, listener: Events[T]) => void;
|
|
23
24
|
/** @hidden */
|
|
24
|
-
getProtoInfo(idMap: IDMap): Component;
|
|
25
|
+
getProtoInfo(idMap: IDMap): proto.Component;
|
|
25
26
|
/** @hidden */
|
|
26
|
-
handleMessage(message: ClientComponentMessage): void;
|
|
27
|
+
handleMessage(message: proto.ClientComponentMessage): void;
|
|
27
28
|
setValue(value: number): void;
|
|
28
29
|
private sanitizeNumber;
|
|
29
30
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import '
|
|
1
|
+
import * as proto from '@arcanejs/protocol';
|
|
2
|
+
import { IDMap } from '../util/index.js';
|
|
3
|
+
import { Base, Listenable } from './base.js';
|
|
3
4
|
|
|
4
5
|
type Events = {
|
|
5
6
|
change: (value: number) => void | Promise<void>;
|
|
@@ -21,9 +22,9 @@ declare class SliderButton extends Base<InternalProps> implements Listenable<Eve
|
|
|
21
22
|
addListener: <T extends "change">(type: T, listener: Events[T]) => void;
|
|
22
23
|
removeListener: <T extends "change">(type: T, listener: Events[T]) => void;
|
|
23
24
|
/** @hidden */
|
|
24
|
-
getProtoInfo(idMap: IDMap): Component;
|
|
25
|
+
getProtoInfo(idMap: IDMap): proto.Component;
|
|
25
26
|
/** @hidden */
|
|
26
|
-
handleMessage(message: ClientComponentMessage): void;
|
|
27
|
+
handleMessage(message: proto.ClientComponentMessage): void;
|
|
27
28
|
setValue(value: number): void;
|
|
28
29
|
private sanitizeNumber;
|
|
29
30
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import '
|
|
1
|
+
import * as proto from '@arcanejs/protocol';
|
|
2
|
+
import { IDMap } from '../util/index.mjs';
|
|
3
|
+
import { Base, Listenable } from './base.mjs';
|
|
3
4
|
|
|
4
5
|
type Events = {
|
|
5
6
|
change: (state: 'on' | 'off') => void | Promise<void>;
|
|
@@ -15,9 +16,9 @@ declare class Switch extends Base<InternalProps> implements Listenable<Events> {
|
|
|
15
16
|
addListener: <T extends "change">(type: T, listener: Events[T]) => void;
|
|
16
17
|
removeListener: <T extends "change">(type: T, listener: Events[T]) => void;
|
|
17
18
|
/** @hidden */
|
|
18
|
-
getProtoInfo(idMap: IDMap): Component;
|
|
19
|
+
getProtoInfo(idMap: IDMap): proto.Component;
|
|
19
20
|
/** @hidden */
|
|
20
|
-
handleMessage(message: ClientComponentMessage): void;
|
|
21
|
+
handleMessage(message: proto.ClientComponentMessage): void;
|
|
21
22
|
setValue(state: 'on' | 'off'): void;
|
|
22
23
|
}
|
|
23
24
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import '
|
|
1
|
+
import * as proto from '@arcanejs/protocol';
|
|
2
|
+
import { IDMap } from '../util/index.js';
|
|
3
|
+
import { Base, Listenable } from './base.js';
|
|
3
4
|
|
|
4
5
|
type Events = {
|
|
5
6
|
change: (state: 'on' | 'off') => void | Promise<void>;
|
|
@@ -15,9 +16,9 @@ declare class Switch extends Base<InternalProps> implements Listenable<Events> {
|
|
|
15
16
|
addListener: <T extends "change">(type: T, listener: Events[T]) => void;
|
|
16
17
|
removeListener: <T extends "change">(type: T, listener: Events[T]) => void;
|
|
17
18
|
/** @hidden */
|
|
18
|
-
getProtoInfo(idMap: IDMap): Component;
|
|
19
|
+
getProtoInfo(idMap: IDMap): proto.Component;
|
|
19
20
|
/** @hidden */
|
|
20
|
-
handleMessage(message: ClientComponentMessage): void;
|
|
21
|
+
handleMessage(message: proto.ClientComponentMessage): void;
|
|
21
22
|
setValue(state: 'on' | 'off'): void;
|
|
22
23
|
}
|
|
23
24
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import '
|
|
1
|
+
import * as proto from '@arcanejs/protocol';
|
|
2
|
+
import { IDMap } from '../util/index.mjs';
|
|
3
|
+
import { BaseParent, Component } from './base.mjs';
|
|
3
4
|
|
|
4
5
|
type TabDefinition = {
|
|
5
6
|
name: string;
|
|
@@ -12,7 +13,7 @@ type TabProps = InternalTabProps;
|
|
|
12
13
|
declare class Tab extends BaseParent<InternalTabProps> {
|
|
13
14
|
validateChildren: (children: Component[]) => void;
|
|
14
15
|
/** @hidden */
|
|
15
|
-
getProtoInfo: (idMap: IDMap) => TabComponent;
|
|
16
|
+
getProtoInfo: (idMap: IDMap) => proto.TabComponent;
|
|
16
17
|
}
|
|
17
18
|
type InternalTabsProps = Record<never, never>;
|
|
18
19
|
type TabsProps = InternalTabsProps;
|
|
@@ -22,7 +23,7 @@ declare class Tabs extends BaseParent<InternalTabsProps> {
|
|
|
22
23
|
addTabs(...tabs: TabDefinition[]): void;
|
|
23
24
|
addTab<C extends Component>(name: string, component: C): C;
|
|
24
25
|
/** @hidden */
|
|
25
|
-
getProtoInfo(idMap: IDMap): TabsComponent;
|
|
26
|
+
getProtoInfo(idMap: IDMap): proto.TabsComponent;
|
|
26
27
|
}
|
|
27
28
|
|
|
28
29
|
export { Tab, type TabProps, Tabs, type TabsProps };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import '
|
|
1
|
+
import * as proto from '@arcanejs/protocol';
|
|
2
|
+
import { IDMap } from '../util/index.js';
|
|
3
|
+
import { BaseParent, Component } from './base.js';
|
|
3
4
|
|
|
4
5
|
type TabDefinition = {
|
|
5
6
|
name: string;
|
|
@@ -12,7 +13,7 @@ type TabProps = InternalTabProps;
|
|
|
12
13
|
declare class Tab extends BaseParent<InternalTabProps> {
|
|
13
14
|
validateChildren: (children: Component[]) => void;
|
|
14
15
|
/** @hidden */
|
|
15
|
-
getProtoInfo: (idMap: IDMap) => TabComponent;
|
|
16
|
+
getProtoInfo: (idMap: IDMap) => proto.TabComponent;
|
|
16
17
|
}
|
|
17
18
|
type InternalTabsProps = Record<never, never>;
|
|
18
19
|
type TabsProps = InternalTabsProps;
|
|
@@ -22,7 +23,7 @@ declare class Tabs extends BaseParent<InternalTabsProps> {
|
|
|
22
23
|
addTabs(...tabs: TabDefinition[]): void;
|
|
23
24
|
addTab<C extends Component>(name: string, component: C): C;
|
|
24
25
|
/** @hidden */
|
|
25
|
-
getProtoInfo(idMap: IDMap): TabsComponent;
|
|
26
|
+
getProtoInfo(idMap: IDMap): proto.TabsComponent;
|
|
26
27
|
}
|
|
27
28
|
|
|
28
29
|
export { Tab, type TabProps, Tabs, type TabsProps };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import '
|
|
1
|
+
import * as proto from '@arcanejs/protocol';
|
|
2
|
+
import { IDMap } from '../util/index.mjs';
|
|
3
|
+
import { Base, Listenable } from './base.mjs';
|
|
3
4
|
|
|
4
5
|
type Events = {
|
|
5
6
|
change: (value: string) => void | Promise<void>;
|
|
@@ -15,9 +16,9 @@ declare class TextInput extends Base<InternalProps> implements Listenable<Events
|
|
|
15
16
|
addListener: <T extends "change">(type: T, listener: Events[T]) => void;
|
|
16
17
|
removeListener: <T extends "change">(type: T, listener: Events[T]) => void;
|
|
17
18
|
/** @hidden */
|
|
18
|
-
getProtoInfo: (idMap: IDMap) => Component;
|
|
19
|
+
getProtoInfo: (idMap: IDMap) => proto.Component;
|
|
19
20
|
/** @hidden */
|
|
20
|
-
handleMessage: (message: ClientComponentMessage) => void;
|
|
21
|
+
handleMessage: (message: proto.ClientComponentMessage) => void;
|
|
21
22
|
getValue: () => string | null;
|
|
22
23
|
getValidatedValue: <T>(validator: (text: string) => T) => null | T;
|
|
23
24
|
setValue: (value: string) => void;
|