UNPKG

6.61 kBTypeScriptView Raw
1/**
2 * @license
3 * Copyright (c) 2021 The Polymer Project Authors. All rights reserved. This
4 * code may only be used under the BSD style license found at
5 * http://polymer.github.io/LICENSE.txt The complete set of authors may be found
6 * at http://polymer.github.io/AUTHORS.txt The complete set of contributors may
7 * be found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by
8 * Google as part of the polymer project is also subject to an additional IP
9 * rights grant found at http://polymer.github.io/PATENTS.txt
10 */
11
12// When building externally, this file is always assumed to be a module, but by
13// default it isn't when building internally, so we need this export statement.
14export {};
15
16declare global {
17 // eslint-disable-next-line no-var
18 var WebComponents: {};
19}
20
21/**
22 * @license
23 * Copyright (c) 2021 The Polymer Project Authors. All rights reserved. This
24 * code may only be used under the BSD style license found at
25 * http://polymer.github.io/LICENSE.txt The complete set of authors may be found
26 * at http://polymer.github.io/AUTHORS.txt The complete set of contributors may
27 * be found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by
28 * Google as part of the polymer project is also subject to an additional IP
29 * rights grant found at http://polymer.github.io/PATENTS.txt
30 */
31
32// When building externally, this file is always assumed to be a module, but by
33// default it isn't when building internally, so we need this export statement.
34export {};
35
36declare global {
37 interface CustomElementRegistry {
38 forcePolyfill?: boolean;
39 polyfillWrapFlushCallback?(outer: (fn: () => void) => void): void;
40 noDocumentConstructionObserver?: boolean;
41 shadyDomFastWalk?: boolean;
42 }
43}
44
45/**
46 * @license
47 * Copyright (c) 2021 The Polymer Project Authors. All rights reserved. This
48 * code may only be used under the BSD style license found at
49 * http://polymer.github.io/LICENSE.txt The complete set of authors may be found
50 * at http://polymer.github.io/AUTHORS.txt The complete set of contributors may
51 * be found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by
52 * Google as part of the polymer project is also subject to an additional IP
53 * rights grant found at http://polymer.github.io/PATENTS.txt
54 */
55
56// When building externally, this file is always assumed to be a module, but by
57// default it isn't when building internally, so we need this export statement.
58export {};
59
60declare global {
61 interface ShadyCSSInterface {
62 styleElement(element: HTMLElement): void;
63 styleSubtree(
64 element: HTMLElement,
65 properties?: {[name: string]: string}
66 ): void;
67 prepareTemplate(
68 template: HTMLTemplateElement,
69 elementName: string,
70 elementExtends?: string
71 ): void;
72 prepareTemplateStyles(
73 template: HTMLTemplateElement,
74 elementName: string,
75 elementExtends?: string
76 ): void;
77 prepareTemplateDom(
78 template: HTMLTemplateElement,
79 elementName: string
80 ): void;
81 styleDocument(properties?: {[name: string]: string}): void;
82 flushCustomStyles(): void;
83 getComputedStyleValue(element: Element, property: string): string;
84 ScopingShim?: {
85 prepareAdoptedCssText(
86 cssTextArray: Array<string>,
87 elementName: string
88 ): void;
89 flush(): void;
90 };
91 ApplyShim?: Object;
92 CustomStyleInterface?: Object;
93 nativeCss: boolean;
94 nativeShadow: boolean;
95 cssBuild?: string;
96 disableRuntime: boolean;
97 }
98
99 interface ShadyCSSOptions {
100 shimcssproperties?: boolean;
101 shimshadow?: boolean;
102 cssBuild?: boolean;
103 disableRuntime?: boolean;
104 }
105
106 // This type alias exists because Tsickle will replace any type name used in the
107 // type of something with the same name with `?`. (Maybe a Closure limitation?)
108 // Making `ShadyCSS` an alias to an underlying type with a different name works
109 // around this because Tsickle appears to resolve type aliases in its output: it
110 // writes `undefined|ShadyCSSInterface` instead of `undefined|?` as the type for
111 // the `ShadyCSS` global.
112 type ShadyCSS = ShadyCSSInterface;
113 // eslint-disable-next-line no-var
114 var ShadyCSS: ShadyCSS | undefined;
115}
116
117/**
118 * @license
119 * Copyright (c) 2021 The Polymer Project Authors. All rights reserved. This
120 * code may only be used under the BSD style license found at
121 * http://polymer.github.io/LICENSE.txt The complete set of authors may be found
122 * at http://polymer.github.io/AUTHORS.txt The complete set of contributors may
123 * be found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by
124 * Google as part of the polymer project is also subject to an additional IP
125 * rights grant found at http://polymer.github.io/PATENTS.txt
126 */
127
128// When building externally, this file is always assumed to be a module, but by
129// default it isn't when building internally, so we need this export statement.
130export {};
131
132declare global {
133 interface ShadyDOMInterface {
134 flush: () => void;
135 inUse: boolean;
136 nativeMethods: {
137 querySelectorAll: typeof document.querySelectorAll;
138 };
139 noPatch: boolean | string;
140 patchElementProto: (node: Object) => void;
141 querySelectorImplementation?: 'native' | 'selectorEngine';
142 wrap: (node: Node) => Node;
143 }
144
145 // This type alias exists because Tsickle will replace any type name used in the
146 // type of something with the same name with `?`. (Maybe a Closure limitation?)
147 // Making `ShadyDOM` an alias to an underlying type with a different name works
148 // around this because Tsickle appears to resolve type aliases in its output: it
149 // writes `undefined|ShadyDOMInterface` instead of `undefined|?` as the type for
150 // the `ShadyDOM` global.
151 type ShadyDOM = ShadyDOMInterface;
152 // eslint-disable-next-line no-var
153 var ShadyDOM: ShadyDOM;
154}
155
156/**
157 * @license
158 * Copyright (c) 2021 The Polymer Project Authors. All rights reserved. This
159 * code may only be used under the BSD style license found at
160 * http://polymer.github.io/LICENSE.txt The complete set of authors may be found
161 * at http://polymer.github.io/AUTHORS.txt The complete set of contributors may
162 * be found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by
163 * Google as part of the polymer project is also subject to an additional IP
164 * rights grant found at http://polymer.github.io/PATENTS.txt
165 */
166
167// When building externally, this file is always assumed to be a module, but by
168// default it isn't when building internally, so we need this export statement.
169export {};
170
171declare global {
172 interface HTMLTemplateElementConstructor {
173 bootstrap(): void;
174 }
175}