UNPKG

6.55 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 wrap: (node: Node) => Node;
142 }
143
144 // This type alias exists because Tsickle will replace any type name used in the
145 // type of something with the same name with `?`. (Maybe a Closure limitation?)
146 // Making `ShadyDOM` an alias to an underlying type with a different name works
147 // around this because Tsickle appears to resolve type aliases in its output: it
148 // writes `undefined|ShadyDOMInterface` instead of `undefined|?` as the type for
149 // the `ShadyDOM` global.
150 type ShadyDOM = ShadyDOMInterface;
151 // eslint-disable-next-line no-var
152 var ShadyDOM: ShadyDOM;
153}
154
155/**
156 * @license
157 * Copyright (c) 2021 The Polymer Project Authors. All rights reserved. This
158 * code may only be used under the BSD style license found at
159 * http://polymer.github.io/LICENSE.txt The complete set of authors may be found
160 * at http://polymer.github.io/AUTHORS.txt The complete set of contributors may
161 * be found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by
162 * Google as part of the polymer project is also subject to an additional IP
163 * rights grant found at http://polymer.github.io/PATENTS.txt
164 */
165
166// When building externally, this file is always assumed to be a module, but by
167// default it isn't when building internally, so we need this export statement.
168export {};
169
170declare global {
171 interface HTMLTemplateElementConstructor {
172 bootstrap(): void;
173 }
174}