@mavonengine/editor 0.0.8 → 0.0.10

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.
Files changed (48) hide show
  1. package/dist/Editor/Network/NetworkOverlay.d.ts +54 -0
  2. package/dist/Editor/Network/SyncStore.d.ts +22 -0
  3. package/dist/Editor/Network/serverApi.d.ts +14 -0
  4. package/dist/Editor/Plugins/pluginsApi.d.ts +49 -0
  5. package/dist/Editor/Server/routesApi.d.ts +23 -0
  6. package/dist/Editor/UI/ActivityBar.d.ts +6 -1
  7. package/dist/Editor/UI/Assets/AssetStats.d.ts +3 -3
  8. package/dist/Editor/UI/Assets/Assets.d.ts +1 -1
  9. package/dist/Editor/UI/Assets/AudioPlayer.d.ts +1 -1
  10. package/dist/Editor/UI/Assets/ModelViewer.d.ts +3 -3
  11. package/dist/Editor/UI/Assets/ParticleViewer.d.ts +3 -3
  12. package/dist/Editor/UI/Assets/TextureViewer.d.ts +3 -3
  13. package/dist/Editor/UI/CanvasPanel.d.ts +1 -1
  14. package/dist/Editor/UI/CanvasToolbar.d.ts +1 -1
  15. package/dist/Editor/UI/Controllers/ControllerDebug.d.ts +1 -0
  16. package/dist/Editor/UI/Controllers/GamepadDiagram.d.ts +5 -0
  17. package/dist/Editor/UI/Controllers/useGamepads.d.ts +6 -0
  18. package/dist/Editor/UI/DockArea.d.ts +17 -0
  19. package/dist/Editor/UI/Editor.d.ts +1 -1
  20. package/dist/Editor/UI/Network/NetworkPanel.d.ts +5 -0
  21. package/dist/Editor/UI/Network/Timeline.d.ts +14 -0
  22. package/dist/Editor/UI/Network/format.d.ts +14 -0
  23. package/dist/Editor/UI/Network/useRecords.d.ts +13 -0
  24. package/dist/Editor/UI/PanelHeader.d.ts +1 -1
  25. package/dist/Editor/UI/Plugins/InstallDialog.d.ts +22 -0
  26. package/dist/Editor/UI/Plugins/Markdown.d.ts +3 -0
  27. package/dist/Editor/UI/Plugins/PluginsPanel.d.ts +8 -0
  28. package/dist/Editor/UI/PropertiesPanel.d.ts +1 -1
  29. package/dist/Editor/UI/SceneExplorer.d.ts +1 -1
  30. package/dist/Editor/UI/ScenePanel.d.ts +1 -0
  31. package/dist/Editor/UI/Server/ServerPanel.d.ts +9 -0
  32. package/dist/Editor/UI/ShadeModeButtons.d.ts +1 -1
  33. package/dist/Editor/UI/StatusBar.d.ts +1 -1
  34. package/dist/Editor/UI/TabBar.d.ts +1 -1
  35. package/dist/Editor/UI/Window.d.ts +1 -1
  36. package/dist/Editor/builtinPrefabs.d.ts +4 -0
  37. package/dist/Editor/demoScene.d.ts +7 -0
  38. package/dist/Editor/panels.d.ts +22 -0
  39. package/dist/Editor/recordPrefabUsage.d.ts +7 -0
  40. package/dist/Editor.css +2 -1
  41. package/dist/Editor.d.ts +29 -2
  42. package/dist/Editor.mjs +1815 -9
  43. package/dist/global-l94NfB94.mjs +22 -0
  44. package/dist/mount-BfaV9yI_.mjs +37038 -0
  45. package/dist/panels-DFsnKBKK.mjs +75 -0
  46. package/package.json +12 -12
  47. package/dist/Editor-CUEoQ8jG.mjs +0 -1352
  48. package/dist/mount-Da8g-2BI.mjs +0 -40805
