UNPKG

@protorians/widgets

Version:

Create your web user interfaces with widgets

68 lines (67 loc) 4.13 kB
import type { IStyleOptions, IStyleSettings, IStyleSheet, IStyleSheetDeclarations, IStyleAliasDictionary, IWidgetNode, IStyleSheetPseudoClasses, IStyleSheetPseudoElements, IStyleSheetAtRules, IStyleSheetStrictCascade, IInlineStyleOptions, IInlineStyle, IStyleStrictDeclaration } from "./types/index.js"; import { IDictionary } from "@protorians/core"; export declare class StyleWidget implements IStyleSheet { readonly options: IStyleOptions; static settings: IStyleSettings; static alias: IDictionary<IStyleAliasDictionary>; protected _repository: HTMLStyleElement | undefined; protected _related: IWidgetNode<any, any> | undefined; protected _definitions: string[]; protected _selector: string; protected locked: boolean; protected _associates: Map<object, IStyleSheet>; protected _associateSelector: string | undefined; declarations: IStyleSheetDeclarations; static unit(value: string | number): string; constructor(options?: IStyleOptions); get status(): boolean; set status(value: boolean); get repository(): HTMLStyleElement | undefined; get definitions(): string; get selector(): string; get associateSelector(): string | undefined; clear(): this; parseProperty(key: string, value: string | number): string; parse(declaration: IStyleSheetDeclarations | IStyleSheet | undefined, selector?: string): string | undefined; merge(declarations: IStyleSheetDeclarations | IStyleSheet | undefined): this; sync(declarations?: IStyleSheetDeclarations): this; bind(widget: IWidgetNode<any, any>): this; remove<K extends keyof IStyleSheetDeclarations>(key: K | K[]): this; update<K extends keyof IStyleSheetDeclarations>(key: K, value: IStyleSheetDeclarations[K]): this; hover(declarations: IStyleSheetDeclarations): this; focus(declarations: IStyleSheetDeclarations): this; blur(declarations: IStyleSheetDeclarations): this; autofill(declarations: IStyleSheetDeclarations): this; when(state: IStyleSheetPseudoClasses | IStyleSheetPseudoClasses[], declarations: IStyleSheetDeclarations): this; after(declarations: IStyleSheetDeclarations): this; before(declarations: IStyleSheetDeclarations): this; isole(state: IStyleSheetPseudoElements | IStyleSheetPseudoElements[], declarations: IStyleSheetDeclarations): this; keyframes(name: string, declarations: IStyleSheetStrictCascade): this; supports(directive: string, declarations: IStyleSheetStrictCascade): this; scope(directive: string, declarations: IStyleSheetStrictCascade): this; property(directive: string, declarations: IStyleSheetStrictCascade): this; viewTransition(directive: string, declarations: IStyleSheetStrictCascade): this; container(directive: string, declarations: IStyleSheetStrictCascade): this; media(directive: string, declarations: IStyleSheetStrictCascade): this; rule(rule: IStyleSheetAtRules, directive: string, declarations: IStyleSheetStrictCascade): this; associate(declarations: IStyleSheetDeclarations): this; associated(declarations: IStyleSheetDeclarations): IStyleSheet | undefined; unassociate(declarations: IStyleSheetDeclarations): this; } export declare class InlineStyleWidget implements IInlineStyle { readonly options: IInlineStyleOptions; protected _attached: Map<string, IWidgetNode<any, any>>; protected _declarations: IStyleStrictDeclaration; constructor(options?: IInlineStyleOptions); protected compute(): string[]; protected assign<K extends keyof IStyleStrictDeclaration>(widget: IWidgetNode<any, any>, key: K, value: IStyleStrictDeclaration[K]): this; sync(widget?: IWidgetNode<any, any>): this; attach(widget: IWidgetNode<any, any>): this; detach(): this; remove<K extends keyof IStyleStrictDeclaration>(key: K | K[]): this; update<K extends keyof IStyleStrictDeclaration>(key: K, value: IStyleStrictDeclaration[K]): this; merge(declaration?: IStyleStrictDeclaration): this; clear(): this; toString(): string; } export declare function Style(declaration: IStyleSheetDeclarations): IStyleSheet;