testing.FakeModel.variants ​Contract 2.0.0 · package sha256
a857eca95b35921109faf997094bb4192f12527d9d0fcd4be7e97f06425bad6e· generated fromtesting.d.tsbyservices/onsite-scripter/scripts/build-contract-docs.mjs; edit the source, not this file.
Property of testing.FakeModel · labs, @experimental · since 2.0.0
variants?: readonly string[];
The GLB's KHR_materials_variants names, as the runtime reads them from the loaded file,
stamped or not: a MaterialSpec.variant this list lacks records 'unsupported-spec' at
'patch.material.variant', as on the runtime. fakeModelFromGlb fills it from the file;
describe(node).manifest stays as manifest says (null for an unstamped GLB).
Default: manifest.variants, else undefined (any name is taken: not checked)
Imports: values (has, validate, the Holo*Error classes, the pure helpers) from @holostep-configurators/runtime-client, types from @holostep-configurators/runtime-client/contract, /math and /testing names from those entries; boot from the runtime module the root's loadRuntimeAtFloor resolves to. A type your page defines is your app's: declare it there, never import it from the package.
Compiled under the contract's strict settings (examples/declaration/24-FakeModel.variants.ts):
import { createFakeSession } from '@holostep-configurators/runtime-client/testing';
import type { IModelNode, Session } from '@holostep-configurators/runtime-client/contract';
import type { FakeModel } from '@holostep-configurators/runtime-client/testing';
declare const session: Session;
declare const signal: AbortSignal;
declare const chair: IModelNode; // glbUrl 'chair.glb'
const model: FakeModel = { nodes: [{ name: 'Frame', mesh: true }], variants: ['Oak', 'Walnut'] };
export const fake = createFakeSession({ strict: true, models: { 'chair.glb': model }, root: [chair] });
// once the root has loaded (pump `tick` until `idle()` settles, as `createFakeSession` shows):
// 'committed' with one 'unsupported-spec' naming Oak and Walnut, as the runtime does
export const teak = () => fake.node(chair.nodeId).set({ material: { variant: 'Teak' } });
| Rule | Result |
|---|---|
| 1. Neutral name | pass: variants names no product |
| 2. A precedent | not recorded: no ledger row (coverage.json) names this member or its owner |
| 3. Two apps, or labs | labs (@experimental at a stable path, reached through has() or supports()): it graduates when a second app uses it |
| 4. The cheaper fix first | not recorded per member (Appendix B decides it per need) |