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

    Function detectPreset

    • The preset that best DESCRIBES a template — what a Series dialog opens on, and what a caller asking "what is this?" is told.

      Parameters

      • values: readonly any[]
      • types: readonly InteropScalarType[]

        The type of each value, Null for a blank — without which a serial date is indistinguishable from any other number.

      • Optionaloptions: IAutoFill.Options

      Returns IAutoFill.Preset

      This is the opposite question from canApply, which asks whether a NAMED fill could be applied. Here the template names itself: a date series at its largest unit (see IAutoFill.DateSeries), a numeric one as Presets.Linear, and text as Presets.Series — reading the series off the template is the best guess text can be given, and is what makes test 1, test 2 and Jan, Feb fill as series rather than repeat. Only values nothing recognizes fall through to Presets.Copy.

      The answer is not checked against the selection — a caller offering it should fall back to a preset canApply allows.