@threenative/procedural-environment 0.1.7 → 0.1.9
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/README.md +62 -1
- package/dist/asset-library-client.js +12956 -0
- package/dist/asset-library.d.ts +36 -0
- package/dist/asset-library.js +13039 -0
- package/dist/index-CYazo00w.d.ts +335 -0
- package/dist/index.d.ts +1 -316
- package/dist/index.js +7 -1
- package/dist/stylized.d.ts +13 -3
- package/dist/stylized.js +4813 -334
- package/package.json +5 -3
- package/scans/credits.json +44 -0
- package/scans/toybox_backdrop-frost.webp +0 -0
- package/scans/toybox_backdrop-garden.webp +0 -0
- package/scans/toybox_backdrop-sand.webp +0 -0
- package/scans/toybox_flagstone-detail.webp +0 -0
- package/scans/toybox_flagstone-normal.webp +0 -0
- package/scans/toybox_metal-detail.webp +0 -0
- package/scans/toybox_metal-normal.webp +0 -0
- package/scans/toybox_planks-detail.webp +0 -0
- package/scans/toybox_planks-normal.webp +0 -0
- package/scans/toybox_rock-detail.webp +0 -0
- package/scans/toybox_rock-normal.webp +0 -0
- package/scans/toybox_slab-detail.webp +0 -0
- package/scans/toybox_slab-normal.webp +0 -0
- package/scans/toybox_soil-detail.webp +0 -0
- package/scans/toybox_soil-normal.webp +0 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { _ as __index_js } from './index-CYazo00w.js';
|
|
2
|
+
import { IncomingMessage, ServerResponse } from 'node:http';
|
|
3
|
+
|
|
4
|
+
type Package = typeof __index_js;
|
|
5
|
+
interface IProceduralEnvironmentSourceOptions {
|
|
6
|
+
/** The project root: bakes cache under `node_modules/.cache/`, saves land under `assets/`. */
|
|
7
|
+
readonly root: string;
|
|
8
|
+
/** Offer "Save to assets/" (copies a bake into `<root>/assets/procedural/<kind>/`). Default false. */
|
|
9
|
+
readonly save?: boolean;
|
|
10
|
+
/** Where bakes are written. Default `<root>/node_modules/.cache/tn-asset-library/procedural`. */
|
|
11
|
+
readonly cache?: string;
|
|
12
|
+
/** Loads the bake functions; the engine's own library re-imports a rebuilt `dist` through it. */
|
|
13
|
+
readonly load?: () => Promise<Package>;
|
|
14
|
+
/** The browser client module; default this package's prebuilt `asset-library-client.js`. */
|
|
15
|
+
readonly client?: string;
|
|
16
|
+
}
|
|
17
|
+
/** The shape `createAssetLibraryPlugin({ sources })` takes; structural, so no create-threenative import. */
|
|
18
|
+
interface IProceduralSource {
|
|
19
|
+
readonly id: "procedural";
|
|
20
|
+
readonly client: string;
|
|
21
|
+
catalog(): Promise<unknown>;
|
|
22
|
+
handle(route: string, url: URL, req: IncomingMessage, res: ServerResponse): Promise<boolean>;
|
|
23
|
+
/** Drops every cached bake (the engine library calls it when `dist` is rebuilt). */
|
|
24
|
+
reset(): Promise<void>;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* This package's bake catalog as a source of the shared Asset Library (`/__assets/` in a kit).
|
|
28
|
+
*
|
|
29
|
+
* @situation browse and bake procedural trees, rocks, cliffs and city modules in the asset library of a game
|
|
30
|
+
* @situation save a procedural bake into the game's assets folder from the asset library
|
|
31
|
+
* @requires npm i -D @threenative/procedural-environment
|
|
32
|
+
* @example createAssetLibraryPlugin({ sources: [proceduralEnvironmentSource({ root, save: true })] })
|
|
33
|
+
*/
|
|
34
|
+
declare function proceduralEnvironmentSource(options: IProceduralEnvironmentSourceOptions): IProceduralSource;
|
|
35
|
+
|
|
36
|
+
export { type IProceduralEnvironmentSourceOptions, type IProceduralSource, proceduralEnvironmentSource };
|