@gradio/core 1.3.0 → 1.4.1

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.
@@ -0,0 +1,627 @@
1
+ import { describe, test, expect, vi } from "vitest";
2
+ import { spy } from "tinyspy";
3
+ import { setupWorker } from "msw/browser";
4
+ import { http, HttpResponse } from "msw";
5
+ import { Dependency, TargetMap } from "./types";
6
+ import { process_frontend_fn, create_target_meta, determine_interactivity, process_server_fn, get_component } from "./_init";
7
+ import { get_api_url } from "./init.svelte";
8
+ import { commands } from "@vitest/browser/context";
9
+ describe("process_frontend_fn", () => {
10
+ test("empty source code returns null", () => {
11
+ const source = "";
12
+ const fn = process_frontend_fn(source, false, 1, 1);
13
+ expect(fn).toBe(null);
14
+ });
15
+ test("falsey source code returns null: false", () => {
16
+ const source = false;
17
+ const fn = process_frontend_fn(source, false, 1, 1);
18
+ expect(fn).toBe(null);
19
+ });
20
+ test("falsey source code returns null: undefined", () => {
21
+ const source = undefined;
22
+ const fn = process_frontend_fn(source, false, 1, 1);
23
+ expect(fn).toBe(null);
24
+ });
25
+ test("falsey source code returns null: null", () => {
26
+ const source = null;
27
+ const fn = process_frontend_fn(source, false, 1, 1);
28
+ expect(fn).toBe(null);
29
+ });
30
+ test("source code returns a function", () => {
31
+ const source = "(arg) => arg";
32
+ const fn = process_frontend_fn(source, false, 1, 1);
33
+ expect(typeof fn).toBe("function");
34
+ });
35
+ test("arrays of values can be passed to the generated function", async () => {
36
+ const source = "(arg) => arg";
37
+ const fn = process_frontend_fn(source, false, 1, 1);
38
+ if (fn) {
39
+ await expect(fn([1])).resolves.toEqual([1]);
40
+ }
41
+ });
42
+ test("arrays of many values can be passed", async () => {
43
+ const source = "(...args) => args";
44
+ const fn = process_frontend_fn(source, false, 1, 1);
45
+ if (fn) {
46
+ await expect(fn([1, 2, 3, 4, 5, 6])).resolves.toEqual([1, 2, 3, 4, 5, 6]);
47
+ }
48
+ });
49
+ test("The generated function returns a promise", () => {
50
+ const source = "(arg) => arg";
51
+ const fn = process_frontend_fn(source, false, 1, 1);
52
+ if (fn) {
53
+ expect(fn([1])).toBeInstanceOf(Promise);
54
+ }
55
+ });
56
+ test("The generated function is callable and returns the expected value", async () => {
57
+ const source = "(arg) => arg";
58
+ const fn = process_frontend_fn(source, false, 1, 1);
59
+ if (fn) {
60
+ await expect(fn([1])).resolves.toEqual([1]);
61
+ }
62
+ });
63
+ test("The return value of the function is wrapped in an array if there is no backend function and the input length is 1", async () => {
64
+ const source = "(arg) => arg";
65
+ const fn = process_frontend_fn(source, false, 1, 1);
66
+ if (fn) {
67
+ await expect(fn([1])).resolves.toEqual([1]);
68
+ }
69
+ });
70
+ test("The return value of the function is not wrapped in an array if there is no backend function and the input length is greater than 1", async () => {
71
+ const source = "(arg) => arg";
72
+ const fn = process_frontend_fn(source, false, 2, 2);
73
+ if (fn) {
74
+ await expect(fn([1])).resolves.toEqual(1);
75
+ }
76
+ });
77
+ test("The return value of the function is wrapped in an array if there is a backend function and the input length is 1", async () => {
78
+ const source = "(arg) => arg";
79
+ const fn = process_frontend_fn(source, true, 1, 1);
80
+ if (fn) {
81
+ await expect(fn([1])).resolves.toEqual([1]);
82
+ }
83
+ });
84
+ test("The return value of the function is not wrapped in an array if there is a backend function and the input length is greater than 1", async () => {
85
+ const source = "(arg) => arg";
86
+ const fn = process_frontend_fn(source, true, 2, 2);
87
+ if (fn) {
88
+ await expect(fn([1])).resolves.toEqual(1);
89
+ }
90
+ });
91
+ });
92
+ describe("create_target_meta", () => {
93
+ test("creates a target map", () => {
94
+ const targets = [
95
+ [1, "change"],
96
+ [2, "input"],
97
+ [3, "load"]
98
+ ];
99
+ const fn_index = 0;
100
+ const target_map = {};
101
+ const result = create_target_meta(targets, fn_index, target_map);
102
+ expect(result).toEqual({
103
+ 1: { change: [0] },
104
+ 2: { input: [0] },
105
+ 3: { load: [0] }
106
+ });
107
+ });
108
+ test("if the target already exists, it adds the new trigger to the list", () => {
109
+ const targets = [
110
+ [1, "change"],
111
+ [1, "input"],
112
+ [1, "load"]
113
+ ];
114
+ const fn_index = 1;
115
+ const target_map = {
116
+ 1: { change: [0] }
117
+ };
118
+ const result = create_target_meta(targets, fn_index, target_map);
119
+ expect(result).toEqual({
120
+ 1: { change: [0, 1], input: [1], load: [1] }
121
+ });
122
+ });
123
+ test("if the trigger already exists, it adds the new function to the list", () => {
124
+ const targets = [
125
+ [1, "change"],
126
+ [2, "change"],
127
+ [3, "change"]
128
+ ];
129
+ const fn_index = 1;
130
+ const target_map = {
131
+ 1: { change: [0] },
132
+ 2: { change: [0] },
133
+ 3: { change: [0] }
134
+ };
135
+ const result = create_target_meta(targets, fn_index, target_map);
136
+ expect(result).toEqual({
137
+ 1: { change: [0, 1] },
138
+ 2: { change: [0, 1] },
139
+ 3: { change: [0, 1] }
140
+ });
141
+ });
142
+ test("if the target and trigger already exist, it adds the new function to the list", () => {
143
+ const targets = [[1, "change"]];
144
+ const fn_index = 1;
145
+ const target_map = {
146
+ 1: { change: [0] }
147
+ };
148
+ const result = create_target_meta(targets, fn_index, target_map);
149
+ expect(result).toEqual({
150
+ 1: { change: [0, 1] }
151
+ });
152
+ });
153
+ test("if the target, trigger and function id already exist, it does not add duplicates", () => {
154
+ const targets = [[1, "change"]];
155
+ const fn_index = 0;
156
+ const target_map = {
157
+ 1: { change: [0] }
158
+ };
159
+ const result = create_target_meta(targets, fn_index, target_map);
160
+ expect(result).toEqual({
161
+ 1: { change: [0] }
162
+ });
163
+ });
164
+ });
165
+ describe("determine_interactivity", () => {
166
+ test("returns true if the prop is interactive = true", () => {
167
+ const result = determine_interactivity(0, true, "hi", new Set([0]), new Set([2]));
168
+ expect(result).toBe(true);
169
+ });
170
+ test("returns false if the prop is interactive = false", () => {
171
+ const result = determine_interactivity(0, false, "hi", new Set([0]), new Set([2]));
172
+ expect(result).toBe(false);
173
+ });
174
+ test("returns true if the component is an input", () => {
175
+ const result = determine_interactivity(0, undefined, "hi", new Set([0]), new Set([2]));
176
+ expect(result).toBe(true);
177
+ });
178
+ test("returns true if the component is not an input or output and the component has no default value: empty string", () => {
179
+ const result = determine_interactivity(2, undefined, "", new Set([0]), new Set([1]));
180
+ expect(result).toBe(true);
181
+ });
182
+ test("returns true if the component is not an input or output and the component has no default value: empty array", () => {
183
+ const result = determine_interactivity(2, undefined, [], new Set([0]), new Set([1]));
184
+ expect(result).toBe(true);
185
+ });
186
+ test("returns true if the component is not an input or output and the component has no default value: boolean", () => {
187
+ const result = determine_interactivity(2, undefined, false, new Set([0]), new Set([1]));
188
+ expect(result).toBe(true);
189
+ });
190
+ test("returns true if the component is not an input or output and the component has no default value: undefined", () => {
191
+ const result = determine_interactivity(2, undefined, undefined, new Set([0]), new Set([1]));
192
+ expect(result).toBe(true);
193
+ });
194
+ test("returns true if the component is not an input or output and the component has no default value: null", () => {
195
+ const result = determine_interactivity(2, undefined, null, new Set([0]), new Set([1]));
196
+ expect(result).toBe(true);
197
+ });
198
+ test("returns true if the component is not an input or output and the component has no default value: 0", () => {
199
+ const result = determine_interactivity(2, undefined, 0, new Set([0]), new Set([1]));
200
+ expect(result).toBe(true);
201
+ });
202
+ test("returns false if the component is not an input or output and the component has a default value", () => {
203
+ const result = determine_interactivity(2, undefined, "hello", new Set([0]), new Set([1]));
204
+ expect(result).toBe(false);
205
+ });
206
+ });
207
+ describe("process_server_fn", () => {
208
+ test("returns an object", () => {
209
+ const result = process_server_fn(1, ["fn1", "fn2"], {});
210
+ expect(result).toBeTypeOf("object");
211
+ });
212
+ test("returns an object with the correct keys", () => {
213
+ const result = process_server_fn(1, ["fn1", "fn2"], {});
214
+ expect(Object.keys(result)).toEqual(["fn1", "fn2"]);
215
+ });
216
+ test("returns an object with the correct keys and values", () => {
217
+ const app = {
218
+ component_server: async (id, fn, args) => {
219
+ return args;
220
+ }
221
+ };
222
+ const result = process_server_fn(1, ["fn1", "fn2"], app);
223
+ expect(Object.keys(result)).toEqual(["fn1", "fn2"]);
224
+ expect(result.fn1).toBeInstanceOf(Function);
225
+ expect(result.fn2).toBeInstanceOf(Function);
226
+ });
227
+ test("returned server functions should resolve to a promise", async () => {
228
+ const app = {
229
+ component_server: async (id, fn, args) => {
230
+ return args;
231
+ }
232
+ };
233
+ const result = process_server_fn(1, ["fn1", "fn2"], app);
234
+ const response = result.fn1("hello");
235
+ expect(response).toBeInstanceOf(Promise);
236
+ });
237
+ test("the functions call the clients component_server function with the correct arguments ", async () => {
238
+ const mock = spy(async (id, fn, args) => {
239
+ return args;
240
+ });
241
+ const app = {
242
+ component_server: mock
243
+ };
244
+ const result = process_server_fn(1, ["fn1", "fn2"], app);
245
+ const response = await result.fn1("hello");
246
+ expect(response).toBe("hello");
247
+ expect(mock.calls).toEqual([[1, "fn1", "hello"]]);
248
+ });
249
+ test("if there are no server functions, it returns an empty object", () => {
250
+ const result = process_server_fn(1, undefined, {});
251
+ expect(result).toEqual({});
252
+ });
253
+ });
254
+ describe("get_component", () => {
255
+ test("returns an object", () => {
256
+ const result = get_component("test-component-one", "class_id", "root", []);
257
+ expect(result.component).toBeTypeOf("object");
258
+ });
259
+ test("returns an object with the correct keys", () => {
260
+ const result = get_component("test-component-one", "class_id", "root", []);
261
+ expect(Object.keys(result)).toEqual([
262
+ "component",
263
+ "name",
264
+ "example_components"
265
+ ]);
266
+ });
267
+ test("the component key is a promise", () => {
268
+ const result = get_component("test-component-one", "class_id", "root", []);
269
+ expect(result.component).toBeInstanceOf(Promise);
270
+ });
271
+ test("the resolved component key is an object", async () => {
272
+ const result = get_component("test-component-one", "class_id", "root", []);
273
+ const o = await result.component;
274
+ expect(o).toBeTypeOf("object");
275
+ });
276
+ test("getting the same component twice should return the same promise", () => {
277
+ const result = get_component("test-component-one", "class_id", "root", []);
278
+ const result_two = get_component("test-component-one", "class_id", "root", []);
279
+ expect(result.component).toBe(result_two.component);
280
+ });
281
+ test("if example components are not provided, the example_components key is undefined", async () => {
282
+ const result = get_component("dataset", "class_id", "root", []);
283
+ expect(result.example_components).toBe(undefined);
284
+ });
285
+ test("if the type is not a dataset, the example_components key is undefined", async () => {
286
+ const result = get_component("test-component-one", "class_id", "root", []);
287
+ expect(result.example_components).toBe(undefined);
288
+ });
289
+ test("when the type is a dataset, returns an object with the correct keys and values and example components", () => {
290
+ const result = get_component("dataset", "class_id", "root", [
291
+ {
292
+ type: "test-component-one",
293
+ component_class_id: "example_class_id",
294
+ id: 1,
295
+ props: {
296
+ value: "hi",
297
+ interactive: false
298
+ },
299
+ has_modes: false,
300
+ instance: {},
301
+ component: {}
302
+ }
303
+ ], ["test-component-one"]);
304
+ expect(result.component).toBeTypeOf("object");
305
+ expect(result.example_components).toBeInstanceOf(Map);
306
+ });
307
+ test("when example components are returned, returns an object with the correct keys and values and example components", () => {
308
+ const result = get_component("dataset", "class_id", "root", [
309
+ {
310
+ type: "test-component-one",
311
+ component_class_id: "example_class_id",
312
+ id: 1,
313
+ props: {
314
+ value: "hi",
315
+ interactive: false
316
+ },
317
+ key: "test-component-one",
318
+ has_modes: false,
319
+ instance: {},
320
+ component: {}
321
+ }
322
+ ], ["test-component-one"]);
323
+ expect(result.example_components?.get("test-component-one")).toBeTypeOf("object");
324
+ expect(result.example_components?.get("test-component-one")).toBeInstanceOf(Promise);
325
+ });
326
+ test.skip("if the component is not found then it should request the component from the server", async () => {
327
+ const api_url = "example.com";
328
+ const id = "test-random";
329
+ const variant = "component";
330
+ const handlers = [
331
+ http.get(`${api_url}/custom_component/${id}/client/${variant}/style.css`, () => {
332
+ return new HttpResponse('console.log("boo")', {
333
+ status: 200,
334
+ headers: {
335
+ "Content-Type": "text/css"
336
+ }
337
+ });
338
+ })
339
+ ];
340
+ // vi.mock calls are always hoisted out of the test function to the top of the file
341
+ // so we need to use vi.hoisted to hoist the mock function above the vi.mock call
342
+ const { mock } = vi.hoisted(() => {
343
+ return { mock: vi.fn() };
344
+ });
345
+ vi.mock(`example.com/custom_component/test-random/client/component/index.js`, async () => {
346
+ mock();
347
+ return {
348
+ default: {
349
+ default: "HELLO"
350
+ }
351
+ };
352
+ });
353
+ const worker = setupWorker(...handlers);
354
+ worker.start();
355
+ await get_component("test-random", id, api_url, []).component;
356
+ expect(mock).toHaveBeenCalled();
357
+ worker.stop();
358
+ });
359
+ });
360
+ describe("get_api_url", () => {
361
+ describe("root URL with trailing slash", () => {
362
+ test("root with trailing slash, api_prefix with leading slash", () => {
363
+ const config = {
364
+ root: "http://example.com/myapp/",
365
+ api_prefix: "/api",
366
+ theme: "default",
367
+ version: "1.0.0",
368
+ autoscroll: true
369
+ };
370
+ const result = get_api_url(config);
371
+ expect(result).toBe("http://example.com/myapp/api");
372
+ });
373
+ test("root with trailing slash, api_prefix without leading slash", () => {
374
+ const config = {
375
+ root: "http://example.com/myapp/",
376
+ api_prefix: "api",
377
+ theme: "default",
378
+ version: "1.0.0",
379
+ autoscroll: true
380
+ };
381
+ const result = get_api_url(config);
382
+ expect(result).toBe("http://example.com/myapp/api");
383
+ });
384
+ test("root at domain root with trailing slash", () => {
385
+ const config = {
386
+ root: "http://example.com/",
387
+ api_prefix: "/api",
388
+ theme: "default",
389
+ version: "1.0.0",
390
+ autoscroll: true
391
+ };
392
+ const result = get_api_url(config);
393
+ expect(result).toBe("http://example.com/api");
394
+ });
395
+ });
396
+ describe("root URL without trailing slash", () => {
397
+ test("root without trailing slash, api_prefix with leading slash", () => {
398
+ const config = {
399
+ root: "http://example.com/myapp",
400
+ api_prefix: "/api",
401
+ theme: "default",
402
+ version: "1.0.0",
403
+ autoscroll: true
404
+ };
405
+ const result = get_api_url(config);
406
+ expect(result).toBe("http://example.com/myapp/api");
407
+ });
408
+ test("root without trailing slash, api_prefix without leading slash", () => {
409
+ const config = {
410
+ root: "http://example.com/myapp",
411
+ api_prefix: "api",
412
+ theme: "default",
413
+ version: "1.0.0",
414
+ autoscroll: true
415
+ };
416
+ const result = get_api_url(config);
417
+ expect(result).toBe("http://example.com/myapp/api");
418
+ });
419
+ test("root at domain root without trailing slash", () => {
420
+ const config = {
421
+ root: "http://example.com",
422
+ api_prefix: "/api",
423
+ theme: "default",
424
+ version: "1.0.0",
425
+ autoscroll: true
426
+ };
427
+ const result = get_api_url(config);
428
+ expect(result).toBe("http://example.com/api");
429
+ });
430
+ });
431
+ describe("different root path combinations", () => {
432
+ test("root path is just '/'", () => {
433
+ const config = {
434
+ root: "http://example.com/",
435
+ api_prefix: "/api",
436
+ theme: "default",
437
+ version: "1.0.0",
438
+ autoscroll: true
439
+ };
440
+ const result = get_api_url(config);
441
+ expect(result).toBe("http://example.com/api");
442
+ });
443
+ test("root path is '/' without trailing slash", () => {
444
+ const config = {
445
+ root: "http://example.com",
446
+ api_prefix: "/api",
447
+ theme: "default",
448
+ version: "1.0.0",
449
+ autoscroll: true
450
+ };
451
+ const result = get_api_url(config);
452
+ expect(result).toBe("http://example.com/api");
453
+ });
454
+ test("root path is '/myapp'", () => {
455
+ const config = {
456
+ root: "http://example.com/myapp",
457
+ api_prefix: "/api",
458
+ theme: "default",
459
+ version: "1.0.0",
460
+ autoscroll: true
461
+ };
462
+ const result = get_api_url(config);
463
+ expect(result).toBe("http://example.com/myapp/api");
464
+ });
465
+ test("root path is '/myapp/'", () => {
466
+ const config = {
467
+ root: "http://example.com/myapp/",
468
+ api_prefix: "/api",
469
+ theme: "default",
470
+ version: "1.0.0",
471
+ autoscroll: true
472
+ };
473
+ const result = get_api_url(config);
474
+ expect(result).toBe("http://example.com/myapp/api");
475
+ });
476
+ test("root path is '/deep/nested/path'", () => {
477
+ const config = {
478
+ root: "http://example.com/deep/nested/path",
479
+ api_prefix: "/api",
480
+ theme: "default",
481
+ version: "1.0.0",
482
+ autoscroll: true
483
+ };
484
+ const result = get_api_url(config);
485
+ expect(result).toBe("http://example.com/deep/nested/path/api");
486
+ });
487
+ test("root path is '/deep/nested/path/'", () => {
488
+ const config = {
489
+ root: "http://example.com/deep/nested/path/",
490
+ api_prefix: "/api",
491
+ theme: "default",
492
+ version: "1.0.0",
493
+ autoscroll: true
494
+ };
495
+ const result = get_api_url(config);
496
+ expect(result).toBe("http://example.com/deep/nested/path/api");
497
+ });
498
+ });
499
+ describe("different api_prefix formats", () => {
500
+ test("api_prefix with leading slash", () => {
501
+ const config = {
502
+ root: "http://example.com/myapp",
503
+ api_prefix: "/api",
504
+ theme: "default",
505
+ version: "1.0.0",
506
+ autoscroll: true
507
+ };
508
+ const result = get_api_url(config);
509
+ expect(result).toBe("http://example.com/myapp/api");
510
+ });
511
+ test("api_prefix without leading slash", () => {
512
+ const config = {
513
+ root: "http://example.com/myapp",
514
+ api_prefix: "api",
515
+ theme: "default",
516
+ version: "1.0.0",
517
+ autoscroll: true
518
+ };
519
+ const result = get_api_url(config);
520
+ expect(result).toBe("http://example.com/myapp/api");
521
+ });
522
+ test("api_prefix with nested path and leading slash", () => {
523
+ const config = {
524
+ root: "http://example.com/myapp",
525
+ api_prefix: "/api/v1",
526
+ theme: "default",
527
+ version: "1.0.0",
528
+ autoscroll: true
529
+ };
530
+ const result = get_api_url(config);
531
+ expect(result).toBe("http://example.com/myapp/api/v1");
532
+ });
533
+ test("api_prefix with nested path without leading slash", () => {
534
+ const config = {
535
+ root: "http://example.com/myapp",
536
+ api_prefix: "api/v1",
537
+ theme: "default",
538
+ version: "1.0.0",
539
+ autoscroll: true
540
+ };
541
+ const result = get_api_url(config);
542
+ expect(result).toBe("http://example.com/myapp/api/v1");
543
+ });
544
+ });
545
+ describe("edge cases", () => {
546
+ test("root with port number", () => {
547
+ const config = {
548
+ root: "http://example.com:8080/myapp",
549
+ api_prefix: "/api",
550
+ theme: "default",
551
+ version: "1.0.0",
552
+ autoscroll: true
553
+ };
554
+ const result = get_api_url(config);
555
+ expect(result).toBe("http://example.com:8080/myapp/api");
556
+ });
557
+ test("root with HTTPS", () => {
558
+ const config = {
559
+ root: "https://example.com/myapp",
560
+ api_prefix: "/api",
561
+ theme: "default",
562
+ version: "1.0.0",
563
+ autoscroll: true
564
+ };
565
+ const result = get_api_url(config);
566
+ expect(result).toBe("https://example.com/myapp/api");
567
+ });
568
+ test("root with query parameters (should be ignored)", () => {
569
+ const config = {
570
+ root: "http://example.com/myapp?param=value",
571
+ api_prefix: "/api",
572
+ theme: "default",
573
+ version: "1.0.0",
574
+ autoscroll: true
575
+ };
576
+ const result = get_api_url(config);
577
+ expect(result).toBe("http://example.com/myapp/api");
578
+ });
579
+ test("root with hash (should be ignored)", () => {
580
+ const config = {
581
+ root: "http://example.com/myapp#section",
582
+ api_prefix: "/api",
583
+ theme: "default",
584
+ version: "1.0.0",
585
+ autoscroll: true
586
+ };
587
+ const result = get_api_url(config);
588
+ expect(result).toBe("http://example.com/myapp/api");
589
+ });
590
+ });
591
+ describe("consistency checks", () => {
592
+ test("same result regardless of root trailing slash", () => {
593
+ const baseConfig = {
594
+ api_prefix: "/api",
595
+ theme: "default",
596
+ version: "1.0.0",
597
+ autoscroll: true
598
+ };
599
+ const config1 = {
600
+ ...baseConfig,
601
+ root: "http://example.com/myapp"
602
+ };
603
+ const config2 = {
604
+ ...baseConfig,
605
+ root: "http://example.com/myapp/"
606
+ };
607
+ expect(get_api_url(config1)).toBe(get_api_url(config2));
608
+ });
609
+ test("same result regardless of api_prefix leading slash", () => {
610
+ const baseConfig = {
611
+ root: "http://example.com/myapp",
612
+ theme: "default",
613
+ version: "1.0.0",
614
+ autoscroll: true
615
+ };
616
+ const config1 = {
617
+ ...baseConfig,
618
+ api_prefix: "/api"
619
+ };
620
+ const config2 = {
621
+ ...baseConfig,
622
+ api_prefix: "api"
623
+ };
624
+ expect(get_api_url(config1)).toBe(get_api_url(config2));
625
+ });
626
+ });
627
+ });
@@ -6,7 +6,10 @@ import type { Dependency, LoadingComponent } from "./types";
6
6
  * @param root
