Project

General

Profile

1
/**
2
 * @license
3
 * Copyright Google Inc. All Rights Reserved.
4
 *
5
 * Use of this source code is governed by an MIT-style license that can be
6
 * found in the LICENSE file at https://angular.io/license
7
 */
8
/**
9
 * This file is a port of shadowCSS from webcomponents.js to TypeScript.
10
 *
11
 * Please make sure to keep to edits in sync with the source file.
12
 *
13
 * Source:
14
 * https://github.com/webcomponents/webcomponentsjs/blob/4efecd7e0e/src/ShadowCSS/ShadowCSS.js
15
 *
16
 * The original file level comment is reproduced below
17
 */
18
export declare class ShadowCss {
19
    strictStyling: boolean;
20
    constructor();
21
    shimCssText(cssText: string, selector: string, hostSelector?: string): string;
22
    private _insertDirectives(cssText);
23
    private _insertPolyfillDirectivesInCssText(cssText);
24
    private _insertPolyfillRulesInCssText(cssText);
25
    private _scopeCssText(cssText, scopeSelector, hostSelector);
26
    private _extractUnscopedRulesFromCssText(cssText);
27
    private _convertColonHost(cssText);
28
    private _convertColonHostContext(cssText);
29
    private _convertColonRule(cssText, regExp, partReplacer);
30
    private _colonHostContextPartReplacer(host, part, suffix);
31
    private _colonHostPartReplacer(host, part, suffix);
32
    private _convertShadowDOMSelectors(cssText);
33
    private _scopeSelectors(cssText, scopeSelector, hostSelector);
34
    private _scopeSelector(selector, scopeSelector, hostSelector, strict);
35
    private _selectorNeedsScoping(selector, scopeSelector);
36
    private _makeScopeMatcher(scopeSelector);
37
    private _applySelectorScope(selector, scopeSelector, hostSelector);
38
    private _applySimpleSelectorScope(selector, scopeSelector, hostSelector);
39
    private _insertPolyfillHostInCssText(selector);
40
}
41
export declare class CssRule {
42
    selector: string;
43
    content: string;
44
    constructor(selector: string, content: string);
45
}
46
export declare function processRules(input: string, ruleCallback: (rule: CssRule) => CssRule): string;
(41-41/54)