import type { SharedRefStaleError, UniqueRefStaleError, World } from '@forgeax/engine-ecs'; import type { AssetGuid } from '@forgeax/engine-pack/guid'; import { type Result } from '@forgeax/engine-rhi'; import type { Asset, AssetError as AssetErrorType, Handle, MaterialAsset, MaterialError, MaterialPass } from '@forgeax/engine-types'; /** A realm-local asset view; publication receivers never construct a World. */ export interface AssetReader { readonly identity: string; resolveAsset(handle: Handle): Result; } export type AssetReadSource = World | AssetReader; /** * Resolve a handle to its asset payload with two-tier slot-range dispatch. * * slot < BUILTIN_BASE -> BuiltinAssetRegistry.resolve(handle) (process-static) * slot >= BUILTIN_BASE -> world.sharedRefs.resolve(handle) (user-tier RC) * * Callers must specify the expected asset type explicitly: * `resolveAssetHandle(world, handle)`. The type parameter is an * assertion -- the runtime dispatch returns the correct payload based on slot * range; the type parameter mirrors the caller's expectation. * * @param world - The World owning the per-World SharedRefStore (user-tier). * @param handle - The branded handle to resolve. * @returns `Result.ok(payload)` on hit, `Result.err(AssetError)` on miss. */ export declare function resolveAssetHandle(world: AssetReadSource, handle: Handle): Result; /** * Walk a MaterialAsset parent chain to produce the inherited passes + * shallow-merged values (W-1..W-7 semantics). feat-20260614 M8 (D-19): * the starting material is resolved from a column `handle` via * {@link resolveAssetHandle} (builtin / user-tier world.sharedRefs); each * ancestor `material.parent` is an embedded GUID (AssetGuid) resolved through * the AssetRegistry catalogue ({@link AssetRegistry.lookup}). The registry * holds no handles -- it is the GUID->payload SSOT for parent resolution. * * Zero-cache (AC-04): every call builds the same table-shaped input and delegates * inheritance semantics to the MaterialAsset resolver in `@forgeax/engine-types`. * Compiler and runtime therefore share root-contract ownership and child-value * override semantics instead of maintaining two subtly different walks. */ export declare function walkMaterialPassesOverSharedRefs(world: World, handle: Handle<'MaterialAsset', 'shared'>, registry: { lookup(guid: AssetGuid | string): Asset | undefined; }): Result<{ passes: MaterialPass[]; parameters: MaterialAsset['parameters']; values: NonNullable; colorSpace: MaterialAsset['colorSpace']; surface: MaterialAsset['surface']; }, AssetErrorType | MaterialError | SharedRefStaleError | UniqueRefStaleError>; //# sourceMappingURL=resolve-asset-handle.d.ts.map