IFClite TypeScript API
    Preparing search index...

    Interface HistorySidecar

    interface HistorySidecar {
        at(at: string | Date, branch?: string): Promise<HistoryEntry | null>;
        branch(name: string, fromEntryId?: string): Promise<BranchInfo>;
        branches(): Promise<BranchInfo[]>;
        clear(): Promise<void>;
        diff(fromEntryId: string, toEntryId: string): Promise<HistoryDiff>;
        entries(branch?: string): Promise<HistoryEntry[]>;
        merge(
            branch: string,
            into: string,
            mergedSnapshot: IfcxFile,
        ): Promise<HistoryEntry>;
        record(
            input: {
                authorClientId?: number;
                branch?: string;
                diff?: IfcxFile;
                label?: string;
                snapshot: IfcxFile;
            },
        ): Promise<HistoryEntry>;
    }

    Implemented by

    Index
    • The entry whose at is closest to (and not after) at.

      Parameters

      • at: string | Date
      • Optionalbranch: string

      Returns Promise<HistoryEntry | null>

    • Create a new branch off fromEntryId (defaults to head of main).

      Parameters

      • name: string
      • OptionalfromEntryId: string

      Returns Promise<BranchInfo>

    • All known branches, in creation order.

      Returns Promise<BranchInfo[]>

    • Remove all entries / branches.

      Returns Promise<void>

    • Per-entity-id diff between two entries.

      Parameters

      • fromEntryId: string
      • toEntryId: string

      Returns Promise<HistoryDiff>

    • All entries, oldest first, optionally filtered to one branch.

      Parameters

      • Optionalbranch: string

      Returns Promise<HistoryEntry[]>

    • Merge branch into into. Returns a synthetic merge entry — apps compute the merged snapshot themselves (typically by replaying Y-update logs through mergeBranch).

      Parameters

      • branch: string
      • into: string
      • mergedSnapshot: IfcxFile

      Returns Promise<HistoryEntry>

    • Append a new entry to a branch (default 'main').

      Parameters

      • input: {
            authorClientId?: number;
            branch?: string;
            diff?: IfcxFile;
            label?: string;
            snapshot: IfcxFile;
        }

      Returns Promise<HistoryEntry>