brows3r — TypeScript API
    Preparing search index...

    Interface DiffState

    interface DiffState {
        currentDiff: ActiveDiff | null;
        closeDiff(reason: "confirmed" | "cancelled" | "closed"): void;
        openDiff(payload: DiffPayload): Promise<string>;
    }
    Index

    Properties

    Methods

    Properties

    currentDiff: ActiveDiff | null

    The currently pending diff, or null when no diff is open.

    Methods

    • Clear the current diff from state.

      reason documents why the diff is being closed:

      • 'confirmed' — the mutating command succeeded.
      • 'cancelled' — user clicked Cancel in the modal (modal already called diffPreviewCancel before calling this).
      • 'closed' — modal dismissed without user action (e.g. Esc or outside-click); the diff id is no longer usable.

      Parameters

      • reason: "confirmed" | "cancelled" | "closed"

      Returns void

    • Open a diff preview for the given payload.

      Calls diffPreviewCreate on the backend, sets currentDiff with the returned DiffId, and returns the id for the caller to thread into the confirm command.

      Throws if the backend returns an error (e.g. unsupported kind).

      Parameters

      Returns Promise<string>