import type { ResolvedSource } from '@struktoai/mirage-core/secrets/types'; import type { Resource } from '@struktoai/mirage-core/resource/base'; /** * Construct a resource by registry name. Mirrors Python's * `mirage.resource.registry.build_resource`. * * Each entry is an async factory that lazy-imports its module so that * importing this file doesn't pull in every backend's dependencies. * Only the resource you actually request gets loaded — important for * S3/Redis whose peer deps (`@aws-sdk/client-s3`, `redis`) are optional. * * Configs are normalized from Python-style snake_case (used in YAML and * by the Python `mirage.config` loader) to TS-idiomatic camelCase. So * the same YAML file works in both Python and TS. */ export type ResourceFactory = (config: Record) => Promise; /** * Look up every constructible name: builtins plus whatever `register()` * has added. */ export declare function knownResources(): string[]; /** * Register a custom resource factory under `name`. Builtin names cannot * be shadowed; re-registering a custom name replaces it. Mirrors * Python's `mirage.resource.registry.register_resource`, which keeps * builtins in REGISTRY and custom entries in a separate _CUSTOM dict so * a plugin cannot replace the builtin `s3` factory. */ export declare function register(name: string, factory: ResourceFactory): void; /** * Build a resource instance by registry name, or from a colon reference * naming a class directly (`./wiki.mjs:WikiResource`, or the package * specifier `my-pkg/backends:WikiResource`). * * Builtins win over custom registrations, and both win over a reference, * so a name can never be reinterpreted as code. Throws if the name is * neither. Mirrors the ladder in Python's `_resolve_entry`, minus its * entry-point rung: Node has no equivalent of `importlib.metadata`, so a * package ships a resource here by exporting it and being named. */ export declare function buildResource(name: string, config?: Record, sources?: Readonly>): Promise; //# sourceMappingURL=registry.d.ts.map