@@ -0,0 +1,54 @@
1
+ import type { ServerEntityView } from '@mavonengine/core/Networking/Client/NetworkManager';
2
+ import type { SyncSnapshot } from '@mavonengine/core/Networking/Debug/sync';
3
+ import EventEmitter from '@mavonengine/core/Utils/EventEmitter';
4
+ import { Group } from 'three';
5
+ import SyncStore from './SyncStore';
6
+ export interface NetworkOverlayOptions {
7
+ /** A wireframe box per networked entity, where the server last said it is */
8
+ ghosts: boolean;
9
+ /** A ring around each player at the server's sync distance */
10
+ rings: boolean;
11
+ /** Colour the ghosts by what this player is sent, instead of by what any player is */
12
+ viewAs: string | null;
13
+ }
14
+ export type GhostState = 'synced' | 'stale' | 'untracked';
15
+ export declare const GHOST_COLORS: Record<GhostState, number>;
16
+ /**
17
+ * How a ghost is coloured: by the server's sync when it is known, otherwise by what this client last received.
18
+ */
19
+ export declare function ghostState(view: ServerEntityView, newestTick: number | null, sync?: SyncSnapshot, viewAs?: string | null): GhostState;
20
+ /**
21
+ * Draws the network state into the editor's viewport: where the server says each entity is (ghosts)
22
+ * and how far each player's state sync reaches (rings).
23
+ *
24
+ * Triggers `changed` when its options change.
25
+ */
26
+ export default class NetworkOverlay extends EventEmitter {
27
+ readonly sync: SyncStore;
28
+ readonly group: Group<import("three").Object3DEventMap>;
29
+ private _options;
30
+ private ghosts;
31
+ private rings;
32
+ private unsubscribe?;
33
+ private boxGeometry;
34
+ private ringGeometry;
35
+ private materials;
36
+ private errorMaterial;
37
+ private ringMaterial;
38
+ private ringSelectedMaterial;
39
+ constructor(sync?: SyncStore, options?: NetworkOverlayOptions);
40
+ get options(): Readonly<NetworkOverlayOptions>;
41
+ setOptions(options: Partial<NetworkOverlayOptions>): void;
42
+ private get active();
43
+ private applyOptions;
44
+ update(): void;
45
+ private updateGhosts;
46
+ private createGhost;
47
+ private updateRings;
48
+ /** How many ghosts and rings are drawn */
49
+ get counts(): {
50
+ ghosts: number;
51
+ rings: number;
52
+ };
53
+ dispose(): void;
54
+ }
@@ -0,0 +1,22 @@
1
+ import type { SyncSnapshot } from '@mavonengine/core/Networking/Debug/sync';
2
+ export interface SyncState {
3
+ /** The server's state sync, undefined until the first answer or after a failed one */
4
+ sync?: SyncSnapshot;
5
+ error?: string;
6
+ }
7
+ /**
8
+ * The server's state sync, asked for a few times a second while something listens: the sync overlay or the Network panel.
9
+ */
10
+ export default class SyncStore {
11
+ private intervalMs;
12
+ private load;
13
+ private state;
14
+ private listeners;
15
+ private timer?;
16
+ private loading;
17
+ constructor(intervalMs?: number, load?: () => Promise<SyncSnapshot>);
18
+ /** Stable until the next answer, for `useSyncExternalStore` */
19
+ get: () => SyncState;
20
+ subscribe: (listener: () => void) => (() => void);
21
+ refresh(): Promise<void>;
22
+ }
@@ -0,0 +1,14 @@
1
+ import type { NetRecordDetail, NetRecordList, NetRecordQuery } from '@mavonengine/core/Networking/Debug/NetRecorder';
2
+ import type { SyncSnapshot } from '@mavonengine/core/Networking/Debug/sync';
3
+ /**
4
+ * The game server's network debug endpoints (GET /api/game/dev/net/*), read by the editor.
5
+ *
6
+ * They are asked on the page's own origin, which is where the game server serves the client in dev.
7
+ * For a client served elsewhere, put the server's URL in `localStorage['mavonengine:server-url']`;
8
+ * the server then has to allow that origin (CORS).
9
+ */
10
+ export declare const SERVER_URL_KEY = "mavonengine:server-url";
11
+ export declare function serverUrl(): string;
12
+ export declare function fetchSync(fetchFn?: typeof fetch): Promise<SyncSnapshot>;
13
+ export declare function fetchPackets(query: NetRecordQuery, fetchFn?: typeof fetch): Promise<NetRecordList>;
14
+ export declare function fetchPacket(id: number, fetchFn?: typeof fetch): Promise<NetRecordDetail | null>;
@@ -0,0 +1,49 @@
1
+ import type { InstallJob, InstallStatus } from '@mavonengine/core/Plugins/install';
2
+ import type { AvailablePlugin } from '@mavonengine/core/Plugins/registry';
3
+ import type { PluginInfo, PluginInfoList } from '@mavonengine/core/Plugins/types';
4
+ export type { AvailablePlugin, InstallJob, InstallStatus, PluginInfo, PluginInfoList };
5
+ /** Put a URL here in localStorage to read the list of available plugins from a fork or a branch */
6
+ export declare const PLUGINS_URL_KEY = "mavonengine:plugins-url";
7
+ export declare function registryUrl(): string;
8
+ /**
9
+ * The plugins that can be installed and the project doesn't have yet: plugins.json on the main branch of the
10
+ * MavonEngine repository, read from GitHub by the browser.
11
+ */
12
+ export declare function fetchAvailablePlugins(installed: PluginInfo[], fetchFn?: typeof fetch): Promise<AvailablePlugin[]>;
13
+ /**
14
+ * The plugins in the project's mavonengine.json, as the dev server describes them: version, readme, prefabs.
15
+ * Asked on the page's own origin, which the Vite dev server with `mavonEnginePlugins()` answers.
16
+ */
17
+ export declare function fetchPlugins(fetchFn?: typeof fetch): Promise<PluginInfoList>;
18
+ export interface PluginPrefab {
19
+ name: string;
20
+ /** Shown in the editor's asset list, when the plugin registered the prefab in this session */
21
+ label?: string;
22
+ /** Registered by the plugin's client entry right now, so it can be placed */
23
+ registered: boolean;
24
+ /** Listed under the plugin's `prefabs` in mavonengine.json: its assets ship in a release */
25
+ used: boolean;
26
+ }
27
+ /**
28
+ * The prefabs of a plugin: the ones it registered in the running editor, plus the ones its manifest or
29
+ * the project's mavonengine.json name
30
+ */
31
+ export declare function pluginPrefabs(plugin: PluginInfo, registered: {
32
+ name: string;
33
+ label?: string;
34
+ plugin?: string;
35
+ }[]): PluginPrefab[];
36
+ /**
37
+ * The README of a plugin that isn't installed, read from the URL the list gives for it
38
+ */
39
+ export declare function fetchAvailableReadme(plugin: AvailablePlugin, fetchFn?: typeof fetch): Promise<string>;
40
+ /**
41
+ * Whether packages can be installed from the editor, and how the running or last install goes.
42
+ * Never throws: a dev server that can't be asked can't install either.
43
+ */
44
+ export declare function fetchInstallStatus(fetchFn?: typeof fetch): Promise<InstallStatus>;
45
+ /**
46
+ * Ask the dev server to install `packages`. It hands that to `mavonengine dev`, which installs them, adds the
47
+ * plugins among them to mavonengine.json and restarts the dev servers. Resolves once the install has started.
48
+ */
49
+ export declare function startInstall(packages: string[], fetchFn?: typeof fetch): Promise<InstallJob>;
@@ -0,0 +1,23 @@
1
+ import type { HttpRouteInfo } from '@mavonengine/core/Networking/Server/Http/RouteInfo';
2
+ export type { HttpRouteInfo };
3
+ /**
4
+ * The game server's list of HTTP endpoints (GET /api/game/routes), read by the editor's Server panel.
5
+ *
6
+ * It is asked on the page's own origin, which is where the game server serves the client in dev.
7
+ * For a client served elsewhere, put the server's URL in `localStorage['mavonengine:server-url']`;
8
+ * the server then has to allow that origin (CORS).
9
+ */
10
+ export declare const SERVER_URL_KEY = "mavonengine:server-url";
11
+ export declare function serverUrl(): string;
12
+ export declare function fetchRoutes(fetchFn?: typeof fetch): Promise<HttpRouteInfo[]>;
13
+ export interface RouteGroup {
14
+ /** `engine`, `game` or the plugin's package */
15
+ id: string;
16
+ /** `Engine`, `Game` or the plugin's package, as shown in the From column */
17
+ from: string;
18
+ routes: HttpRouteInfo[];
19
+ }
20
+ /**
21
+ * Routes by who registered them: the game's own first, then each plugin, the engine's last
22
+ */
23
+ export declare function groupRoutes(routes: HttpRouteInfo[]): RouteGroup[];
@@ -1 +1,6 @@
1
- export default function ActivityBar(): import("react/jsx-runtime").JSX.Element;
1
+ /** What the editor shows next to the activity bar: the scene editor itself, or a view that takes its place */
2
+ export type Activity = 'scene' | 'server' | 'plugins';
3
+ export default function ActivityBar({ active, onSelect }: {
4
+ active: Activity;
5
+ onSelect(activity: Activity): void;
6
+ }): import("react").JSX.Element;
@@ -2,7 +2,7 @@ interface Stat {
2
2
  label: string;
3
3
  value: string;
4
4
  }
