API

Interface IEditablePropertyOption

Interface that defines the options available for an editable property

interface IEditablePropertyOption {
    embedded?: boolean;
    max?: number;
    min?: number;
    notifiers?: {
        activatePreviewCommand?: boolean;
        callback?: (
            scene: Nullable<Scene>,
            block: any,
        ) => boolean | void | undefined;
        onValidation?: (block: any, propertyName: string) => boolean;
        rebuild?: boolean;
        update?: boolean;
    };
    options?: IEditablePropertyListOption[];
}
Index
embedded?: boolean

Define if the property is displayed inside the source block or in a separate property tab

max?: number

max value

min?: number

min value

notifiers?: {
    activatePreviewCommand?: boolean;
    callback?: (
        scene: Nullable<Scene>,
        block: any,
    ) => boolean | void | undefined;
    onValidation?: (block: any, propertyName: string) => boolean;
    rebuild?: boolean;
    update?: boolean;
}

notifiers: indicates which actions to take when the property is changed

Type Declaration

  • OptionalactivatePreviewCommand?: boolean

    the onPreviewCommandActivated observer of the preview manager should be triggered

  • Optionalcallback?: (scene: Nullable<Scene>, block: any) => boolean | void | undefined

    a callback to trigger

  • OptionalonValidation?: (block: any, propertyName: string) => boolean

    a callback to validate the property. Returns true if the property is ok, else false. If false, the rebuild/update/callback events won't be called

  • Optionalrebuild?: boolean

    the entity should be rebuilt

  • Optionalupdate?: boolean

    the preview should be updated

list of the options for a variable of type list