7
7
  * @returns the loading component
8
8
  */
9
- export declare function get_component(type: string, class_id: string, root: string, variant?: "component" | "example" | "base"): LoadingComponent;
9
+ export declare function get_component(type: string, class_id: string, root: string, variant?: "component" | "example" | "base"): {
10
+ component: LoadingComponent;
11
+ runtime: false | typeof import("svelte");
12
+ };
10
13
  /**
11
14
  * Get all component ids that are an input dependency and all that are an output dependency
12
15
  * @param dep the dependency
@@ -14,7 +14,7 @@ export function get_component(type, class_id, root, variant = "component") {
14
14
  name: type,
15
15
  id: class_id,
16
16
  variant
17
- }).component;
17
+ });
18
18
  }
19
19
  /**
20
20
  * Get all component ids that are an input dependency and all that are an output dependency
@@ -23,6 +23,7 @@ export interface ProcessedComponentMeta {
23
23
  props: Record<string, unknown>;
24
24
  };
25
25
  component: Component | LoadingComponent | null;
26
+ runtime: false | typeof import("svelte");
26
27
  documentation?: Documentation;
27
28
  children: ProcessedComponentMeta[];
28
29
  component_class_id: string;
@@ -109,5 +110,6 @@ export interface AppConfig {
109
110
  autoscroll: boolean;
110
111
  api_prefix: string;
111
112
  api_url: string;
113
+ fill_height?: boolean;
112
114
  }
113
115
  export {};
@@ -16,5 +16,6 @@ declare module "virtual:component-loader" {
16
16
  export function load_component(args: Args): {
17
17
  name: ComponentMeta["type"];
18
18
  component: LoadedComponent;
19
+ runtime: false | typeof import("svelte");
19
20
  };
20
21
  }