import { escapeHtml } from "@intentic/base/escape";
export interface EmbedEndpoint {
readonly base: string;
readonly automationId: string;
}
export declare class EmbedError extends Error {
readonly status: number;
constructor(message: string, status: number);
}
export declare const embedFailure: (response: Response) => Promise;
export declare const embedUrl: ({ base, automationId }: EmbedEndpoint, slug: string, path: string) => string;
export declare const fetchEmbedJson: (url: string) => Promise;
export interface PowChallenge {
readonly salt: string;
readonly difficulty: number;
}
export declare const fetchEmbedChallenge: (endpoint: EmbedEndpoint, slug: string, param: string, id: string) => Promise;
export declare const solveProofOfWork: (challenge: PowChallenge, insecure: string, onProgress?: (attempts: number) => void) => Promise;
export declare const readStored: (name: string) => string | undefined;
export declare const writeStored: (name: string, value: string) => void;
export declare const storedId: (name: string) => string;
export declare const embedScript: (srcMatch: string) => HTMLScriptElement | null;
export declare const embedEndpointOf: (script: HTMLScriptElement) => EmbedEndpoint | undefined;
export declare const WEBCHAT_EVENT: {
readonly delta: "delta";
readonly pending: "pending";
readonly error: "error";
readonly done: "done";
};
export declare const DEFAULT_ACCENT = "#e47100";
export declare const parseHex: (value: string) => [number, number, number] | undefined;
export declare const onAccent: (accent: string, dark: string) => string;
export { escapeHtml };
//# sourceMappingURL=embed.d.ts.map