import { Token, Tokenizer } from "../types.js";
import { LlamaText } from "./LlamaText.js";
import { QueuedTokenRelease, QueuedTokenReleaseLock } from "./TokenStreamRegulator.js";
export type StopGenerationTrigger = (string | Token)[];
export declare class StopGenerationDetector<T extends string = string> {
    recordGeneration({ text, tokens, queuedTokenRelease, startNewChecks }: {
        text: string;
        tokens: Token[];
        queuedTokenRelease?: QueuedTokenRelease;
        startNewChecks?: boolean;
    }): void;
    addStopTrigger(stopTrigger: StopGenerationTrigger, completeEvent?: T): this;
    /** Whether there are some stops that have been found and triggered. */
    get hasTriggeredStops(): boolean;
    /** Whether there are some stops that have been found, but not triggered yet. */
    get hasInProgressStops(): boolean;
    /** Gets the stops that have been found and triggered. */
    getTriggeredStops(): {
        stopTrigger: StopGenerationTrigger;
        events: T[];
        remainingGenerations: (string | Token[])[];
        queuedTokenReleaseLocks: QueuedTokenReleaseLock[];
    }[];
    clearTriggeredStops(): void;
    clearInProgressStops(): void;
    static resolveStopTriggers(stopTriggers: readonly (StopGenerationTrigger | LlamaText)[], tokenizer: Tokenizer): StopGenerationTrigger[];
    static resolveLlamaTextTrigger(llamaText: LlamaText, tokenizer: Tokenizer): StopGenerationTrigger;
}
