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

    Function canApply

    • Whether preset can be offered for a selection holding these value types.

      Parameters

      • preset: IAutoFill.Preset
      • values: readonly any[]
      • types: readonly InteropScalarType[]

        The type of each value in the selection, Null for a blank.

      Returns boolean

      Three checks, and between them they account for every state Excel's fill menu shows:

      • Type — a filler is offered only where the values are the type it reads. This is what greys Fill Months on a numeric selection, and Linear Trend on a date one.
      • Arity — IAutoFill.Preset.minValues against the non-blank count. This is what greys Linear Trend on a single cell.
      • Claim — IAutoFill.Filler.matches. This is what greys Fill Series on abc, def while leaving Copy Cells alone: nothing recognizes a series there, so the fill would be a copy by another name.

      A filler's matches therefore has to answer could you fill from this if asked, which is NOT always is this template already a series of my kind. The two come apart for a filler that is never auto-detected: Fill Weekdays should be offered for a template of two weekend dates — it means "give me business days from here", and the engine happily takes a Saturday anchor — even though those two dates are not a weekday series. A filler outside Types.Series's composite is only ever asked on the explicit path, so it should claim permissively.