/** A dependency the plugin imported eagerly; `value` is read lazily. */ export interface StaticDep { absMid: string; readonly value: any; } /** A dependency behind a dynamic import, used for asynchronous `require([...])`. */ export interface LazyDep { absMid: string; load(): Promise; runtimeHas?: boolean; } export type Dep = StaticDep | LazyDep; /** The module scope description the plugin emits for each transformed AMD module. */ export interface ModuleSpec { absMid: string; statics?: Record; lazies?: Record; globalBase?: string; globalStatics?: Record; globalLazies?: Record; cjs?: Record; } export interface AmdRequire { (mid: string): any; (mids: string[], callback?: (...args: any[]) => any, errback?: (err: any) => void): any; toAbsMid(mid: any): string; toUrl(mid: any): string; has: typeof __dojoHas; rawConfig: Record; on: typeof on; signal: typeof signal; async: number; undef?(mid: string): void; } export type AmdDefine = ((a: any, b?: any, c?: any) => any) & { amd?: boolean; }; declare const registry: Record; declare let hasCache: Record; export declare function __dojoConfigure(config: Record, features: Record, options?: { globalBase?: string; circularDependencyProxies?: boolean; undefinedStaticDependenciesAreCircular?: boolean; }): void; export declare function __dojoHas(name: string): any; export declare namespace __dojoHas { export { hasCache as cache }; export var add: (name: string, test: any, now?: boolean, force?: boolean) => any; export var remove: (name: string) => void; } export declare function __dojoRuntimeHas(name: string): any; export declare function __dojoRuntimeHasExpression(expression: string, dependencies: Map): unknown; /** * A dependency scope: module ids exactly as written in the source, mapped to the * value (statics) or a lazy importer (lazies) the plugin resolved at build time. */ declare class Scope { base: string; statics: Record; lazies: Record; fallback: Scope | undefined; constructor(base: string, statics?: Record, lazies?: Record, fallback?: Scope); entry(mid: string): Dep | undefined; toAbsMid(mid: any): string; /** The registry key for `mid`, following aliases. */ key(mid: string): string; lookup(mid: string): any; } declare class ModuleContext { absMid: string; cjs: Record; context: Scope; globalScope: Scope; value: any; module: any; exports: any; contextRequire: AmdRequire; require: AmdRequire; define: AmdDefine; constructor(spec: ModuleSpec); lookup(scope: Scope, mid: string): any; } /** * Describes a statically imported dependency. The value is read on demand because * Dojo has circular dependencies: reading an ES module binding that is still * initialising throws, and Dojo's own loader passes `undefined` in that situation. */ export declare function __dojoDep(get: () => any, absMid: string, needsInterop?: number): StaticDep; declare function on(type: string, listener: (event: any) => void): { remove(): void; }; declare function signal(type: string, event: any): void; /** Creates the module scope injected above every transformed AMD module. */ export declare function __dojoModule(spec: ModuleSpec): ModuleContext; /** * Evaluates an AMD module body. `new Function` is what makes this work: its body runs in * sloppy mode, whereas the surrounding ES module is always strict. Dojo's declare() reads * `arguments.callee` on every instantiation and `this.inherited(arguments)` needs the same, * both of which throw in strict mode. */ export declare function __dojoRun(ctx: ModuleContext, source: string, sourceUrl?: string): any; /** Registers a value produced by a synthesized module (has!, text!, i18n!, ...). */ export declare function __dojoRegister(absMid: string, value: any): any; /** Declares that `alias` addresses the same module as `canonical`. */ export declare function __dojoAlias(canonical: string, alias: string): void; /** A context require bound to `absMid`, used by loader-extension proxies. */ export declare function __dojoRequireFor(absMid: string, statics: Record): AmdRequire; export { registry as __dojoRegistry };