AutoDisposeMode: undefined | {
    maxWidth: number;
    type: "max-width";
} | {
    maxHeight: number;
    type: "max-height";
}

Interface for describing auto dispose mode of an UI element.

Can be used to set a condition, where the UI element is automatically disposed, removing it from view. Use with setAutoDispose.

 // Example, remove UI element when it is larger than 20% of viewport.
UIElement.setAutoDispose({
type: 'max-width',
maxWidth: 0.20,
})