Runtime providers
ASORuntimeProvider resolves declared representations into application-specific loaded values.
Typed interface
import { RuntimeRegistry, type ASORuntimeProvider } from '@aso/sdk';
const provider: ASORuntimeProvider<MyLoadedAsset> = {
id: 'my-runtime',
capabilities: { types: ['mesh'], formats: ['glb'], mediaTypes: ['model/gltf-binary'] },
async load(representation, context) {
const bytes = await fetch(representation.url, { signal: context.signal }).then(r => r.arrayBuffer());
return { value: await loadAsset(bytes), representation, providerId: 'my-runtime' };
}
};
const registry = new RuntimeRegistry().register(provider);
const loaded = await registry.load(object, { signal: abortController.signal });Resolution compares type, format, and media type capabilities. Use context preferences for deterministic selection, pass AbortSignal through all work, verify bytes before reporting success, and release created resources when no longer needed.