svelte2tsx 0.4.13 → 0.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +14 -1
- package/index.js +1815 -253
- package/index.mjs +1815 -253
- package/package.json +2 -2
- package/svelte-jsx.d.ts +302 -1
- package/svelte-native-jsx.d.ts +10 -0
- package/svelte-shims.d.ts +43 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "svelte2tsx",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.2",
|
|
4
4
|
"description": "Convert Svelte components to TSX for type checking",
|
|
5
5
|
"author": "David Pershouse",
|
|
6
6
|
"license": "MIT",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"source-map": "^0.6.1",
|
|
35
35
|
"source-map-support": "^0.5.16",
|
|
36
36
|
"sourcemap-codec": "^1.4.8",
|
|
37
|
-
"svelte": "~3.
|
|
37
|
+
"svelte": "~3.46.1",
|
|
38
38
|
"tiny-glob": "^0.2.6",
|
|
39
39
|
"tslib": "^1.10.0",
|
|
40
40
|
"typescript": "^4.5.3"
|
package/svelte-jsx.d.ts
CHANGED
|
@@ -1,5 +1,303 @@
|
|
|
1
1
|
/// <reference lib="dom" />
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
declare namespace svelteHTML {
|
|
4
|
+
|
|
5
|
+
// Every namespace eligible for use needs to implement the following two functions
|
|
6
|
+
function mapElementTag<K extends keyof ElementTagNameMap>(
|
|
7
|
+
tag: K
|
|
8
|
+
): ElementTagNameMap[K];
|
|
9
|
+
function mapElementTag<K extends keyof SVGElementTagNameMap>(
|
|
10
|
+
tag: K
|
|
11
|
+
): SVGElementTagNameMap[K];
|
|
12
|
+
function mapElementTag(
|
|
13
|
+
tag: any
|
|
14
|
+
): HTMLElement;
|
|
15
|
+
|
|
16
|
+
function createElement<Elements extends IntrinsicElements, Key extends keyof Elements>(
|
|
17
|
+
element: Key, attrs: Elements[Key]
|
|
18
|
+
): Key extends keyof ElementTagNameMap ? ElementTagNameMap[Key] : Key extends keyof SVGElementTagNameMap ? SVGElementTagNameMap[Key] : HTMLElement;
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
type NativeElement = HTMLElement;
|
|
22
|
+
|
|
23
|
+
// TypeScript SVGElement has no `dataset` (Chrome 55+, Firefox 51+).
|
|
24
|
+
type Element = NativeElement & {
|
|
25
|
+
dataset: DOMStringMap;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
//
|
|
29
|
+
// Event Handler Types
|
|
30
|
+
// ----------------------------------------------------------------------
|
|
31
|
+
type EventHandler<E extends Event = Event, T extends EventTarget = HTMLElement> =
|
|
32
|
+
svelte.JSX.EventHandler<E,T>;
|
|
33
|
+
|
|
34
|
+
type ClipboardEventHandler<T extends EventTarget> = svelte.JSX.ClipboardEventHandler<T>;
|
|
35
|
+
type CompositionEventHandler<T extends EventTarget> = svelte.JSX.CompositionEventHandler<T>;
|
|
36
|
+
type DragEventHandler<T extends EventTarget> = svelte.JSX.DragEventHandler<T>;
|
|
37
|
+
type FocusEventHandler<T extends EventTarget> = svelte.JSX.FocusEventHandler<T>;
|
|
38
|
+
type FormEventHandler<T extends EventTarget> = svelte.JSX.FormEventHandler<T>;
|
|
39
|
+
type ChangeEventHandler<T extends EventTarget> = svelte.JSX.ChangeEventHandler<T>;
|
|
40
|
+
type KeyboardEventHandler<T extends EventTarget> = svelte.JSX.KeyboardEventHandler<T>;
|
|
41
|
+
type MouseEventHandler<T extends EventTarget> = svelte.JSX.MouseEventHandler<T>;
|
|
42
|
+
type TouchEventHandler<T extends EventTarget> = svelte.JSX.TouchEventHandler<T>;
|
|
43
|
+
type PointerEventHandler<T extends EventTarget> = svelte.JSX.PointerEventHandler<T>;
|
|
44
|
+
type UIEventHandler<T extends EventTarget> = svelte.JSX.UIEventHandler<T>;
|
|
45
|
+
type WheelEventHandler<T extends EventTarget> = svelte.JSX.WheelEventHandler<T>;
|
|
46
|
+
type AnimationEventHandler<T extends EventTarget> = svelte.JSX.AnimationEventHandler<T>;
|
|
47
|
+
type TransitionEventHandler<T extends EventTarget> = svelte.JSX.TransitionEventHandler<T>;
|
|
48
|
+
type MessageEventHandler<T extends EventTarget> = svelte.JSX.MessageEventHandler<T>;
|
|
49
|
+
|
|
50
|
+
// See CSS 3 CSS-wide keywords https://www.w3.org/TR/css3-values/#common-keywords
|
|
51
|
+
// See CSS 3 Explicit Defaulting https://www.w3.org/TR/css-cascade-3/#defaulting-keywords
|
|
52
|
+
// "all CSS properties can accept these values"
|
|
53
|
+
type CSSWideKeyword = svelte.JSX.CSSWideKeyword;
|
|
54
|
+
|
|
55
|
+
// See CSS 3 <percentage> type https://drafts.csswg.org/css-values-3/#percentages
|
|
56
|
+
type CSSPercentage = svelte.JSX.CSSPercentage;
|
|
57
|
+
|
|
58
|
+
// See CSS 3 <length> type https://drafts.csswg.org/css-values-3/#lengths
|
|
59
|
+
type CSSLength = svelte.JSX.CSSLength;
|
|
60
|
+
|
|
61
|
+
// This interface is not complete. Only properties accepting
|
|
62
|
+
// unit-less numbers are listed here (see CSSProperty.js in React)
|
|
63
|
+
|
|
64
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
|
65
|
+
interface DOMAttributes<T extends EventTarget> extends svelte.JSX.DOMAttributes<T> {}
|
|
66
|
+
|
|
67
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
|
68
|
+
interface AriaAttributes extends svelte.JSX.AriaAttributes {}
|
|
69
|
+
|
|
70
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
|
71
|
+
interface HTMLAttributes<T extends EventTarget> extends svelte.JSX.HTMLAttributes<T> {}
|
|
72
|
+
|
|
73
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
|
74
|
+
interface SVGAttributes<T extends EventTarget> extends svelte.JSX.SVGAttributes<T> {
|
|
75
|
+
'xlink:actuate'?: string | undefined;
|
|
76
|
+
'xlink:arcrole'?: string | undefined;
|
|
77
|
+
'xlink:href'?: string | undefined;
|
|
78
|
+
'xlink:role'?: string | undefined;
|
|
79
|
+
'xlink:show'?: string | undefined;
|
|
80
|
+
'xlink:title'?: string | undefined;
|
|
81
|
+
'xlink:type'?: string | undefined;
|
|
82
|
+
'xml:base'?: string | undefined;
|
|
83
|
+
'xml:lang'?: string | undefined;
|
|
84
|
+
'xml:space'?: string | undefined;
|
|
85
|
+
'xmlns'?: string | undefined;
|
|
86
|
+
'xmlns:xlink'?: string | undefined;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
|
90
|
+
interface HTMLProps<T extends EventTarget> extends HTMLAttributes<T> {}
|
|
91
|
+
|
|
92
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
|
93
|
+
interface SVGProps<T extends EventTarget> extends SVGAttributes<T> {}
|
|
94
|
+
|
|
95
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
|
96
|
+
interface SvelteInputProps extends svelte.JSX.SvelteInputProps {}
|
|
97
|
+
|
|
98
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
|
99
|
+
interface SvelteWindowProps extends svelte.JSX.SvelteWindowProps {}
|
|
100
|
+
|
|
101
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
|
102
|
+
interface SapperAnchorProps extends svelte.JSX.SapperAnchorProps {}
|
|
103
|
+
|
|
104
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
|
105
|
+
interface SvelteKitAnchorProps extends svelte.JSX.SvelteKitAnchorProps {}
|
|
106
|
+
|
|
107
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
|
108
|
+
interface SvelteMediaTimeRange extends svelte.JSX.SvelteMediaTimeRange {}
|
|
109
|
+
|
|
110
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
|
111
|
+
interface SvelteMediaProps extends svelte.JSX.SvelteMediaProps {}
|
|
112
|
+
|
|
113
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
|
114
|
+
interface SvelteVideoProps extends svelte.JSX.SvelteVideoProps {}
|
|
115
|
+
|
|
116
|
+
// no "extends svelte.JSX" because else we wouldn't get the references to the right interfaces
|
|
117
|
+
interface IntrinsicElements {
|
|
118
|
+
// HTML
|
|
119
|
+
a: HTMLProps<HTMLAnchorElement> & SapperAnchorProps & SvelteKitAnchorProps;
|
|
120
|
+
abbr: HTMLProps<HTMLElement>;
|
|
121
|
+
address: HTMLProps<HTMLElement>;
|
|
122
|
+
area: HTMLProps<HTMLAreaElement>;
|
|
123
|
+
article: HTMLProps<HTMLElement>;
|
|
124
|
+
aside: HTMLProps<HTMLElement>;
|
|
125
|
+
audio: HTMLProps<HTMLAudioElement> & SvelteMediaProps;
|
|
126
|
+
b: HTMLProps<HTMLElement>;
|
|
127
|
+
base: HTMLProps<HTMLBaseElement>;
|
|
128
|
+
bdi: HTMLProps<HTMLElement>;
|
|
129
|
+
bdo: HTMLProps<HTMLElement>;
|
|
130
|
+
big: HTMLProps<HTMLElement>;
|
|
131
|
+
blockquote: HTMLProps<HTMLElement>;
|
|
132
|
+
body: HTMLProps<HTMLBodyElement>;
|
|
133
|
+
br: HTMLProps<HTMLBRElement>;
|
|
134
|
+
button: HTMLProps<HTMLButtonElement>;
|
|
135
|
+
canvas: HTMLProps<HTMLCanvasElement>;
|
|
136
|
+
caption: HTMLProps<HTMLElement>;
|
|
137
|
+
cite: HTMLProps<HTMLElement>;
|
|
138
|
+
code: HTMLProps<HTMLElement>;
|
|
139
|
+
col: HTMLProps<HTMLTableColElement>;
|
|
140
|
+
colgroup: HTMLProps<HTMLTableColElement>;
|
|
141
|
+
data: HTMLProps<HTMLElement>;
|
|
142
|
+
datalist: HTMLProps<HTMLDataListElement>;
|
|
143
|
+
dd: HTMLProps<HTMLElement>;
|
|
144
|
+
del: HTMLProps<HTMLElement>;
|
|
145
|
+
details: HTMLProps<HTMLElement>;
|
|
146
|
+
dfn: HTMLProps<HTMLElement>;
|
|
147
|
+
dialog: HTMLProps<HTMLElement>;
|
|
148
|
+
div: HTMLProps<HTMLDivElement>;
|
|
149
|
+
dl: HTMLProps<HTMLDListElement>;
|
|
150
|
+
dt: HTMLProps<HTMLElement>;
|
|
151
|
+
em: HTMLProps<HTMLElement>;
|
|
152
|
+
embed: HTMLProps<HTMLEmbedElement>;
|
|
153
|
+
fieldset: HTMLProps<HTMLFieldSetElement>;
|
|
154
|
+
figcaption: HTMLProps<HTMLElement>;
|
|
155
|
+
figure: HTMLProps<HTMLElement>;
|
|
156
|
+
footer: HTMLProps<HTMLElement>;
|
|
157
|
+
form: HTMLProps<HTMLFormElement>;
|
|
158
|
+
h1: HTMLProps<HTMLHeadingElement>;
|
|
159
|
+
h2: HTMLProps<HTMLHeadingElement>;
|
|
160
|
+
h3: HTMLProps<HTMLHeadingElement>;
|
|
161
|
+
h4: HTMLProps<HTMLHeadingElement>;
|
|
162
|
+
h5: HTMLProps<HTMLHeadingElement>;
|
|
163
|
+
h6: HTMLProps<HTMLHeadingElement>;
|
|
164
|
+
head: HTMLProps<HTMLHeadElement>;
|
|
165
|
+
header: HTMLProps<HTMLElement>;
|
|
166
|
+
hgroup: HTMLProps<HTMLElement>;
|
|
167
|
+
hr: HTMLProps<HTMLHRElement>;
|
|
168
|
+
html: HTMLProps<HTMLHtmlElement>;
|
|
169
|
+
i: HTMLProps<HTMLElement>;
|
|
170
|
+
iframe: HTMLProps<HTMLIFrameElement>;
|
|
171
|
+
img: HTMLProps<HTMLImageElement>;
|
|
172
|
+
input: SvelteInputProps;
|
|
173
|
+
ins: HTMLProps<HTMLModElement>;
|
|
174
|
+
kbd: HTMLProps<HTMLElement>;
|
|
175
|
+
keygen: HTMLProps<HTMLElement>;
|
|
176
|
+
label: HTMLProps<HTMLLabelElement>;
|
|
177
|
+
legend: HTMLProps<HTMLLegendElement>;
|
|
178
|
+
li: HTMLProps<HTMLLIElement>;
|
|
179
|
+
link: HTMLProps<HTMLLinkElement>;
|
|
180
|
+
main: HTMLProps<HTMLElement>;
|
|
181
|
+
map: HTMLProps<HTMLMapElement>;
|
|
182
|
+
mark: HTMLProps<HTMLElement>;
|
|
183
|
+
menu: HTMLProps<HTMLElement>;
|
|
184
|
+
menuitem: HTMLProps<HTMLElement>;
|
|
185
|
+
meta: HTMLProps<HTMLMetaElement>;
|
|
186
|
+
meter: HTMLProps<HTMLElement>;
|
|
187
|
+
nav: HTMLProps<HTMLElement>;
|
|
188
|
+
noindex: HTMLProps<HTMLElement>;
|
|
189
|
+
noscript: HTMLProps<HTMLElement>;
|
|
190
|
+
object: HTMLProps<HTMLObjectElement>;
|
|
191
|
+
ol: HTMLProps<HTMLOListElement>;
|
|
192
|
+
optgroup: HTMLProps<HTMLOptGroupElement>;
|
|
193
|
+
option: HTMLProps<HTMLOptionElement>;
|
|
194
|
+
output: HTMLProps<HTMLElement>;
|
|
195
|
+
p: HTMLProps<HTMLParagraphElement>;
|
|
196
|
+
param: HTMLProps<HTMLParamElement>;
|
|
197
|
+
picture: HTMLProps<HTMLElement>;
|
|
198
|
+
pre: HTMLProps<HTMLPreElement>;
|
|
199
|
+
progress: HTMLProps<HTMLProgressElement>;
|
|
200
|
+
q: HTMLProps<HTMLQuoteElement>;
|
|
201
|
+
rp: HTMLProps<HTMLElement>;
|
|
202
|
+
rt: HTMLProps<HTMLElement>;
|
|
203
|
+
ruby: HTMLProps<HTMLElement>;
|
|
204
|
+
s: HTMLProps<HTMLElement>;
|
|
205
|
+
samp: HTMLProps<HTMLElement>;
|
|
206
|
+
script: HTMLProps<HTMLElement>;
|
|
207
|
+
section: HTMLProps<HTMLElement>;
|
|
208
|
+
select: HTMLProps<HTMLSelectElement>;
|
|
209
|
+
small: HTMLProps<HTMLElement>;
|
|
210
|
+
source: HTMLProps<HTMLSourceElement>;
|
|
211
|
+
span: HTMLProps<HTMLSpanElement>;
|
|
212
|
+
strong: HTMLProps<HTMLElement>;
|
|
213
|
+
style: HTMLProps<HTMLStyleElement>;
|
|
214
|
+
sub: HTMLProps<HTMLElement>;
|
|
215
|
+
summary: HTMLProps<HTMLElement>;
|
|
216
|
+
sup: HTMLProps<HTMLElement>;
|
|
217
|
+
table: HTMLProps<HTMLTableElement>;
|
|
218
|
+
tbody: HTMLProps<HTMLTableSectionElement>;
|
|
219
|
+
td: HTMLProps<HTMLTableDataCellElement>;
|
|
220
|
+
textarea: HTMLProps<HTMLTextAreaElement>;
|
|
221
|
+
tfoot: HTMLProps<HTMLTableSectionElement>;
|
|
222
|
+
th: HTMLProps<HTMLTableHeaderCellElement>;
|
|
223
|
+
thead: HTMLProps<HTMLTableSectionElement>;
|
|
224
|
+
time: HTMLProps<HTMLElement>;
|
|
225
|
+
title: HTMLProps<HTMLTitleElement>;
|
|
226
|
+
tr: HTMLProps<HTMLTableRowElement>;
|
|
227
|
+
track: HTMLProps<HTMLTrackElement>;
|
|
228
|
+
u: HTMLProps<HTMLElement>;
|
|
229
|
+
ul: HTMLProps<HTMLUListElement>;
|
|
230
|
+
var: HTMLProps<HTMLElement>;
|
|
231
|
+
video: HTMLProps<HTMLVideoElement> & SvelteVideoProps;
|
|
232
|
+
wbr: HTMLProps<HTMLElement>;
|
|
233
|
+
|
|
234
|
+
svg: SVGProps<SVGSVGElement>;
|
|
235
|
+
|
|
236
|
+
animate: SVGProps<SVGElement>; // @TODO: It is SVGAnimateElement but not in dom.d.ts for now.
|
|
237
|
+
circle: SVGProps<SVGCircleElement>;
|
|
238
|
+
clipPath: SVGProps<SVGClipPathElement>;
|
|
239
|
+
defs: SVGProps<SVGDefsElement>;
|
|
240
|
+
desc: SVGProps<SVGDescElement>;
|
|
241
|
+
ellipse: SVGProps<SVGEllipseElement>;
|
|
242
|
+
feBlend: SVGProps<SVGFEBlendElement>;
|
|
243
|
+
feColorMatrix: SVGProps<SVGFEColorMatrixElement>;
|
|
244
|
+
feComponentTransfer: SVGProps<SVGFEComponentTransferElement>;
|
|
245
|
+
feComposite: SVGProps<SVGFECompositeElement>;
|
|
246
|
+
feConvolveMatrix: SVGProps<SVGFEConvolveMatrixElement>;
|
|
247
|
+
feDiffuseLighting: SVGProps<SVGFEDiffuseLightingElement>;
|
|
248
|
+
feDisplacementMap: SVGProps<SVGFEDisplacementMapElement>;
|
|
249
|
+
feDistantLight: SVGProps<SVGFEDistantLightElement>;
|
|
250
|
+
feFlood: SVGProps<SVGFEFloodElement>;
|
|
251
|
+
feFuncA: SVGProps<SVGFEFuncAElement>;
|
|
252
|
+
feFuncB: SVGProps<SVGFEFuncBElement>;
|
|
253
|
+
feFuncG: SVGProps<SVGFEFuncGElement>;
|
|
254
|
+
feFuncR: SVGProps<SVGFEFuncRElement>;
|
|
255
|
+
feGaussianBlur: SVGProps<SVGFEGaussianBlurElement>;
|
|
256
|
+
feImage: SVGProps<SVGFEImageElement>;
|
|
257
|
+
feMerge: SVGProps<SVGFEMergeElement>;
|
|
258
|
+
feMergeNode: SVGProps<SVGFEMergeNodeElement>;
|
|
259
|
+
feMorphology: SVGProps<SVGFEMorphologyElement>;
|
|
260
|
+
feOffset: SVGProps<SVGFEOffsetElement>;
|
|
261
|
+
fePointLight: SVGProps<SVGFEPointLightElement>;
|
|
262
|
+
feSpecularLighting: SVGProps<SVGFESpecularLightingElement>;
|
|
263
|
+
feSpotLight: SVGProps<SVGFESpotLightElement>;
|
|
264
|
+
feTile: SVGProps<SVGFETileElement>;
|
|
265
|
+
feTurbulence: SVGProps<SVGFETurbulenceElement>;
|
|
266
|
+
filter: SVGProps<SVGFilterElement>;
|
|
267
|
+
foreignObject: SVGProps<SVGForeignObjectElement>;
|
|
268
|
+
g: SVGProps<SVGGElement>;
|
|
269
|
+
image: SVGProps<SVGImageElement>;
|
|
270
|
+
line: SVGProps<SVGLineElement>;
|
|
271
|
+
linearGradient: SVGProps<SVGLinearGradientElement>;
|
|
272
|
+
marker: SVGProps<SVGMarkerElement>;
|
|
273
|
+
mask: SVGProps<SVGMaskElement>;
|
|
274
|
+
metadata: SVGProps<SVGMetadataElement>;
|
|
275
|
+
path: SVGProps<SVGPathElement>;
|
|
276
|
+
pattern: SVGProps<SVGPatternElement>;
|
|
277
|
+
polygon: SVGProps<SVGPolygonElement>;
|
|
278
|
+
polyline: SVGProps<SVGPolylineElement>;
|
|
279
|
+
radialGradient: SVGProps<SVGRadialGradientElement>;
|
|
280
|
+
rect: SVGProps<SVGRectElement>;
|
|
281
|
+
stop: SVGProps<SVGStopElement>;
|
|
282
|
+
switch: SVGProps<SVGSwitchElement>;
|
|
283
|
+
symbol: SVGProps<SVGSymbolElement>;
|
|
284
|
+
text: SVGProps<SVGTextElement>;
|
|
285
|
+
textPath: SVGProps<SVGTextPathElement>;
|
|
286
|
+
tspan: SVGProps<SVGTSpanElement>;
|
|
287
|
+
use: SVGProps<SVGUseElement>;
|
|
288
|
+
view: SVGProps<SVGViewElement>;
|
|
289
|
+
|
|
290
|
+
// Svelte specific
|
|
291
|
+
sveltewindow: HTMLProps<Window> & SvelteWindowProps;
|
|
292
|
+
sveltebody: HTMLProps<HTMLElement>;
|
|
293
|
+
sveltefragment: { slot?: string; };
|
|
294
|
+
svelteoptions: { [name: string]: any };
|
|
295
|
+
sveltehead: { [name: string]: any };
|
|
296
|
+
|
|
297
|
+
[name: string]: { [name: string]: any };
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
|
|
3
301
|
/**
|
|
4
302
|
* Adapted from jsx-dom
|
|
5
303
|
* @see https://github.com/proteriax/jsx-dom/blob/be06937ba16908d87bf8aa4372a3583133e02b8a/index.d.ts
|
|
@@ -555,6 +853,7 @@ declare namespace svelte.JSX {
|
|
|
555
853
|
tabindex?: number | undefined | null;
|
|
556
854
|
target?: string | undefined | null;
|
|
557
855
|
title?: string | undefined | null;
|
|
856
|
+
translate?: "yes" | "no" | "" | undefined | null;
|
|
558
857
|
type?: string | undefined | null;
|
|
559
858
|
usemap?: string | undefined | null;
|
|
560
859
|
value?: any | undefined | null;
|
|
@@ -1146,6 +1445,8 @@ declare namespace svelte.JSX {
|
|
|
1146
1445
|
sveltewindow: HTMLProps<Window> & SvelteWindowProps;
|
|
1147
1446
|
sveltebody: HTMLProps<HTMLElement>;
|
|
1148
1447
|
sveltefragment: { slot?: string; };
|
|
1448
|
+
svelteoptions: { [name: string]: any };
|
|
1449
|
+
sveltehead: { [name: string]: any };
|
|
1149
1450
|
|
|
1150
1451
|
[name: string]: { [name: string]: any };
|
|
1151
1452
|
}
|
package/svelte-native-jsx.d.ts
CHANGED
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
/* eslint @typescript-eslint/no-unused-vars: off */
|
|
2
2
|
declare namespace svelteNative.JSX {
|
|
3
3
|
|
|
4
|
+
// Every namespace eligible for use needs to implement the following two functions
|
|
5
|
+
function mapElementTag(
|
|
6
|
+
tag: string
|
|
7
|
+
): any;
|
|
8
|
+
|
|
9
|
+
function createElement<Elements extends IntrinsicElements, Key extends keyof Elements>(
|
|
10
|
+
element: Key, attrs: Elements[Key]
|
|
11
|
+
): any;
|
|
12
|
+
|
|
13
|
+
|
|
4
14
|
/* svelte specific */
|
|
5
15
|
interface ElementClass {
|
|
6
16
|
$$prop_def: any;
|
package/svelte-shims.d.ts
CHANGED
|
@@ -120,6 +120,7 @@ declare function __sveltets_1_ensureAction(actionCall: SvelteActionReturnType):
|
|
|
120
120
|
declare function __sveltets_1_ensureTransition(transitionCall: SvelteTransitionReturnType): {};
|
|
121
121
|
declare function __sveltets_1_ensureFunction(expression: (e: Event & { detail?: any }) => unknown ): {};
|
|
122
122
|
declare function __sveltets_1_ensureType<T>(type: AConstructorTypeOf<T>, el: T): {};
|
|
123
|
+
declare function __sveltets_1_ensureType<T1, T2>(type1: AConstructorTypeOf<T1>, type2: AConstructorTypeOf<T2>, el: T1 | T2): {};
|
|
123
124
|
declare function __sveltets_1_createEnsureSlot<Slots = Record<string, Record<string, any>>>(): <K1 extends keyof Slots, K2 extends keyof Slots[K1]>(k1: K1, k2: K2, val: Slots[K1][K2]) => Slots[K1][K2];
|
|
124
125
|
declare function __sveltets_1_ensureRightProps<Props>(props: Props): {};
|
|
125
126
|
declare function __sveltets_1_cssProp(prop: Record<string, any>): {};
|
|
@@ -216,3 +217,45 @@ declare function __sveltets_1_createSvelte2TsxComponent<Props, Events, Slots>(
|
|
|
216
217
|
|
|
217
218
|
declare function __sveltets_1_unwrapArr<T>(arr: ArrayLike<T>): T
|
|
218
219
|
declare function __sveltets_1_unwrapPromiseLike<T>(promise: PromiseLike<T> | T): T
|
|
220
|
+
|
|
221
|
+
// v2
|
|
222
|
+
declare function __sveltets_2_createCreateSlot<Slots = Record<string, Record<string, any>>>(): <SlotName extends keyof Slots>(slotName: SlotName, attrs: Slots[SlotName]) => Record<string, any>;
|
|
223
|
+
declare function __sveltets_2_createComponentAny(props: Record<string, any>): Svelte2TsxComponent<any, any, any>;
|
|
224
|
+
|
|
225
|
+
declare function __sveltets_2_any(...dummy: any[]): any;
|
|
226
|
+
declare function __sveltets_2_empty(...dummy: any[]): {};
|
|
227
|
+
|
|
228
|
+
declare function __sveltets_2_cssProp(prop: Record<string, any>): {};
|
|
229
|
+
|
|
230
|
+
type __sveltets_2_SvelteAnimationReturnType = {
|
|
231
|
+
delay?: number,
|
|
232
|
+
duration?: number,
|
|
233
|
+
easing?: (t: number) => number,
|
|
234
|
+
css?: (t: number, u: number) => string,
|
|
235
|
+
tick?: (t: number, u: number) => void
|
|
236
|
+
}
|
|
237
|
+
declare var __sveltets_2_AnimationMove: { from: DOMRect, to: DOMRect }
|
|
238
|
+
declare function __sveltets_2_ensureAnimation(animationCall: __sveltets_2_SvelteAnimationReturnType): {};
|
|
239
|
+
|
|
240
|
+
type __sveltets_2_SvelteActionReturnType = {
|
|
241
|
+
update?: (args: any) => void,
|
|
242
|
+
destroy?: () => void
|
|
243
|
+
} | void
|
|
244
|
+
declare function __sveltets_2_ensureAction(actionCall: __sveltets_2_SvelteActionReturnType): {};
|
|
245
|
+
|
|
246
|
+
type __sveltets_2_SvelteTransitionConfig = {
|
|
247
|
+
delay?: number,
|
|
248
|
+
duration?: number,
|
|
249
|
+
easing?: (t: number) => number,
|
|
250
|
+
css?: (t: number, u: number) => string,
|
|
251
|
+
tick?: (t: number, u: number) => void
|
|
252
|
+
}
|
|
253
|
+
type __sveltets_2_SvelteTransitionReturnType = __sveltets_2_SvelteTransitionConfig | (() => __sveltets_2_SvelteTransitionConfig)
|
|
254
|
+
declare function __sveltets_2_ensureTransition(transitionCall: __sveltets_2_SvelteTransitionReturnType): {};
|
|
255
|
+
|
|
256
|
+
declare function __sveltets_2_ensureType<T>(type: AConstructorTypeOf<T>, el: T): {};
|
|
257
|
+
declare function __sveltets_2_ensureType<T1, T2>(type1: AConstructorTypeOf<T1>, type2: AConstructorTypeOf<T2>, el: T1 | T2): {};
|
|
258
|
+
|
|
259
|
+
declare function __sveltets_2_ensureComponent<T extends new (args: {target: any, props?: any}) => Svelte2TsxComponent<any, any, any>>(type: T): T extends never ? Svelte2TsxComponent<any, any, any> : T;
|
|
260
|
+
|
|
261
|
+
declare function __sveltets_2_ensureArray<T extends ArrayLike<unknown>>(array: T): T extends ArrayLike<infer U> ? U[] : any[];
|