Type Alias SettingsTreeFieldValue

SettingsTreeFieldValue:
    | {
        input: "autocomplete";
        items: string[];
        placeholder?: string;
        value?: string;
    }
    | { input: "boolean"; value?: boolean }
    | {
        hideClearButton?: boolean;
        input: "rgb";
        placeholder?: string;
        value?: string;
    }
    | {
        hideClearButton?: boolean;
        input: "rgba";
        placeholder?: string;
        value?: string;
    }
    | { input: "gradient"; value?: [string, string] }
    | {
        input: "messagepath";
        supportsMathModifiers?: boolean;
        validTypes?: string[];
        value?: string;
    }
    | {
        input: "number";
        max?: number;
        min?: number;
        placeholder?: string;
        precision?: number;
        step?: number;
        value?: number;
    }
    | {
        input: "select";
        options: { disabled?: boolean; label: string; value: undefined
        | number }[];
        value?: number | number[];
    }
    | {
        input: "select";
        options: { disabled?: boolean; label: string; value: undefined
        | string }[];
        value?: string | string[];
    }
    | { input: "string"; placeholder?: string; value?: string }
    | {
        input: "toggle";
        options: string[] | { label: string; value: undefined | string }[];
        value?: string;
    }
    | {
        input: "toggle";
        options: number[]
        | { label: string; value: undefined | number }[];
        value?: number;
    }
    | {
        input: "vec3";
        labels?: [string, string, string];
        max?: number;
        min?: number;
        placeholder?: [undefined | string, undefined | string, undefined | string];
        precision?: number;
        step?: number;
        value?: [undefined | number, undefined | number, undefined | number];
    }
    | {
        input: "vec2";
        labels?: [string, string];
        max?: number;
        min?: number;
        placeholder?: [undefined | string, undefined | string];
        precision?: number;
        step?: number;
        value?: [undefined | number, undefined | number];
    }

A settings tree field specifies the input type and the value of a field in the settings editor.

Type declaration

  • { input: "autocomplete"; items: string[]; placeholder?: string; value?: string }
    • input: "autocomplete"
    • items: string[]
    • Optionalplaceholder?: string

      Optional placeholder text displayed in the field input when value is undefined

    • Optionalvalue?: string
  • { input: "boolean"; value?: boolean }
  • {
        hideClearButton?: boolean;
        input: "rgb";
        placeholder?: string;
        value?: string;
    }
    • OptionalhideClearButton?: boolean

      Optional field that's true if the clear button should be hidden.

    • input: "rgb"
    • Optionalplaceholder?: string

      Optional placeholder text displayed in the field input when value is undefined

    • Optionalvalue?: string
  • {
        hideClearButton?: boolean;
        input: "rgba";
        placeholder?: string;
        value?: string;
    }
    • OptionalhideClearButton?: boolean

      Optional field that's true if the clear button should be hidden.

    • input: "rgba"
    • Optionalplaceholder?: string

      Optional placeholder text displayed in the field input when value is undefined

    • Optionalvalue?: string
  • { input: "gradient"; value?: [string, string] }
  • {
        input: "messagepath";
        supportsMathModifiers?: boolean;
        validTypes?: string[];
        value?: string;
    }
    • input: "messagepath"
    • OptionalsupportsMathModifiers?: boolean

      True if the input should allow math modifiers like @abs.

    • OptionalvalidTypes?: string[]
    • Optionalvalue?: string
  • {
        input: "number";
        max?: number;
        min?: number;
        placeholder?: string;
        precision?: number;
        step?: number;
        value?: number;
    }
    • input: "number"
    • Optionalmax?: number
    • Optionalmin?: number
    • Optionalplaceholder?: string

      Optional placeholder text displayed in the field input when value is undefined

    • Optionalprecision?: number
    • Optionalstep?: number
    • Optionalvalue?: number
  • {
        input: "select";
        options: { disabled?: boolean; label: string; value: undefined | number }[];
        value?: number | number[];
    }
  • {
        input: "select";
        options: { disabled?: boolean; label: string; value: undefined | string }[];
        value?: string | string[];
    }
  • { input: "string"; placeholder?: string; value?: string }
    • input: "string"
    • Optionalplaceholder?: string

      Optional placeholder text displayed in the field input when value is undefined

    • Optionalvalue?: string
  • {
        input: "toggle";
        options: string[] | { label: string; value: undefined | string }[];
        value?: string;
    }
  • {
        input: "toggle";
        options: number[] | { label: string; value: undefined | number }[];
        value?: number;
    }
  • {
        input: "vec3";
        labels?: [string, string, string];
        max?: number;
        min?: number;
        placeholder?: [undefined | string, undefined | string, undefined | string];
        precision?: number;
        step?: number;
        value?: [undefined | number, undefined | number, undefined | number];
    }
  • {
        input: "vec2";
        labels?: [string, string];
        max?: number;
        min?: number;
        placeholder?: [undefined | string, undefined | string];
        precision?: number;
        step?: number;
        value?: [undefined | number, undefined | number];
    }