-
Notifications
You must be signed in to change notification settings - Fork 55
Expand file tree
/
Copy pathauto-complete-element-define.ts
More file actions
35 lines (32 loc) · 1.04 KB
/
auto-complete-element-define.ts
File metadata and controls
35 lines (32 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import {AutoCompleteElement} from './auto-complete-element.js'
const root = (typeof globalThis !== 'undefined' ? globalThis : window) as typeof window
try {
// Lowercase C is here for backwards compat
root.AutocompleteElement = root.AutoCompleteElement = AutoCompleteElement.define()
} catch (e: unknown) {
if (
!(root.DOMException && e instanceof DOMException && e.name === 'NotSupportedError') &&
!(e instanceof ReferenceError)
) {
throw e
}
}
type JSXBase = JSX.IntrinsicElements extends {span: unknown}
? JSX.IntrinsicElements
: Record<string, Record<string, unknown>>
declare global {
interface Window {
AutoCompleteElement: typeof AutoCompleteElement
AutocompleteElement: typeof AutoCompleteElement
}
interface HTMLElementTagNameMap {
'auto-complete': AutoCompleteElement
}
namespace JSX {
interface IntrinsicElements {
['auto-complete']: JSXBase['span'] & Partial<Omit<AutoCompleteElement, keyof HTMLElement>>
}
}
}
export default AutoCompleteElement
export * from './auto-complete-element.js'