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

    Interface ISelector<T, I>

    Used for defining condition selectors.

    interface ISelector<T extends Scalar = Scalar, I extends Scalar = T> {
        createTransformer(ctx: IContext): MaybePromise<Transformer<T, I> | null>;
        getDefaultCondition?(
            context?: DefaultConditionContext,
        ): DefaultCondition<any> | null;
        getDescription?(): string;
        getInputType(): InteropScalarType | null;
        getName(): string;
        getRenderHints?(): readonly string[] | null;
        getSelectType(): InteropScalarType | null;
        getTitle?(): string;
    }

    Type Parameters

    • T extends Scalar = Scalar
    • I extends Scalar = T
    Index
    • Called once per evaluation to build the selector predicate.

      Parameters

      Returns MaybePromise<Transformer<T, I> | null>

      • May be async: callers must await the result before evaluation.
      • ctx is scoped to the condition block (same one you’ll see inside the predicate), so you can safely use it for one-time initialization, stats, etc.
      • An example of where we would want to batch is 'address or 'in list'.
      • Return null for identity selectors (no transformation needed — value passes through as-is).
    • The condition a user starts from on choosing this selector.

      Parameters

      Returns DefaultCondition<any> | null

      The operator and, only where one value is plainly the right one, its param. null for a selector with no natural operator.

      An authoring UI asks for this when a user picks the selector, so the choice shows an operator at once rather than an empty condition. An omitted param is filled by the operator's own ICondition.IOperator.createDefaultParam; supply one only when it is the value the user would have chosen, since an invented value that is saved unnoticed is a rule nobody wrote.

      Read context.ranges through getStats(), never by visiting its cells: a whole column may be selected.

    • Returns a human-readable description of the selector.

      Returns string

    • Return type of scalar this selector accepts.

      Returns InteropScalarType | null

      • If not specified or null is returns all types will be passed.
      • Value is stable and should not change between calls for the same selector instance.
    • The name of the selector.

      Returns string

    • Optional function to provide a hint for rendering the condition in the UI.

      Returns readonly string[] | null

      A string hint for rendering the condition.

      This can be used to provide additional context or guidance for users when displaying the condition in the UI. Some examples of built-in hints are:

      Examples:

      • The Items operator might return "list" to suggest a list-style editor.
      • The Boolean operator might return "checkbox".
    • Return type of scalar this selector returns.

      Returns InteropScalarType | null

      • If not specified or null is returns all types will be passed.
      • Value is stable and should not change between calls for the same selector instance.
    • Returns a human-readable title of the selector.

      Returns string