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

    Interface AutoFillOptions

    Options for ICellRange.autoFill.

    interface AutoFillOptions {
        author?: Author;
        autoFit?: boolean | AutoFitOptions;
        autoSelect?: boolean | ICellRange.SelectOptions;
        autoSelectRestore?: boolean | ICellRange.SelectOptions;
        description?: string;
        expectedCommitId?: string;
        filler?: Filler<any>;
        fillerOptions?: IAutoFill.Options;
        preview?: boolean;
        readOnly?: boolean;
        snap?: boolean;
        type?: ICell.Content;
    }

    Hierarchy (View Summary)

    Index
    author?: Author

    Who authored this change. Recorded on the commit (ICommit.getAuthor).

    the store's author, else null (unattributed)

    autoFit?: boolean | AutoFitOptions

    Fit the affected columns and rows to their content once the operation completes.

    false - sizes are left alone.

    The fit runs once, as the last write of the operation, so it measures the finished content and its sizes belong to the same undo entry - one undo puts both the content and the widths back.

    If set to true then autoFit will mimic the UI with the following options:

    {
    skipCustomSize: true,
    expandOnly: true,
    minContent: true
    }
    autoSelect?: boolean | ICellRange.SelectOptions

    Select the affected range once the operation completes.

    false - the selection is left alone.

    The selection is applied once, after the whole operation - within a batch, the last operation to ask for one wins. It is applied only if the selection is still where it was when the operation began: a user who moved while it ran keeps where they went.

    Pass it for an edit the user made. A script that passes neither this nor autoSelectRestore never moves the user, whether it runs, is undone or is redone.

    autoSelectRestore?: boolean | ICellRange.SelectOptions

    Select the affected range when the operation is undone or redone.

    autoSelect

    An undo lands where the operation began - for most operations the range they affected, for an auto-fill the template it was dragged from - and a redo where it left the user. Within a batch an undo lands where the first operation to ask says, a redo where the last one does.

    For an edit made from where the user already is, pass this without autoSelect: a value typed into a cell of a selected block leaves the block selected, and undoing it selects the cell.

    description?: string

    A human description.

    'determined by the set operation and locale'
    
    expectedCommitId?: string

    Optimistic concurrency guard. If set, the operation only begins if the store's current commit id matches; otherwise a TransactionConflictError is thrown.

    The check happens atomically as the root transaction begins — there is no window between check and commit. If any transaction is already open the check fails with reason open (the head could move beneath the operation).

    filler?: Filler<any>

    Provide custom fillers.

    AutoFill.Types.Series

    fillerOptions?: IAutoFill.Options

    Options to pass to the IAutoFill.Filler.

    These will also be passed if a custom filler is used.

    preview?: boolean

    Compute the fill but commit nothing — the returned range is a projection of the result.

    false
    
    • The sheet is untouched and no undo entry is created.
    • The returned range covers the destination and is read-only; writes to it throw.
    • Its cells are derived, not read from the sheet — see ICellRange.autoFill.
    • Cells are computed on demand, so previewing one cell of a large fill costs one cell.
    readOnly?: boolean

    Declares the operation read-only: any state update within it throws.

    false
    

    Writes are tracked automatically — a batch that performs no updates never creates a commit (no new commit id, no events, no undo entry) whether or not this is set. The flag is purely an assertion for callers that want the guarantee enforced. Nested transactions inherit it; they cannot opt back out.

    snap?: boolean

    Fill the nearest destination that is legal instead of throwing when the given one is not.

    false
    
    • Only merges make a destination illegal, so with none on the fill axis this changes nothing.
    • The fill amount is rounded outward to the merge unit (drag one row into a merge and the whole merge is covered, Excel-style), then clamped inward to the sheet. If not even one merge unit fits, the fill becomes a no-op.
    • Shrinking destinations are always legal and are never moved.
    • Opt-in by design: a caller that named an exact destination gets an error rather than a silently different fill. Turn it on for pointer-driven input, where the raw destination is a guess.
    • The returned range reports where the fill actually landed — so a drag can snap, preview and commit through one call and they can never disagree.
    type?: ICell.Content

    Which part of the cells the fill carries — the same selector CopyOptions.type takes.

    Everything: values, formulas and formatting.
    
    • ICell.Content.Formats is Excel's Fill Formatting Only: the template's formatting (styles, number formats, merges, conditional formats and validations) is tiled into the destination and the values already there are left alone. The filler is not consulted.
    • ICell.Content.Values is Fill Without Formatting: the series is written and the destination keeps its own formatting — a date series lands as plain serials in a cell that has no date format of its own.
    • On a shrinking destination the vacated cells lose only the selected part.
    • Any other member throws — a fill has no notion of copying just hyperlinks or comments.