import type { ParserInterface } from '../parsers/parser.interface.js'; import { InjectParams, InjectorOptions, InjectorResult } from './types.js'; import { type IDGenerator } from '@domscribe/manifest'; export declare class DomscribeInjector { private readonly parser; private readonly idGenerator; private readonly options; private isInitialized; constructor(parser: ParserInterface, idGenerator: IDGenerator, options?: InjectorOptions); get initalized(): boolean; set initialized(value: boolean); /** * Initialize the Injector. This will load the ID generator and initialize it. * Also initializes the parser if it has an initialize method. * * @remarks Safe to call multiple times, will only initialize once. * @returns A promise that resolves when the Injector is initialized. */ initialize(): Promise; /** * Transform source code by injecting `data-ds` attributes on JSX elements. * * @param source - Source code string to transform * @param params - Optional source file path and source map consumer * @returns Transformed code, source map, manifest entries, and metrics */ inject(source: string, params?: InjectParams): InjectorResult; /** Get the parser instance used by this injector. */ getParser(): ParserInterface; /** * Persist the ID cache to disk without closing the injector. * Safe to call repeatedly — only writes when the cache is dirty. */ saveCache(): void; /** * Close the injector and persist the ID cache to disk. * Marks the instance as uninitialized so it can be re-initialized. */ close(): void; private generateId; private getPreTranspiledPosition; } /** * Factory function that creates a DomscribeInjector with an IDStabilizer * singleton for the given workspace. * * @param parser - Parser implementation to use for AST generation * @param workspaceRoot - Workspace root for cache directory resolution * @param options - Injector options (debug, etc.) */ export declare function createInjector(parser: ParserInterface, workspaceRoot: string, options?: InjectorOptions): DomscribeInjector; //# sourceMappingURL=injector.d.ts.map