UNPKG

1.57 kBTypeScriptView Raw
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 */
18export declare class ShadowCss {
19 strictStyling: boolean;
20 constructor();
21 shimCssText(cssText: string, selector: string, hostSelector?: string): string;
22 private _insertDirectives;
23 private _insertPolyfillDirectivesInCssText;
24 private _insertPolyfillRulesInCssText;
25 private _scopeCssText;
26 private _extractUnscopedRulesFromCssText;
27 private _convertColonHost;
28 private _convertColonHostContext;
29 private _convertColonRule;
30 private _colonHostContextPartReplacer;
31 private _colonHostPartReplacer;
32 private _convertShadowDOMSelectors;
33 private _scopeSelectors;
34 private _scopeSelector;
35 private _selectorNeedsScoping;
36 private _makeScopeMatcher;
37 private _applySelectorScope;
38 private _applySimpleSelectorScope;
39 private _insertPolyfillHostInCssText;
40}
41export declare class CssRule {
42 selector: string;
43 content: string;
44 constructor(selector: string, content: string);
45}
46export declare function processRules(input: string, ruleCallback: (rule: CssRule) => CssRule): string;