@vyr/runtime 0.0.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/build/Action.d.ts +42 -0
- package/build/DataService.d.ts +26 -0
- package/build/DraggableService.d.ts +37 -0
- package/build/InspectorService.d.ts +18 -0
- package/build/PresetService.d.ts +31 -0
- package/build/RemoteService.d.ts +12 -0
- package/build/Runtime.d.ts +8 -0
- package/build/ShortcutkeyService.d.ts +23 -0
- package/build/data/body.d.ts +13 -0
- package/build/data/footer.d.ts +42 -0
- package/build/data/header.d.ts +11 -0
- package/build/data/inspector.d.ts +10 -0
- package/build/data/sidebar.d.ts +11 -0
- package/build/data/status.d.ts +17 -0
- package/build/index.d.ts +10 -0
- package/build/locale/Language.d.ts +3 -0
- package/build/locale/LanguageProvider.d.ts +30 -0
- package/build/locale/index.d.ts +2 -0
- package/build/navigator/SidebarNavigator.d.ts +52 -0
- package/build/navigator/index.d.ts +1 -0
- package/package.json +22 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
declare abstract class Action {
|
|
2
|
+
static id: string;
|
|
3
|
+
static rightMenu: number;
|
|
4
|
+
static shortcutkey: number;
|
|
5
|
+
readonly id: string;
|
|
6
|
+
readonly value: number;
|
|
7
|
+
abstract label: string;
|
|
8
|
+
order: number;
|
|
9
|
+
/**行为的触发类型 */
|
|
10
|
+
trigger: number;
|
|
11
|
+
/**是否显示 */
|
|
12
|
+
show: boolean;
|
|
13
|
+
/**是否被禁用 */
|
|
14
|
+
disabled: boolean;
|
|
15
|
+
/**该行为的子行为 */
|
|
16
|
+
children: Action[];
|
|
17
|
+
/**快捷键服务会调用该方法验证行为是否应该被更新 */
|
|
18
|
+
abstract validator(...args: any[]): boolean;
|
|
19
|
+
/**更新行为的属性,例如`show` `disabled`等属性。可在行为执行前控制是否展示/禁用该行为*/
|
|
20
|
+
abstract update(): void;
|
|
21
|
+
/**该行为需要执行的逻辑 */
|
|
22
|
+
abstract execute(): void;
|
|
23
|
+
constructor();
|
|
24
|
+
active(): boolean;
|
|
25
|
+
}
|
|
26
|
+
declare class ActionGroup {
|
|
27
|
+
private actions;
|
|
28
|
+
private queue;
|
|
29
|
+
private needReset;
|
|
30
|
+
readonly region: string;
|
|
31
|
+
constructor(region: string, actions: Action[]);
|
|
32
|
+
reset(forced?: boolean): void;
|
|
33
|
+
add(...actions: Action[]): void;
|
|
34
|
+
remove(...actions: Action[]): void;
|
|
35
|
+
getActions(): Action[];
|
|
36
|
+
get<T extends Action | null = Action | null>(id: string): T;
|
|
37
|
+
/**更新所有行为,右键菜单功能会调用该方法 */
|
|
38
|
+
update(trigger: number): Action[];
|
|
39
|
+
/**对所有行为进行验证,通过验证的行为将被执行,快捷键功能会调用该方法 */
|
|
40
|
+
execute(trigger: number, ...args: any[]): boolean;
|
|
41
|
+
}
|
|
42
|
+
export { ActionGroup, Action };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Service } from "@vyr/service";
|
|
2
|
+
import { Header } from "./data/header";
|
|
3
|
+
import { Body } from './data/body';
|
|
4
|
+
import { Sidebar } from './data/sidebar';
|
|
5
|
+
import { Inspector } from "./data/inspector";
|
|
6
|
+
import { Footer } from './data/footer';
|
|
7
|
+
import { Status } from './data/status';
|
|
8
|
+
declare class DataService extends Service {
|
|
9
|
+
readonly scripts: {
|
|
10
|
+
label: string;
|
|
11
|
+
value: string;
|
|
12
|
+
}[];
|
|
13
|
+
readonly header: Header;
|
|
14
|
+
readonly body: Body;
|
|
15
|
+
readonly sidebar: Sidebar;
|
|
16
|
+
readonly inspector: Inspector;
|
|
17
|
+
readonly footer: Footer;
|
|
18
|
+
readonly status: Status;
|
|
19
|
+
constructor(name: string);
|
|
20
|
+
setup(): Promise<void>;
|
|
21
|
+
addScripte(script: {
|
|
22
|
+
label: string;
|
|
23
|
+
value: string;
|
|
24
|
+
}): void;
|
|
25
|
+
}
|
|
26
|
+
export { DataService };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Service } from "@vyr/service";
|
|
2
|
+
import { SerializationObject } from '@vyr/engine';
|
|
3
|
+
import { AdditionalData, DraggableEndType, DraggableData } from '@vyr/declare';
|
|
4
|
+
declare abstract class Draggable<D extends AdditionalData = AdditionalData, T extends AdditionalData = D> {
|
|
5
|
+
abstract readonly id: string;
|
|
6
|
+
/**对拖拽的类型进行限制 */
|
|
7
|
+
limit(dragData: DraggableData<D>, targetData: DraggableData<D>, type: DraggableEndType): DraggableEndType;
|
|
8
|
+
updateTargetOfKey<T extends AdditionalData = AdditionalData>(key: string, value: any, target: SerializationObject): void;
|
|
9
|
+
/**拖拽组的启动器,当托拽功能准备启动拖拽组时会调用该方法。
|
|
10
|
+
*
|
|
11
|
+
* @param dragData 准备拖动的对象
|
|
12
|
+
* @returns 返回值决定了该对象是否可被拖动
|
|
13
|
+
*/
|
|
14
|
+
abstract starter(dragData: D): boolean;
|
|
15
|
+
/**拖拽组的验证器,当托拽对象进入目标对象`(该托拽组内的任意一个对象)`时会调用该方法。
|
|
16
|
+
*
|
|
17
|
+
* @param targetData 进入的目标对象
|
|
18
|
+
* @returns 返回值决定了托拽对象能否被放置在目标对象
|
|
19
|
+
*/
|
|
20
|
+
abstract validator(dragData: DraggableData<D>, targetData: DraggableData<T>): boolean;
|
|
21
|
+
/**成功完成托拽时该方法将被执行 */
|
|
22
|
+
abstract finished(dragData: DraggableData<D>, targetData: DraggableData<T>, type: DraggableEndType): void;
|
|
23
|
+
}
|
|
24
|
+
declare class DraggableKey {
|
|
25
|
+
scene: string;
|
|
26
|
+
asset: string;
|
|
27
|
+
inspector: string;
|
|
28
|
+
footer: string;
|
|
29
|
+
}
|
|
30
|
+
declare class DraggableService extends Service {
|
|
31
|
+
static readonly key: DraggableKey;
|
|
32
|
+
private _collection;
|
|
33
|
+
readonly key: DraggableKey;
|
|
34
|
+
get(id: string | number): Draggable<AdditionalData, AdditionalData>;
|
|
35
|
+
set(id: string | number, draggable: Draggable): void;
|
|
36
|
+
}
|
|
37
|
+
export { Draggable, DraggableService, };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ComponentPublicInstance, Component, AsyncComponentLoader } from 'vue';
|
|
2
|
+
import { Service } from "@vyr/service";
|
|
3
|
+
interface ServiceConfig {
|
|
4
|
+
loading: Component;
|
|
5
|
+
error: Component;
|
|
6
|
+
}
|
|
7
|
+
declare class InspectorService<T extends new () => ComponentPublicInstance = new () => ComponentPublicInstance> extends Service {
|
|
8
|
+
private map;
|
|
9
|
+
readonly loading: Component;
|
|
10
|
+
readonly error: Component;
|
|
11
|
+
constructor(name: string, config: ServiceConfig);
|
|
12
|
+
setup(): Promise<void>;
|
|
13
|
+
ready(): Promise<void>;
|
|
14
|
+
start(): Promise<void>;
|
|
15
|
+
get<R extends T = T>(id: string): R;
|
|
16
|
+
set(id: string, executor: AsyncComponentLoader): void;
|
|
17
|
+
}
|
|
18
|
+
export { InspectorService };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Descriptor } from "@vyr/engine";
|
|
2
|
+
import { Service } from "@vyr/service";
|
|
3
|
+
interface Preset {
|
|
4
|
+
type: string;
|
|
5
|
+
value: string;
|
|
6
|
+
label: string;
|
|
7
|
+
executor: (...args: any[]) => Promise<void>;
|
|
8
|
+
}
|
|
9
|
+
type InteractionProvider = {
|
|
10
|
+
id: string;
|
|
11
|
+
label: string;
|
|
12
|
+
ignore: string[] | ((descriptor: Descriptor) => boolean);
|
|
13
|
+
};
|
|
14
|
+
declare class PresetService extends Service {
|
|
15
|
+
private _collection;
|
|
16
|
+
private _typeCollection;
|
|
17
|
+
private _eventProviderCollection;
|
|
18
|
+
constructor(name: string);
|
|
19
|
+
private _addGlobalInteractionProvider;
|
|
20
|
+
private _addHTMLInteractionProvider;
|
|
21
|
+
get(value: string): Preset;
|
|
22
|
+
getByType(type: string): Preset[];
|
|
23
|
+
set(preset: Preset): void;
|
|
24
|
+
addInteractionProvider(provider: InteractionProvider): void;
|
|
25
|
+
getInteractionLabel(id: string): string;
|
|
26
|
+
getByInteractionProvider(descriptor: Descriptor): {
|
|
27
|
+
label: string;
|
|
28
|
+
value: string;
|
|
29
|
+
}[];
|
|
30
|
+
}
|
|
31
|
+
export { Preset, PresetService };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Service } from "@vyr/service";
|
|
2
|
+
import { Job, RemoteConfig, RemoteInvoker } from '@vyr/remote';
|
|
3
|
+
declare class RemoteService extends Service {
|
|
4
|
+
private _collection;
|
|
5
|
+
constructor(name: string);
|
|
6
|
+
private dispose;
|
|
7
|
+
create(config: Partial<Omit<RemoteConfig, "id">>): RemoteInvoker;
|
|
8
|
+
get(id: string | number): RemoteInvoker;
|
|
9
|
+
set(id: string | number, remote: RemoteInvoker): void;
|
|
10
|
+
send(task: Job): void;
|
|
11
|
+
}
|
|
12
|
+
export { RemoteService };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Region, Service } from "@vyr/service";
|
|
2
|
+
import { Action, ActionGroup } from "./Action";
|
|
3
|
+
declare class ShortcutkeyService extends Service {
|
|
4
|
+
static spaced: boolean;
|
|
5
|
+
static update(event: KeyboardEvent, enable: boolean): void;
|
|
6
|
+
private groupCollection;
|
|
7
|
+
private current;
|
|
8
|
+
private status;
|
|
9
|
+
constructor(name: string);
|
|
10
|
+
private bindActionHandler;
|
|
11
|
+
private unbindActionHandler;
|
|
12
|
+
listen(): void;
|
|
13
|
+
/**获取快捷键服务的当前行为组 */
|
|
14
|
+
get(): ActionGroup;
|
|
15
|
+
get(name: Region | 'global'): ActionGroup;
|
|
16
|
+
/**设置快捷键服务的行为组,多次调用会覆盖上一次的设置 */
|
|
17
|
+
active(region: Region): void;
|
|
18
|
+
unactive(): void;
|
|
19
|
+
enable(): void;
|
|
20
|
+
disable(): void;
|
|
21
|
+
getAction<T extends Action = Action>(id: string): T | null;
|
|
22
|
+
}
|
|
23
|
+
export { ShortcutkeyService };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { VirtualNode } from '@vyr/service-rpc';
|
|
2
|
+
declare class Status {
|
|
3
|
+
/**鼠标当前所在的区域
|
|
4
|
+
* @directory 目录
|
|
5
|
+
* @manifest 清单
|
|
6
|
+
*/
|
|
7
|
+
mouseRegion: 'directory' | 'manifest';
|
|
8
|
+
/**鼠标在当前区域的激活项 */
|
|
9
|
+
mouseItem: VirtualNode | null;
|
|
10
|
+
/**目录的修改模式 */
|
|
11
|
+
modifyMode: 'close' | 'add' | 'edit';
|
|
12
|
+
/**目录的修改模式开启时修改的数据项 */
|
|
13
|
+
modifyValue: VirtualNode | null;
|
|
14
|
+
/**目录的修改模式为`add`时的类型 */
|
|
15
|
+
modifyModeAdd: 'file' | 'dir';
|
|
16
|
+
/**目录的修改模式为`add`且路径为`file`时文件的内容 */
|
|
17
|
+
modifyContent: string;
|
|
18
|
+
/**目录的修改模式为`add`且路径为`file`时文件的后缀 */
|
|
19
|
+
modifySuffix: string;
|
|
20
|
+
/**快捷操作的类型 */
|
|
21
|
+
stickup: 'copy' | 'cut' | '';
|
|
22
|
+
/**快捷操作的数据项 */
|
|
23
|
+
stickupItems: VirtualNode[];
|
|
24
|
+
/**全选数组 */
|
|
25
|
+
selectAll: VirtualNode[];
|
|
26
|
+
/**对清单进行筛选时所需的值 */
|
|
27
|
+
search: string;
|
|
28
|
+
}
|
|
29
|
+
declare class Footer {
|
|
30
|
+
readonly root: VirtualNode;
|
|
31
|
+
readonly emptyDirectory: VirtualNode;
|
|
32
|
+
readonly status: Status;
|
|
33
|
+
readonly getter: {
|
|
34
|
+
label(item: VirtualNode): string;
|
|
35
|
+
value(item: VirtualNode): string;
|
|
36
|
+
};
|
|
37
|
+
directory: VirtualNode;
|
|
38
|
+
manifest: VirtualNode[];
|
|
39
|
+
size: number;
|
|
40
|
+
updateManifest(): VirtualNode[];
|
|
41
|
+
}
|
|
42
|
+
export { Footer };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { SidebarNavigator } from "../navigator";
|
|
2
|
+
declare class Sidebar {
|
|
3
|
+
private _collection;
|
|
4
|
+
size: number;
|
|
5
|
+
active: string;
|
|
6
|
+
get<T extends SidebarNavigator | null = SidebarNavigator | null>(key: string): T;
|
|
7
|
+
set<T extends SidebarNavigator = SidebarNavigator>(navigator: T): T;
|
|
8
|
+
getCollection(): SidebarNavigator[];
|
|
9
|
+
toggle(key: string): void;
|
|
10
|
+
}
|
|
11
|
+
export { Sidebar };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
declare class Transform {
|
|
2
|
+
target: string;
|
|
3
|
+
mode: string;
|
|
4
|
+
}
|
|
5
|
+
declare class Helper {
|
|
6
|
+
}
|
|
7
|
+
declare class Aniamtion {
|
|
8
|
+
max: number;
|
|
9
|
+
currentTime: number;
|
|
10
|
+
enabled: boolean;
|
|
11
|
+
}
|
|
12
|
+
declare class Status {
|
|
13
|
+
transform: Transform;
|
|
14
|
+
helper: Helper;
|
|
15
|
+
animation: Aniamtion;
|
|
16
|
+
}
|
|
17
|
+
export { Status };
|
package/build/index.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from './locale';
|
|
2
|
+
export * from './navigator';
|
|
3
|
+
export * from './Action';
|
|
4
|
+
export * from './DataService';
|
|
5
|
+
export * from './PresetService';
|
|
6
|
+
export * from './DraggableService';
|
|
7
|
+
export * from './InspectorService';
|
|
8
|
+
export * from './RemoteService';
|
|
9
|
+
export * from './ShortcutkeyService';
|
|
10
|
+
export * from './Runtime';
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { LanguageProvider } from '@vyr/locale';
|
|
2
|
+
interface ZhCNLanguageProvider extends LanguageProvider {
|
|
3
|
+
'preset.Interaction.id.mount': string;
|
|
4
|
+
'preset.Interaction.id.click': string;
|
|
5
|
+
'preset.Interaction.id.mousedown': string;
|
|
6
|
+
'preset.Interaction.id.mouseup': string;
|
|
7
|
+
'preset.Interaction.id.mouseenter': string;
|
|
8
|
+
'preset.Interaction.id.mouseleave': string;
|
|
9
|
+
'preset.Interaction.id.mousemove': string;
|
|
10
|
+
'preset.Interaction.id.mouseout': string;
|
|
11
|
+
'preset.Interaction.id.mouseover': string;
|
|
12
|
+
'preset.Interaction.id.contextmenu': string;
|
|
13
|
+
'preset.Interaction.id.dblclick': string;
|
|
14
|
+
'preset.Interaction.id.keydown': string;
|
|
15
|
+
'preset.Interaction.id.keyup': string;
|
|
16
|
+
'preset.Interaction.id.focus': string;
|
|
17
|
+
'preset.Interaction.id.blur': string;
|
|
18
|
+
'preset.Interaction.id.play': string;
|
|
19
|
+
'preset.Interaction.id.pause': string;
|
|
20
|
+
'preset.Interaction.id.pointercancel': string;
|
|
21
|
+
'preset.Interaction.id.pointerdown': string;
|
|
22
|
+
'preset.Interaction.id.pointerenter': string;
|
|
23
|
+
'preset.Interaction.id.pointerleave': string;
|
|
24
|
+
'preset.Interaction.id.pointermove': string;
|
|
25
|
+
'preset.Interaction.id.pointerout': string;
|
|
26
|
+
'preset.Interaction.id.pointerover': string;
|
|
27
|
+
'preset.Interaction.id.pointerup': string;
|
|
28
|
+
}
|
|
29
|
+
declare const zhCnLanguageProvider: ZhCNLanguageProvider;
|
|
30
|
+
export { ZhCNLanguageProvider, zhCnLanguageProvider, };
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { Descriptor, DeserializationObject } from "@vyr/engine";
|
|
2
|
+
import { DraggableData, DraggableEndType } from "@vyr/declare";
|
|
3
|
+
import { RpcService, VirtualNode } from "@vyr/service-rpc";
|
|
4
|
+
import { Job } from "@vyr/remote";
|
|
5
|
+
import { Draggable } from "../DraggableService";
|
|
6
|
+
declare class Status {
|
|
7
|
+
/**目录的修改模式 */
|
|
8
|
+
modifyMode: 'close' | 'add' | 'edit';
|
|
9
|
+
/**场景树的修改模式开启时修改的数据项 */
|
|
10
|
+
modifyValue: Descriptor | null;
|
|
11
|
+
/**场景树的修改模式为`add`时的元数据对象 */
|
|
12
|
+
modifyContent: Descriptor | null;
|
|
13
|
+
/**鼠标在当前区域的激活项 */
|
|
14
|
+
mouseItem: Descriptor | null;
|
|
15
|
+
/**快捷操作的类型 */
|
|
16
|
+
stickup: 'copy' | 'cut' | '';
|
|
17
|
+
/**快捷操作的数据项 */
|
|
18
|
+
stickupItems: Descriptor[];
|
|
19
|
+
/**对场景节点进行筛选时所需的值 */
|
|
20
|
+
search: string;
|
|
21
|
+
}
|
|
22
|
+
/**该类会被响应式对象使用,定义方法时不要使用箭头函数(会导致在方法里修改变量时,直接修改了原始对象) */
|
|
23
|
+
declare abstract class SidebarNavigator {
|
|
24
|
+
static key: string;
|
|
25
|
+
readonly key: string;
|
|
26
|
+
readonly label: string;
|
|
27
|
+
readonly icon: string;
|
|
28
|
+
readonly root: Descriptor;
|
|
29
|
+
readonly getter: {
|
|
30
|
+
label(item: Descriptor): string;
|
|
31
|
+
value(item: Descriptor): string;
|
|
32
|
+
disabled(): boolean;
|
|
33
|
+
};
|
|
34
|
+
readonly status: Status;
|
|
35
|
+
readonly events: Array<{
|
|
36
|
+
key: string;
|
|
37
|
+
bind: (...args: any[]) => void;
|
|
38
|
+
}>;
|
|
39
|
+
url: string;
|
|
40
|
+
selectAll: Descriptor[];
|
|
41
|
+
constructor(label: string, icon: string);
|
|
42
|
+
active(): void;
|
|
43
|
+
unactive(): void;
|
|
44
|
+
on(rpc: RpcService, key: string, cb: (...args: any[]) => void): (...args: any[]) => void;
|
|
45
|
+
unAll(rpc: RpcService): void;
|
|
46
|
+
abstract finishedWhereInspectorDraggable(draggable: Draggable, dragData: DraggableData<VirtualNode>, targetData: DraggableData, type: DraggableEndType): void;
|
|
47
|
+
abstract ensureReadonlyWhereRoutine(client: string): boolean;
|
|
48
|
+
abstract saveWhereRoutine(content: DeserializationObject<Descriptor>): void;
|
|
49
|
+
abstract remoteTransformEvent(...args: any[]): void;
|
|
50
|
+
abstract remotePickEvent(task: InstanceType<typeof Job['invoke']['pick']['Response']>): void;
|
|
51
|
+
}
|
|
52
|
+
export { Status, SidebarNavigator, };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './SidebarNavigator';
|
package/package.json
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@vyr/runtime",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": " - Type Declarations",
|
|
5
|
+
"main": "",
|
|
6
|
+
"author": "",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"dependencies": {
|
|
9
|
+
"vue": "3.5.22",
|
|
10
|
+
"@vyr/locale": "0.0.1",
|
|
11
|
+
"@vyr/declare": "0.0.1",
|
|
12
|
+
"@vyr/engine": "0.0.1",
|
|
13
|
+
"@vyr/remote": "0.0.1",
|
|
14
|
+
"@vyr/service": "0.0.1",
|
|
15
|
+
"@vyr/service-rpc": "0.0.1"
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"**/*.d.ts"
|
|
19
|
+
],
|
|
20
|
+
"types": "./index.d.ts",
|
|
21
|
+
"typings": "./index.d.ts"
|
|
22
|
+
}
|