Interface ControlledProxyOptions<Properties, Target>

Options for creating a controlled proxy object.

Type parameters will be inferred from the option values. It should not be necessary to provide them explicitly.

interface ControlledProxyOptions<Properties, Target> {
    defaultControls?: Record<Properties, boolean>;
    defaultDisabledMemberHandler?: DisabledMemberHandler<Properties, Target>;
    target: Target;
}

Type Parameters

  • Properties extends PropertyKey

    Union representing property keys of the controlled properties.

  • Target extends ControlledPartial<Properties>

    The target object type. Must have all keys in Properties.

Properties

defaultControls?: Record<Properties, boolean>

An object containing the default control flags for each controlled property. This object will be rendered as the [controlProp] property of the proxy object.

defaultDisabledMemberHandler?: DisabledMemberHandler<Properties, Target>

The default handler function for disabled controlled properties. Defaults to () => undefined. See the DisabledMemberHandler type for more information.

target: Target

The target object to proxy.