@threenative/core 0.3.4 → 0.3.5
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/capabilities.json +1505 -79
- package/dist/{audio-7i3Xl0l3.d.ts → audio-DIJE5HTr.d.ts} +43 -3
- package/dist/{canvas-layer-DDmC_VVF.d.ts → canvas-layer-C1-5CviZ.d.ts} +5 -1
- package/dist/{game-CljaDv4D.d.ts → game-Bj8G1wmD.d.ts} +102 -11
- package/dist/hot.d.ts +4 -4
- package/dist/index.d.ts +712 -118
- package/dist/index.js +12423 -4955
- package/dist/{gpu-readback-CqJEfWNQ.d.ts → model-lod-BDAUYgsS.d.ts} +80 -5
- package/dist/playtest.d.ts +6 -10
- package/dist/playtest.js +47 -24
- package/dist/react-css.d.ts +62 -0
- package/dist/react-css.js +591 -0
- package/dist/react.d.ts +2 -2
- package/dist/{renderer-CfsS2hxi.d.ts → renderer-9yEo9hPa.d.ts} +489 -22
- package/dist/terrain-jobs-worker.d.ts +2 -0
- package/dist/terrain-jobs-worker.js +130 -0
- package/dist/ui-layer.js +59 -8
- package/dist/world.d.ts +766 -73
- package/dist/world.js +9307 -3543
- package/gpl/recipes/export_world.py +18 -1
- package/mcp/blender-server.mjs +7 -4
- package/mcp/blender.mjs +3 -4
- package/mcp/engine-server.mjs +2 -2
- package/mcp/servers.mjs +4 -4
- package/package.json +15 -9
- package/patches/three@0.185.1-prd269-upgrade.patch +22418 -0
- package/patches/three@0.185.1.patch +6594 -700
- package/scripts/apply-three-patch.mjs +62 -4
- package/src/animation-blend.ts +264 -0
- package/src/animation-composition.ts +362 -0
- package/src/animation-layers.ts +260 -0
- package/src/animation-root-motion.ts +283 -0
- package/src/animation.ts +896 -0
- package/src/assets.ts +1303 -0
- package/src/atmosphere/index.ts +335 -0
- package/src/atmosphere/luts.ts +298 -0
- package/src/atmosphere/params.ts +323 -0
- package/src/audio.ts +912 -0
- package/src/billboard.ts +124 -0
- package/src/bone-lengths.ts +157 -0
- package/src/camera-shake.ts +116 -0
- package/src/canvas-layer.ts +47 -0
- package/src/clip-audit.ts +401 -0
- package/src/clustered-batch.ts +492 -0
- package/src/clustered-mesh.ts +638 -0
- package/src/compute-driven.ts +176 -0
- package/src/compute-timing.ts +318 -0
- package/src/config.ts +593 -0
- package/src/debug.ts +82 -0
- package/src/engine-render-hook.ts +25 -0
- package/src/entities.ts +79 -0
- package/src/entity-snapshot.ts +53 -0
- package/src/flight.ts +683 -0
- package/src/fluid-field.ts +748 -0
- package/src/fluid-particles.ts +1253 -0
- package/src/frame-budget.ts +1368 -0
- package/src/game.ts +2390 -0
- package/src/geometry-capture.ts +1098 -0
- package/src/gpu-class.ts +160 -0
- package/src/gpu-frame-observation.ts +424 -0
- package/src/gpu-readback.ts +143 -0
- package/src/gpu-scene-bvh.ts +464 -0
- package/src/grounding.ts +100 -0
- package/src/hot.ts +161 -0
- package/src/import-meta.d.ts +13 -0
- package/src/index.ts +1536 -0
- package/src/input.ts +690 -0
- package/src/instanced-batch-lod.ts +283 -0
- package/src/instanced-batch.ts +274 -0
- package/src/interpolation.ts +129 -0
- package/src/launch-diagnostics.ts +161 -0
- package/src/loop.ts +564 -0
- package/src/matrix-world.ts +245 -0
- package/src/merge-parts.ts +812 -0
- package/src/model-lod.ts +1315 -0
- package/src/net-protocol.ts +333 -0
- package/src/net-session.ts +477 -0
- package/src/net.ts +80 -0
- package/src/ocean/fft.ts +72 -0
- package/src/ocean/spectral.ts +728 -0
- package/src/particle-significance.ts +102 -0
- package/src/particles.ts +648 -0
- package/src/path-follow.ts +175 -0
- package/src/picking.ts +250 -0
- package/src/pipeline-census.ts +1566 -0
- package/src/platform.ts +210 -0
- package/src/playtest.ts +839 -0
- package/src/pointer-events.ts +411 -0
- package/src/pose-measure.ts +435 -0
- package/src/profiling/FrameCounters.ts +231 -0
- package/src/profiling/Spans.ts +548 -0
- package/src/profiling/opacity-convention.ts +21 -0
- package/src/profiling/render-list-validate.ts +175 -0
- package/src/profiling/render-trap-audit.ts +84 -0
- package/src/profiling/scene-warning.ts +190 -0
- package/src/profiling/span-probes.ts +191 -0
- package/src/profiling/unlit-foliage-warning.ts +149 -0
- package/src/projection-apply.ts +1529 -0
- package/src/projection-marker.ts +142 -0
- package/src/projection-plan.ts +1258 -0
- package/src/projection-skinned.ts +419 -0
- package/src/projection-stability.ts +409 -0
- package/src/projection-uniform.ts +328 -0
- package/src/random.ts +41 -0
- package/src/react-css.ts +604 -0
- package/src/react-glyphs.ts +114 -0
- package/src/react-host.ts +576 -0
- package/src/react-layout.ts +265 -0
- package/src/react.ts +60 -0
- package/src/render/alpha-antialiasing.ts +159 -0
- package/src/render/batched-velocity.ts +126 -0
- package/src/render/chain.ts +1021 -0
- package/src/render/daylight.ts +189 -0
- package/src/render/depth-pyramid.ts +596 -0
- package/src/render/foliage-alpha.ts +166 -0
- package/src/render/material-key.ts +60 -0
- package/src/render/mesh-pool.ts +144 -0
- package/src/render/probe-volume.ts +1668 -0
- package/src/render/resolution-subrect.ts +253 -0
- package/src/render/velocity.ts +442 -0
- package/src/render/virtual-shadow-pages.ts +827 -0
- package/src/render/virtual-shadow-partial.ts +174 -0
- package/src/render/virtual-shadow.ts +3330 -0
- package/src/render/world-impostor-surface.ts +722 -0
- package/src/render/world-impostor.ts +558 -0
- package/src/render-camera-cull.ts +441 -0
- package/src/render-pass-budget.ts +501 -0
- package/src/renderProjection.ts +758 -0
- package/src/renderer-config.ts +127 -0
- package/src/renderer.ts +1847 -0
- package/src/replay-protocol.ts +85 -0
- package/src/replay.ts +205 -0
- package/src/resolution-scaler.ts +819 -0
- package/src/rig-preparation.ts +271 -0
- package/src/ripple-field.ts +432 -0
- package/src/scale.ts +109 -0
- package/src/scene.ts +239 -0
- package/src/schedule.ts +155 -0
- package/src/skeletal-mesh.ts +61 -0
- package/src/skeleton.ts +100 -0
- package/src/snow-field.ts +744 -0
- package/src/softbody-topology.ts +269 -0
- package/src/softbody.ts +516 -0
- package/src/sprite-animator.ts +222 -0
- package/src/startup-readiness.ts +386 -0
- package/src/state.ts +66 -0
- package/src/static-transform.ts +274 -0
- package/src/storage-buffer.ts +253 -0
- package/src/streaming.ts +308 -0
- package/src/target-fps.ts +92 -0
- package/src/terrain-jobs-worker.ts +17 -0
- package/src/terrain-jobs.ts +353 -0
- package/src/textures.ts +39 -0
- package/src/tracers.ts +237 -0
- package/src/ui-bridge.ts +368 -0
- package/src/ui-hit-regions.ts +380 -0
- package/src/ui-layer.ts +83 -0
- package/src/ui-state.ts +220 -0
- package/src/version.ts +2 -0
- package/src/viewport.ts +253 -0
- package/src/warmup.ts +1357 -0
- package/src/water-surface.ts +384 -0
- package/src/wave-field.ts +524 -0
- package/src/world-capabilities.ts +131 -0
- package/src/world-cell-proxy.ts +392 -0
- package/src/world-cells.ts +10564 -0
- package/src/world-gpu-scene.ts +3354 -0
- package/src/world-heightmap.ts +82 -0
- package/src/world-package.ts +469 -0
- package/src/world-passes.ts +582 -0
- package/src/world-region.ts +17 -0
- package/src/world-terrain-splat.ts +564 -0
- package/src/world-tiles.ts +3826 -0
- package/src/world-topology.ts +370 -0
- package/src/world-validate.ts +48 -0
- package/src/world.ts +805 -0
package/src/grounding.ts
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { Matrix4, type Object3D, Vector3 } from "three";
|
|
2
|
+
import { measureThreePose, posedBounds } from "./pose-measure.js";
|
|
3
|
+
|
|
4
|
+
export interface IGroundSnapOptions {
|
|
5
|
+
/** Whether to apply the correction. Measurement and `clearance` continue when this is false. */
|
|
6
|
+
readonly enabled?: boolean;
|
|
7
|
+
/** Maximum correction speed in metres per second. Unset follows the authored pose exactly. */
|
|
8
|
+
readonly maxRate?: number;
|
|
9
|
+
/** Visual meshes to measure. Defaults to every mesh below `model`. */
|
|
10
|
+
readonly meshes?: readonly Object3D[];
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Keeps the lowest posed point of a rendered model on a surface.
|
|
15
|
+
*
|
|
16
|
+
* This is render grounding, not collider snap-to-ground. It uses a cached skin envelope so a
|
|
17
|
+
* frame loop never runs the precise per-vertex bounds path. `enabled` is deliberately a range:
|
|
18
|
+
* turning correction off still leaves `clearance` and `audit()` truthful.
|
|
19
|
+
*/
|
|
20
|
+
export class GroundSnap {
|
|
21
|
+
readonly model: Object3D;
|
|
22
|
+
readonly meshes: readonly Object3D[] | undefined;
|
|
23
|
+
enabled: boolean;
|
|
24
|
+
maxRate: number | undefined;
|
|
25
|
+
clearance: number | null = null;
|
|
26
|
+
private readonly parentInverse = new Matrix4();
|
|
27
|
+
private readonly parentOrigin = new Vector3();
|
|
28
|
+
private readonly parentTarget = new Vector3();
|
|
29
|
+
|
|
30
|
+
constructor(model: Object3D, options: IGroundSnapOptions = {}) {
|
|
31
|
+
this.model = model;
|
|
32
|
+
this.meshes = options.meshes;
|
|
33
|
+
this.enabled = options.enabled ?? true;
|
|
34
|
+
this.maxRate = options.maxRate;
|
|
35
|
+
validateMaxRate(this.maxRate);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/** Move `group` so its lowest posed point meets `surfaceY`, then report the real clearance. */
|
|
39
|
+
apply(group: Object3D, surfaceY: number, dt: number): void {
|
|
40
|
+
if (!Number.isFinite(surfaceY)) throw new Error("GroundSnap surfaceY must be finite.");
|
|
41
|
+
if (!Number.isFinite(dt) || dt < 0)
|
|
42
|
+
throw new Error("GroundSnap dt must be finite and non-negative.");
|
|
43
|
+
validateMaxRate(this.maxRate);
|
|
44
|
+
|
|
45
|
+
const before = posedBounds(this.model, this.meshes);
|
|
46
|
+
if (!Number.isFinite(before.min[1])) {
|
|
47
|
+
this.clearance = null;
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const desired = surfaceY - before.min[1];
|
|
52
|
+
const correction =
|
|
53
|
+
this.maxRate === undefined ? desired : clamp(desired, -this.maxRate * dt, this.maxRate * dt);
|
|
54
|
+
if (this.enabled) this.applyWorldCorrection(group, correction);
|
|
55
|
+
|
|
56
|
+
// Re-read after the move. The group may be under a scaled or rotated parent, so the local
|
|
57
|
+
// correction is not always one world metre for one local metre. posedBounds forces its own
|
|
58
|
+
// whole-subtree matrix pass, so no explicit update here — that was a second full pass per
|
|
59
|
+
// grounded character per frame buying nothing the measurement below does not redo.
|
|
60
|
+
const after = posedBounds(this.model, this.meshes);
|
|
61
|
+
this.clearance = after.min[1] - surfaceY;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
private applyWorldCorrection(group: Object3D, correction: number): void {
|
|
65
|
+
const parent = group.parent;
|
|
66
|
+
if (parent === null) {
|
|
67
|
+
group.position.y += correction;
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
parent.updateWorldMatrix(true, false);
|
|
72
|
+
this.parentInverse.copy(parent.matrixWorld).invert();
|
|
73
|
+
this.parentOrigin.set(0, 0, 0).applyMatrix4(this.parentInverse);
|
|
74
|
+
this.parentTarget.set(0, correction, 0).applyMatrix4(this.parentInverse);
|
|
75
|
+
group.position.add(this.parentTarget.sub(this.parentOrigin));
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Compare the cheap envelope's lower bound with a precise vertex measurement.
|
|
80
|
+
*
|
|
81
|
+
* This is intentionally opt-in: calling it in `apply()` would restore the frame-time defect
|
|
82
|
+
* this class exists to remove. A negative result means the envelope is below the precise skin.
|
|
83
|
+
*/
|
|
84
|
+
audit(): number | null {
|
|
85
|
+
const estimate = posedBounds(this.model, this.meshes);
|
|
86
|
+
const precise = measureThreePose(this.model, { bounds: this.meshes }).bounds;
|
|
87
|
+
if (precise === null || !Number.isFinite(estimate.min[1])) return null;
|
|
88
|
+
return estimate.min[1] - precise.min[1];
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
function validateMaxRate(maxRate: number | undefined): void {
|
|
93
|
+
if (maxRate !== undefined && (!Number.isFinite(maxRate) || maxRate < 0)) {
|
|
94
|
+
throw new Error("GroundSnap maxRate must be finite and non-negative.");
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
function clamp(value: number, min: number, max: number): number {
|
|
99
|
+
return Math.min(max, Math.max(min, value));
|
|
100
|
+
}
|
package/src/hot.ts
ADDED
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
/// <reference path="./import-meta.d.ts" />
|
|
2
|
+
|
|
3
|
+
import { audioRuntimeSnapshot } from "./audio.js";
|
|
4
|
+
import type { IGame } from "./game.js";
|
|
5
|
+
export interface IHotDiagnostics {
|
|
6
|
+
readonly reloads: number;
|
|
7
|
+
readonly entities: number;
|
|
8
|
+
readonly sceneObjects: number;
|
|
9
|
+
readonly canvases: number;
|
|
10
|
+
readonly audio: ReturnType<typeof audioRuntimeSnapshot>;
|
|
11
|
+
readonly physics: number | null;
|
|
12
|
+
}
|
|
13
|
+
type HotData = {
|
|
14
|
+
readonly state: Record<string, unknown>;
|
|
15
|
+
readonly reloads: number;
|
|
16
|
+
/** The scene the session was in. Absent for data written before scene resume existed. */
|
|
17
|
+
readonly sceneName?: string | undefined;
|
|
18
|
+
};
|
|
19
|
+
const isDev =
|
|
20
|
+
(import.meta as ImportMeta & { env?: Record<"DEV", boolean | undefined> }).env?.DEV === true;
|
|
21
|
+
/**
|
|
22
|
+
* Validate that hot-reload state can cross the Vite boundary.
|
|
23
|
+
* @situation preserve JSON-shaped state during hot reload
|
|
24
|
+
* @situation reject a non-portable game state before reload
|
|
25
|
+
* @constraint state must contain finite numbers and plain objects only
|
|
26
|
+
* @example assertPortableState(game.state.getState());
|
|
27
|
+
*/
|
|
28
|
+
export function assertPortableState(state: unknown): void {
|
|
29
|
+
visitPortable(state, "state", new Set<object>());
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Register hot-reload state preservation for a game.
|
|
33
|
+
* @situation keep game state while editing source in development
|
|
34
|
+
* @situation diagnose state shape changes during hot reload
|
|
35
|
+
* @constraint use only in the web development entry
|
|
36
|
+
* @example acceptHotUpdate(game, import.meta.hot);
|
|
37
|
+
*/
|
|
38
|
+
export function acceptHotUpdate<TState extends Record<string, unknown>, TPhysics>(
|
|
39
|
+
game: IGame<TState, TPhysics>,
|
|
40
|
+
hot: IImportMeta["hot"],
|
|
41
|
+
): void {
|
|
42
|
+
if (hot === undefined) return;
|
|
43
|
+
hot.accept();
|
|
44
|
+
const carried = hot.data.threenative as HotData | undefined;
|
|
45
|
+
const reloads = carried?.reloads ?? 0;
|
|
46
|
+
if (carried !== undefined) restoreState(game, carried.state);
|
|
47
|
+
// State alone was never enough. The update re-runs the game's entry module, which rebuilds the
|
|
48
|
+
// game and boots it at `config.start` — so a session that was playing came back holding its own
|
|
49
|
+
// state on the main menu, with every entity and its physics world gone, and the store insisting
|
|
50
|
+
// the screen was still "playing". Resuming the scene is what makes the restored state true.
|
|
51
|
+
if (carried?.sceneName !== undefined) {
|
|
52
|
+
try {
|
|
53
|
+
game.resumeScene(carried.sceneName);
|
|
54
|
+
} catch {
|
|
55
|
+
// A scene that no longer exists in the updated module is not a reason to lose the reload;
|
|
56
|
+
// the game boots at its start scene, which is what it would have done anyway.
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
if (isDev && typeof window !== "undefined") {
|
|
60
|
+
const host = window as unknown as Record<string, unknown> &
|
|
61
|
+
Partial<Record<"__THREENATIVE__", Record<string, unknown> & { hot?: () => IHotDiagnostics }>>;
|
|
62
|
+
host.__THREENATIVE__ = {
|
|
63
|
+
...host.__THREENATIVE__,
|
|
64
|
+
hot: () => diagnostics(game, reloads),
|
|
65
|
+
snapshot: host.__THREENATIVE__?.snapshot ?? (() => ({})),
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
let disposed = false;
|
|
69
|
+
hot.dispose((data) => {
|
|
70
|
+
if (disposed) return;
|
|
71
|
+
disposed = true;
|
|
72
|
+
try {
|
|
73
|
+
game.state.flush();
|
|
74
|
+
const state = game.state.getState();
|
|
75
|
+
assertPortableState(state);
|
|
76
|
+
data.threenative = { reloads: reloads + 1, sceneName: game.sceneName, state };
|
|
77
|
+
} catch (error) {
|
|
78
|
+
data.threenative = undefined;
|
|
79
|
+
hot.invalidate(error instanceof Error ? error.message : String(error));
|
|
80
|
+
throw error;
|
|
81
|
+
} finally {
|
|
82
|
+
game.stop();
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
function restoreState<TState extends Record<string, unknown>, TPhysics>(
|
|
87
|
+
game: IGame<TState, TPhysics>,
|
|
88
|
+
carried: Record<string, unknown>,
|
|
89
|
+
): void {
|
|
90
|
+
assertPortableState(carried);
|
|
91
|
+
const defaults = game.state.getState();
|
|
92
|
+
const state: Record<string, unknown> = { ...defaults };
|
|
93
|
+
const dropped = Object.keys(carried).filter((key) => !(key in defaults));
|
|
94
|
+
const added = Object.keys(defaults).filter((key) => !(key in carried));
|
|
95
|
+
for (const key of Object.keys(defaults)) {
|
|
96
|
+
if (key in carried) state[key] = carried[key];
|
|
97
|
+
}
|
|
98
|
+
game.state.setState(state as TState);
|
|
99
|
+
if (dropped.length > 0 || added.length > 0)
|
|
100
|
+
console.info(
|
|
101
|
+
`ThreeNative hot reload state shape: dropped [${dropped.join(", ")}]; added [${added.join(", ")}]`,
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
function diagnostics<TState extends Record<string, unknown>, TPhysics>(
|
|
105
|
+
game: IGame<TState, TPhysics>,
|
|
106
|
+
reloads: number,
|
|
107
|
+
): IHotDiagnostics {
|
|
108
|
+
const ctx = game.ctx;
|
|
109
|
+
let sceneObjects = 0;
|
|
110
|
+
ctx?.scene.traverse(() => {
|
|
111
|
+
sceneObjects += 1;
|
|
112
|
+
});
|
|
113
|
+
const physics = ctx?.physics as { numBodies?: unknown } | undefined;
|
|
114
|
+
return {
|
|
115
|
+
reloads,
|
|
116
|
+
entities: ctx === undefined ? 0 : Object.keys(ctx.entities.snapshot()).length,
|
|
117
|
+
sceneObjects,
|
|
118
|
+
canvases: typeof document === "undefined" ? 0 : document.querySelectorAll("canvas").length,
|
|
119
|
+
audio: audioRuntimeSnapshot(),
|
|
120
|
+
physics: typeof physics?.numBodies === "function" ? physics.numBodies() : null,
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
function visitPortable(value: unknown, path: string, ancestors: Set<object>): void {
|
|
124
|
+
if (value === null) return;
|
|
125
|
+
if (typeof value === "string" || typeof value === "boolean") return;
|
|
126
|
+
if (typeof value !== "object") {
|
|
127
|
+
if (typeof value === "number" && Number.isFinite(value)) return;
|
|
128
|
+
if (typeof value === "number")
|
|
129
|
+
throw new Error(`Hot reload state ${path} must contain only finite numbers.`);
|
|
130
|
+
throw new Error(`Hot reload state ${path} must contain only JSON-shaped values.`);
|
|
131
|
+
}
|
|
132
|
+
if (ancestors.has(value)) throw new Error(`Hot reload state ${path} contains a cycle.`);
|
|
133
|
+
if (Array.isArray(value)) {
|
|
134
|
+
ancestors.add(value);
|
|
135
|
+
for (let index = 0; index < value.length; index += 1)
|
|
136
|
+
visitPortable(value[index], `${path}[${index}]`, ancestors);
|
|
137
|
+
ancestors.delete(value);
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
const prototype = Object.getPrototypeOf(value);
|
|
141
|
+
if (prototype !== Object.prototype && prototype !== null)
|
|
142
|
+
throw new Error(`Hot reload state ${path} must contain only plain objects.`);
|
|
143
|
+
ancestors.add(value);
|
|
144
|
+
for (const key of Object.keys(value))
|
|
145
|
+
visitPortable((value as Record<string, unknown>)[key], `${path}.${key}`, ancestors);
|
|
146
|
+
ancestors.delete(value);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
interface IImportMeta {
|
|
150
|
+
readonly env?: {
|
|
151
|
+
readonly DEV?: boolean;
|
|
152
|
+
};
|
|
153
|
+
readonly hot?: IViteHotContext;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
interface IViteHotContext {
|
|
157
|
+
readonly data: Record<string, unknown>;
|
|
158
|
+
accept(): void;
|
|
159
|
+
dispose(callback: (data: Record<string, unknown>) => void): void;
|
|
160
|
+
invalidate(message?: string): void;
|
|
161
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
interface IImportMeta {
|
|
2
|
+
readonly env?: {
|
|
3
|
+
readonly DEV?: boolean;
|
|
4
|
+
};
|
|
5
|
+
readonly hot?: IViteHotContext;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
interface IViteHotContext {
|
|
9
|
+
readonly data: Record<string, unknown>;
|
|
10
|
+
accept(): void;
|
|
11
|
+
dispose(callback: (data: Record<string, unknown>) => void): void;
|
|
12
|
+
invalidate(message?: string): void;
|
|
13
|
+
}
|