UNPKG

903 BTypeScriptView Raw
1import { WidgetModel, WidgetView } from './widget';
2export declare class StyleModel extends WidgetModel {
3 defaults(): any;
4 static styleProperties: {
5 [s: string]: IStyleProperty;
6 };
7}
8interface IStyleProperty {
9 attribute: string;
10 selector: string;
11 default: string;
12}
13export declare class StyleView extends WidgetView {
14 /**
15 * Public constructor
16 */
17 initialize(parameters: WidgetView.InitializeParameters): void;
18 /**
19 * Register a CSS trait that is known by the model
20 * @param trait
21 */
22 registerTrait(trait: string): void;
23 /**
24 * Handles when a trait value changes
25 */
26 handleChange(trait: string, value: any): void;
27 /**
28 * Apply styles for all registered traits
29 */
30 style(): void;
31 /**
32 * Remove the styling from the parent view.
33 */
34 unstyle(): void;
35 private _traitNames;
36}
37export {};