5
- declare const _default: ({ stats }: {
6
- stats: Stat[];
7
- }) => import("react/jsx-runtime").JSX.Element;
8
5
  export default _default;
6
+ declare function _default({ stats }: {
7
+ stats: Stat[];
8
+ }): import("react").JSX.Element;
@@ -1,2 +1,2 @@
1
- declare const _default: () => import("react/jsx-runtime").JSX.Element;
2
1
  export default _default;
2
+ declare function _default(): import("react").JSX.Element;
@@ -1,5 +1,5 @@
1
1
  interface Props {
2
2
  buffer: AudioBuffer;
3
3
  }
4
- declare const _default: ({ buffer }: Props) => import("react/jsx-runtime").JSX.Element;
5
4
  export default _default;
5
+ declare function _default({ buffer }: Props): import("react").JSX.Element;
@@ -1,6 +1,6 @@
1
1
  import type { AnimationClip, Object3D } from 'three';
2
- declare const _default: ({ model, animations }: {
2
+ export default _default;
3
+ declare function _default({ model, animations }: {
3
4
  model: Object3D;
4
5
  animations?: AnimationClip[];
5
- }) => import("react/jsx-runtime").JSX.Element;
6
- export default _default;
6
+ }): import("react").JSX.Element;
@@ -1,4 +1,4 @@
1
- declare const _default: ({ particleName }: {
2
- particleName: string;
3
- }) => import("react/jsx-runtime").JSX.Element;
4
1
  export default _default;
