SheetXL - v0.8.0-beta.9+sites.210.e2d420901
    Preparing search index...

    Function useWorkbookFormat

    • Tracks the format a workbook is bound to (Origin.getFormat()) as React state.

      Parameters

      • workbook: IWorkbook | null

        The workbook to track, or null.

      Returns string | null

      The resolved format key (e.g. 'SheetXL'), the path's extension when no key has been resolved yet, or null for an unbound workbook.

      A format KEY, not a full format type — resolving one to the other needs the registry (getWriteFormats({ search: key })), which is async and a concern of whoever is asking.

      Follows the workbook to whichever origin it lives in, so chrome that names the current format (a Save As menu, a status bar) updates the moment a Save As moves the workbook rather than going stale until the next mount.