Skip to content
Sheetwrite

@sheetwrite/core/history

HistoryPanelArchiveinterface

Report a problem

On this page

The archive calls the version history panel makes; HistoryArchive provides them.

Members

Methods

saveVersion( name: string, authorId: string, time: number, signal?: AbortSignal, ): Promise<HistoryVersion>;

Names the archived head as a new version.

listVersions(options?: { maxEntries?: number; cursor?: string; signal?: AbortSignal; }): Promise<HistoryListPage>;

Returns one page of versions, newest first.

readVersion(id: string, signal?: AbortSignal): Promise<WorkbookSnapshot>;

Rebuilds the document as it was at one version.

releaseMemory?(): void;

optional

Frees the version that the archive keeps rebuilt between calls. The panel calls it when it closes and when the grid trims memory.

Declaration

View full TypeScript declaration
export interface HistoryPanelArchive {
saveVersion(
name: string,
authorId: string,
time: number,
signal?: AbortSignal,
): Promise<HistoryVersion>;
listVersions(options?: {
maxEntries?: number;
cursor?: string;
signal?: AbortSignal;
}): Promise<HistoryListPage>;
readVersion(id: string, signal?: AbortSignal): Promise<WorkbookSnapshot>;
diffVersions(request: HistoryDiffRequest): Promise<HistoryDiffPage>;
restoreVersion(
grid: Grid,
id: string,
releaseMemory?(): void;
}

Referenced by

Public exports naming HistoryPanelArchive