UNPKG

1.99 kBTypeScriptView Raw
1import { ViewBase } from '../core/view-base';
2import { SyntaxTree } from '../../css';
3import { RuleSet, Node, SelectorCore, ChangeMap } from '../styling/css-selector';
4import { KeyframeAnimationInfo } from '../animation/keyframe-animation';
5
6export class CssState {
7 /**
8 * Re-evaluate the selectors and apply any changes to the underlying view.
9 */
10 public apply(): void;
11
12 /**
13 * Gets the static selectors that match the view and the dynamic selectors that may potentially match the view.
14 */
15 public changeMap: ChangeMap<ViewBase>;
16
17 /**
18 * Checks whether style scope and CSS state selectors are in sync.
19 */
20 public isSelectorsLatestVersionApplied(): boolean;
21}
22
23export class StyleScope {
24 public css: string;
25 public addCss(cssString: string, cssFileName?: string): void;
26 public addCssFile(cssFileName: string): void;
27 public changeCssFile(cssFileName: string): void;
28
29 public static createSelectorsFromCss(css: string, cssFileName: string, keyframes: Object): RuleSet[];
30 public static createSelectorsFromImports(tree: SyntaxTree, keyframes: Object): RuleSet[];
31 public ensureSelectors(): number;
32
33 /**
34 * Increase the application CSS selector version.
35 */
36 public _increaseApplicationCssSelectorVersion(): void;
37 public isApplicationCssSelectorsLatestVersionApplied(): boolean;
38 public isLocalCssSelectorsLatestVersionApplied(): boolean;
39
40 public applySelectors(view: ViewBase): void;
41 public query(options: Node): SelectorCore[];
42
43 public getKeyframeAnimationWithName(animationName: string): KeyframeAnimationInfo;
44 public getAnimations(ruleset: RuleSet): KeyframeAnimationInfo[];
45}
46
47export function resolveFileNameFromUrl(url: string, appDirectory: string, fileExists: (filepath: string) => boolean, importSource?: string): string;
48export function applyInlineStyle(view: ViewBase, style: string): void;
49export function addTaggedAdditionalCSS(cssText: string, tag?: string | Number): boolean;
50export function removeTaggedAdditionalCSS(tag: String | Number): boolean;