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

    Interface Filler<T>

    Represents a filler capable of determining if it can fill a value and creating an IAutoFill.FillAt function for generating filled values within a single dimension (row or column).

    interface Filler<T = any> {
        createFillAt: (
            values: readonly T[],
            options?: IAutoFill.Options,
        ) => FillAt<T> | null;
        id: string;
        matches: (
            values: readonly T[],
            from?: number,
            options?: IAutoFill.Options,
        ) => number;
        supportsStep?: boolean;
        supportsStop?: boolean;
        supportsTrend?: boolean;
        type?: InteropScalarType;
    }

    Type Parameters

    • T = any

    Implemented by

    Index
    createFillAt: (
        values: readonly T[],
        options?: IAutoFill.Options,
    ) => FillAt<T> | null

    Create a IAutoFill.FillAt function using the provided values and options.

    • The first elements in the values is guaranteed to never be null.
    • Return null if the autofill is unable to fill.
    id: string

    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.

    matches: (
        values: readonly T[],
        from?: number,
        options?: IAutoFill.Options,
    ) => number

    How many values starting at from this filler claims as ONE series, or 0 for none.

    Type Declaration

      • (values: readonly T[], from?: number, options?: IAutoFill.Options): number
      • Parameters

        • values: readonly T[]

          The whole segment. Treat as readonly.

        • Optionalfrom: number

          The first value to consider.

        • Optionaloptions: IAutoFill.Options

          The options the fill would run with — notably Options.types, without which a serial date is indistinguishable from any other number.

        Returns number

    • Blanks inside a claim are gaps in the series, not terminators; trailing blanks are left out of the count.
    • A claim is trimmed to the run of values matching type, so it is safe to simply claim as far as the series goes.
    • A template may hold several series of the same type — Test 1, Test 3, Wow 1 is two — so returning the length lets the caller resolve the whole template in one pass rather than growing a run and re-asking.
    • Claiming a segment is not a promise to fill it: createFillAt may still decide the values are not a series and return null.
    supportsStep?: boolean

    Whether Options.stepValue means anything to this filler.

    false — the field is hidden.
    

    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

    Whether Options.stopValue means anything to this filler.

    false — the field is hidden.
    

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

    supportsTrend?: boolean

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

    false — the field is hidden.
    

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

    type?: InteropScalarType

    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.