import type { Run as BaseRun } from "../run";
import type { VarsService } from "../vars";
import type { MetaService } from "../meta";
import type { GraphData, Toc, WithItems } from './types';
import type { WatchConfig } from '~/commands/build/features/watch';
import { Graph, VFile } from "../utils";
export type TocServiceConfig = {
    ignore: string[];
    ignoreStage: string[];
    template: {
        enabled: boolean;
        keepNotVar: boolean;
        features: {
            conditions: boolean | string;
            substitutions: boolean;
        };
        scopes: {
            code: boolean;
            text: boolean;
        };
    };
    removeHiddenTocItems: boolean;
    removeEmptyTocItems: boolean;
} & Partial<WatchConfig>;
type WalkStepResult<I> = I | I[] | null | undefined;
export type WalkStepContext<T extends object = {}> = Hash<unknown> & T;
type WalkOptions<T> = {
    accept: (item: T) => boolean;
};
type Run = BaseRun<TocServiceConfig> & {
    vars: VarsService;
    meta: MetaService;
};
type Options = Partial<{
    skipMissingVars: boolean;
    mode: 'translate' | 'build';
    pdfDebug: boolean;
}>;
export declare class TocService {
    readonly name = "Toc";
    readonly relations: Graph<GraphData>;
    get tocs(): Toc[];
    get entries(): NormalizedPath[];
    private run;
    private logger;
    private config;
    private options;
    private get vars();
    private get meta();
    constructor(run: Run, options: Options);
    init(paths: NormalizedPath[]): Promise<Toc[]>;
    pushAdditionalEntries(path: NormalizedPath, toc: Toc): Promise<void>;
    dump(file: NormalizedPath, toc?: Toc): Promise<VFile<Toc>>;
    /**
     * Visits items which will be project entries. Applies actor to each item.
     * Then applies actor to each item in actor result.items.
     * Returns actor results.
     */
    walkEntries<T extends WithItems<T> & {
        href: NormalizedPath;
    }>(items: T[] | undefined, actor: (item: T) => Promise<WalkStepResult<T>> | WalkStepResult<T>): Promise<T[] | undefined>;
    /**
     * Visits all passed items. Applies actor to each item.
     * Then applies actor to each item in actor result.items.
     * Returns actor results.
     */
    walkItems<T extends WithItems<T>>(items: T[] | undefined, actor: (item: T, context: WalkStepContext) => Promise<WalkStepResult<T>> | WalkStepResult<T>, options?: WalkOptions<T>): Promise<T[] | undefined>;
    /**
     * Resolves toc path and data for any page path.
     * Expects what all paths are already loaded in service.
     */
    for(path: RelativePath): Toc;
    release(path: NormalizedPath): void;
    isToc(path: NormalizedPath): false | Toc | Promise<Toc | undefined> | undefined;
    isEntry(path: NormalizedPath): boolean;
    isGenerator(path: NormalizedPath): boolean;
    private _dump;
    private load;
    private include;
    /**
     * Visits all passed items. Applies actor to each item.
     * Then applies actor to each item in actor result.items.
     * Returns actor results.
     * DFS
     */
    private _walkItems;
    private shouldSkip;
    private addEntries;
    private restrictAccess;
    private loaderContext;
}
export {};
