mobx-sentinel API doc
    Preparing search index...
    Config: {
        id?: Attrs["id"];
        onBlur?: Attrs["onBlur"];
        onChange?: Attrs["onChange"];
        onFocus?: Attrs["onFocus"];
    } & (
        | {
            getter: () => string | null;
            setter: (value: string) => void;
            type?: StringType;
            valueAs?: "string";
        }
        | {
            getter: () => number | null;
            setter: (value: number | null) => void;
            type?: NumericValueType;
            valueAs: "number";
        }
        | {
            getter: () => string | null;
            setter: (value: Date | null) => void;
            type?: DateValueType;
            valueAs: "date";
        }
    )

    Type declaration

    • Optionalid?: Attrs["id"]

      [Override] ID of the input element

    • OptionalonBlur?: Attrs["onBlur"]

      [Extend] Blur handler

    • OptionalonChange?: Attrs["onChange"]

      [Extend] Change handler

    • OptionalonFocus?: Attrs["onFocus"]

      [Extend] Focus handler

    • {
          getter: () => string | null;
          setter: (value: string) => void;
          type?: StringType;
          valueAs?: "string";
      }
      • Computedgetter: () => string | null

        Get the value from the model

      • Actionsetter: (value: string) => void

        Set the value to the model

      • Optionaltype?: StringType

        Type of form control.

        When unspecified, it is deduced from the valueAs.

        "text" - when valueAs is undefined or "string"
        
      • OptionalvalueAs?: "string"

        Value type of the input element. It determines how getter/setter should handle the value.

    • {
          getter: () => number | null;
          setter: (value: number | null) => void;
          type?: NumericValueType;
          valueAs: "number";
      }
      • Computedgetter: () => number | null

        Get the value from the model

      • Actionsetter: (value: number | null) => void

        Set the value to the model

      • Optionaltype?: NumericValueType

        Type of form control.

        When unspecified, it is deduced from the valueAs.

        "number" - when valueAs is "number"
        
      • valueAs: "number"

        Value type of the input element. It determines how getter/setter should handle the value.

    • {
          getter: () => string | null;
          setter: (value: Date | null) => void;
          type?: DateValueType;
          valueAs: "date";
      }
      • Computedgetter: () => string | null

        Get the value from the model

        String representation of the date. As Date instance has no distinction between date and datetime, it's developers' responsibility to format the date correctly.

        type attr Expected format Example
        date YYYY-MM-DD 2024-12-31
        datetime-local YYYY-MM-DDTHH:mm 2024-12-31T23:59
        time HH:mm or HH:mm:ss 23:59 or 23:59:59
        week YYYY-Www 2024-W52
        month YYYY-MM 2024-12
        date.toISOString().split("T")[0]
        
      • Actionsetter: (value: Date | null) => void

        Set the value to the model

      • Optionaltype?: DateValueType

        Type of form control.

        When unspecified, it is deduced from the valueAs.

        "date" - when valueAs is "date"
        
      • valueAs: "date"

        Value type of the input element. It determines how getter/setter should handle the value.