///
declare namespace svelteHTML {
// Every namespace eligible for use needs to implement the following two functions
function mapElementTag(
tag: K
): ElementTagNameMap[K];
function mapElementTag(
tag: K
): SVGElementTagNameMap[K];
function mapElementTag(
tag: any
): any; // needs to be any because used in context of
function createElement(
// "undefined | null" because of
element: Key | undefined | null, attrs: Elements[Key]
): Key extends keyof ElementTagNameMap ? ElementTagNameMap[Key] : Key extends keyof SVGElementTagNameMap ? SVGElementTagNameMap[Key] : any;
type NativeElement = HTMLElement;
// TypeScript SVGElement has no `dataset` (Chrome 55+, Firefox 51+).
type Element = NativeElement & {
dataset: DOMStringMap;
};
//
// Event Handler Types
// ----------------------------------------------------------------------
type EventHandler =
svelte.JSX.EventHandler;
type ClipboardEventHandler = svelte.JSX.ClipboardEventHandler;
type CompositionEventHandler = svelte.JSX.CompositionEventHandler;
type DragEventHandler = svelte.JSX.DragEventHandler;
type FocusEventHandler = svelte.JSX.FocusEventHandler;
type FormEventHandler = svelte.JSX.FormEventHandler;
type ChangeEventHandler = svelte.JSX.ChangeEventHandler;
type KeyboardEventHandler = svelte.JSX.KeyboardEventHandler;
type MouseEventHandler = svelte.JSX.MouseEventHandler;
type TouchEventHandler = svelte.JSX.TouchEventHandler;
type PointerEventHandler = svelte.JSX.PointerEventHandler;
type UIEventHandler = svelte.JSX.UIEventHandler;
type WheelEventHandler = svelte.JSX.WheelEventHandler;
type AnimationEventHandler = svelte.JSX.AnimationEventHandler;
type TransitionEventHandler = svelte.JSX.TransitionEventHandler;
type MessageEventHandler = svelte.JSX.MessageEventHandler;
// See CSS 3 CSS-wide keywords https://www.w3.org/TR/css3-values/#common-keywords
// See CSS 3 Explicit Defaulting https://www.w3.org/TR/css-cascade-3/#defaulting-keywords
// "all CSS properties can accept these values"
type CSSWideKeyword = svelte.JSX.CSSWideKeyword;
// See CSS 3 type https://drafts.csswg.org/css-values-3/#percentages
type CSSPercentage = svelte.JSX.CSSPercentage;
// See CSS 3 type https://drafts.csswg.org/css-values-3/#lengths
type CSSLength = svelte.JSX.CSSLength;
// This interface is not complete. Only properties accepting
// unit-less numbers are listed here (see CSSProperty.js in React)
// eslint-disable-next-line @typescript-eslint/no-empty-interface
interface DOMAttributes extends svelte.JSX.DOMAttributes {}
// eslint-disable-next-line @typescript-eslint/no-empty-interface
interface AriaAttributes extends svelte.JSX.AriaAttributes {}
// eslint-disable-next-line @typescript-eslint/no-empty-interface
interface HTMLAttributes extends svelte.JSX.HTMLAttributes {}
// eslint-disable-next-line @typescript-eslint/no-empty-interface
interface SVGAttributes extends svelte.JSX.SVGAttributes {
'xlink:actuate'?: string | undefined;
'xlink:arcrole'?: string | undefined;
'xlink:href'?: string | undefined;
'xlink:role'?: string | undefined;
'xlink:show'?: string | undefined;
'xlink:title'?: string | undefined;
'xlink:type'?: string | undefined;
'xml:base'?: string | undefined;
'xml:lang'?: string | undefined;
'xml:space'?: string | undefined;
'xmlns'?: string | undefined;
'xmlns:xlink'?: string | undefined;
}
// eslint-disable-next-line @typescript-eslint/no-empty-interface
interface HTMLProps extends HTMLAttributes {}
// eslint-disable-next-line @typescript-eslint/no-empty-interface
interface SVGProps extends SVGAttributes {}
// eslint-disable-next-line @typescript-eslint/no-empty-interface
interface SvelteInputProps extends svelte.JSX.SvelteInputProps {}
// eslint-disable-next-line @typescript-eslint/no-empty-interface
interface SvelteWindowProps extends svelte.JSX.SvelteWindowProps {}
interface SapperAnchorProps {
"sapper:noscroll"?: true | undefined | null;
"sapper:prefetch"?: true | undefined | null;
}
interface SvelteKitAnchorProps {
"sveltekit:noscroll"?: true | undefined | null;
"sveltekit:prefetch"?: true | undefined | null;
"sveltekit:reload"?: true | undefined | null;
}
// eslint-disable-next-line @typescript-eslint/no-empty-interface
interface SvelteMediaTimeRange extends svelte.JSX.SvelteMediaTimeRange {}
// eslint-disable-next-line @typescript-eslint/no-empty-interface
interface SvelteMediaProps extends svelte.JSX.SvelteMediaProps {}
// eslint-disable-next-line @typescript-eslint/no-empty-interface
interface SvelteVideoProps extends svelte.JSX.SvelteVideoProps {}
// no "extends svelte.JSX" because else we wouldn't get the references to the right interfaces
interface IntrinsicElements {
// HTML
a: HTMLProps & SapperAnchorProps & SvelteKitAnchorProps;
abbr: HTMLProps;
address: HTMLProps;
area: HTMLProps;
article: HTMLProps;
aside: HTMLProps;
audio: HTMLProps & SvelteMediaProps;
b: HTMLProps;
base: HTMLProps;
bdi: HTMLProps;
bdo: HTMLProps;
big: HTMLProps;
blockquote: HTMLProps;
body: HTMLProps;
br: HTMLProps;
button: HTMLProps;
canvas: HTMLProps;
caption: HTMLProps;
cite: HTMLProps;
code: HTMLProps;
col: HTMLProps;
colgroup: HTMLProps;
data: HTMLProps;
datalist: HTMLProps;
dd: HTMLProps;
del: HTMLProps;
details: HTMLProps;
dfn: HTMLProps;
dialog: HTMLProps;
div: HTMLProps;
dl: HTMLProps;
dt: HTMLProps;
em: HTMLProps;
embed: HTMLProps;
fieldset: HTMLProps;
figcaption: HTMLProps;
figure: HTMLProps;
footer: HTMLProps;
form: HTMLProps;
h1: HTMLProps;
h2: HTMLProps;
h3: HTMLProps;
h4: HTMLProps;
h5: HTMLProps;
h6: HTMLProps;
head: HTMLProps;
header: HTMLProps;
hgroup: HTMLProps;
hr: HTMLProps;
html: HTMLProps;
i: HTMLProps;
iframe: HTMLProps;
img: HTMLProps;
input: SvelteInputProps;
ins: HTMLProps;
kbd: HTMLProps;
keygen: HTMLProps;
label: HTMLProps;
legend: HTMLProps;
li: HTMLProps;
link: HTMLProps;
main: HTMLProps;
map: HTMLProps;
mark: HTMLProps;
menu: HTMLProps;
menuitem: HTMLProps;
meta: HTMLProps;
meter: HTMLProps;
nav: HTMLProps;
noindex: HTMLProps;
noscript: HTMLProps;
object: HTMLProps;
ol: HTMLProps;
optgroup: HTMLProps;
option: HTMLProps;
output: HTMLProps;
p: HTMLProps;
param: HTMLProps;
picture: HTMLProps;
pre: HTMLProps;
progress: HTMLProps;
q: HTMLProps;
rp: HTMLProps;
rt: HTMLProps;
ruby: HTMLProps;
s: HTMLProps;
samp: HTMLProps;
script: HTMLProps;
section: HTMLProps;
select: HTMLProps;
small: HTMLProps;
source: HTMLProps;
span: HTMLProps;
strong: HTMLProps;
style: HTMLProps;
sub: HTMLProps;
summary: HTMLProps;
sup: HTMLProps;
table: HTMLProps;
tbody: HTMLProps;
td: HTMLProps;
textarea: HTMLProps;
tfoot: HTMLProps;
th: HTMLProps;
thead: HTMLProps;
time: HTMLProps;
title: HTMLProps;
tr: HTMLProps;
track: HTMLProps;
u: HTMLProps;
ul: HTMLProps;
var: HTMLProps;
video: HTMLProps & SvelteVideoProps;
wbr: HTMLProps;
svg: SVGProps;
animate: SVGProps; // @TODO: It is SVGAnimateElement but not in dom.d.ts for now.
circle: SVGProps;
clipPath: SVGProps;
defs: SVGProps;
desc: SVGProps;
ellipse: SVGProps;
feBlend: SVGProps;
feColorMatrix: SVGProps;
feComponentTransfer: SVGProps;
feComposite: SVGProps;
feConvolveMatrix: SVGProps;
feDiffuseLighting: SVGProps;
feDisplacementMap: SVGProps;
feDistantLight: SVGProps;
feFlood: SVGProps;
feFuncA: SVGProps;
feFuncB: SVGProps;
feFuncG: SVGProps;
feFuncR: SVGProps;
feGaussianBlur: SVGProps;
feImage: SVGProps;
feMerge: SVGProps;
feMergeNode: SVGProps;
feMorphology: SVGProps;
feOffset: SVGProps;
fePointLight: SVGProps;
feSpecularLighting: SVGProps;
feSpotLight: SVGProps;
feTile: SVGProps;
feTurbulence: SVGProps;
filter: SVGProps;
foreignObject: SVGProps;
g: SVGProps;
image: SVGProps;
line: SVGProps;
linearGradient: SVGProps;
marker: SVGProps;
mask: SVGProps;
metadata: SVGProps;
path: SVGProps;
pattern: SVGProps;
polygon: SVGProps;
polyline: SVGProps;
radialGradient: SVGProps;
rect: SVGProps;
stop: SVGProps;
switch: SVGProps;
symbol: SVGProps;
text: SVGProps;
textPath: SVGProps;
tspan: SVGProps;
use: SVGProps;
view: SVGProps;
// Svelte specific
sveltewindow: HTMLProps & SvelteWindowProps;
sveltebody: HTMLProps;
sveltefragment: { slot?: string; };
svelteoptions: { [name: string]: any };
sveltehead: { [name: string]: any };
[name: string]: { [name: string]: any };
}
}
/**
* Adapted from jsx-dom
* @see https://github.com/proteriax/jsx-dom/blob/be06937ba16908d87bf8aa4372a3583133e02b8a/index.d.ts
*
* which was adapted from
*
* Adapted from React’s TypeScript definition from DefinitelyTyped.
* @see https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/react/index.d.ts
*/
declare namespace svelte.JSX {
/* svelte specific */
interface ElementClass {
$$prop_def: any;
}
interface ElementAttributesProperty {
$$prop_def: any; // specify the property name to use
}
/* html jsx */
export type Child = Node | Node[] | string | number;
export type Children = Child | Child[];
type NativeElement = HTMLElement;
interface IntrinsicAttributes {
slot?: string;
}
// TypeScript SVGElement has no `dataset` (Chrome 55+, Firefox 51+).
type Element = NativeElement & {
dataset: DOMStringMap;
};
//
// Event Handler Types
// ----------------------------------------------------------------------
type EventHandler =
(event: E & { currentTarget: EventTarget & T}) => any;
type ClipboardEventHandler = EventHandler;
type CompositionEventHandler = EventHandler;
type DragEventHandler = EventHandler;
type FocusEventHandler = EventHandler;
type FormEventHandler = EventHandler;
type ChangeEventHandler = EventHandler;
type KeyboardEventHandler = EventHandler;
type MouseEventHandler = EventHandler;
type TouchEventHandler = EventHandler;
type PointerEventHandler = EventHandler;
type UIEventHandler = EventHandler;
type WheelEventHandler = EventHandler;
type AnimationEventHandler = EventHandler;
type TransitionEventHandler = EventHandler;
type MessageEventHandler = EventHandler;
// See CSS 3 CSS-wide keywords https://www.w3.org/TR/css3-values/#common-keywords
// See CSS 3 Explicit Defaulting https://www.w3.org/TR/css-cascade-3/#defaulting-keywords
// "all CSS properties can accept these values"
type CSSWideKeyword = 'initial' | 'inherit' | 'unset';
// See CSS 3 type https://drafts.csswg.org/css-values-3/#percentages
type CSSPercentage = string;
// See CSS 3 type https://drafts.csswg.org/css-values-3/#lengths
type CSSLength = number | string;
// This interface is not complete. Only properties accepting
// unit-less numbers are listed here (see CSSProperty.js in React)
interface DOMAttributes {
// jsx-dom specific
/* children?: Children;
innerText?: string;
namespaceURI?: string;
ref?: ((e: T) => void) | Ref; */
// Clipboard Events
oncopy?: ClipboardEventHandler | undefined | null;
oncut?: ClipboardEventHandler