uiconfig.js
    Preparing search index...

    Class UiConfigMethods

    Index

    Constructors

    Properties

    undoEditingWaitTime: number = 2000
    undoPresets: {
        UiConfigMethods_action: (
            c: ActionCommand,
        ) => { redo: () => Promise<void>; undo: () => Promise<void> };
        UiConfigMethods_set: (
            c: SetValueCommand,
        ) => { redo: () => void; undo: () => void };
    } = ...

    Methods

    • Parameters

      • config: UiObjectConfig
      • props: {
            config?: UiObjectConfig<any, string, any>;
            configPath?: UiObjectConfig<any, string, any>[];
            last?: boolean;
            lastValue?: any;
            value?: any;
        }
      • ...args: any[]

      Returns void

    • Get the value from config

      Type Parameters

      Parameters

      • config: UiObjectConfig<T>
      • val: undefined | T

        existing value, new value can be copied to this if not equal.

      • copyOnEqual: boolean = true

        whether the value should be copied to val if equal. Default is true.

      Returns undefined | T

      The value from the binding, cloned or copied if possible. If the value is equal and copyOnEqual is false, then undefined is returned. this can be used to check if the value is changed

    • Performs an action with undo/redo support.

      Type Parameters

      • T extends AnyFunction

      Parameters

      • targ: any

        the target object to call the action on

      • action: T

        a function that returns - 1. an undo function, 2. an object with undo and redo functions (and optional action)

      • args: Parameters<T>

        the arguments to pass to the action function

      • config: UiObjectConfig

        ui config

      • OptionalonUndoRedo: (c: ActionCommand) => void

        optional callback function to be called on undo/redo of the command. Not called on first action execution, only on undo/redo.

      Returns Promise<void>

    • Type Parameters

      Parameters

      • config: UiObjectConfig<T>
      • value: T
      • props: {
            config?: UiObjectConfig<any, string, any>;
            configPath?: UiObjectConfig<any, string, any>[];
            last?: boolean;
            lastValue?: any;
            value?: any;
        }

        only the prop last need to be set, rest are optional. lastValue can be set if known (but it should be exactly equal to the value in the binding and not cloned).

      • OptionalforceOnChange: boolean
      • trackUndo: boolean = true

      Returns Promise<boolean>