UNPKG

1.09 kBTypeScriptView Raw
1/// <reference types="backbone" />
2import { WidgetModel, WidgetView } from './widget';
3/**
4 * Three functions to deal with some CSS attributes
5 * to make them easier to use.
6 */
7export declare class StyleModel extends WidgetModel {
8 defaults(): Backbone.ObjectHash;
9 static styleProperties: {
10 [s: string]: IStyleProperty;
11 };
12}
13interface IStyleProperty {
14 attribute: string;
15 selector: string;
16 default: string;
17}
18export declare class StyleView extends WidgetView {
19 /**
20 * Public constructor
21 */
22 initialize(parameters: WidgetView.IInitializeParameters): void;
23 /**
24 * Register a CSS trait that is known by the model
25 * @param trait
26 */
27 registerTrait(trait: string): void;
28 /**
29 * Handles when a trait value changes
30 */
31 handleChange(trait: string, value: any): void;
32 /**
33 * Apply styles for all registered traits
34 */
35 style(): void;
36 /**
37 * Remove the styling from the parent view.
38 */
39 unstyle(): void;
40 private _traitNames;
41}
42export {};
43//# sourceMappingURL=widget_style.d.ts.map
\No newline at end of file