histoire
Version:
A fast story book powered by Vite
60 lines • 3.17 kB
TypeScript
import type { HistoireVisualApproveOptions, HistoireVisualRunOptions, HistoireVisualRunSummary } from '@histoire/shared';
import type { VisualSource } from './source.js';
import { saveVisualCase } from './cases.js';
/** Retained source and mutable evidence stay private to one service owner. */
export declare function createVisualService(resolveSource: () => VisualSource): {
/** Independent review authority belongs to one browser socket. */
createReviewSession(): {
recoverPage(offset?: number): Promise<{
results: import("@histoire/shared").UiVisualResult[];
total: number;
nextOffset?: number;
issues: string[];
}>;
recover(): Promise<{
results: import("@histoire/shared").UiVisualResult[];
issues: string[];
}>;
claim(run: HistoireVisualRunSummary, offset?: number, limit?: number): Promise<import("@histoire/shared").UiVisualResult[]>;
approve(selections: {
handle: string;
resultId: string;
}[], observe?: (receipts: import("@histoire/shared").HistoireVisualApprovalReceipt[]) => void | Promise<void>): Promise<import("@histoire/shared").HistoireVisualApprovalReceipt[]>;
flushReports: () => Promise<void>;
reportIssues: () => string[];
artifact(runId: string, resultId: string, kind: 'baseline' | 'current' | 'diff'): string;
/** Remove retired sessions after their writes drain, keeping teardown ownership. */
close(): Promise<void>;
};
/** Current canonical and explicitly saved Matrix inventory. */
listCases(): Promise<import("@histoire/shared").HistoireVisualCase[]>;
/** Save complete props without altering project story source. */
saveCase(input: Parameters<typeof saveVisualCase>[2]): Promise<import("@histoire/shared").HistoireVisualCase>;
/** Remove only saved definition, keeping historical baselines and captures. */
removeCase(caseId: string): Promise<void>;
/** Each run owns one cancellation scope over shared execution; `plan` receives incremental targets. */
run(options?: HistoireVisualRunOptions, observe?: (run: HistoireVisualRunSummary) => void, plan?: (resultIds: string[]) => void): Promise<HistoireVisualRunSummary>;
/** Snapshot page readers cannot mutate retained private evidence. */
getRun(id: string): {
id: string;
platform: string;
baselineSource: string;
baselineCommit?: string;
state: 'running' | 'completed' | 'cancelled';
results: import("@histoire/shared").HistoireVisualResult[];
total: number;
reportPath: string;
htmlPath: string;
ok: boolean;
reused?: {
total: number;
failing: number;
};
stale: boolean;
};
/** Filesystem CAS and generation checks guard every selected baseline. */
approve(options: HistoireVisualApproveOptions): Promise<import("@histoire/shared").HistoireVisualApprovalReceipt[]>;
/** Close stops owned captures and joins their browser cleanup. */
close(): Promise<void>;
};
//# sourceMappingURL=service.d.ts.map