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

    Fills a straight numeric series — each value the previous one PLUS a step.

    The step is read off the template as a least-squares fit, so a template that only roughly trends still extends along its line. IAutoFill.Options.stepValue replaces that step outright, and IAutoFill.Options.trend keeps the fit while refusing any step at all.

    Implements

    Index
    id: string = 'linear'

    Identifies the filler. Must be unique among the fillers in use.

    This is what names the fill in a menu, survives into a transaction's ITransaction.Operation.params, and lets a script ask for a fill type by name — so it is a stable key, not a display label.

    supportsStep: boolean = true

    Whether Options.stepValue means anything to this filler.

    These three say only which fields an authoring surface should OFFER; they say nothing about whether the filler can be applied to a given selection (see Preset). The step's meaning is the filler's own — an addend for a linear series, a RATIO for a growth one, a count of units for a date one — so the value is passed through uninterpreted.

    supportsStop: boolean = true

    Whether Options.stopValue means anything to this filler.

    Only an ordered series can be stopped; a list or an ordinal one has nothing to compare.

    supportsTrend: boolean = true

    Whether this filler can fit its series to the values rather than stepping from them (Options.trend).

    A fit needs at least two values, so a preset that turns it on carries that arity — see Preset.minValues.

    type: InteropScalarType = InteropScalarType.Number

    The value type this filler reads.

    • The filler is only ever offered values of this type — a claim that runs past the type is trimmed back, so matches does not have to re-check what the caller already knows. Blanks carry no type and never split a series.
    • Leave it undefined to be offered a segment of ANY type (still one type at a time).
    • Dates are InteropScalarType.Date: cell values are serial numbers, and it is the cell's number format — not the runtime type — that makes one a date.
    • A filler that reads more than one type registers once per type; where it sits in each Composite's list is its priority for that type.
    • Create a IAutoFill.FillAt function using the provided values and options.

      Parameters

      Returns FillAt<number> | null

      • The first elements in the values is guaranteed to never be null.
      • Return null if the autofill is unable to fill.
    • Claims the run of numbers — a numeric template is one series, however its values trend.

      Parameters

      • values: readonly number[]
      • from: number = 0

      Returns number