/* auto-generated by NAPI-RS */ /* eslint-disable */ export declare class Compiler { constructor(config: object) inputObservations(): string traceDependencies(): object traceModuleGraph(): object /** async compile, return promise */ compile(): object /** * Drain on a dedicated OS thread: cache writes themselves use the Rayon * pool, so blocking that pool here could starve the writes being joined. */ flushCache(): object /** sync compile */ compileSync(): void /** TODO: usage example */ update(paths: Array<[string, string]>, threadSafeCallback: ((err: Error | null, ) => any), sync: boolean, generateUpdateResource: boolean): object addWatchFiles(root: string, paths: Array): void hasModule(resolvedPath: string): boolean getParentFiles(resolvedPath: string): Array resources(): Record resourcesMap(): Record writeResourcesToDisk(): void watchModules(): Array relativeModulePaths(): Array resource(name: string): Buffer | null stats(): string invalidateModule(moduleId: string): void /** Write cache with name and data */ writeMetadata(name: string, data: string, options?: JsApiMetadata | undefined | null): void /** Read cache with name, return `undefined` if not exists */ readMetadata(name: string, options?: JsApiMetadata | undefined | null): string | null /** Read cache by scope, return Array of cache data, if not exists, return empty array */ readMetadataByScope(scope: string): Array } export type JsCompiler = Compiler /** A process/Env-local native snapshot. No pointer or large content is returned to JS. */ export declare class DocsSnapshot { constructor(root: string, site: string) /** Run the original Rust prepare on an owned worker, keeping Node's loop free. */ prepare(planPath: string): Promise /** Return only the fields needed by workflow/SSR, not modules or private inputs. */ metadata(): string /** Compile one target with deterministic native ownership, independent of GC. */ compileTarget(config: object): Promise /** Delegate to the same verifier as the snapshot plugin; no seal checks are omitted. */ verify(verification: string): Promise /** Release this handle. Existing compiler providers retain their own safe leases. */ close(): void } export declare class OutputDirectoryLock { constructor(path: string) release(): void } export declare class Resolver { constructor(config: object) resolve(source: string, baseDir: string, dynamicExtensions?: Array | undefined | null): string } export type JsResolver = Resolver export interface DocsTargetResult { resources: Record inputObservations: string } export interface JsApiMetadata { /** Scope of the cache, used different name, same scope will hit the same cache */ scope?: Array /** reference ModuleId of the cache, when the module is invalidated, the cache will be invalidated too */ refer?: Array } export interface JsModuleHookFilters { moduleTypes?: Array resolvedPaths?: Array } export interface JsPluginAugmentResourceHashHookFilters { resourcePotTypes: Array moduleIds: Array } export interface JsPluginLoadHookFilters { resolvedPaths: Array } export interface JsPluginProcessRenderedResourcePotHookFilters { resourcePotTypes: Array moduleIds: Array } /** Resolve hook filters, works as `||`. If any importers or sources matches any regex item in the Vec, we treat it as filtered. */ export interface JsPluginResolveHookFilters { importers: Array sources: Array } export declare const enum JsPluginTransformHtmlHookOrder { Pre = 0, Normal = 1, Post = 2 } export interface JsTracedModule { id: string contentHash: string packageName: string packageVersion: string } export interface JsTracedModuleGraph { root: string modules: Array edges: Record> reverseEdges: Record> } export interface JsUpdateResult { added: Array changed: Array removed: Array immutableModules: string mutableModules: string boundaries: Record>> dynamicResourcesMap?: Record>> extraWatchResult: WatchDiffResult } export interface WatchDiffResult { add: Array remove: Array }