@tomorrowevening/hermes 0.0.42 → 0.0.43

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/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  "module": "./dist/hermes.esm.js",
8
8
  "types": "./types/index.d.ts",
9
9
  "type": "module",
10
- "version": "0.0.42",
10
+ "version": "0.0.43",
11
11
  "homepage": "https://github.com/tomorrowevening/hermes#readme",
12
12
  "bugs": {
13
13
  "url": "https://github.com/tomorrowevening/hermes/issues"
@@ -76,6 +76,7 @@
76
76
  "tweakpane": "^4.0.0",
77
77
  "typescript": "^5.0.2",
78
78
  "vite": "^4.4.5",
79
+ "vite-plugin-glsl": "^1.2.1",
79
80
  "ws": "^8.16.0"
80
81
  }
81
82
  }
@@ -10,7 +10,6 @@ export default class Application {
10
10
  protected _connected: boolean;
11
11
  protected _useBC: boolean;
12
12
  constructor(id: string, debugEnabled: boolean, useBC?: boolean);
13
- init(): Promise<void>;
14
13
  addComponent(name: string, component: BaseRemote): void;
15
14
  dispose(): void;
16
15
  send(data: BroadcastData): void;
@@ -1,2 +1,18 @@
1
1
  import Application from './Application';
2
- export default function RemoteController(app: Application): void;
2
+ import type { BroadcastData } from './types';
3
+ export type RemoteCallback = (app: Application, remote: any, msg: BroadcastData) => void;
4
+ interface RemoteCall {
5
+ remote: any;
6
+ callback: RemoteCallback;
7
+ }
8
+ export default class RemoteController {
9
+ appHandlers: RemoteCall[];
10
+ editorHandlers: RemoteCall[];
11
+ private _app;
12
+ private static _instance;
13
+ handleAppBroadcast: (msg: BroadcastData) => void;
14
+ handleEditorBroadcast: (msg: BroadcastData) => void;
15
+ set app(app: Application);
16
+ static get instance(): RemoteController;
17
+ }
18
+ export {};
@@ -1,9 +1,6 @@
1
1
  import Application from '../Application';
2
- import { BroadcastData } from '../types';
3
2
  export default class BaseRemote {
4
3
  app: Application;
5
4
  constructor(app: Application);
6
5
  dispose(): void;
7
- handleApp(_: BroadcastData): void;
8
- handleEditor(_: BroadcastData): void;
9
6
  }
@@ -1,7 +1,5 @@
1
1
  import BaseRemote from './BaseRemote';
2
- import { BroadcastData } from '../types';
3
2
  export default class RemoteComponents extends BaseRemote {
4
3
  selectDropdown(dropdown: string, value: any): void;
5
4
  updateDropdown(dropdown: string, list: string[]): void;
6
- handleApp(msg: BroadcastData): void;
7
5
  }
@@ -1,6 +1,6 @@
1
1
  import { IProject, IRafDriver, ISheet, ISheetObject } from '@theatre/core';
2
2
  import BaseRemote from './BaseRemote';
3
- import { BroadcastData, DataUpdateCallback, VoidCallback } from '../types';
3
+ import { DataUpdateCallback, VoidCallback } from '../types';
4
4
  export default class RemoteTheatre extends BaseRemote {
5
5
  project: IProject | undefined;
6
6
  sheets: Map<string, ISheet>;
@@ -16,6 +16,4 @@ export default class RemoteTheatre extends BaseRemote {
16
16
  clearSheetObjects(sheetName: string): void;
17
17
  sheetObject(sheetName: string, key: string, props: any, onUpdate?: DataUpdateCallback): ISheetObject | undefined;
18
18
  unsubscribe(sheetObject: ISheetObject): undefined;
19
- handleApp(msg: BroadcastData): void;
20
- handleEditor(msg: BroadcastData): void;
21
19
  }
@@ -1,6 +1,5 @@
1
1
  import { Camera, Scene } from 'three';
2
2
  import BaseRemote from './BaseRemote';
3
- import { BroadcastData } from '../types';
4
3
  export default class RemoteThree extends BaseRemote {
5
4
  scene?: Scene;
6
5
  getObject(uuid: string): void;
@@ -11,6 +10,4 @@ export default class RemoteThree extends BaseRemote {
11
10
  setScene(value: Scene): void;
12
11
  addCamera(camera: Camera): void;
13
12
  removeCamera(camera: Camera): void;
14
- handleApp(msg: BroadcastData): void;
15
- handleEditor(msg: BroadcastData): void;
16
13
  }
@@ -1,7 +1,7 @@
1
1
  import { Pane } from 'tweakpane';
2
2
  import Application from '../Application';
3
3
  import BaseRemote from './BaseRemote';
4
- import { BroadcastData, DataUpdateCallback, VoidCallback } from '../types';
4
+ import { DataUpdateCallback, VoidCallback } from '../types';
5
5
  export default class RemoteTweakpane extends BaseRemote {
6
6
  bindCBs: Map<string, DataUpdateCallback>;
7
7
  buttonCBs: Map<string, VoidCallback>;
@@ -20,5 +20,4 @@ export default class RemoteTweakpane extends BaseRemote {
20
20
  triggerButton(id: string): void;
21
21
  createInspector(): void;
22
22
  clearInspector(): void;
23
- handleApp(msg: BroadcastData): void;
24
23
  }
@@ -0,0 +1,4 @@
1
+ import Application from '../Application';
2
+ import RemoteComponents from './RemoteComponents';
3
+ import type { BroadcastData } from '../types';
4
+ export declare function componentsApp(app: Application, remote: RemoteComponents, msg: BroadcastData): void;
@@ -0,0 +1,5 @@
1
+ import Application from '../Application';
2
+ import RemoteTheatre from './RemoteTheatre';
3
+ import type { BroadcastData } from '../types';
4
+ export declare function theatreApp(app: Application, remote: RemoteTheatre, msg: BroadcastData): void;
5
+ export declare function theatreEditor(app: Application, remote: RemoteTheatre, msg: BroadcastData): void;
@@ -0,0 +1,5 @@
1
+ import Application from '../Application';
2
+ import RemoteThree from './RemoteThree';
3
+ import type { BroadcastData } from '../types';
4
+ export declare function threeApp(app: Application, remote: RemoteThree, msg: BroadcastData): void;
5
+ export declare function threeEditor(app: Application, remote: RemoteThree, msg: BroadcastData): void;
@@ -0,0 +1,4 @@
1
+ import Application from '../Application';
2
+ import RemoteTweakpane from './RemoteTweakpane';
3
+ import type { BroadcastData } from '../types';
4
+ export declare function tweakpaneApp(app: Application, remote: RemoteTweakpane, msg: BroadcastData): void;
package/types/index.d.ts CHANGED
@@ -4,6 +4,10 @@ export { default as Application } from './core/Application';
4
4
  export { debugDispatcher, ToolEvents } from './editor/global';
5
5
  export { default as BaseRemote } from './core/remote/BaseRemote';
6
6
  export { default as RemoteComponents } from './core/remote/RemoteComponents';
7
+ export * from './core/remote/componentsUtils';
8
+ export * from './core/remote/theatreUtils';
9
+ export * from './core/remote/threeUtils';
10
+ export * from './core/remote/tweakpaneUtils';
7
11
  export * from './editor/theatreUtils';
8
12
  export { default as RemoteTheatre } from './core/remote/RemoteTheatre';
9
13
  export { default as RemoteThree } from './core/remote/RemoteThree';