/** * Resolve the absolute path of the instrumenter's internal * `directive-bookkeeper.js` against the HOISTED `@stryker-mutator/instrumenter` * instance — the same technique as `resolveMutatePath()` (the package's * `exports` map does not expose it as a subpath). */ export declare function resolveDirectiveBookkeeperPath(): string; /** * Expand ONE directive comment value in place: when it is a Stryker * `disable|restore [next-line] [: reason]` directive whose name list * contains a bare `llm` (case-insensitive), append every `category` not already * present (case-insensitive) after the existing names — which keep their * original order — and leave the `: reason` suffix, `all`, unrelated names and * any surrounding whitespace untouched. Any other value is returned unchanged. * PURE. */ export declare function expandLlmDirective(value: string, categories?: readonly string[]): string; /** * Expand an `excludedMutations` list: when it contains exactly `'llm'` * (case-sensitive, mirroring Stryker's own `includes` check), append every * `category` not already present; otherwise return a copy. PURE. */ export declare function expandExcludedMutations(excluded: readonly string[], categories?: readonly string[]): string[]; /** The slice of a babel node the bookkeeper destructures. */ export interface DirectiveNode { loc?: unknown; leadingComments?: ReadonlyArray<{ value: string; }> | null; } /** The structural minimum of Stryker's `DirectiveBookkeeper` class we patch. */ export interface DirectiveBookkeeperClass { prototype: { processStrykerDirectives(node: DirectiveNode): void; }; } /** * Wrap `bookkeeper.prototype.processStrykerDirectives` once so every directive * naming a bare `llm` is booked as if it also named every `category`. Pure * apart from the prototype write; testable with a fake class. * * @returns `'installed'` on the first call, `'already-installed'` afterwards. */ export declare function installLlmDirectiveAlias(bookkeeper: DirectiveBookkeeperClass, categories?: readonly string[]): 'installed' | 'already-installed'; /** Test seam for {@link installLlmDirectiveAliasIntoStryker}. */ export interface InstallLlmDirectiveAliasOptions { /** Override the module resolution (tests point it at a missing / methodless module). */ resolvePath?: () => string; } /** * Resolve the real instrumenter `directive-bookkeeper.js` by runtime path, * dynamic-import it (a computed `file://` URL, so the bundler keeps it * external) and install the alias on its `DirectiveBookkeeper` class. Returns * `true` when the alias is (or already was) installed; on ANY failure — module * unresolvable, class or method missing — logs a loud warning through `log` * and returns `false`. Never throws. */ export declare function installLlmDirectiveAliasIntoStryker(log?: (line: string) => void, options?: InstallLlmDirectiveAliasOptions): Promise;