lazy-widgets
Version:
Typescript retained mode GUI for the HTML canvas API
27 lines (26 loc) • 1.07 kB
TypeScript
import { PassthroughWidget } from './PassthroughWidget.js';
import type { Theme } from '../theme/Theme.js';
import type { Widget, WidgetProperties } from './Widget.js';
import type { WidgetAutoXML } from '../xml/WidgetAutoXML.js';
/**
* A {@link PassthroughWidget} which changes the theme of its child and
* completely ignores inherited themes.
*
* Can be constrained to a specific type of children.
*
* Since the new theme replaces the inherited theme, children of the child will
* also inherit this theme since inherited themes are propagated down the widget
* tree.
*
* @category Widget
*/
export declare class ThemeScope<W extends Widget = Widget> extends PassthroughWidget<W> {
static autoXML: WidgetAutoXML;
/** The theme used for the child. */
private _scopeTheme;
constructor(child: W, theme?: Theme, properties?: Readonly<WidgetProperties>);
set inheritedTheme(_theme: Theme | undefined);
get inheritedTheme(): Theme | undefined;
set scopeTheme(scopeTheme: Theme | undefined);
get scopeTheme(): Theme | undefined;
}