2
+ declare function _default({ particleName }: {
3
+ particleName: string;
4
+ }): import("react").JSX.Element;
@@ -1,7 +1,7 @@
1
1
  import type { CubeTexture, Texture } from 'three';
2
2
  export type RawImage = HTMLImageElement | HTMLCanvasElement | ImageBitmap;
3
3
  export declare function getTextureUrl(texture: Texture<RawImage> | CubeTexture<HTMLImageElement>): string;
4
- declare const _default: ({ texture }: {
5
- texture: Texture<RawImage> | CubeTexture<HTMLImageElement>;
6
- }) => import("react/jsx-runtime").JSX.Element;
7
4
  export default _default;
5
+ declare function _default({ texture }: {
6
+ texture: Texture<RawImage> | CubeTexture<HTMLImageElement>;
7
+ }): import("react").JSX.Element;
@@ -1,2 +1,2 @@
1
- declare const _default: () => import("react/jsx-runtime").JSX.Element;
2
1
  export default _default;
2
+ declare function _default(): import("react").JSX.Element;
@@ -4,4 +4,4 @@ export declare const SHADE_MODES: {
4
4
  label: string;
5
5
  paths: string[];
6
6
  }[];
7
- export default function CanvasToolbar(): import("react/jsx-runtime").JSX.Element;
7
+ export default function CanvasToolbar(): import("react").JSX.Element;
@@ -0,0 +1 @@
1
+ export default function ControllerDebug(): import("react").JSX.Element;
@@ -0,0 +1,5 @@
1
+ import type { GamepadState } from '@mavonengine/core/GamepadManager';
2
+ export default function GamepadDiagram({ gamepad, deadzone }: {
3
+ gamepad: GamepadState;
4
+ deadzone: number;
5
+ }): import("react").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import type { GamepadState } from '@mavonengine/core/GamepadManager';
2
+ /**
3
+ * Connected controllers from the running game.
4
+ * Re-renders on connect / disconnect, and every animation frame when `live` is set.
5
+ */
6
+ export declare function useGamepads(live?: boolean): GamepadState[];
@@ -0,0 +1,17 @@
1
+ import type { EditorPanelLocation } from '@mavonengine/core/Types/IEditor';
2
+ import type { ReactNode } from 'react';
3
+ export interface BuiltinPanel {
4
+ id: string;
5
+ title: string;
6
+ element: ReactNode;
7
+ /** Wrap in the padded, scrolling panel body. Default true */
8
+ padded?: boolean;
9
+ }
10
+ /**
11
+ * One dock of the editor (left, bottom or right): its built-in panels and the custom ones registered for it, as tabs.
12
+ * Built-in panels stay mounted while hidden so they keep their state; custom panels mount when their tab is shown.
13
+ */
14
+ export default function DockArea({ location, builtins }: {
15
+ location: EditorPanelLocation;
16
+ builtins: BuiltinPanel[];
17
+ }): import("react").JSX.Element;
@@ -1,3 +1,3 @@
1
1
  import './global.css';
