ecspresso 0.14.9 → 0.14.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.
- package/dist/command-buffer.d.ts +6 -2
- package/dist/ecspresso.d.ts +61 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/index.js.map +6 -6
- package/dist/plugin.d.ts +8 -2
- package/package.json +1 -1
package/dist/plugin.d.ts
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import type ECSpresso from './ecspresso';
|
|
2
2
|
import type { SystemPhase } from './types';
|
|
3
3
|
import type { WorldConfig, EmptyConfig, MergeConfigs, WithComponents, WithEvents, WithResources, WithAssets, WithScreens } from './type-utils';
|
|
4
|
+
/**
|
|
5
|
+
* Registrar passed as the second argument to a plugin's `install` function.
|
|
6
|
+
* Each registered disposer runs (in reverse order) when the plugin is
|
|
7
|
+
* uninstalled via `world.uninstallPlugin(id)` or when `world.dispose()` is called.
|
|
8
|
+
*/
|
|
9
|
+
export type PluginCleanupRegistrar = (fn: () => void) => void;
|
|
4
10
|
/**
|
|
5
11
|
* Plugin interface for ECSpresso. A plugin is a plain object with an `install`
|
|
6
12
|
* function that configures a world directly, plus phantom properties for
|
|
@@ -11,7 +17,7 @@ import type { WorldConfig, EmptyConfig, MergeConfigs, WithComponents, WithEvents
|
|
|
11
17
|
*/
|
|
12
18
|
export interface Plugin<Cfg extends WorldConfig = EmptyConfig, Requires extends WorldConfig = EmptyConfig, Labels extends string = never, Groups extends string = never, AssetGroupNames extends string = never, ReactiveQueryNames extends string = never> {
|
|
13
19
|
readonly id: string;
|
|
14
|
-
readonly install: (world: ECSpresso<MergeConfigs<Cfg, Requires
|
|
20
|
+
readonly install: (world: ECSpresso<MergeConfigs<Cfg, Requires>>, onCleanup: PluginCleanupRegistrar) => void;
|
|
15
21
|
readonly _cfg?: Cfg;
|
|
16
22
|
readonly _requires?: Requires;
|
|
17
23
|
readonly _labels?: Labels;
|
|
@@ -111,7 +117,7 @@ export declare class PluginBuilder<Cfg extends WorldConfig = EmptyConfig, Requir
|
|
|
111
117
|
* `ECSpresso<MergeConfigs<Cfg, Requires>>` — meaning it can use both the
|
|
112
118
|
* types this plugin provides and the types it declared via `.requires<>()`.
|
|
113
119
|
*/
|
|
114
|
-
install(install: (world: ECSpresso<MergeConfigs<Cfg, Requires
|
|
120
|
+
install(install: (world: ECSpresso<MergeConfigs<Cfg, Requires>>, onCleanup: PluginCleanupRegistrar) => void): Plugin<Cfg, Requires, Labels, Groups, AssetGroupNames, ReactiveQueryNames>;
|
|
115
121
|
}
|
|
116
122
|
/**
|
|
117
123
|
* Entry point for the fluent plugin builder. Pass the plugin id and chain
|