2
- declare function Editor(): import("react/jsx-runtime").JSX.Element;
2
+ declare function Editor(): import("react").JSX.Element;
3
3
  export default Editor;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * The editor's Network panel: packets and network events of the server or of this tab, a timeline of them,
3
+ * the server's state sync, and the switches of the viewport overlay.
4
+ */
5
+ export default function NetworkPanel(): import("react").JSX.Element;
@@ -0,0 +1,14 @@
1
+ import type { NetRecord } from '@mavonengine/core/Networking/Debug/NetRecorder';
2
+ declare const LANES: readonly ['out', 'in', 'event'];
3
+ export declare function laneOf(record: NetRecord): typeof LANES[number];
4
+ /**
5
+ * The last `windowMs` of traffic as marks on three lanes: sent, received and events. Taller marks are larger packets.
6
+ * While `live` the newest moment sits at the right edge and the marks scroll; paused it ends at the last record.
7
+ */
8
+ export default function Timeline({ records, selectedId, live, windowMs }: {
9
+ records: NetRecord[];
10
+ selectedId?: number;
11
+ live: boolean;
12
+ windowMs?: number;
13
+ }): import("react").JSX.Element;
14
+ export {};
@@ -0,0 +1,14 @@
1
+ import type { NetRecord } from '@mavonengine/core/Networking/Debug/NetRecorder';
2
+ export declare function formatBytes(bytes: number | undefined): string;
3
+ /** Local time with milliseconds, e.g. 14:02:11.123 */
4
+ export declare function formatTime(timestamp: number): string;
5
+ /** The facts of a record in one line: tick, sequence id and what `info` holds */
6
+ export declare function describeRecord(record: NetRecord): string;
7
+ export interface RecordFilter {
8
+ kind: 'all' | 'packet' | 'event';
9
+ /** ping / pong: one pair a second per client */
10
+ pings: boolean;
11
+ /** Part of the message name or the peer, case-insensitive */
12
+ text: string;
13
+ }
14
+ export declare function filterRecords(records: NetRecord[], { kind, pings, text }: RecordFilter): NetRecord[];
@@ -0,0 +1,13 @@
1
+ import type { NetRecord, NetRecordDetail } from '@mavonengine/core/Networking/Debug/NetRecorder';
2
+ /** Whose records are shown: everything the server sent and received, or only this tab's own traffic */
3
+ export type RecordSource = 'server' | 'client';
4
+ /**
5
+ * The newest records of one side, oldest first, kept up to date while not paused
6
+ */
7
+ export declare function useRecords(source: RecordSource, paused: boolean): {
8
+ records: NetRecord[];
9
+ error: string | undefined;
10
+ clear: () => void;
11
+ };
12
+ /** One record with its payload, undefined while it loads or when nothing is selected */
13
+ export declare function useRecordDetail(source: RecordSource, id: number | undefined): NetRecordDetail | null | undefined;
@@ -1,3 +1,3 @@
1
1
  export default function PanelHeader({ title }: {
2
2
  title: string;
3
- }): import("react/jsx-runtime").JSX.Element;
3
+ }): import("react").JSX.Element;
@@ -0,0 +1,22 @@
1
+ /** How often the install is asked about while it runs */
2
+ export declare const INSTALL_POLL_MS = 1000;
3
+ export interface InstallRequest {
4
+ /** What is handed to the package manager: names, name@version, file: paths, URLs */
5
+ packages: string[];
6
+ /** Where the source can be looked at, when the list of plugins says */
7
+ homepage?: string;
8
+ }
9
+ /** Where to look at what `spec` installs: the list's homepage, the URL itself, or its page on npm */
10
+ export declare function sourceOf(spec: string, homepage?: string): string | undefined;
11
+ /**
12
+ * Asks before anything is installed, then shows how the install goes.
13
+ *
14
+ * A package runs its own code on the machine, when it is installed and whenever the game runs, and nothing
15
+ * checks what it does. So the dialog says so, points at the source and only installs once the person
16
+ * has ticked that they looked at it.
17
+ */
18
+ export default function InstallDialog({ request, onClose, fetchFn }: {
19
+ request: InstallRequest;
20
+ onClose(): void;
21
+ fetchFn?: typeof fetch;
22
+ }): import("react").JSX.Element;
@@ -0,0 +1,3 @@
1
+ export default function Markdown({ source }: {
2
+ source: string;
3
+ }): import("react").JSX.Element;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * The plugins in the project's mavonengine.json: what each is, and which HTTP endpoints and prefabs come from it.
3
+ * Plugin details come from the dev server, endpoints from the game server, prefabs from the running editor.
4
+ * Below them, the plugins that can be installed: the public list on GitHub, without the ones the project has.
5
+ */
6
+ export default function PluginsPanel({ fetchFn }: {
7
+ fetchFn?: typeof fetch;
8
+ }): import("react").JSX.Element;
@@ -1 +1 @@
1
- export default function PropertiesPanel(): import("react/jsx-runtime").JSX.Element;
1
+ export default function PropertiesPanel(): import("react").JSX.Element;
@@ -1 +1 @@
1
- export default function SceneExplorer(): import("react/jsx-runtime").JSX.Element;
1
+ export default function SceneExplorer(): import("react").JSX.Element;
@@ -0,0 +1 @@
1
+ export default function ScenePanel(): import("react").JSX.Element;
@@ -0,0 +1,9 @@
1
+ /** How often the list is read again while the panel is shown */
2
+ export declare const ROUTES_REFRESH_MS = 5000;
3
+ /**
4
+ * The game server's HTTP endpoints: the engine's, the game's own and those of plugins.
5
+ * Read from the running server, so it shows what the server answers right now.
6
+ */
7
+ export default function ServerPanel({ fetchFn }: {
8
+ fetchFn?: typeof fetch;
9
+ }): import("react").JSX.Element;
@@ -6,5 +6,5 @@ interface Props {
6
6
  activeClass: string;
7
7
  size?: number;
8
8
  }
9
- export default function ShadeModeButtons({ shadeMode, onChange, btnClass, activeClass, size }: Props): import("react/jsx-runtime").JSX.Element;
9
+ export default function ShadeModeButtons({ shadeMode, onChange, btnClass, activeClass, size }: Props): import("react").JSX.Element;
10
10
  export {};
@@ -1 +1 @@
1
- export default function StatusBar(): import("react/jsx-runtime").JSX.Element;
1
+ export default function StatusBar(): import("react").JSX.Element;
@@ -1 +1 @@
1
- export default function TabBar(): import("react/jsx-runtime").JSX.Element;
1
+ export default function TabBar(): import("react").JSX.Element;
@@ -11,5 +11,5 @@ interface Props {
11
11
  storageKey?: string;
12
12
  onClose(): void;
13
13
  }
14
- declare const _default: ({ title, children, defaultX, defaultY, defaultWidth, defaultHeight, minWidth, minHeight, storageKey, onClose }: Props) => import("react").ReactPortal;
15
14
  export default _default;
15
+ declare function _default({ title, children, defaultX, defaultY, defaultWidth, defaultHeight, minWidth, minHeight, storageKey, onClose }: Props): import("react").ReactPortal;
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Register the prefabs that come with the engine. Plugins add theirs with `ctx.registerPrefab()`.
3
+ */
4
+ export declare function registerBuiltinPrefabs(): void;
@@ -0,0 +1,7 @@
1
+ import type { SceneData } from '@mavonengine/core/Scene/types';
2
+ /** The scene the editor opens and saves when the game loaded none */
3
+ export declare const DEFAULT_SCENE_NAME = "main";
4
+ /**
5
+ * Some shapes on a ground plane, to have something to look at in a new project
6
+ */
7
+ export declare function demoScene(): SceneData;
@@ -0,0 +1,22 @@
1
+ import type { EditorPanel, EditorPanelLocation } from '@mavonengine/core/Types/IEditor';
2
+ import type IEditor from '@mavonengine/core/Types/IEditor';
3
+ import type { ComponentType } from 'react';
4
+ export type { EditorPanelLocation };
5
+ /**
6
+ * A panel for the editor. Same as core's `EditorPanel`, with `component` typed as a React component.
7
+ */
8
+ export interface EditorPanelDefinition extends Omit<EditorPanel, 'component'> {
9
+ component?: ComponentType<{
10
+ editor: IEditor;
11
+ }>;
12
+ }
13
+ /**
14
+ * Dock a panel in the editor. Works before the editor boots too, e.g. next to `Editor.registerListener()`.
15
+ * Returns a function that removes it again.
16
+ */
17
+ export declare function registerEditorPanel(panel: EditorPanelDefinition | EditorPanel): () => void;
18
+ export declare function unregisterEditorPanel(id: string): void;
19
+ /** Every registered panel, for `useSyncExternalStore` */
20
+ export declare function getEditorPanels(): EditorPanelDefinition[];
21
+ export declare function subscribeEditorPanels(listener: () => void): () => void;
22
+ export declare function panelsAt(all: EditorPanelDefinition[], location: EditorPanelLocation): EditorPanelDefinition[];
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Tell the dev server that the project uses a plugin prefab, so its assets ship in the release.
3
+ * The server adds it to the plugin's `prefabs` in mavonengine.json. Sent once per prefab per session.
4
+ */
5
+ export declare function recordPrefabUsage(plugin: string, prefab: string, fetchFn?: typeof fetch): Promise<void>;
6
+ /** For tests */
7
+ export declare function resetRecordedPrefabs(): void;