@coxwave/tap-kit-types 2.0.0 → 2.0.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/dist/index.d.ts +1986 -400
- package/dist/index.js +699 -134
- package/dist/index.js.map +1 -1
- package/package.json +13 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as CSS from 'csstype';
|
|
2
|
-
import * as v from 'valibot';
|
|
3
2
|
import { ReactNode, CSSProperties } from 'react';
|
|
4
3
|
|
|
5
4
|
/**
|
|
@@ -188,14 +187,15 @@ interface ContainerModeChangeAckMessage {
|
|
|
188
187
|
*
|
|
189
188
|
* Sent when:
|
|
190
189
|
* - User toggles layout via LayoutToggleButton (iframe → parent → iframe)
|
|
191
|
-
* - Viewport resize forces floating mode (parent only)
|
|
192
190
|
* - Parent calls Container.setLayoutState programmatically
|
|
193
191
|
*
|
|
194
|
-
*
|
|
192
|
+
* Note: "floating-forced" is internal state, not exposed to iframe
|
|
195
193
|
*/
|
|
196
194
|
interface ContainerLayoutStateChangedMessage {
|
|
197
195
|
type: "container:layout:state:changed";
|
|
198
|
-
layoutState: "floating" | "sidebar"
|
|
196
|
+
layoutState: "floating" | "sidebar";
|
|
197
|
+
/** Viewport too narrow for sidebar (toggle button should hide) */
|
|
198
|
+
isNarrowViewport?: boolean;
|
|
199
199
|
}
|
|
200
200
|
/**
|
|
201
201
|
* Viewport Resize Event (parent window → iframe)
|
|
@@ -234,400 +234,1963 @@ interface ConfigUpdateMessage {
|
|
|
234
234
|
* Default: "inline"
|
|
235
235
|
*/
|
|
236
236
|
mode?: "inline" | "floating" | "sidebar";
|
|
237
|
+
/**
|
|
238
|
+
* Allow user to toggle between floating and sidebar layouts
|
|
239
|
+
* @default true
|
|
240
|
+
*/
|
|
241
|
+
allowLayoutToggle?: boolean;
|
|
237
242
|
/**
|
|
238
243
|
* Container configuration (styling for floating/sidebar modes)
|
|
239
244
|
*
|
|
240
245
|
* Structure:
|
|
241
246
|
* - floatingConfig: { position, width, height, borderRadius }
|
|
242
247
|
* - sidebarConfig: { maxWidth, minViewportWidth }
|
|
248
|
+
*/
|
|
249
|
+
container?: {
|
|
250
|
+
floatingConfig?: {
|
|
251
|
+
position?: {
|
|
252
|
+
top?: string;
|
|
253
|
+
left?: string;
|
|
254
|
+
right?: string;
|
|
255
|
+
bottom?: string;
|
|
256
|
+
};
|
|
257
|
+
width?: string;
|
|
258
|
+
height?: string;
|
|
259
|
+
borderRadius?: string;
|
|
260
|
+
};
|
|
261
|
+
sidebarConfig?: {
|
|
262
|
+
maxWidth?: string;
|
|
263
|
+
minViewportWidth?: number;
|
|
264
|
+
};
|
|
265
|
+
};
|
|
266
|
+
}
|
|
267
|
+
/**
|
|
268
|
+
* Google Analytics Event Message (iframe → parent)
|
|
269
|
+
* Sent from edutap iframe to tap-kit-core for analytics tracking
|
|
270
|
+
*/
|
|
271
|
+
interface GAEventMessage {
|
|
272
|
+
type: "GA_EVENT";
|
|
273
|
+
payload: Record<string, unknown>;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
/**
|
|
277
|
+
* Fallback type.
|
|
278
|
+
*/
|
|
279
|
+
type Fallback<TSchema extends BaseSchema<unknown, unknown, BaseIssue<unknown>>> = MaybeReadonly<InferOutput<TSchema>> | ((dataset?: OutputDataset<InferOutput<TSchema>, InferIssue<TSchema>>, config?: Config<InferIssue<TSchema>>) => MaybeReadonly<InferOutput<TSchema>>);
|
|
280
|
+
/**
|
|
281
|
+
* Schema with fallback type.
|
|
282
|
+
*/
|
|
283
|
+
type SchemaWithFallback<TSchema extends BaseSchema<unknown, unknown, BaseIssue<unknown>>, TFallback extends Fallback<TSchema>> = TSchema & {
|
|
284
|
+
/**
|
|
285
|
+
* The fallback value.
|
|
286
|
+
*/
|
|
287
|
+
readonly fallback: TFallback;
|
|
288
|
+
};
|
|
289
|
+
|
|
290
|
+
/**
|
|
291
|
+
* Fallback async type.
|
|
292
|
+
*/
|
|
293
|
+
type FallbackAsync<TSchema extends BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>> = MaybeReadonly<InferOutput<TSchema>> | ((dataset?: OutputDataset<InferOutput<TSchema>, InferIssue<TSchema>>, config?: Config<InferIssue<TSchema>>) => MaybePromise<MaybeReadonly<InferOutput<TSchema>>>);
|
|
294
|
+
/**
|
|
295
|
+
* Schema with fallback async type.
|
|
296
|
+
*/
|
|
297
|
+
type SchemaWithFallbackAsync<TSchema extends BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>, TFallback extends FallbackAsync<TSchema>> = Omit<TSchema, 'async' | '~standard' | '~run'> & {
|
|
298
|
+
/**
|
|
299
|
+
* The fallback value.
|
|
300
|
+
*/
|
|
301
|
+
readonly fallback: TFallback;
|
|
302
|
+
/**
|
|
303
|
+
* Whether it's async.
|
|
304
|
+
*/
|
|
305
|
+
readonly async: true;
|
|
306
|
+
/**
|
|
307
|
+
* The Standard Schema properties.
|
|
308
|
+
*
|
|
309
|
+
* @internal
|
|
310
|
+
*/
|
|
311
|
+
readonly '~standard': StandardProps<InferInput<TSchema>, InferOutput<TSchema>>;
|
|
312
|
+
/**
|
|
313
|
+
* Parses unknown input values.
|
|
314
|
+
*
|
|
315
|
+
* @param dataset The input dataset.
|
|
316
|
+
* @param config The configuration.
|
|
317
|
+
*
|
|
318
|
+
* @returns The output dataset.
|
|
319
|
+
*
|
|
320
|
+
* @internal
|
|
321
|
+
*/
|
|
322
|
+
readonly '~run': (dataset: UnknownDataset, config: Config<BaseIssue<unknown>>) => Promise<OutputDataset<InferOutput<TSchema>, InferIssue<TSchema>>>;
|
|
323
|
+
};
|
|
324
|
+
|
|
325
|
+
/**
|
|
326
|
+
* Schema with pipe type.
|
|
327
|
+
*/
|
|
328
|
+
type SchemaWithPipe<TPipe extends readonly [
|
|
329
|
+
BaseSchema<unknown, unknown, BaseIssue<unknown>>,
|
|
330
|
+
...PipeItem<any, unknown, BaseIssue<unknown>>[]
|
|
331
|
+
]> = Omit<FirstTupleItem<TPipe>, 'pipe' | '~standard' | '~run' | '~types'> & {
|
|
332
|
+
/**
|
|
333
|
+
* The pipe items.
|
|
334
|
+
*/
|
|
335
|
+
readonly pipe: TPipe;
|
|
336
|
+
/**
|
|
337
|
+
* The Standard Schema properties.
|
|
338
|
+
*
|
|
339
|
+
* @internal
|
|
340
|
+
*/
|
|
341
|
+
readonly '~standard': StandardProps<InferInput<FirstTupleItem<TPipe>>, InferOutput<LastTupleItem<TPipe>>>;
|
|
342
|
+
/**
|
|
343
|
+
* Parses unknown input values.
|
|
344
|
+
*
|
|
345
|
+
* @param dataset The input dataset.
|
|
346
|
+
* @param config The configuration.
|
|
347
|
+
*
|
|
348
|
+
* @returns The output dataset.
|
|
349
|
+
*
|
|
350
|
+
* @internal
|
|
351
|
+
*/
|
|
352
|
+
readonly '~run': (dataset: UnknownDataset, config: Config<BaseIssue<unknown>>) => OutputDataset<InferOutput<LastTupleItem<TPipe>>, InferIssue<TPipe[number]>>;
|
|
353
|
+
/**
|
|
354
|
+
* The input, output and issue type.
|
|
355
|
+
*
|
|
356
|
+
* @internal
|
|
357
|
+
*/
|
|
358
|
+
readonly '~types'?: {
|
|
359
|
+
readonly input: InferInput<FirstTupleItem<TPipe>>;
|
|
360
|
+
readonly output: InferOutput<LastTupleItem<TPipe>>;
|
|
361
|
+
readonly issue: InferIssue<TPipe[number]>;
|
|
362
|
+
} | undefined;
|
|
363
|
+
};
|
|
364
|
+
|
|
365
|
+
/**
|
|
366
|
+
* Schema with pipe async type.
|
|
367
|
+
*/
|
|
368
|
+
type SchemaWithPipeAsync<TPipe extends readonly [
|
|
369
|
+
(BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>),
|
|
370
|
+
...(PipeItem<any, unknown, BaseIssue<unknown>> | PipeItemAsync<any, unknown, BaseIssue<unknown>>)[]
|
|
371
|
+
]> = Omit<FirstTupleItem<TPipe>, 'async' | 'pipe' | '~standard' | '~run' | '~types'> & {
|
|
372
|
+
/**
|
|
373
|
+
* The pipe items.
|
|
374
|
+
*/
|
|
375
|
+
readonly pipe: TPipe;
|
|
376
|
+
/**
|
|
377
|
+
* Whether it's async.
|
|
378
|
+
*/
|
|
379
|
+
readonly async: true;
|
|
380
|
+
/**
|
|
381
|
+
* The Standard Schema properties.
|
|
382
|
+
*
|
|
383
|
+
* @internal
|
|
384
|
+
*/
|
|
385
|
+
readonly '~standard': StandardProps<InferInput<FirstTupleItem<TPipe>>, InferOutput<LastTupleItem<TPipe>>>;
|
|
386
|
+
/**
|
|
387
|
+
* Parses unknown input values.
|
|
388
|
+
*
|
|
389
|
+
* @param dataset The input dataset.
|
|
390
|
+
* @param config The configuration.
|
|
391
|
+
*
|
|
392
|
+
* @returns The output dataset.
|
|
393
|
+
*
|
|
394
|
+
* @internal
|
|
395
|
+
*/
|
|
396
|
+
readonly '~run': (dataset: UnknownDataset, config: Config<BaseIssue<unknown>>) => Promise<OutputDataset<InferOutput<LastTupleItem<TPipe>>, InferIssue<TPipe[number]>>>;
|
|
397
|
+
/**
|
|
398
|
+
* The input, output and issue type.
|
|
399
|
+
*
|
|
400
|
+
* @internal
|
|
401
|
+
*/
|
|
402
|
+
readonly '~types'?: {
|
|
403
|
+
readonly input: InferInput<FirstTupleItem<TPipe>>;
|
|
404
|
+
readonly output: InferOutput<LastTupleItem<TPipe>>;
|
|
405
|
+
readonly issue: InferIssue<TPipe[number]>;
|
|
406
|
+
} | undefined;
|
|
407
|
+
};
|
|
408
|
+
|
|
409
|
+
/**
|
|
410
|
+
* Base metadata interface.
|
|
411
|
+
*/
|
|
412
|
+
interface BaseMetadata<TInput> {
|
|
413
|
+
/**
|
|
414
|
+
* The object kind.
|
|
415
|
+
*/
|
|
416
|
+
readonly kind: 'metadata';
|
|
417
|
+
/**
|
|
418
|
+
* The metadata type.
|
|
419
|
+
*/
|
|
420
|
+
readonly type: string;
|
|
421
|
+
/**
|
|
422
|
+
* The metadata reference.
|
|
423
|
+
*/
|
|
424
|
+
readonly reference: (...args: any[]) => BaseMetadata<any>;
|
|
425
|
+
/**
|
|
426
|
+
* The input, output and issue type.
|
|
427
|
+
*
|
|
428
|
+
* @internal
|
|
429
|
+
*/
|
|
430
|
+
readonly '~types'?: {
|
|
431
|
+
readonly input: TInput;
|
|
432
|
+
readonly output: TInput;
|
|
433
|
+
readonly issue: never;
|
|
434
|
+
} | undefined;
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
/**
|
|
438
|
+
* Unknown dataset interface.
|
|
439
|
+
*/
|
|
440
|
+
interface UnknownDataset {
|
|
441
|
+
/**
|
|
442
|
+
* Whether is's typed.
|
|
443
|
+
*/
|
|
444
|
+
typed?: false;
|
|
445
|
+
/**
|
|
446
|
+
* The dataset value.
|
|
447
|
+
*/
|
|
448
|
+
value: unknown;
|
|
449
|
+
/**
|
|
450
|
+
* The dataset issues.
|
|
451
|
+
*/
|
|
452
|
+
issues?: undefined;
|
|
453
|
+
}
|
|
454
|
+
/**
|
|
455
|
+
* Success dataset interface.
|
|
456
|
+
*/
|
|
457
|
+
interface SuccessDataset<TValue> {
|
|
458
|
+
/**
|
|
459
|
+
* Whether is's typed.
|
|
460
|
+
*/
|
|
461
|
+
typed: true;
|
|
462
|
+
/**
|
|
463
|
+
* The dataset value.
|
|
464
|
+
*/
|
|
465
|
+
value: TValue;
|
|
466
|
+
/**
|
|
467
|
+
* The dataset issues.
|
|
468
|
+
*/
|
|
469
|
+
issues?: undefined;
|
|
470
|
+
}
|
|
471
|
+
/**
|
|
472
|
+
* Partial dataset interface.
|
|
473
|
+
*/
|
|
474
|
+
interface PartialDataset<TValue, TIssue extends BaseIssue<unknown>> {
|
|
475
|
+
/**
|
|
476
|
+
* Whether is's typed.
|
|
477
|
+
*/
|
|
478
|
+
typed: true;
|
|
479
|
+
/**
|
|
480
|
+
* The dataset value.
|
|
481
|
+
*/
|
|
482
|
+
value: TValue;
|
|
483
|
+
/**
|
|
484
|
+
* The dataset issues.
|
|
485
|
+
*/
|
|
486
|
+
issues: [TIssue, ...TIssue[]];
|
|
487
|
+
}
|
|
488
|
+
/**
|
|
489
|
+
* Failure dataset interface.
|
|
490
|
+
*/
|
|
491
|
+
interface FailureDataset<TIssue extends BaseIssue<unknown>> {
|
|
492
|
+
/**
|
|
493
|
+
* Whether is's typed.
|
|
494
|
+
*/
|
|
495
|
+
typed: false;
|
|
496
|
+
/**
|
|
497
|
+
* The dataset value.
|
|
498
|
+
*/
|
|
499
|
+
value: unknown;
|
|
500
|
+
/**
|
|
501
|
+
* The dataset issues.
|
|
502
|
+
*/
|
|
503
|
+
issues: [TIssue, ...TIssue[]];
|
|
504
|
+
}
|
|
505
|
+
/**
|
|
506
|
+
* Output dataset type.
|
|
507
|
+
*/
|
|
508
|
+
type OutputDataset<TValue, TIssue extends BaseIssue<unknown>> = SuccessDataset<TValue> | PartialDataset<TValue, TIssue> | FailureDataset<TIssue>;
|
|
509
|
+
|
|
510
|
+
/**
|
|
511
|
+
* The Standard Schema properties interface.
|
|
512
|
+
*/
|
|
513
|
+
interface StandardProps<TInput, TOutput> {
|
|
514
|
+
/**
|
|
515
|
+
* The version number of the standard.
|
|
516
|
+
*/
|
|
517
|
+
readonly version: 1;
|
|
518
|
+
/**
|
|
519
|
+
* The vendor name of the schema library.
|
|
520
|
+
*/
|
|
521
|
+
readonly vendor: 'valibot';
|
|
522
|
+
/**
|
|
523
|
+
* Validates unknown input values.
|
|
524
|
+
*/
|
|
525
|
+
readonly validate: (value: unknown) => StandardResult<TOutput> | Promise<StandardResult<TOutput>>;
|
|
526
|
+
/**
|
|
527
|
+
* Inferred types associated with the schema.
|
|
528
|
+
*/
|
|
529
|
+
readonly types?: StandardTypes<TInput, TOutput> | undefined;
|
|
530
|
+
}
|
|
531
|
+
/**
|
|
532
|
+
* The result interface of the validate function.
|
|
533
|
+
*/
|
|
534
|
+
type StandardResult<TOutput> = StandardSuccessResult<TOutput> | StandardFailureResult;
|
|
535
|
+
/**
|
|
536
|
+
* The result interface if validation succeeds.
|
|
537
|
+
*/
|
|
538
|
+
interface StandardSuccessResult<TOutput> {
|
|
539
|
+
/**
|
|
540
|
+
* The typed output value.
|
|
541
|
+
*/
|
|
542
|
+
readonly value: TOutput;
|
|
543
|
+
/**
|
|
544
|
+
* The non-existent issues.
|
|
545
|
+
*/
|
|
546
|
+
readonly issues?: undefined;
|
|
547
|
+
}
|
|
548
|
+
/**
|
|
549
|
+
* The result interface if validation fails.
|
|
550
|
+
*/
|
|
551
|
+
interface StandardFailureResult {
|
|
552
|
+
/**
|
|
553
|
+
* The issues of failed validation.
|
|
554
|
+
*/
|
|
555
|
+
readonly issues: readonly StandardIssue[];
|
|
556
|
+
}
|
|
557
|
+
/**
|
|
558
|
+
* The issue interface of the failure output.
|
|
559
|
+
*/
|
|
560
|
+
interface StandardIssue {
|
|
561
|
+
/**
|
|
562
|
+
* The error message of the issue.
|
|
563
|
+
*/
|
|
564
|
+
readonly message: string;
|
|
565
|
+
/**
|
|
566
|
+
* The path of the issue, if any.
|
|
567
|
+
*/
|
|
568
|
+
readonly path?: readonly (PropertyKey | StandardPathItem)[] | undefined;
|
|
569
|
+
}
|
|
570
|
+
/**
|
|
571
|
+
* The path item interface of the issue.
|
|
572
|
+
*/
|
|
573
|
+
interface StandardPathItem {
|
|
574
|
+
/**
|
|
575
|
+
* The key of the path item.
|
|
576
|
+
*/
|
|
577
|
+
readonly key: PropertyKey;
|
|
578
|
+
}
|
|
579
|
+
/**
|
|
580
|
+
* The Standard Schema types interface.
|
|
581
|
+
*/
|
|
582
|
+
interface StandardTypes<TInput, TOutput> {
|
|
583
|
+
/**
|
|
584
|
+
* The input type of the schema.
|
|
585
|
+
*/
|
|
586
|
+
readonly input: TInput;
|
|
587
|
+
/**
|
|
588
|
+
* The output type of the schema.
|
|
589
|
+
*/
|
|
590
|
+
readonly output: TOutput;
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
/**
|
|
594
|
+
* Base schema interface.
|
|
595
|
+
*/
|
|
596
|
+
interface BaseSchema<TInput, TOutput, TIssue extends BaseIssue<unknown>> {
|
|
597
|
+
/**
|
|
598
|
+
* The object kind.
|
|
599
|
+
*/
|
|
600
|
+
readonly kind: 'schema';
|
|
601
|
+
/**
|
|
602
|
+
* The schema type.
|
|
603
|
+
*/
|
|
604
|
+
readonly type: string;
|
|
605
|
+
/**
|
|
606
|
+
* The schema reference.
|
|
607
|
+
*/
|
|
608
|
+
readonly reference: (...args: any[]) => BaseSchema<unknown, unknown, BaseIssue<unknown>>;
|
|
609
|
+
/**
|
|
610
|
+
* The expected property.
|
|
611
|
+
*/
|
|
612
|
+
readonly expects: string;
|
|
613
|
+
/**
|
|
614
|
+
* Whether it's async.
|
|
615
|
+
*/
|
|
616
|
+
readonly async: false;
|
|
617
|
+
/**
|
|
618
|
+
* The Standard Schema properties.
|
|
619
|
+
*
|
|
620
|
+
* @internal
|
|
621
|
+
*/
|
|
622
|
+
readonly '~standard': StandardProps<TInput, TOutput>;
|
|
623
|
+
/**
|
|
624
|
+
* Parses unknown input values.
|
|
625
|
+
*
|
|
626
|
+
* @param dataset The input dataset.
|
|
627
|
+
* @param config The configuration.
|
|
628
|
+
*
|
|
629
|
+
* @returns The output dataset.
|
|
630
|
+
*
|
|
631
|
+
* @internal
|
|
632
|
+
*/
|
|
633
|
+
readonly '~run': (dataset: UnknownDataset, config: Config<BaseIssue<unknown>>) => OutputDataset<TOutput, TIssue>;
|
|
634
|
+
/**
|
|
635
|
+
* The input, output and issue type.
|
|
636
|
+
*
|
|
637
|
+
* @internal
|
|
638
|
+
*/
|
|
639
|
+
readonly '~types'?: {
|
|
640
|
+
readonly input: TInput;
|
|
641
|
+
readonly output: TOutput;
|
|
642
|
+
readonly issue: TIssue;
|
|
643
|
+
} | undefined;
|
|
644
|
+
}
|
|
645
|
+
/**
|
|
646
|
+
* Base schema async interface.
|
|
647
|
+
*/
|
|
648
|
+
interface BaseSchemaAsync<TInput, TOutput, TIssue extends BaseIssue<unknown>> extends Omit<BaseSchema<TInput, TOutput, TIssue>, 'reference' | 'async' | '~run'> {
|
|
649
|
+
/**
|
|
650
|
+
* The schema reference.
|
|
651
|
+
*/
|
|
652
|
+
readonly reference: (...args: any[]) => BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>;
|
|
653
|
+
/**
|
|
654
|
+
* Whether it's async.
|
|
655
|
+
*/
|
|
656
|
+
readonly async: true;
|
|
657
|
+
/**
|
|
658
|
+
* Parses unknown input values.
|
|
659
|
+
*
|
|
660
|
+
* @param dataset The input dataset.
|
|
661
|
+
* @param config The configuration.
|
|
662
|
+
*
|
|
663
|
+
* @returns The output dataset.
|
|
664
|
+
*
|
|
665
|
+
* @internal
|
|
666
|
+
*/
|
|
667
|
+
readonly '~run': (dataset: UnknownDataset, config: Config<BaseIssue<unknown>>) => Promise<OutputDataset<TOutput, TIssue>>;
|
|
668
|
+
}
|
|
669
|
+
/**
|
|
670
|
+
* Generic schema type.
|
|
671
|
+
*/
|
|
672
|
+
type GenericSchema<TInput = unknown, TOutput = TInput, TIssue extends BaseIssue<unknown> = BaseIssue<unknown>> = BaseSchema<TInput, TOutput, TIssue>;
|
|
673
|
+
|
|
674
|
+
/**
|
|
675
|
+
* Base transformation interface.
|
|
676
|
+
*/
|
|
677
|
+
interface BaseTransformation<TInput, TOutput, TIssue extends BaseIssue<unknown>> {
|
|
678
|
+
/**
|
|
679
|
+
* The object kind.
|
|
680
|
+
*/
|
|
681
|
+
readonly kind: 'transformation';
|
|
682
|
+
/**
|
|
683
|
+
* The transformation type.
|
|
684
|
+
*/
|
|
685
|
+
readonly type: string;
|
|
686
|
+
/**
|
|
687
|
+
* The transformation reference.
|
|
688
|
+
*/
|
|
689
|
+
readonly reference: (...args: any[]) => BaseTransformation<any, any, BaseIssue<unknown>>;
|
|
690
|
+
/**
|
|
691
|
+
* Whether it's async.
|
|
692
|
+
*/
|
|
693
|
+
readonly async: false;
|
|
694
|
+
/**
|
|
695
|
+
* Transforms known input values.
|
|
696
|
+
*
|
|
697
|
+
* @param dataset The input dataset.
|
|
698
|
+
* @param config The configuration.
|
|
699
|
+
*
|
|
700
|
+
* @returns The output dataset.
|
|
701
|
+
*
|
|
702
|
+
* @internal
|
|
703
|
+
*/
|
|
704
|
+
readonly '~run': (dataset: SuccessDataset<TInput>, config: Config<BaseIssue<unknown>>) => OutputDataset<TOutput, BaseIssue<unknown> | TIssue>;
|
|
705
|
+
/**
|
|
706
|
+
* The input, output and issue type.
|
|
707
|
+
*
|
|
708
|
+
* @internal
|
|
709
|
+
*/
|
|
710
|
+
readonly '~types'?: {
|
|
711
|
+
readonly input: TInput;
|
|
712
|
+
readonly output: TOutput;
|
|
713
|
+
readonly issue: TIssue;
|
|
714
|
+
} | undefined;
|
|
715
|
+
}
|
|
716
|
+
/**
|
|
717
|
+
* Base transformation async interface.
|
|
718
|
+
*/
|
|
719
|
+
interface BaseTransformationAsync<TInput, TOutput, TIssue extends BaseIssue<unknown>> extends Omit<BaseTransformation<TInput, TOutput, TIssue>, 'reference' | 'async' | '~run'> {
|
|
720
|
+
/**
|
|
721
|
+
* The transformation reference.
|
|
722
|
+
*/
|
|
723
|
+
readonly reference: (...args: any[]) => BaseTransformation<any, any, BaseIssue<unknown>> | BaseTransformationAsync<any, any, BaseIssue<unknown>>;
|
|
724
|
+
/**
|
|
725
|
+
* Whether it's async.
|
|
726
|
+
*/
|
|
727
|
+
readonly async: true;
|
|
728
|
+
/**
|
|
729
|
+
* Transforms known input values.
|
|
730
|
+
*
|
|
731
|
+
* @param dataset The input dataset.
|
|
732
|
+
* @param config The configuration.
|
|
733
|
+
*
|
|
734
|
+
* @returns The output dataset.
|
|
243
735
|
*
|
|
244
|
-
*
|
|
736
|
+
* @internal
|
|
737
|
+
*/
|
|
738
|
+
readonly '~run': (dataset: SuccessDataset<TInput>, config: Config<BaseIssue<unknown>>) => Promise<OutputDataset<TOutput, BaseIssue<unknown> | TIssue>>;
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
/**
|
|
742
|
+
* Base validation interface.
|
|
743
|
+
*/
|
|
744
|
+
interface BaseValidation<TInput, TOutput, TIssue extends BaseIssue<unknown>> {
|
|
745
|
+
/**
|
|
746
|
+
* The object kind.
|
|
747
|
+
*/
|
|
748
|
+
readonly kind: 'validation';
|
|
749
|
+
/**
|
|
750
|
+
* The validation type.
|
|
751
|
+
*/
|
|
752
|
+
readonly type: string;
|
|
753
|
+
/**
|
|
754
|
+
* The validation reference.
|
|
755
|
+
*/
|
|
756
|
+
readonly reference: (...args: any[]) => BaseValidation<any, any, BaseIssue<unknown>>;
|
|
757
|
+
/**
|
|
758
|
+
* The expected property.
|
|
759
|
+
*/
|
|
760
|
+
readonly expects: string | null;
|
|
761
|
+
/**
|
|
762
|
+
* Whether it's async.
|
|
763
|
+
*/
|
|
764
|
+
readonly async: false;
|
|
765
|
+
/**
|
|
766
|
+
* Validates known input values.
|
|
767
|
+
*
|
|
768
|
+
* @param dataset The input dataset.
|
|
769
|
+
* @param config The configuration.
|
|
770
|
+
*
|
|
771
|
+
* @returns The output dataset.
|
|
772
|
+
*
|
|
773
|
+
* @internal
|
|
774
|
+
*/
|
|
775
|
+
readonly '~run': (dataset: OutputDataset<TInput, BaseIssue<unknown>>, config: Config<BaseIssue<unknown>>) => OutputDataset<TOutput, BaseIssue<unknown> | TIssue>;
|
|
776
|
+
/**
|
|
777
|
+
* The input, output and issue type.
|
|
778
|
+
*
|
|
779
|
+
* @internal
|
|
780
|
+
*/
|
|
781
|
+
readonly '~types'?: {
|
|
782
|
+
readonly input: TInput;
|
|
783
|
+
readonly output: TOutput;
|
|
784
|
+
readonly issue: TIssue;
|
|
785
|
+
} | undefined;
|
|
786
|
+
}
|
|
787
|
+
/**
|
|
788
|
+
* Base validation async interface.
|
|
789
|
+
*/
|
|
790
|
+
interface BaseValidationAsync<TInput, TOutput, TIssue extends BaseIssue<unknown>> extends Omit<BaseValidation<TInput, TOutput, TIssue>, 'reference' | 'async' | '~run'> {
|
|
791
|
+
/**
|
|
792
|
+
* The validation reference.
|
|
793
|
+
*/
|
|
794
|
+
readonly reference: (...args: any[]) => BaseValidation<any, any, BaseIssue<unknown>> | BaseValidationAsync<any, any, BaseIssue<unknown>>;
|
|
795
|
+
/**
|
|
796
|
+
* Whether it's async.
|
|
797
|
+
*/
|
|
798
|
+
readonly async: true;
|
|
799
|
+
/**
|
|
800
|
+
* Validates known input values.
|
|
801
|
+
*
|
|
802
|
+
* @param dataset The input dataset.
|
|
803
|
+
* @param config The configuration.
|
|
804
|
+
*
|
|
805
|
+
* @returns The output dataset.
|
|
806
|
+
*
|
|
807
|
+
* @internal
|
|
808
|
+
*/
|
|
809
|
+
readonly '~run': (dataset: OutputDataset<TInput, BaseIssue<unknown>>, config: Config<BaseIssue<unknown>>) => Promise<OutputDataset<TOutput, BaseIssue<unknown> | TIssue>>;
|
|
810
|
+
}
|
|
811
|
+
|
|
812
|
+
/**
|
|
813
|
+
* Infer input type.
|
|
814
|
+
*/
|
|
815
|
+
type InferInput<TItem extends BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>> | BaseValidation<any, unknown, BaseIssue<unknown>> | BaseValidationAsync<any, unknown, BaseIssue<unknown>> | BaseTransformation<any, unknown, BaseIssue<unknown>> | BaseTransformationAsync<any, unknown, BaseIssue<unknown>> | BaseMetadata<any>> = NonNullable<TItem['~types']>['input'];
|
|
816
|
+
/**
|
|
817
|
+
* Infer output type.
|
|
818
|
+
*/
|
|
819
|
+
type InferOutput<TItem extends BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>> | BaseValidation<any, unknown, BaseIssue<unknown>> | BaseValidationAsync<any, unknown, BaseIssue<unknown>> | BaseTransformation<any, unknown, BaseIssue<unknown>> | BaseTransformationAsync<any, unknown, BaseIssue<unknown>> | BaseMetadata<any>> = NonNullable<TItem['~types']>['output'];
|
|
820
|
+
/**
|
|
821
|
+
* Infer issue type.
|
|
822
|
+
*/
|
|
823
|
+
type InferIssue<TItem extends BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>> | BaseValidation<any, unknown, BaseIssue<unknown>> | BaseValidationAsync<any, unknown, BaseIssue<unknown>> | BaseTransformation<any, unknown, BaseIssue<unknown>> | BaseTransformationAsync<any, unknown, BaseIssue<unknown>> | BaseMetadata<any>> = NonNullable<TItem['~types']>['issue'];
|
|
824
|
+
/**
|
|
825
|
+
* Constructs a type that is maybe readonly.
|
|
826
|
+
*/
|
|
827
|
+
type MaybeReadonly<TValue> = TValue | Readonly<TValue>;
|
|
828
|
+
/**
|
|
829
|
+
* Constructs a type that is maybe a promise.
|
|
830
|
+
*/
|
|
831
|
+
type MaybePromise<TValue> = TValue | Promise<TValue>;
|
|
832
|
+
/**
|
|
833
|
+
* Prettifies a type for better readability.
|
|
834
|
+
*
|
|
835
|
+
* Hint: This type has no effect and is only used so that TypeScript displays
|
|
836
|
+
* the final type in the preview instead of the utility types used.
|
|
837
|
+
*/
|
|
838
|
+
type Prettify<TObject> = {
|
|
839
|
+
[TKey in keyof TObject]: TObject[TKey];
|
|
840
|
+
} & {};
|
|
841
|
+
/**
|
|
842
|
+
* Marks specific keys as optional.
|
|
843
|
+
*/
|
|
844
|
+
type MarkOptional<TObject, TKeys extends keyof TObject> = {
|
|
845
|
+
[TKey in keyof TObject]?: unknown;
|
|
846
|
+
} & Omit<TObject, TKeys> & Partial<Pick<TObject, TKeys>>;
|
|
847
|
+
/**
|
|
848
|
+
* Extracts first tuple item.
|
|
849
|
+
*/
|
|
850
|
+
type FirstTupleItem<TTuple extends readonly [unknown, ...unknown[]]> = TTuple[0];
|
|
851
|
+
/**
|
|
852
|
+
* Extracts last tuple item.
|
|
853
|
+
*/
|
|
854
|
+
type LastTupleItem<TTuple extends readonly [unknown, ...unknown[]]> = TTuple[TTuple extends readonly [unknown, ...infer TRest] ? TRest['length'] : never];
|
|
855
|
+
|
|
856
|
+
/**
|
|
857
|
+
* Error message type.
|
|
858
|
+
*/
|
|
859
|
+
type ErrorMessage<TIssue extends BaseIssue<unknown>> = ((issue: TIssue) => string) | string;
|
|
860
|
+
/**
|
|
861
|
+
* Default type.
|
|
862
|
+
*/
|
|
863
|
+
type Default<TWrapped extends BaseSchema<unknown, unknown, BaseIssue<unknown>>, TInput extends null | undefined> = MaybeReadonly<InferInput<TWrapped> | TInput> | ((dataset?: UnknownDataset, config?: Config<InferIssue<TWrapped>>) => MaybeReadonly<InferInput<TWrapped> | TInput>) | undefined;
|
|
864
|
+
/**
|
|
865
|
+
* Default async type.
|
|
866
|
+
*/
|
|
867
|
+
type DefaultAsync<TWrapped extends BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>, TInput extends null | undefined> = MaybeReadonly<InferInput<TWrapped> | TInput> | ((dataset?: UnknownDataset, config?: Config<InferIssue<TWrapped>>) => MaybePromise<MaybeReadonly<InferInput<TWrapped> | TInput>>) | undefined;
|
|
868
|
+
/**
|
|
869
|
+
* Default value type.
|
|
870
|
+
*/
|
|
871
|
+
type DefaultValue<TDefault extends Default<BaseSchema<unknown, unknown, BaseIssue<unknown>>, null | undefined> | DefaultAsync<BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>, null | undefined>> = TDefault extends DefaultAsync<infer TWrapped extends BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>, infer TInput> ? TDefault extends (dataset?: UnknownDataset, config?: Config<InferIssue<TWrapped>>) => MaybePromise<InferInput<TWrapped> | TInput> ? Awaited<ReturnType<TDefault>> : TDefault : never;
|
|
872
|
+
|
|
873
|
+
/**
|
|
874
|
+
* Optional entry schema type.
|
|
875
|
+
*/
|
|
876
|
+
type OptionalEntrySchema = ExactOptionalSchema<BaseSchema<unknown, unknown, BaseIssue<unknown>>, unknown> | NullishSchema<BaseSchema<unknown, unknown, BaseIssue<unknown>>, unknown> | OptionalSchema<BaseSchema<unknown, unknown, BaseIssue<unknown>>, unknown>;
|
|
877
|
+
/**
|
|
878
|
+
* Optional entry schema async type.
|
|
879
|
+
*/
|
|
880
|
+
type OptionalEntrySchemaAsync = ExactOptionalSchemaAsync<BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>, unknown> | NullishSchemaAsync<BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>, unknown> | OptionalSchemaAsync<BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>, unknown>;
|
|
881
|
+
/**
|
|
882
|
+
* Object entries interface.
|
|
883
|
+
*/
|
|
884
|
+
interface ObjectEntries {
|
|
885
|
+
[key: string]: BaseSchema<unknown, unknown, BaseIssue<unknown>> | SchemaWithFallback<BaseSchema<unknown, unknown, BaseIssue<unknown>>, unknown> | OptionalEntrySchema;
|
|
886
|
+
}
|
|
887
|
+
/**
|
|
888
|
+
* Object entries async interface.
|
|
889
|
+
*/
|
|
890
|
+
interface ObjectEntriesAsync {
|
|
891
|
+
[key: string]: BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>> | SchemaWithFallback<BaseSchema<unknown, unknown, BaseIssue<unknown>>, unknown> | SchemaWithFallbackAsync<BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>, unknown> | OptionalEntrySchema | OptionalEntrySchemaAsync;
|
|
892
|
+
}
|
|
893
|
+
/**
|
|
894
|
+
* Infer entries input type.
|
|
895
|
+
*/
|
|
896
|
+
type InferEntriesInput<TEntries extends ObjectEntries | ObjectEntriesAsync> = {
|
|
897
|
+
-readonly [TKey in keyof TEntries]: InferInput<TEntries[TKey]>;
|
|
898
|
+
};
|
|
899
|
+
/**
|
|
900
|
+
* Infer entries output type.
|
|
901
|
+
*/
|
|
902
|
+
type InferEntriesOutput<TEntries extends ObjectEntries | ObjectEntriesAsync> = {
|
|
903
|
+
-readonly [TKey in keyof TEntries]: InferOutput<TEntries[TKey]>;
|
|
904
|
+
};
|
|
905
|
+
/**
|
|
906
|
+
* Optional input keys type.
|
|
907
|
+
*/
|
|
908
|
+
type OptionalInputKeys<TEntries extends ObjectEntries | ObjectEntriesAsync> = {
|
|
909
|
+
[TKey in keyof TEntries]: TEntries[TKey] extends OptionalEntrySchema | OptionalEntrySchemaAsync ? TKey : never;
|
|
910
|
+
}[keyof TEntries];
|
|
911
|
+
/**
|
|
912
|
+
* Optional output keys type.
|
|
913
|
+
*/
|
|
914
|
+
type OptionalOutputKeys<TEntries extends ObjectEntries | ObjectEntriesAsync> = {
|
|
915
|
+
[TKey in keyof TEntries]: TEntries[TKey] extends OptionalEntrySchema | OptionalEntrySchemaAsync ? undefined extends TEntries[TKey]['default'] ? TKey : never : never;
|
|
916
|
+
}[keyof TEntries];
|
|
917
|
+
/**
|
|
918
|
+
* Input with question marks type.
|
|
919
|
+
*/
|
|
920
|
+
type InputWithQuestionMarks<TEntries extends ObjectEntries | ObjectEntriesAsync, TObject extends InferEntriesInput<TEntries>> = MarkOptional<TObject, OptionalInputKeys<TEntries>>;
|
|
921
|
+
/**
|
|
922
|
+
* Output with question marks type.
|
|
923
|
+
*/
|
|
924
|
+
type OutputWithQuestionMarks<TEntries extends ObjectEntries | ObjectEntriesAsync, TObject extends InferEntriesOutput<TEntries>> = MarkOptional<TObject, OptionalOutputKeys<TEntries>>;
|
|
925
|
+
/**
|
|
926
|
+
* Readonly output keys type.
|
|
927
|
+
*/
|
|
928
|
+
type ReadonlyOutputKeys<TEntries extends ObjectEntries | ObjectEntriesAsync> = {
|
|
929
|
+
[TKey in keyof TEntries]: TEntries[TKey] extends SchemaWithPipe<infer TPipe> | SchemaWithPipeAsync<infer TPipe> ? ReadonlyAction<any> extends TPipe[number] ? TKey : never : never;
|
|
930
|
+
}[keyof TEntries];
|
|
931
|
+
/**
|
|
932
|
+
* Output with readonly type.
|
|
933
|
+
*/
|
|
934
|
+
type OutputWithReadonly<TEntries extends ObjectEntries | ObjectEntriesAsync, TObject extends OutputWithQuestionMarks<TEntries, InferEntriesOutput<TEntries>>> = Readonly<TObject> & Pick<TObject, Exclude<keyof TObject, ReadonlyOutputKeys<TEntries>>>;
|
|
935
|
+
/**
|
|
936
|
+
* Infer object input type.
|
|
937
|
+
*/
|
|
938
|
+
type InferObjectInput<TEntries extends ObjectEntries | ObjectEntriesAsync> = Prettify<InputWithQuestionMarks<TEntries, InferEntriesInput<TEntries>>>;
|
|
939
|
+
/**
|
|
940
|
+
* Infer object output type.
|
|
941
|
+
*/
|
|
942
|
+
type InferObjectOutput<TEntries extends ObjectEntries | ObjectEntriesAsync> = Prettify<OutputWithReadonly<TEntries, OutputWithQuestionMarks<TEntries, InferEntriesOutput<TEntries>>>>;
|
|
943
|
+
/**
|
|
944
|
+
* Infer object issue type.
|
|
945
|
+
*/
|
|
946
|
+
type InferObjectIssue<TEntries extends ObjectEntries | ObjectEntriesAsync> = InferIssue<TEntries[keyof TEntries]>;
|
|
947
|
+
|
|
948
|
+
/**
|
|
949
|
+
* Array path item interface.
|
|
950
|
+
*/
|
|
951
|
+
interface ArrayPathItem {
|
|
952
|
+
/**
|
|
953
|
+
* The path item type.
|
|
954
|
+
*/
|
|
955
|
+
readonly type: 'array';
|
|
956
|
+
/**
|
|
957
|
+
* The path item origin.
|
|
958
|
+
*/
|
|
959
|
+
readonly origin: 'value';
|
|
960
|
+
/**
|
|
961
|
+
* The path item input.
|
|
962
|
+
*/
|
|
963
|
+
readonly input: MaybeReadonly<unknown[]>;
|
|
964
|
+
/**
|
|
965
|
+
* The path item key.
|
|
966
|
+
*/
|
|
967
|
+
readonly key: number;
|
|
968
|
+
/**
|
|
969
|
+
* The path item value.
|
|
970
|
+
*/
|
|
971
|
+
readonly value: unknown;
|
|
972
|
+
}
|
|
973
|
+
/**
|
|
974
|
+
* Map path item interface.
|
|
975
|
+
*/
|
|
976
|
+
interface MapPathItem {
|
|
977
|
+
/**
|
|
978
|
+
* The path item type.
|
|
979
|
+
*/
|
|
980
|
+
readonly type: 'map';
|
|
981
|
+
/**
|
|
982
|
+
* The path item origin.
|
|
983
|
+
*/
|
|
984
|
+
readonly origin: 'key' | 'value';
|
|
985
|
+
/**
|
|
986
|
+
* The path item input.
|
|
987
|
+
*/
|
|
988
|
+
readonly input: Map<unknown, unknown>;
|
|
989
|
+
/**
|
|
990
|
+
* The path item key.
|
|
991
|
+
*/
|
|
992
|
+
readonly key: unknown;
|
|
993
|
+
/**
|
|
994
|
+
* The path item value.
|
|
995
|
+
*/
|
|
996
|
+
readonly value: unknown;
|
|
997
|
+
}
|
|
998
|
+
/**
|
|
999
|
+
* Object path item interface.
|
|
1000
|
+
*/
|
|
1001
|
+
interface ObjectPathItem {
|
|
1002
|
+
/**
|
|
1003
|
+
* The path item type.
|
|
1004
|
+
*/
|
|
1005
|
+
readonly type: 'object';
|
|
1006
|
+
/**
|
|
1007
|
+
* The path item origin.
|
|
1008
|
+
*/
|
|
1009
|
+
readonly origin: 'key' | 'value';
|
|
1010
|
+
/**
|
|
1011
|
+
* The path item input.
|
|
1012
|
+
*/
|
|
1013
|
+
readonly input: Record<string, unknown>;
|
|
1014
|
+
/**
|
|
1015
|
+
* The path item key.
|
|
1016
|
+
*/
|
|
1017
|
+
readonly key: string;
|
|
1018
|
+
/**
|
|
1019
|
+
* The path item value.
|
|
1020
|
+
*/
|
|
1021
|
+
readonly value: unknown;
|
|
1022
|
+
}
|
|
1023
|
+
/**
|
|
1024
|
+
* Set path item interface.
|
|
1025
|
+
*/
|
|
1026
|
+
interface SetPathItem {
|
|
1027
|
+
/**
|
|
1028
|
+
* The path item type.
|
|
1029
|
+
*/
|
|
1030
|
+
readonly type: 'set';
|
|
1031
|
+
/**
|
|
1032
|
+
* The path item origin.
|
|
1033
|
+
*/
|
|
1034
|
+
readonly origin: 'value';
|
|
1035
|
+
/**
|
|
1036
|
+
* The path item input.
|
|
1037
|
+
*/
|
|
1038
|
+
readonly input: Set<unknown>;
|
|
1039
|
+
/**
|
|
1040
|
+
* The path item key.
|
|
1041
|
+
*/
|
|
1042
|
+
readonly key: null;
|
|
1043
|
+
/**
|
|
1044
|
+
* The path item key.
|
|
1045
|
+
*/
|
|
1046
|
+
readonly value: unknown;
|
|
1047
|
+
}
|
|
1048
|
+
/**
|
|
1049
|
+
* Unknown path item interface.
|
|
1050
|
+
*/
|
|
1051
|
+
interface UnknownPathItem {
|
|
1052
|
+
/**
|
|
1053
|
+
* The path item type.
|
|
1054
|
+
*/
|
|
1055
|
+
readonly type: 'unknown';
|
|
1056
|
+
/**
|
|
1057
|
+
* The path item origin.
|
|
1058
|
+
*/
|
|
1059
|
+
readonly origin: 'key' | 'value';
|
|
1060
|
+
/**
|
|
1061
|
+
* The path item input.
|
|
1062
|
+
*/
|
|
1063
|
+
readonly input: unknown;
|
|
1064
|
+
/**
|
|
1065
|
+
* The path item key.
|
|
1066
|
+
*/
|
|
1067
|
+
readonly key: unknown;
|
|
1068
|
+
/**
|
|
1069
|
+
* The path item value.
|
|
1070
|
+
*/
|
|
1071
|
+
readonly value: unknown;
|
|
1072
|
+
}
|
|
1073
|
+
/**
|
|
1074
|
+
* Issue path item type.
|
|
1075
|
+
*/
|
|
1076
|
+
type IssuePathItem = ArrayPathItem | MapPathItem | ObjectPathItem | SetPathItem | UnknownPathItem;
|
|
1077
|
+
/**
|
|
1078
|
+
* Base issue interface.
|
|
1079
|
+
*/
|
|
1080
|
+
interface BaseIssue<TInput> extends Config<BaseIssue<TInput>> {
|
|
1081
|
+
/**
|
|
1082
|
+
* The issue kind.
|
|
1083
|
+
*/
|
|
1084
|
+
readonly kind: 'schema' | 'validation' | 'transformation';
|
|
1085
|
+
/**
|
|
1086
|
+
* The issue type.
|
|
1087
|
+
*/
|
|
1088
|
+
readonly type: string;
|
|
1089
|
+
/**
|
|
1090
|
+
* The raw input data.
|
|
1091
|
+
*/
|
|
1092
|
+
readonly input: TInput;
|
|
1093
|
+
/**
|
|
1094
|
+
* The expected property.
|
|
1095
|
+
*/
|
|
1096
|
+
readonly expected: string | null;
|
|
1097
|
+
/**
|
|
1098
|
+
* The received property.
|
|
1099
|
+
*/
|
|
1100
|
+
readonly received: string;
|
|
1101
|
+
/**
|
|
1102
|
+
* The error message.
|
|
1103
|
+
*/
|
|
1104
|
+
readonly message: string;
|
|
1105
|
+
/**
|
|
1106
|
+
* The input requirement.
|
|
1107
|
+
*/
|
|
1108
|
+
readonly requirement?: unknown | undefined;
|
|
1109
|
+
/**
|
|
1110
|
+
* The issue path.
|
|
1111
|
+
*/
|
|
1112
|
+
readonly path?: [IssuePathItem, ...IssuePathItem[]] | undefined;
|
|
1113
|
+
/**
|
|
1114
|
+
* The sub issues.
|
|
1115
|
+
*/
|
|
1116
|
+
readonly issues?: [BaseIssue<TInput>, ...BaseIssue<TInput>[]] | undefined;
|
|
1117
|
+
}
|
|
1118
|
+
|
|
1119
|
+
/**
|
|
1120
|
+
* Config interface.
|
|
1121
|
+
*/
|
|
1122
|
+
interface Config<TIssue extends BaseIssue<unknown>> {
|
|
1123
|
+
/**
|
|
1124
|
+
* The selected language.
|
|
1125
|
+
*/
|
|
1126
|
+
readonly lang?: string | undefined;
|
|
1127
|
+
/**
|
|
1128
|
+
* The error message.
|
|
1129
|
+
*/
|
|
1130
|
+
readonly message?: ErrorMessage<TIssue> | undefined;
|
|
1131
|
+
/**
|
|
1132
|
+
* Whether it should be aborted early.
|
|
1133
|
+
*/
|
|
1134
|
+
readonly abortEarly?: boolean | undefined;
|
|
1135
|
+
/**
|
|
1136
|
+
* Whether a pipe should be aborted early.
|
|
1137
|
+
*/
|
|
1138
|
+
readonly abortPipeEarly?: boolean | undefined;
|
|
1139
|
+
}
|
|
1140
|
+
|
|
1141
|
+
/**
|
|
1142
|
+
* Pipe action type.
|
|
1143
|
+
*/
|
|
1144
|
+
type PipeAction<TInput, TOutput, TIssue extends BaseIssue<unknown>> = BaseValidation<TInput, TOutput, TIssue> | BaseTransformation<TInput, TOutput, TIssue> | BaseMetadata<TInput>;
|
|
1145
|
+
/**
|
|
1146
|
+
* Pipe action async type.
|
|
1147
|
+
*/
|
|
1148
|
+
type PipeActionAsync<TInput, TOutput, TIssue extends BaseIssue<unknown>> = BaseValidationAsync<TInput, TOutput, TIssue> | BaseTransformationAsync<TInput, TOutput, TIssue>;
|
|
1149
|
+
/**
|
|
1150
|
+
* Pipe item type.
|
|
1151
|
+
*/
|
|
1152
|
+
type PipeItem<TInput, TOutput, TIssue extends BaseIssue<unknown>> = BaseSchema<TInput, TOutput, TIssue> | PipeAction<TInput, TOutput, TIssue>;
|
|
1153
|
+
/**
|
|
1154
|
+
* Pipe item async type.
|
|
1155
|
+
*/
|
|
1156
|
+
type PipeItemAsync<TInput, TOutput, TIssue extends BaseIssue<unknown>> = BaseSchemaAsync<TInput, TOutput, TIssue> | PipeActionAsync<TInput, TOutput, TIssue>;
|
|
1157
|
+
|
|
1158
|
+
/**
|
|
1159
|
+
* Any schema interface.
|
|
1160
|
+
*/
|
|
1161
|
+
interface AnySchema extends BaseSchema<any, any, never> {
|
|
1162
|
+
/**
|
|
1163
|
+
* The schema type.
|
|
1164
|
+
*/
|
|
1165
|
+
readonly type: 'any';
|
|
1166
|
+
/**
|
|
1167
|
+
* The schema reference.
|
|
1168
|
+
*/
|
|
1169
|
+
readonly reference: typeof any;
|
|
1170
|
+
/**
|
|
1171
|
+
* The expected property.
|
|
1172
|
+
*/
|
|
1173
|
+
readonly expects: 'any';
|
|
1174
|
+
}
|
|
1175
|
+
/**
|
|
1176
|
+
* Creates an any schema.
|
|
1177
|
+
*
|
|
1178
|
+
* Hint: This schema function exists only for completeness and is not
|
|
1179
|
+
* recommended in practice. Instead, `unknown` should be used to accept
|
|
1180
|
+
* unknown data.
|
|
1181
|
+
*
|
|
1182
|
+
* @returns An any schema.
|
|
1183
|
+
*/
|
|
1184
|
+
declare function any(): AnySchema;
|
|
1185
|
+
|
|
1186
|
+
/**
|
|
1187
|
+
* Boolean issue interface.
|
|
1188
|
+
*/
|
|
1189
|
+
interface BooleanIssue extends BaseIssue<unknown> {
|
|
1190
|
+
/**
|
|
1191
|
+
* The issue kind.
|
|
1192
|
+
*/
|
|
1193
|
+
readonly kind: 'schema';
|
|
1194
|
+
/**
|
|
1195
|
+
* The issue type.
|
|
1196
|
+
*/
|
|
1197
|
+
readonly type: 'boolean';
|
|
1198
|
+
/**
|
|
1199
|
+
* The expected property.
|
|
1200
|
+
*/
|
|
1201
|
+
readonly expected: 'boolean';
|
|
1202
|
+
}
|
|
1203
|
+
/**
|
|
1204
|
+
* Boolean schema interface.
|
|
1205
|
+
*/
|
|
1206
|
+
interface BooleanSchema<TMessage extends ErrorMessage<BooleanIssue> | undefined> extends BaseSchema<boolean, boolean, BooleanIssue> {
|
|
1207
|
+
/**
|
|
1208
|
+
* The schema type.
|
|
1209
|
+
*/
|
|
1210
|
+
readonly type: 'boolean';
|
|
1211
|
+
/**
|
|
1212
|
+
* The schema reference.
|
|
1213
|
+
*/
|
|
1214
|
+
readonly reference: typeof boolean;
|
|
1215
|
+
/**
|
|
1216
|
+
* The expected property.
|
|
1217
|
+
*/
|
|
1218
|
+
readonly expects: 'boolean';
|
|
1219
|
+
/**
|
|
1220
|
+
* The error message.
|
|
1221
|
+
*/
|
|
1222
|
+
readonly message: TMessage;
|
|
1223
|
+
}
|
|
1224
|
+
/**
|
|
1225
|
+
* Creates a boolean schema.
|
|
1226
|
+
*
|
|
1227
|
+
* @returns A boolean schema.
|
|
1228
|
+
*/
|
|
1229
|
+
declare function boolean(): BooleanSchema<undefined>;
|
|
1230
|
+
/**
|
|
1231
|
+
* Creates a boolean schema.
|
|
1232
|
+
*
|
|
1233
|
+
* @param message The error message.
|
|
1234
|
+
*
|
|
1235
|
+
* @returns A boolean schema.
|
|
1236
|
+
*/
|
|
1237
|
+
declare function boolean<const TMessage extends ErrorMessage<BooleanIssue> | undefined>(message: TMessage): BooleanSchema<TMessage>;
|
|
1238
|
+
|
|
1239
|
+
/**
|
|
1240
|
+
* Exact optional schema interface.
|
|
1241
|
+
*/
|
|
1242
|
+
interface ExactOptionalSchema<TWrapped extends BaseSchema<unknown, unknown, BaseIssue<unknown>>, TDefault extends Default<TWrapped, never>> extends BaseSchema<InferInput<TWrapped>, InferOutput<TWrapped>, InferIssue<TWrapped>> {
|
|
1243
|
+
/**
|
|
1244
|
+
* The schema type.
|
|
1245
|
+
*/
|
|
1246
|
+
readonly type: 'exact_optional';
|
|
1247
|
+
/**
|
|
1248
|
+
* The schema reference.
|
|
1249
|
+
*/
|
|
1250
|
+
readonly reference: typeof exactOptional;
|
|
1251
|
+
/**
|
|
1252
|
+
* The expected property.
|
|
1253
|
+
*/
|
|
1254
|
+
readonly expects: TWrapped['expects'];
|
|
1255
|
+
/**
|
|
1256
|
+
* The wrapped schema.
|
|
1257
|
+
*/
|
|
1258
|
+
readonly wrapped: TWrapped;
|
|
1259
|
+
/**
|
|
1260
|
+
* The default value.
|
|
1261
|
+
*/
|
|
1262
|
+
readonly default: TDefault;
|
|
1263
|
+
}
|
|
1264
|
+
/**
|
|
1265
|
+
* Creates an exact optional schema.
|
|
1266
|
+
*
|
|
1267
|
+
* @param wrapped The wrapped schema.
|
|
1268
|
+
*
|
|
1269
|
+
* @returns An exact optional schema.
|
|
1270
|
+
*/
|
|
1271
|
+
declare function exactOptional<const TWrapped extends BaseSchema<unknown, unknown, BaseIssue<unknown>>>(wrapped: TWrapped): ExactOptionalSchema<TWrapped, undefined>;
|
|
1272
|
+
/**
|
|
1273
|
+
* Creates an exact optional schema.
|
|
1274
|
+
*
|
|
1275
|
+
* @param wrapped The wrapped schema.
|
|
1276
|
+
* @param default_ The default value.
|
|
1277
|
+
*
|
|
1278
|
+
* @returns An exact optional schema.
|
|
1279
|
+
*/
|
|
1280
|
+
declare function exactOptional<const TWrapped extends BaseSchema<unknown, unknown, BaseIssue<unknown>>, const TDefault extends Default<TWrapped, never>>(wrapped: TWrapped, default_: TDefault): ExactOptionalSchema<TWrapped, TDefault>;
|
|
1281
|
+
|
|
1282
|
+
/**
|
|
1283
|
+
* Exact optional schema async interface.
|
|
1284
|
+
*/
|
|
1285
|
+
interface ExactOptionalSchemaAsync<TWrapped extends BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>, TDefault extends DefaultAsync<TWrapped, never>> extends BaseSchemaAsync<InferInput<TWrapped>, InferOutput<TWrapped>, InferIssue<TWrapped>> {
|
|
1286
|
+
/**
|
|
1287
|
+
* The schema type.
|
|
1288
|
+
*/
|
|
1289
|
+
readonly type: 'exact_optional';
|
|
1290
|
+
/**
|
|
1291
|
+
* The schema reference.
|
|
1292
|
+
*/
|
|
1293
|
+
readonly reference: typeof exactOptional | typeof exactOptionalAsync;
|
|
1294
|
+
/**
|
|
1295
|
+
* The expected property.
|
|
1296
|
+
*/
|
|
1297
|
+
readonly expects: TWrapped['expects'];
|
|
1298
|
+
/**
|
|
1299
|
+
* The wrapped schema.
|
|
1300
|
+
*/
|
|
1301
|
+
readonly wrapped: TWrapped;
|
|
1302
|
+
/**
|
|
1303
|
+
* The default value.
|
|
1304
|
+
*/
|
|
1305
|
+
readonly default: TDefault;
|
|
1306
|
+
}
|
|
1307
|
+
/**
|
|
1308
|
+
* Creates an exact optional schema.
|
|
1309
|
+
*
|
|
1310
|
+
* @param wrapped The wrapped schema.
|
|
1311
|
+
*
|
|
1312
|
+
* @returns An exact optional schema.
|
|
1313
|
+
*/
|
|
1314
|
+
declare function exactOptionalAsync<const TWrapped extends BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>>(wrapped: TWrapped): ExactOptionalSchemaAsync<TWrapped, undefined>;
|
|
1315
|
+
/**
|
|
1316
|
+
* Creates an exact optional schema.
|
|
1317
|
+
*
|
|
1318
|
+
* @param wrapped The wrapped schema.
|
|
1319
|
+
* @param default_ The default value.
|
|
1320
|
+
*
|
|
1321
|
+
* @returns An exact optional schema.
|
|
1322
|
+
*/
|
|
1323
|
+
declare function exactOptionalAsync<const TWrapped extends BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>, const TDefault extends DefaultAsync<TWrapped, never>>(wrapped: TWrapped, default_: TDefault): ExactOptionalSchemaAsync<TWrapped, TDefault>;
|
|
1324
|
+
|
|
1325
|
+
/**
|
|
1326
|
+
* Literal type.
|
|
1327
|
+
*/
|
|
1328
|
+
type Literal = bigint | boolean | number | string | symbol;
|
|
1329
|
+
/**
|
|
1330
|
+
* Literal issue interface.
|
|
1331
|
+
*/
|
|
1332
|
+
interface LiteralIssue extends BaseIssue<unknown> {
|
|
1333
|
+
/**
|
|
1334
|
+
* The issue kind.
|
|
1335
|
+
*/
|
|
1336
|
+
readonly kind: 'schema';
|
|
1337
|
+
/**
|
|
1338
|
+
* The issue type.
|
|
1339
|
+
*/
|
|
1340
|
+
readonly type: 'literal';
|
|
1341
|
+
/**
|
|
1342
|
+
* The expected property.
|
|
1343
|
+
*/
|
|
1344
|
+
readonly expected: string;
|
|
1345
|
+
}
|
|
1346
|
+
/**
|
|
1347
|
+
* Literal schema interface.
|
|
1348
|
+
*/
|
|
1349
|
+
interface LiteralSchema<TLiteral extends Literal, TMessage extends ErrorMessage<LiteralIssue> | undefined> extends BaseSchema<TLiteral, TLiteral, LiteralIssue> {
|
|
1350
|
+
/**
|
|
1351
|
+
* The schema type.
|
|
1352
|
+
*/
|
|
1353
|
+
readonly type: 'literal';
|
|
1354
|
+
/**
|
|
1355
|
+
* The schema reference.
|
|
1356
|
+
*/
|
|
1357
|
+
readonly reference: typeof literal;
|
|
1358
|
+
/**
|
|
1359
|
+
* The literal value.
|
|
1360
|
+
*/
|
|
1361
|
+
readonly literal: TLiteral;
|
|
1362
|
+
/**
|
|
1363
|
+
* The error message.
|
|
1364
|
+
*/
|
|
1365
|
+
readonly message: TMessage;
|
|
1366
|
+
}
|
|
1367
|
+
/**
|
|
1368
|
+
* Creates a literal schema.
|
|
1369
|
+
*
|
|
1370
|
+
* @param literal_ The literal value.
|
|
1371
|
+
*
|
|
1372
|
+
* @returns A literal schema.
|
|
1373
|
+
*/
|
|
1374
|
+
declare function literal<const TLiteral extends Literal>(literal_: TLiteral): LiteralSchema<TLiteral, undefined>;
|
|
1375
|
+
/**
|
|
1376
|
+
* Creates a literal schema.
|
|
1377
|
+
*
|
|
1378
|
+
* @param literal_ The literal value.
|
|
1379
|
+
* @param message The error message.
|
|
1380
|
+
*
|
|
1381
|
+
* @returns A literal schema.
|
|
1382
|
+
*/
|
|
1383
|
+
declare function literal<const TLiteral extends Literal, const TMessage extends ErrorMessage<LiteralIssue> | undefined>(literal_: TLiteral, message: TMessage): LiteralSchema<TLiteral, TMessage>;
|
|
1384
|
+
|
|
1385
|
+
/**
|
|
1386
|
+
* Union issue interface.
|
|
1387
|
+
*/
|
|
1388
|
+
interface UnionIssue<TSubIssue extends BaseIssue<unknown>> extends BaseIssue<unknown> {
|
|
1389
|
+
/**
|
|
1390
|
+
* The issue kind.
|
|
1391
|
+
*/
|
|
1392
|
+
readonly kind: 'schema';
|
|
1393
|
+
/**
|
|
1394
|
+
* The issue type.
|
|
1395
|
+
*/
|
|
1396
|
+
readonly type: 'union';
|
|
1397
|
+
/**
|
|
1398
|
+
* The expected property.
|
|
1399
|
+
*/
|
|
1400
|
+
readonly expected: string;
|
|
1401
|
+
/**
|
|
1402
|
+
* The sub issues.
|
|
1403
|
+
*/
|
|
1404
|
+
readonly issues?: [TSubIssue, ...TSubIssue[]];
|
|
1405
|
+
}
|
|
1406
|
+
|
|
1407
|
+
/**
|
|
1408
|
+
* Union options type.
|
|
1409
|
+
*/
|
|
1410
|
+
type UnionOptions = MaybeReadonly<BaseSchema<unknown, unknown, BaseIssue<unknown>>[]>;
|
|
1411
|
+
/**
|
|
1412
|
+
* Union schema interface.
|
|
1413
|
+
*/
|
|
1414
|
+
interface UnionSchema<TOptions extends UnionOptions, TMessage extends ErrorMessage<UnionIssue<InferIssue<TOptions[number]>>> | undefined> extends BaseSchema<InferInput<TOptions[number]>, InferOutput<TOptions[number]>, UnionIssue<InferIssue<TOptions[number]>> | InferIssue<TOptions[number]>> {
|
|
1415
|
+
/**
|
|
1416
|
+
* The schema type.
|
|
1417
|
+
*/
|
|
1418
|
+
readonly type: 'union';
|
|
1419
|
+
/**
|
|
1420
|
+
* The schema reference.
|
|
1421
|
+
*/
|
|
1422
|
+
readonly reference: typeof union;
|
|
1423
|
+
/**
|
|
1424
|
+
* The union options.
|
|
1425
|
+
*/
|
|
1426
|
+
readonly options: TOptions;
|
|
1427
|
+
/**
|
|
1428
|
+
* The error message.
|
|
1429
|
+
*/
|
|
1430
|
+
readonly message: TMessage;
|
|
1431
|
+
}
|
|
1432
|
+
/**
|
|
1433
|
+
* Creates an union schema.
|
|
1434
|
+
*
|
|
1435
|
+
* @param options The union options.
|
|
1436
|
+
*
|
|
1437
|
+
* @returns An union schema.
|
|
1438
|
+
*/
|
|
1439
|
+
declare function union<const TOptions extends UnionOptions>(options: TOptions): UnionSchema<TOptions, undefined>;
|
|
1440
|
+
/**
|
|
1441
|
+
* Creates an union schema.
|
|
1442
|
+
*
|
|
1443
|
+
* @param options The union options.
|
|
1444
|
+
* @param message The error message.
|
|
1445
|
+
*
|
|
1446
|
+
* @returns An union schema.
|
|
1447
|
+
*/
|
|
1448
|
+
declare function union<const TOptions extends UnionOptions, const TMessage extends ErrorMessage<UnionIssue<InferIssue<TOptions[number]>>> | undefined>(options: TOptions, message: TMessage): UnionSchema<TOptions, TMessage>;
|
|
1449
|
+
|
|
1450
|
+
/**
|
|
1451
|
+
* Infer nullish output type.
|
|
1452
|
+
*/
|
|
1453
|
+
type InferNullishOutput<TWrapped extends BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>, TDefault extends DefaultAsync<TWrapped, null | undefined>> = undefined extends TDefault ? InferOutput<TWrapped> | null | undefined : InferOutput<TWrapped> | Extract<DefaultValue<TDefault>, null | undefined>;
|
|
1454
|
+
|
|
1455
|
+
/**
|
|
1456
|
+
* Nullish schema interface.
|
|
1457
|
+
*/
|
|
1458
|
+
interface NullishSchema<TWrapped extends BaseSchema<unknown, unknown, BaseIssue<unknown>>, TDefault extends Default<TWrapped, null | undefined>> extends BaseSchema<InferInput<TWrapped> | null | undefined, InferNullishOutput<TWrapped, TDefault>, InferIssue<TWrapped>> {
|
|
1459
|
+
/**
|
|
1460
|
+
* The schema type.
|
|
1461
|
+
*/
|
|
1462
|
+
readonly type: 'nullish';
|
|
1463
|
+
/**
|
|
1464
|
+
* The schema reference.
|
|
1465
|
+
*/
|
|
1466
|
+
readonly reference: typeof nullish;
|
|
1467
|
+
/**
|
|
1468
|
+
* The expected property.
|
|
1469
|
+
*/
|
|
1470
|
+
readonly expects: `(${TWrapped['expects']} | null | undefined)`;
|
|
1471
|
+
/**
|
|
1472
|
+
* The wrapped schema.
|
|
1473
|
+
*/
|
|
1474
|
+
readonly wrapped: TWrapped;
|
|
1475
|
+
/**
|
|
1476
|
+
* The default value.
|
|
1477
|
+
*/
|
|
1478
|
+
readonly default: TDefault;
|
|
1479
|
+
}
|
|
1480
|
+
/**
|
|
1481
|
+
* Creates a nullish schema.
|
|
1482
|
+
*
|
|
1483
|
+
* @param wrapped The wrapped schema.
|
|
1484
|
+
*
|
|
1485
|
+
* @returns A nullish schema.
|
|
1486
|
+
*/
|
|
1487
|
+
declare function nullish<const TWrapped extends BaseSchema<unknown, unknown, BaseIssue<unknown>>>(wrapped: TWrapped): NullishSchema<TWrapped, undefined>;
|
|
1488
|
+
/**
|
|
1489
|
+
* Creates a nullish schema.
|
|
1490
|
+
*
|
|
1491
|
+
* @param wrapped The wrapped schema.
|
|
1492
|
+
* @param default_ The default value.
|
|
1493
|
+
*
|
|
1494
|
+
* @returns A nullish schema.
|
|
1495
|
+
*/
|
|
1496
|
+
declare function nullish<const TWrapped extends BaseSchema<unknown, unknown, BaseIssue<unknown>>, const TDefault extends Default<TWrapped, null | undefined>>(wrapped: TWrapped, default_: TDefault): NullishSchema<TWrapped, TDefault>;
|
|
1497
|
+
|
|
1498
|
+
/**
|
|
1499
|
+
* Nullish schema async interface.
|
|
1500
|
+
*/
|
|
1501
|
+
interface NullishSchemaAsync<TWrapped extends BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>, TDefault extends DefaultAsync<TWrapped, null | undefined>> extends BaseSchemaAsync<InferInput<TWrapped> | null | undefined, InferNullishOutput<TWrapped, TDefault>, InferIssue<TWrapped>> {
|
|
1502
|
+
/**
|
|
1503
|
+
* The schema type.
|
|
1504
|
+
*/
|
|
1505
|
+
readonly type: 'nullish';
|
|
1506
|
+
/**
|
|
1507
|
+
* The schema reference.
|
|
1508
|
+
*/
|
|
1509
|
+
readonly reference: typeof nullish | typeof nullishAsync;
|
|
1510
|
+
/**
|
|
1511
|
+
* The expected property.
|
|
1512
|
+
*/
|
|
1513
|
+
readonly expects: `(${TWrapped['expects']} | null | undefined)`;
|
|
1514
|
+
/**
|
|
1515
|
+
* The wrapped schema.
|
|
1516
|
+
*/
|
|
1517
|
+
readonly wrapped: TWrapped;
|
|
1518
|
+
/**
|
|
1519
|
+
* The default value.
|
|
1520
|
+
*/
|
|
1521
|
+
readonly default: TDefault;
|
|
1522
|
+
}
|
|
1523
|
+
/**
|
|
1524
|
+
* Creates a nullish schema.
|
|
1525
|
+
*
|
|
1526
|
+
* @param wrapped The wrapped schema.
|
|
1527
|
+
*
|
|
1528
|
+
* @returns A nullish schema.
|
|
1529
|
+
*/
|
|
1530
|
+
declare function nullishAsync<const TWrapped extends BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>>(wrapped: TWrapped): NullishSchemaAsync<TWrapped, undefined>;
|
|
1531
|
+
/**
|
|
1532
|
+
* Creates a nullish schema.
|
|
1533
|
+
*
|
|
1534
|
+
* @param wrapped The wrapped schema.
|
|
1535
|
+
* @param default_ The default value.
|
|
1536
|
+
*
|
|
1537
|
+
* @returns A nullish schema.
|
|
1538
|
+
*/
|
|
1539
|
+
declare function nullishAsync<const TWrapped extends BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>, const TDefault extends DefaultAsync<TWrapped, null | undefined>>(wrapped: TWrapped, default_: TDefault): NullishSchemaAsync<TWrapped, TDefault>;
|
|
1540
|
+
|
|
1541
|
+
/**
|
|
1542
|
+
* Number issue interface.
|
|
1543
|
+
*/
|
|
1544
|
+
interface NumberIssue extends BaseIssue<unknown> {
|
|
1545
|
+
/**
|
|
1546
|
+
* The issue kind.
|
|
1547
|
+
*/
|
|
1548
|
+
readonly kind: 'schema';
|
|
1549
|
+
/**
|
|
1550
|
+
* The issue type.
|
|
1551
|
+
*/
|
|
1552
|
+
readonly type: 'number';
|
|
1553
|
+
/**
|
|
1554
|
+
* The expected property.
|
|
1555
|
+
*/
|
|
1556
|
+
readonly expected: 'number';
|
|
1557
|
+
}
|
|
1558
|
+
/**
|
|
1559
|
+
* Number schema interface.
|
|
1560
|
+
*/
|
|
1561
|
+
interface NumberSchema<TMessage extends ErrorMessage<NumberIssue> | undefined> extends BaseSchema<number, number, NumberIssue> {
|
|
1562
|
+
/**
|
|
1563
|
+
* The schema type.
|
|
1564
|
+
*/
|
|
1565
|
+
readonly type: 'number';
|
|
1566
|
+
/**
|
|
1567
|
+
* The schema reference.
|
|
1568
|
+
*/
|
|
1569
|
+
readonly reference: typeof number;
|
|
1570
|
+
/**
|
|
1571
|
+
* The expected property.
|
|
1572
|
+
*/
|
|
1573
|
+
readonly expects: 'number';
|
|
1574
|
+
/**
|
|
1575
|
+
* The error message.
|
|
1576
|
+
*/
|
|
1577
|
+
readonly message: TMessage;
|
|
1578
|
+
}
|
|
1579
|
+
/**
|
|
1580
|
+
* Creates a number schema.
|
|
1581
|
+
*
|
|
1582
|
+
* @returns A number schema.
|
|
1583
|
+
*/
|
|
1584
|
+
declare function number(): NumberSchema<undefined>;
|
|
1585
|
+
/**
|
|
1586
|
+
* Creates a number schema.
|
|
1587
|
+
*
|
|
1588
|
+
* @param message The error message.
|
|
1589
|
+
*
|
|
1590
|
+
* @returns A number schema.
|
|
1591
|
+
*/
|
|
1592
|
+
declare function number<const TMessage extends ErrorMessage<NumberIssue> | undefined>(message: TMessage): NumberSchema<TMessage>;
|
|
1593
|
+
|
|
1594
|
+
/**
|
|
1595
|
+
* Object issue interface.
|
|
1596
|
+
*/
|
|
1597
|
+
interface ObjectIssue extends BaseIssue<unknown> {
|
|
1598
|
+
/**
|
|
1599
|
+
* The issue kind.
|
|
1600
|
+
*/
|
|
1601
|
+
readonly kind: 'schema';
|
|
1602
|
+
/**
|
|
1603
|
+
* The issue type.
|
|
1604
|
+
*/
|
|
1605
|
+
readonly type: 'object';
|
|
1606
|
+
/**
|
|
1607
|
+
* The expected property.
|
|
1608
|
+
*/
|
|
1609
|
+
readonly expected: 'Object' | `"${string}"`;
|
|
1610
|
+
}
|
|
1611
|
+
|
|
1612
|
+
/**
|
|
1613
|
+
* Object schema interface.
|
|
1614
|
+
*/
|
|
1615
|
+
interface ObjectSchema<TEntries extends ObjectEntries, TMessage extends ErrorMessage<ObjectIssue> | undefined> extends BaseSchema<InferObjectInput<TEntries>, InferObjectOutput<TEntries>, ObjectIssue | InferObjectIssue<TEntries>> {
|
|
1616
|
+
/**
|
|
1617
|
+
* The schema type.
|
|
1618
|
+
*/
|
|
1619
|
+
readonly type: 'object';
|
|
1620
|
+
/**
|
|
1621
|
+
* The schema reference.
|
|
1622
|
+
*/
|
|
1623
|
+
readonly reference: typeof object;
|
|
1624
|
+
/**
|
|
1625
|
+
* The expected property.
|
|
1626
|
+
*/
|
|
1627
|
+
readonly expects: 'Object';
|
|
1628
|
+
/**
|
|
1629
|
+
* The entries schema.
|
|
1630
|
+
*/
|
|
1631
|
+
readonly entries: TEntries;
|
|
1632
|
+
/**
|
|
1633
|
+
* The error message.
|
|
1634
|
+
*/
|
|
1635
|
+
readonly message: TMessage;
|
|
1636
|
+
}
|
|
1637
|
+
/**
|
|
1638
|
+
* Creates an object schema.
|
|
1639
|
+
*
|
|
1640
|
+
* Hint: This schema removes unknown entries. The output will only include the
|
|
1641
|
+
* entries you specify. To include unknown entries, use `looseObject`. To
|
|
1642
|
+
* return an issue for unknown entries, use `strictObject`. To include and
|
|
1643
|
+
* validate unknown entries, use `objectWithRest`.
|
|
1644
|
+
*
|
|
1645
|
+
* @param entries The entries schema.
|
|
1646
|
+
*
|
|
1647
|
+
* @returns An object schema.
|
|
1648
|
+
*/
|
|
1649
|
+
declare function object<const TEntries extends ObjectEntries>(entries: TEntries): ObjectSchema<TEntries, undefined>;
|
|
1650
|
+
/**
|
|
1651
|
+
* Creates an object schema.
|
|
1652
|
+
*
|
|
1653
|
+
* Hint: This schema removes unknown entries. The output will only include the
|
|
1654
|
+
* entries you specify. To include unknown entries, use `looseObject`. To
|
|
1655
|
+
* return an issue for unknown entries, use `strictObject`. To include and
|
|
1656
|
+
* validate unknown entries, use `objectWithRest`.
|
|
1657
|
+
*
|
|
1658
|
+
* @param entries The entries schema.
|
|
1659
|
+
* @param message The error message.
|
|
1660
|
+
*
|
|
1661
|
+
* @returns An object schema.
|
|
1662
|
+
*/
|
|
1663
|
+
declare function object<const TEntries extends ObjectEntries, const TMessage extends ErrorMessage<ObjectIssue> | undefined>(entries: TEntries, message: TMessage): ObjectSchema<TEntries, TMessage>;
|
|
1664
|
+
|
|
1665
|
+
/**
|
|
1666
|
+
* Infer optional output type.
|
|
1667
|
+
*/
|
|
1668
|
+
type InferOptionalOutput<TWrapped extends BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>, TDefault extends DefaultAsync<TWrapped, undefined>> = undefined extends TDefault ? InferOutput<TWrapped> | undefined : InferOutput<TWrapped> | Extract<DefaultValue<TDefault>, undefined>;
|
|
1669
|
+
|
|
1670
|
+
/**
|
|
1671
|
+
* Optional schema interface.
|
|
1672
|
+
*/
|
|
1673
|
+
interface OptionalSchema<TWrapped extends BaseSchema<unknown, unknown, BaseIssue<unknown>>, TDefault extends Default<TWrapped, undefined>> extends BaseSchema<InferInput<TWrapped> | undefined, InferOptionalOutput<TWrapped, TDefault>, InferIssue<TWrapped>> {
|
|
1674
|
+
/**
|
|
1675
|
+
* The schema type.
|
|
1676
|
+
*/
|
|
1677
|
+
readonly type: 'optional';
|
|
1678
|
+
/**
|
|
1679
|
+
* The schema reference.
|
|
1680
|
+
*/
|
|
1681
|
+
readonly reference: typeof optional;
|
|
1682
|
+
/**
|
|
1683
|
+
* The expected property.
|
|
1684
|
+
*/
|
|
1685
|
+
readonly expects: `(${TWrapped['expects']} | undefined)`;
|
|
1686
|
+
/**
|
|
1687
|
+
* The wrapped schema.
|
|
1688
|
+
*/
|
|
1689
|
+
readonly wrapped: TWrapped;
|
|
1690
|
+
/**
|
|
1691
|
+
* The default value.
|
|
1692
|
+
*/
|
|
1693
|
+
readonly default: TDefault;
|
|
1694
|
+
}
|
|
1695
|
+
/**
|
|
1696
|
+
* Creates an optional schema.
|
|
1697
|
+
*
|
|
1698
|
+
* @param wrapped The wrapped schema.
|
|
1699
|
+
*
|
|
1700
|
+
* @returns An optional schema.
|
|
1701
|
+
*/
|
|
1702
|
+
declare function optional<const TWrapped extends BaseSchema<unknown, unknown, BaseIssue<unknown>>>(wrapped: TWrapped): OptionalSchema<TWrapped, undefined>;
|
|
1703
|
+
/**
|
|
1704
|
+
* Creates an optional schema.
|
|
1705
|
+
*
|
|
1706
|
+
* @param wrapped The wrapped schema.
|
|
1707
|
+
* @param default_ The default value.
|
|
1708
|
+
*
|
|
1709
|
+
* @returns An optional schema.
|
|
1710
|
+
*/
|
|
1711
|
+
declare function optional<const TWrapped extends BaseSchema<unknown, unknown, BaseIssue<unknown>>, const TDefault extends Default<TWrapped, undefined>>(wrapped: TWrapped, default_: TDefault): OptionalSchema<TWrapped, TDefault>;
|
|
1712
|
+
|
|
1713
|
+
/**
|
|
1714
|
+
* Optional schema async interface.
|
|
1715
|
+
*/
|
|
1716
|
+
interface OptionalSchemaAsync<TWrapped extends BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>, TDefault extends DefaultAsync<TWrapped, undefined>> extends BaseSchemaAsync<InferInput<TWrapped> | undefined, InferOptionalOutput<TWrapped, TDefault>, InferIssue<TWrapped>> {
|
|
1717
|
+
/**
|
|
1718
|
+
* The schema type.
|
|
1719
|
+
*/
|
|
1720
|
+
readonly type: 'optional';
|
|
1721
|
+
/**
|
|
1722
|
+
* The schema reference.
|
|
1723
|
+
*/
|
|
1724
|
+
readonly reference: typeof optional | typeof optionalAsync;
|
|
1725
|
+
/**
|
|
1726
|
+
* The expected property.
|
|
1727
|
+
*/
|
|
1728
|
+
readonly expects: `(${TWrapped['expects']} | undefined)`;
|
|
1729
|
+
/**
|
|
1730
|
+
* The wrapped schema.
|
|
1731
|
+
*/
|
|
1732
|
+
readonly wrapped: TWrapped;
|
|
1733
|
+
/**
|
|
1734
|
+
* The default value.
|
|
1735
|
+
*/
|
|
1736
|
+
readonly default: TDefault;
|
|
1737
|
+
}
|
|
1738
|
+
/**
|
|
1739
|
+
* Creates an optional schema.
|
|
1740
|
+
*
|
|
1741
|
+
* @param wrapped The wrapped schema.
|
|
1742
|
+
*
|
|
1743
|
+
* @returns An optional schema.
|
|
1744
|
+
*/
|
|
1745
|
+
declare function optionalAsync<const TWrapped extends BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>>(wrapped: TWrapped): OptionalSchemaAsync<TWrapped, undefined>;
|
|
1746
|
+
/**
|
|
1747
|
+
* Creates an optional schema.
|
|
1748
|
+
*
|
|
1749
|
+
* @param wrapped The wrapped schema.
|
|
1750
|
+
* @param default_ The default value.
|
|
1751
|
+
*
|
|
1752
|
+
* @returns An optional schema.
|
|
1753
|
+
*/
|
|
1754
|
+
declare function optionalAsync<const TWrapped extends BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>, const TDefault extends DefaultAsync<TWrapped, undefined>>(wrapped: TWrapped, default_: TDefault): OptionalSchemaAsync<TWrapped, TDefault>;
|
|
1755
|
+
|
|
1756
|
+
/**
|
|
1757
|
+
* Record issue interface.
|
|
1758
|
+
*/
|
|
1759
|
+
interface RecordIssue extends BaseIssue<unknown> {
|
|
1760
|
+
/**
|
|
1761
|
+
* The issue kind.
|
|
1762
|
+
*/
|
|
1763
|
+
readonly kind: 'schema';
|
|
1764
|
+
/**
|
|
1765
|
+
* The issue type.
|
|
1766
|
+
*/
|
|
1767
|
+
readonly type: 'record';
|
|
1768
|
+
/**
|
|
1769
|
+
* The expected property.
|
|
1770
|
+
*/
|
|
1771
|
+
readonly expected: 'Object';
|
|
1772
|
+
}
|
|
1773
|
+
/**
|
|
1774
|
+
* Is literal type.
|
|
1775
|
+
*/
|
|
1776
|
+
type IsLiteral<TKey extends string | number | symbol> = string extends TKey ? false : number extends TKey ? false : symbol extends TKey ? false : TKey extends Brand<string | number | symbol> ? false : true;
|
|
1777
|
+
/**
|
|
1778
|
+
* Optional keys type.
|
|
1779
|
+
*/
|
|
1780
|
+
type OptionalKeys<TObject extends Record<string | number | symbol, unknown>> = {
|
|
1781
|
+
[TKey in keyof TObject]: IsLiteral<TKey> extends true ? TKey : never;
|
|
1782
|
+
}[keyof TObject];
|
|
1783
|
+
/**
|
|
1784
|
+
* With question marks type.
|
|
1785
|
+
*
|
|
1786
|
+
* Hint: We mark an entry as optional if we detect that its key is a literal
|
|
1787
|
+
* type. The reason for this is that it is not technically possible to detect
|
|
1788
|
+
* missing literal keys without restricting the key schema to `string`, `enum`
|
|
1789
|
+
* and `picklist`. However, if `enum` and `picklist` are used, it is better to
|
|
1790
|
+
* use `object` with `entriesFromList` because it already covers the needed
|
|
1791
|
+
* functionality. This decision also reduces the bundle size of `record`,
|
|
1792
|
+
* because it only needs to check the entries of the input and not any missing
|
|
1793
|
+
* keys.
|
|
1794
|
+
*/
|
|
1795
|
+
type WithQuestionMarks<TObject extends Record<string | number | symbol, unknown>> = MarkOptional<TObject, OptionalKeys<TObject>>;
|
|
1796
|
+
/**
|
|
1797
|
+
* With readonly type.
|
|
1798
|
+
*/
|
|
1799
|
+
type WithReadonly<TValue extends BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>, TObject extends WithQuestionMarks<Record<string | number | symbol, unknown>>> = TValue extends SchemaWithPipe<infer TPipe> | SchemaWithPipeAsync<infer TPipe> ? ReadonlyAction<any> extends TPipe[number] ? Readonly<TObject> : TObject : TObject;
|
|
1800
|
+
/**
|
|
1801
|
+
* Infer record input type.
|
|
1802
|
+
*/
|
|
1803
|
+
type InferRecordInput<TKey extends BaseSchema<string, string | number | symbol, BaseIssue<unknown>> | BaseSchemaAsync<string, string | number | symbol, BaseIssue<unknown>>, TValue extends BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>> = Prettify<WithQuestionMarks<Record<InferInput<TKey>, InferInput<TValue>>>>;
|
|
1804
|
+
/**
|
|
1805
|
+
* Infer record output type.
|
|
1806
|
+
*/
|
|
1807
|
+
type InferRecordOutput<TKey extends BaseSchema<string, string | number | symbol, BaseIssue<unknown>> | BaseSchemaAsync<string, string | number | symbol, BaseIssue<unknown>>, TValue extends BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>> = Prettify<WithReadonly<TValue, WithQuestionMarks<Record<InferOutput<TKey>, InferOutput<TValue>>>>>;
|
|
1808
|
+
|
|
1809
|
+
/**
|
|
1810
|
+
* Record schema interface.
|
|
1811
|
+
*/
|
|
1812
|
+
interface RecordSchema<TKey extends BaseSchema<string, string | number | symbol, BaseIssue<unknown>>, TValue extends BaseSchema<unknown, unknown, BaseIssue<unknown>>, TMessage extends ErrorMessage<RecordIssue> | undefined> extends BaseSchema<InferRecordInput<TKey, TValue>, InferRecordOutput<TKey, TValue>, RecordIssue | InferIssue<TKey> | InferIssue<TValue>> {
|
|
1813
|
+
/**
|
|
1814
|
+
* The schema type.
|
|
1815
|
+
*/
|
|
1816
|
+
readonly type: 'record';
|
|
1817
|
+
/**
|
|
1818
|
+
* The schema reference.
|
|
1819
|
+
*/
|
|
1820
|
+
readonly reference: typeof record;
|
|
1821
|
+
/**
|
|
1822
|
+
* The expected property.
|
|
1823
|
+
*/
|
|
1824
|
+
readonly expects: 'Object';
|
|
1825
|
+
/**
|
|
1826
|
+
* The record key schema.
|
|
1827
|
+
*/
|
|
1828
|
+
readonly key: TKey;
|
|
1829
|
+
/**
|
|
1830
|
+
* The record value schema.
|
|
1831
|
+
*/
|
|
1832
|
+
readonly value: TValue;
|
|
1833
|
+
/**
|
|
1834
|
+
* The error message.
|
|
245
1835
|
*/
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
1836
|
+
readonly message: TMessage;
|
|
1837
|
+
}
|
|
1838
|
+
/**
|
|
1839
|
+
* Creates a record schema.
|
|
1840
|
+
*
|
|
1841
|
+
* @param key The key schema.
|
|
1842
|
+
* @param value The value schema.
|
|
1843
|
+
*
|
|
1844
|
+
* @returns A record schema.
|
|
1845
|
+
*/
|
|
1846
|
+
declare function record<const TKey extends BaseSchema<string, string | number | symbol, BaseIssue<unknown>>, const TValue extends BaseSchema<unknown, unknown, BaseIssue<unknown>>>(key: TKey, value: TValue): RecordSchema<TKey, TValue, undefined>;
|
|
1847
|
+
/**
|
|
1848
|
+
* Creates a record schema.
|
|
1849
|
+
*
|
|
1850
|
+
* @param key The key schema.
|
|
1851
|
+
* @param value The value schema.
|
|
1852
|
+
* @param message The error message.
|
|
1853
|
+
*
|
|
1854
|
+
* @returns A record schema.
|
|
1855
|
+
*/
|
|
1856
|
+
declare function record<const TKey extends BaseSchema<string, string | number | symbol, BaseIssue<unknown>>, const TValue extends BaseSchema<unknown, unknown, BaseIssue<unknown>>, const TMessage extends ErrorMessage<RecordIssue> | undefined>(key: TKey, value: TValue, message: TMessage): RecordSchema<TKey, TValue, TMessage>;
|
|
1857
|
+
|
|
1858
|
+
/**
|
|
1859
|
+
* String issue interface.
|
|
1860
|
+
*/
|
|
1861
|
+
interface StringIssue extends BaseIssue<unknown> {
|
|
1862
|
+
/**
|
|
1863
|
+
* The issue kind.
|
|
1864
|
+
*/
|
|
1865
|
+
readonly kind: 'schema';
|
|
1866
|
+
/**
|
|
1867
|
+
* The issue type.
|
|
1868
|
+
*/
|
|
1869
|
+
readonly type: 'string';
|
|
1870
|
+
/**
|
|
1871
|
+
* The expected property.
|
|
1872
|
+
*/
|
|
1873
|
+
readonly expected: 'string';
|
|
1874
|
+
}
|
|
1875
|
+
/**
|
|
1876
|
+
* String schema interface.
|
|
1877
|
+
*/
|
|
1878
|
+
interface StringSchema<TMessage extends ErrorMessage<StringIssue> | undefined> extends BaseSchema<string, string, StringIssue> {
|
|
1879
|
+
/**
|
|
1880
|
+
* The schema type.
|
|
1881
|
+
*/
|
|
1882
|
+
readonly type: 'string';
|
|
1883
|
+
/**
|
|
1884
|
+
* The schema reference.
|
|
1885
|
+
*/
|
|
1886
|
+
readonly reference: typeof string;
|
|
1887
|
+
/**
|
|
1888
|
+
* The expected property.
|
|
1889
|
+
*/
|
|
1890
|
+
readonly expects: 'string';
|
|
1891
|
+
/**
|
|
1892
|
+
* The error message.
|
|
1893
|
+
*/
|
|
1894
|
+
readonly message: TMessage;
|
|
1895
|
+
}
|
|
1896
|
+
/**
|
|
1897
|
+
* Creates a string schema.
|
|
1898
|
+
*
|
|
1899
|
+
* @returns A string schema.
|
|
1900
|
+
*/
|
|
1901
|
+
declare function string(): StringSchema<undefined>;
|
|
1902
|
+
/**
|
|
1903
|
+
* Creates a string schema.
|
|
1904
|
+
*
|
|
1905
|
+
* @param message The error message.
|
|
1906
|
+
*
|
|
1907
|
+
* @returns A string schema.
|
|
1908
|
+
*/
|
|
1909
|
+
declare function string<const TMessage extends ErrorMessage<StringIssue> | undefined>(message: TMessage): StringSchema<TMessage>;
|
|
1910
|
+
|
|
1911
|
+
/**
|
|
1912
|
+
* Brand symbol.
|
|
1913
|
+
*/
|
|
1914
|
+
declare const BrandSymbol: unique symbol;
|
|
1915
|
+
/**
|
|
1916
|
+
* Brand name type.
|
|
1917
|
+
*/
|
|
1918
|
+
type BrandName = string | number | symbol;
|
|
1919
|
+
/**
|
|
1920
|
+
* Brand interface.
|
|
1921
|
+
*/
|
|
1922
|
+
interface Brand<TName extends BrandName> {
|
|
1923
|
+
[BrandSymbol]: {
|
|
1924
|
+
[TValue in TName]: TValue;
|
|
263
1925
|
};
|
|
264
1926
|
}
|
|
1927
|
+
|
|
265
1928
|
/**
|
|
266
|
-
*
|
|
267
|
-
* Sent from edutap iframe to tap-kit-core for analytics tracking
|
|
1929
|
+
* Readonly output type.
|
|
268
1930
|
*/
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
1931
|
+
type ReadonlyOutput<TInput> = TInput extends Map<infer TKey, infer TValue> ? ReadonlyMap<TKey, TValue> : TInput extends Set<infer TValue> ? ReadonlySet<TValue> : Readonly<TInput>;
|
|
1932
|
+
/**
|
|
1933
|
+
* Readonly action interface.
|
|
1934
|
+
*/
|
|
1935
|
+
interface ReadonlyAction<TInput> extends BaseTransformation<TInput, ReadonlyOutput<TInput>, never> {
|
|
1936
|
+
/**
|
|
1937
|
+
* The action type.
|
|
1938
|
+
*/
|
|
1939
|
+
readonly type: 'readonly';
|
|
1940
|
+
/**
|
|
1941
|
+
* The action reference.
|
|
1942
|
+
*/
|
|
1943
|
+
readonly reference: typeof readonly;
|
|
272
1944
|
}
|
|
1945
|
+
/**
|
|
1946
|
+
* Creates a readonly transformation action.
|
|
1947
|
+
*
|
|
1948
|
+
* @returns A readonly action.
|
|
1949
|
+
*/
|
|
1950
|
+
declare function readonly<TInput>(): ReadonlyAction<TInput>;
|
|
273
1951
|
|
|
274
1952
|
/**
|
|
275
1953
|
* Schema for CSS style properties
|
|
276
1954
|
* Allows any CSS property as string or number
|
|
277
1955
|
*/
|
|
278
|
-
declare const CSSStyleSchema:
|
|
1956
|
+
declare const CSSStyleSchema: RecordSchema<StringSchema<undefined>, UnionSchema<[StringSchema<undefined>, NumberSchema<undefined>], undefined>, undefined>;
|
|
279
1957
|
/**
|
|
280
1958
|
* Schema for AlarmElementProps
|
|
281
1959
|
* Supports common HTML attributes
|
|
282
1960
|
*/
|
|
283
|
-
declare const AlarmElementPropsSchema:
|
|
284
|
-
readonly style:
|
|
285
|
-
readonly className:
|
|
286
|
-
readonly id:
|
|
287
|
-
readonly src:
|
|
288
|
-
readonly alt:
|
|
289
|
-
readonly href:
|
|
290
|
-
readonly target:
|
|
291
|
-
readonly type:
|
|
292
|
-
readonly placeholder:
|
|
293
|
-
readonly value:
|
|
294
|
-
readonly disabled:
|
|
1961
|
+
declare const AlarmElementPropsSchema: ObjectSchema<{
|
|
1962
|
+
readonly style: OptionalSchema<RecordSchema<StringSchema<undefined>, UnionSchema<[StringSchema<undefined>, NumberSchema<undefined>], undefined>, undefined>, undefined>;
|
|
1963
|
+
readonly className: OptionalSchema<StringSchema<undefined>, undefined>;
|
|
1964
|
+
readonly id: OptionalSchema<StringSchema<undefined>, undefined>;
|
|
1965
|
+
readonly src: OptionalSchema<StringSchema<undefined>, undefined>;
|
|
1966
|
+
readonly alt: OptionalSchema<StringSchema<undefined>, undefined>;
|
|
1967
|
+
readonly href: OptionalSchema<StringSchema<undefined>, undefined>;
|
|
1968
|
+
readonly target: OptionalSchema<StringSchema<undefined>, undefined>;
|
|
1969
|
+
readonly type: OptionalSchema<StringSchema<undefined>, undefined>;
|
|
1970
|
+
readonly placeholder: OptionalSchema<StringSchema<undefined>, undefined>;
|
|
1971
|
+
readonly value: OptionalSchema<StringSchema<undefined>, undefined>;
|
|
1972
|
+
readonly disabled: OptionalSchema<BooleanSchema<undefined>, undefined>;
|
|
295
1973
|
}, undefined>;
|
|
296
1974
|
/**
|
|
297
1975
|
* Schema for AlarmElement (recursive)
|
|
298
1976
|
* Supports nested structure with children and payload
|
|
299
1977
|
*/
|
|
300
|
-
declare const AlarmElementSchema:
|
|
1978
|
+
declare const AlarmElementSchema: GenericSchema<any>;
|
|
301
1979
|
/**
|
|
302
1980
|
* Schema for AlarmMessageInstanceType (simplified)
|
|
303
1981
|
* Uses JSON Component Descriptor pattern
|
|
304
1982
|
* content includes UI + payload (for click handling)
|
|
305
1983
|
*/
|
|
306
|
-
declare const AlarmMessageInstanceSchema:
|
|
307
|
-
readonly content:
|
|
308
|
-
readonly duration:
|
|
1984
|
+
declare const AlarmMessageInstanceSchema: ObjectSchema<{
|
|
1985
|
+
readonly content: GenericSchema<any>;
|
|
1986
|
+
readonly duration: OptionalSchema<NumberSchema<undefined>, undefined>;
|
|
309
1987
|
}, undefined>;
|
|
310
|
-
declare const TapReadySchema:
|
|
311
|
-
readonly type:
|
|
312
|
-
readonly gaId:
|
|
1988
|
+
declare const TapReadySchema: ObjectSchema<{
|
|
1989
|
+
readonly type: LiteralSchema<"tap:ready", undefined>;
|
|
1990
|
+
readonly gaId: StringSchema<undefined>;
|
|
313
1991
|
}, undefined>;
|
|
314
|
-
declare const TapCloseSchema:
|
|
315
|
-
readonly type:
|
|
1992
|
+
declare const TapCloseSchema: ObjectSchema<{
|
|
1993
|
+
readonly type: LiteralSchema<"tap:close", undefined>;
|
|
316
1994
|
}, undefined>;
|
|
317
|
-
declare const TimelineSeekSchema:
|
|
318
|
-
readonly type:
|
|
319
|
-
readonly clipId:
|
|
320
|
-
readonly clipPlayHead:
|
|
1995
|
+
declare const TimelineSeekSchema: ObjectSchema<{
|
|
1996
|
+
readonly type: LiteralSchema<"timeline:seek", undefined>;
|
|
1997
|
+
readonly clipId: StringSchema<undefined>;
|
|
1998
|
+
readonly clipPlayHead: NumberSchema<undefined>;
|
|
321
1999
|
}, undefined>;
|
|
322
|
-
declare const AlarmClickSchema:
|
|
323
|
-
readonly type:
|
|
324
|
-
readonly messageInfo:
|
|
325
|
-
readonly content:
|
|
326
|
-
readonly duration:
|
|
2000
|
+
declare const AlarmClickSchema: ObjectSchema<{
|
|
2001
|
+
readonly type: LiteralSchema<"alarm:click", undefined>;
|
|
2002
|
+
readonly messageInfo: ObjectSchema<{
|
|
2003
|
+
readonly content: GenericSchema<any>;
|
|
2004
|
+
readonly duration: OptionalSchema<NumberSchema<undefined>, undefined>;
|
|
327
2005
|
}, undefined>;
|
|
328
2006
|
}, undefined>;
|
|
329
|
-
declare const AlarmFadeInSchema:
|
|
330
|
-
readonly type:
|
|
331
|
-
readonly messageInfo:
|
|
332
|
-
readonly content:
|
|
333
|
-
readonly duration:
|
|
2007
|
+
declare const AlarmFadeInSchema: ObjectSchema<{
|
|
2008
|
+
readonly type: LiteralSchema<"alarm:fadeIn", undefined>;
|
|
2009
|
+
readonly messageInfo: ObjectSchema<{
|
|
2010
|
+
readonly content: GenericSchema<any>;
|
|
2011
|
+
readonly duration: OptionalSchema<NumberSchema<undefined>, undefined>;
|
|
334
2012
|
}, undefined>;
|
|
335
2013
|
}, undefined>;
|
|
336
|
-
declare const PopUpOpenSchema:
|
|
337
|
-
readonly type:
|
|
338
|
-
readonly popUpInfo:
|
|
339
|
-
readonly html:
|
|
340
|
-
readonly requestId:
|
|
2014
|
+
declare const PopUpOpenSchema: ObjectSchema<{
|
|
2015
|
+
readonly type: LiteralSchema<"popUp:open", undefined>;
|
|
2016
|
+
readonly popUpInfo: ObjectSchema<{
|
|
2017
|
+
readonly html: StringSchema<undefined>;
|
|
2018
|
+
readonly requestId: OptionalSchema<StringSchema<undefined>, undefined>;
|
|
341
2019
|
}, undefined>;
|
|
342
2020
|
}, undefined>;
|
|
343
|
-
declare const PopUpCloseSchema:
|
|
344
|
-
readonly type:
|
|
2021
|
+
declare const PopUpCloseSchema: ObjectSchema<{
|
|
2022
|
+
readonly type: LiteralSchema<"popUp:close", undefined>;
|
|
345
2023
|
}, undefined>;
|
|
346
|
-
declare const MaterialViewOpenSchema:
|
|
347
|
-
readonly type:
|
|
348
|
-
readonly materialId:
|
|
349
|
-
readonly presignedUrl:
|
|
350
|
-
readonly pageStart:
|
|
351
|
-
readonly pageEnd:
|
|
352
|
-
readonly nonce:
|
|
2024
|
+
declare const MaterialViewOpenSchema: ObjectSchema<{
|
|
2025
|
+
readonly type: LiteralSchema<"material:view:open", undefined>;
|
|
2026
|
+
readonly materialId: StringSchema<undefined>;
|
|
2027
|
+
readonly presignedUrl: StringSchema<undefined>;
|
|
2028
|
+
readonly pageStart: NumberSchema<undefined>;
|
|
2029
|
+
readonly pageEnd: NumberSchema<undefined>;
|
|
2030
|
+
readonly nonce: OptionalSchema<UnionSchema<[StringSchema<undefined>, NumberSchema<undefined>], undefined>, undefined>;
|
|
353
2031
|
}, undefined>;
|
|
354
|
-
declare const MaterialViewCloseSchema:
|
|
355
|
-
readonly type:
|
|
2032
|
+
declare const MaterialViewCloseSchema: ObjectSchema<{
|
|
2033
|
+
readonly type: LiteralSchema<"material:view:close", undefined>;
|
|
356
2034
|
}, undefined>;
|
|
357
|
-
declare const MaterialViewErrorSchema:
|
|
358
|
-
readonly type:
|
|
359
|
-
readonly materialId:
|
|
360
|
-
readonly error:
|
|
361
|
-
readonly message:
|
|
2035
|
+
declare const MaterialViewErrorSchema: ObjectSchema<{
|
|
2036
|
+
readonly type: LiteralSchema<"material:view:error", undefined>;
|
|
2037
|
+
readonly materialId: StringSchema<undefined>;
|
|
2038
|
+
readonly error: UnionSchema<[LiteralSchema<"fetch_failed", undefined>, LiteralSchema<"expired_url", undefined>, LiteralSchema<"extraction_failed", undefined>, LiteralSchema<"unknown", undefined>], undefined>;
|
|
2039
|
+
readonly message: OptionalSchema<StringSchema<undefined>, undefined>;
|
|
362
2040
|
}, undefined>;
|
|
363
|
-
declare const ContainerModeChangeSchema:
|
|
364
|
-
readonly type:
|
|
365
|
-
readonly mode:
|
|
366
|
-
readonly nonce:
|
|
2041
|
+
declare const ContainerModeChangeSchema: ObjectSchema<{
|
|
2042
|
+
readonly type: LiteralSchema<"container:mode:change", undefined>;
|
|
2043
|
+
readonly mode: UnionSchema<[LiteralSchema<"floating", undefined>, LiteralSchema<"sidebar", undefined>], undefined>;
|
|
2044
|
+
readonly nonce: OptionalSchema<UnionSchema<[StringSchema<undefined>, NumberSchema<undefined>], undefined>, undefined>;
|
|
367
2045
|
}, undefined>;
|
|
368
|
-
declare const ContainerModeChangeAckSchema:
|
|
369
|
-
readonly type:
|
|
370
|
-
readonly success:
|
|
371
|
-
readonly currentMode:
|
|
372
|
-
readonly nonce:
|
|
2046
|
+
declare const ContainerModeChangeAckSchema: ObjectSchema<{
|
|
2047
|
+
readonly type: LiteralSchema<"container:mode:change:ack", undefined>;
|
|
2048
|
+
readonly success: BooleanSchema<undefined>;
|
|
2049
|
+
readonly currentMode: UnionSchema<[LiteralSchema<"floating", undefined>, LiteralSchema<"sidebar", undefined>, LiteralSchema<"floating-forced", undefined>], undefined>;
|
|
2050
|
+
readonly nonce: OptionalSchema<UnionSchema<[StringSchema<undefined>, NumberSchema<undefined>], undefined>, undefined>;
|
|
373
2051
|
}, undefined>;
|
|
374
|
-
declare const ContainerLayoutStateChangedSchema:
|
|
375
|
-
readonly type:
|
|
376
|
-
readonly layoutState:
|
|
2052
|
+
declare const ContainerLayoutStateChangedSchema: ObjectSchema<{
|
|
2053
|
+
readonly type: LiteralSchema<"container:layout:state:changed", undefined>;
|
|
2054
|
+
readonly layoutState: UnionSchema<[LiteralSchema<"floating", undefined>, LiteralSchema<"sidebar", undefined>], undefined>;
|
|
2055
|
+
readonly isNarrowViewport: OptionalSchema<BooleanSchema<undefined>, undefined>;
|
|
377
2056
|
}, undefined>;
|
|
378
|
-
declare const ViewportResizeSchema:
|
|
379
|
-
readonly type:
|
|
380
|
-
readonly viewportWidth:
|
|
2057
|
+
declare const ViewportResizeSchema: ObjectSchema<{
|
|
2058
|
+
readonly type: LiteralSchema<"viewport:resize", undefined>;
|
|
2059
|
+
readonly viewportWidth: NumberSchema<undefined>;
|
|
381
2060
|
}, undefined>;
|
|
382
|
-
declare const ConfigUpdateSchema:
|
|
383
|
-
readonly type:
|
|
384
|
-
readonly apiKey:
|
|
385
|
-
readonly hostOrigin:
|
|
386
|
-
readonly tapUrl:
|
|
387
|
-
readonly apiUrl:
|
|
388
|
-
readonly environment:
|
|
389
|
-
readonly language:
|
|
390
|
-
readonly userId:
|
|
391
|
-
readonly courseId:
|
|
392
|
-
readonly clipId:
|
|
393
|
-
readonly clipPlayHead:
|
|
394
|
-
readonly
|
|
395
|
-
readonly
|
|
396
|
-
|
|
397
|
-
readonly floatingConfig:
|
|
398
|
-
readonly position:
|
|
399
|
-
readonly top:
|
|
400
|
-
readonly left:
|
|
401
|
-
readonly right:
|
|
402
|
-
readonly bottom:
|
|
2061
|
+
declare const ConfigUpdateSchema: ObjectSchema<{
|
|
2062
|
+
readonly type: LiteralSchema<"config:update", undefined>;
|
|
2063
|
+
readonly apiKey: OptionalSchema<StringSchema<undefined>, undefined>;
|
|
2064
|
+
readonly hostOrigin: OptionalSchema<StringSchema<undefined>, undefined>;
|
|
2065
|
+
readonly tapUrl: OptionalSchema<StringSchema<undefined>, undefined>;
|
|
2066
|
+
readonly apiUrl: OptionalSchema<StringSchema<undefined>, undefined>;
|
|
2067
|
+
readonly environment: OptionalSchema<UnionSchema<[LiteralSchema<"dev", undefined>, LiteralSchema<"prod", undefined>, LiteralSchema<"demo", undefined>, LiteralSchema<"staging", undefined>], undefined>, undefined>;
|
|
2068
|
+
readonly language: OptionalSchema<StringSchema<undefined>, undefined>;
|
|
2069
|
+
readonly userId: OptionalSchema<StringSchema<undefined>, undefined>;
|
|
2070
|
+
readonly courseId: OptionalSchema<StringSchema<undefined>, undefined>;
|
|
2071
|
+
readonly clipId: OptionalSchema<StringSchema<undefined>, undefined>;
|
|
2072
|
+
readonly clipPlayHead: OptionalSchema<NumberSchema<undefined>, undefined>;
|
|
2073
|
+
readonly mode: OptionalSchema<UnionSchema<[LiteralSchema<"inline", undefined>, LiteralSchema<"floating", undefined>, LiteralSchema<"sidebar", undefined>], undefined>, undefined>;
|
|
2074
|
+
readonly allowLayoutToggle: OptionalSchema<BooleanSchema<undefined>, undefined>;
|
|
2075
|
+
readonly container: OptionalSchema<ObjectSchema<{
|
|
2076
|
+
readonly floatingConfig: OptionalSchema<ObjectSchema<{
|
|
2077
|
+
readonly position: OptionalSchema<ObjectSchema<{
|
|
2078
|
+
readonly top: OptionalSchema<StringSchema<undefined>, undefined>;
|
|
2079
|
+
readonly left: OptionalSchema<StringSchema<undefined>, undefined>;
|
|
2080
|
+
readonly right: OptionalSchema<StringSchema<undefined>, undefined>;
|
|
2081
|
+
readonly bottom: OptionalSchema<StringSchema<undefined>, undefined>;
|
|
403
2082
|
}, undefined>, undefined>;
|
|
404
|
-
readonly width:
|
|
405
|
-
readonly height:
|
|
406
|
-
readonly borderRadius:
|
|
2083
|
+
readonly width: OptionalSchema<StringSchema<undefined>, undefined>;
|
|
2084
|
+
readonly height: OptionalSchema<StringSchema<undefined>, undefined>;
|
|
2085
|
+
readonly borderRadius: OptionalSchema<StringSchema<undefined>, undefined>;
|
|
407
2086
|
}, undefined>, undefined>;
|
|
408
|
-
readonly sidebarConfig:
|
|
409
|
-
readonly maxWidth:
|
|
410
|
-
readonly minViewportWidth:
|
|
2087
|
+
readonly sidebarConfig: OptionalSchema<ObjectSchema<{
|
|
2088
|
+
readonly maxWidth: OptionalSchema<StringSchema<undefined>, undefined>;
|
|
2089
|
+
readonly minViewportWidth: OptionalSchema<NumberSchema<undefined>, undefined>;
|
|
411
2090
|
}, undefined>, undefined>;
|
|
412
2091
|
}, undefined>, undefined>;
|
|
413
2092
|
}, undefined>;
|
|
414
|
-
declare const GAEventSchema:
|
|
415
|
-
readonly type:
|
|
416
|
-
readonly payload:
|
|
2093
|
+
declare const GAEventSchema: ObjectSchema<{
|
|
2094
|
+
readonly type: LiteralSchema<"GA_EVENT", undefined>;
|
|
2095
|
+
readonly payload: RecordSchema<StringSchema<undefined>, AnySchema, undefined>;
|
|
417
2096
|
}, undefined>;
|
|
418
|
-
declare const TapMessageSchema:
|
|
419
|
-
readonly type:
|
|
420
|
-
readonly gaId:
|
|
421
|
-
}, undefined>,
|
|
422
|
-
readonly type:
|
|
423
|
-
}, undefined>,
|
|
424
|
-
readonly type:
|
|
425
|
-
readonly clipId:
|
|
426
|
-
readonly clipPlayHead:
|
|
427
|
-
}, undefined>,
|
|
428
|
-
readonly type:
|
|
429
|
-
readonly messageInfo:
|
|
430
|
-
readonly content:
|
|
431
|
-
readonly duration:
|
|
2097
|
+
declare const TapMessageSchema: UnionSchema<[ObjectSchema<{
|
|
2098
|
+
readonly type: LiteralSchema<"tap:ready", undefined>;
|
|
2099
|
+
readonly gaId: StringSchema<undefined>;
|
|
2100
|
+
}, undefined>, ObjectSchema<{
|
|
2101
|
+
readonly type: LiteralSchema<"tap:close", undefined>;
|
|
2102
|
+
}, undefined>, ObjectSchema<{
|
|
2103
|
+
readonly type: LiteralSchema<"timeline:seek", undefined>;
|
|
2104
|
+
readonly clipId: StringSchema<undefined>;
|
|
2105
|
+
readonly clipPlayHead: NumberSchema<undefined>;
|
|
2106
|
+
}, undefined>, ObjectSchema<{
|
|
2107
|
+
readonly type: LiteralSchema<"alarm:click", undefined>;
|
|
2108
|
+
readonly messageInfo: ObjectSchema<{
|
|
2109
|
+
readonly content: GenericSchema<any>;
|
|
2110
|
+
readonly duration: OptionalSchema<NumberSchema<undefined>, undefined>;
|
|
432
2111
|
}, undefined>;
|
|
433
|
-
}, undefined>,
|
|
434
|
-
readonly type:
|
|
435
|
-
readonly messageInfo:
|
|
436
|
-
readonly content:
|
|
437
|
-
readonly duration:
|
|
2112
|
+
}, undefined>, ObjectSchema<{
|
|
2113
|
+
readonly type: LiteralSchema<"alarm:fadeIn", undefined>;
|
|
2114
|
+
readonly messageInfo: ObjectSchema<{
|
|
2115
|
+
readonly content: GenericSchema<any>;
|
|
2116
|
+
readonly duration: OptionalSchema<NumberSchema<undefined>, undefined>;
|
|
438
2117
|
}, undefined>;
|
|
439
|
-
}, undefined>,
|
|
440
|
-
readonly type:
|
|
441
|
-
readonly popUpInfo:
|
|
442
|
-
readonly html:
|
|
443
|
-
readonly requestId:
|
|
2118
|
+
}, undefined>, ObjectSchema<{
|
|
2119
|
+
readonly type: LiteralSchema<"popUp:open", undefined>;
|
|
2120
|
+
readonly popUpInfo: ObjectSchema<{
|
|
2121
|
+
readonly html: StringSchema<undefined>;
|
|
2122
|
+
readonly requestId: OptionalSchema<StringSchema<undefined>, undefined>;
|
|
444
2123
|
}, undefined>;
|
|
445
|
-
}, undefined>,
|
|
446
|
-
readonly type:
|
|
447
|
-
}, undefined>,
|
|
448
|
-
readonly type:
|
|
449
|
-
readonly materialId:
|
|
450
|
-
readonly presignedUrl:
|
|
451
|
-
readonly pageStart:
|
|
452
|
-
readonly pageEnd:
|
|
453
|
-
readonly nonce:
|
|
454
|
-
}, undefined>,
|
|
455
|
-
readonly type:
|
|
456
|
-
}, undefined>,
|
|
457
|
-
readonly type:
|
|
458
|
-
readonly materialId:
|
|
459
|
-
readonly error:
|
|
460
|
-
readonly message:
|
|
461
|
-
}, undefined>,
|
|
462
|
-
readonly type:
|
|
463
|
-
readonly mode:
|
|
464
|
-
readonly nonce:
|
|
465
|
-
}, undefined>,
|
|
466
|
-
readonly type:
|
|
467
|
-
readonly success:
|
|
468
|
-
readonly currentMode:
|
|
469
|
-
readonly nonce:
|
|
470
|
-
}, undefined>,
|
|
471
|
-
readonly type:
|
|
472
|
-
readonly layoutState:
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
readonly
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
readonly
|
|
479
|
-
readonly
|
|
480
|
-
readonly
|
|
481
|
-
readonly
|
|
482
|
-
readonly
|
|
483
|
-
readonly
|
|
484
|
-
readonly
|
|
485
|
-
readonly
|
|
486
|
-
readonly
|
|
487
|
-
readonly
|
|
488
|
-
readonly
|
|
489
|
-
readonly
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
readonly
|
|
495
|
-
readonly
|
|
496
|
-
readonly
|
|
2124
|
+
}, undefined>, ObjectSchema<{
|
|
2125
|
+
readonly type: LiteralSchema<"popUp:close", undefined>;
|
|
2126
|
+
}, undefined>, ObjectSchema<{
|
|
2127
|
+
readonly type: LiteralSchema<"material:view:open", undefined>;
|
|
2128
|
+
readonly materialId: StringSchema<undefined>;
|
|
2129
|
+
readonly presignedUrl: StringSchema<undefined>;
|
|
2130
|
+
readonly pageStart: NumberSchema<undefined>;
|
|
2131
|
+
readonly pageEnd: NumberSchema<undefined>;
|
|
2132
|
+
readonly nonce: OptionalSchema<UnionSchema<[StringSchema<undefined>, NumberSchema<undefined>], undefined>, undefined>;
|
|
2133
|
+
}, undefined>, ObjectSchema<{
|
|
2134
|
+
readonly type: LiteralSchema<"material:view:close", undefined>;
|
|
2135
|
+
}, undefined>, ObjectSchema<{
|
|
2136
|
+
readonly type: LiteralSchema<"material:view:error", undefined>;
|
|
2137
|
+
readonly materialId: StringSchema<undefined>;
|
|
2138
|
+
readonly error: UnionSchema<[LiteralSchema<"fetch_failed", undefined>, LiteralSchema<"expired_url", undefined>, LiteralSchema<"extraction_failed", undefined>, LiteralSchema<"unknown", undefined>], undefined>;
|
|
2139
|
+
readonly message: OptionalSchema<StringSchema<undefined>, undefined>;
|
|
2140
|
+
}, undefined>, ObjectSchema<{
|
|
2141
|
+
readonly type: LiteralSchema<"container:mode:change", undefined>;
|
|
2142
|
+
readonly mode: UnionSchema<[LiteralSchema<"floating", undefined>, LiteralSchema<"sidebar", undefined>], undefined>;
|
|
2143
|
+
readonly nonce: OptionalSchema<UnionSchema<[StringSchema<undefined>, NumberSchema<undefined>], undefined>, undefined>;
|
|
2144
|
+
}, undefined>, ObjectSchema<{
|
|
2145
|
+
readonly type: LiteralSchema<"container:mode:change:ack", undefined>;
|
|
2146
|
+
readonly success: BooleanSchema<undefined>;
|
|
2147
|
+
readonly currentMode: UnionSchema<[LiteralSchema<"floating", undefined>, LiteralSchema<"sidebar", undefined>, LiteralSchema<"floating-forced", undefined>], undefined>;
|
|
2148
|
+
readonly nonce: OptionalSchema<UnionSchema<[StringSchema<undefined>, NumberSchema<undefined>], undefined>, undefined>;
|
|
2149
|
+
}, undefined>, ObjectSchema<{
|
|
2150
|
+
readonly type: LiteralSchema<"container:layout:state:changed", undefined>;
|
|
2151
|
+
readonly layoutState: UnionSchema<[LiteralSchema<"floating", undefined>, LiteralSchema<"sidebar", undefined>], undefined>;
|
|
2152
|
+
readonly isNarrowViewport: OptionalSchema<BooleanSchema<undefined>, undefined>;
|
|
2153
|
+
}, undefined>, ObjectSchema<{
|
|
2154
|
+
readonly type: LiteralSchema<"viewport:resize", undefined>;
|
|
2155
|
+
readonly viewportWidth: NumberSchema<undefined>;
|
|
2156
|
+
}, undefined>, ObjectSchema<{
|
|
2157
|
+
readonly type: LiteralSchema<"config:update", undefined>;
|
|
2158
|
+
readonly apiKey: OptionalSchema<StringSchema<undefined>, undefined>;
|
|
2159
|
+
readonly hostOrigin: OptionalSchema<StringSchema<undefined>, undefined>;
|
|
2160
|
+
readonly tapUrl: OptionalSchema<StringSchema<undefined>, undefined>;
|
|
2161
|
+
readonly apiUrl: OptionalSchema<StringSchema<undefined>, undefined>;
|
|
2162
|
+
readonly environment: OptionalSchema<UnionSchema<[LiteralSchema<"dev", undefined>, LiteralSchema<"prod", undefined>, LiteralSchema<"demo", undefined>, LiteralSchema<"staging", undefined>], undefined>, undefined>;
|
|
2163
|
+
readonly language: OptionalSchema<StringSchema<undefined>, undefined>;
|
|
2164
|
+
readonly userId: OptionalSchema<StringSchema<undefined>, undefined>;
|
|
2165
|
+
readonly courseId: OptionalSchema<StringSchema<undefined>, undefined>;
|
|
2166
|
+
readonly clipId: OptionalSchema<StringSchema<undefined>, undefined>;
|
|
2167
|
+
readonly clipPlayHead: OptionalSchema<NumberSchema<undefined>, undefined>;
|
|
2168
|
+
readonly mode: OptionalSchema<UnionSchema<[LiteralSchema<"inline", undefined>, LiteralSchema<"floating", undefined>, LiteralSchema<"sidebar", undefined>], undefined>, undefined>;
|
|
2169
|
+
readonly allowLayoutToggle: OptionalSchema<BooleanSchema<undefined>, undefined>;
|
|
2170
|
+
readonly container: OptionalSchema<ObjectSchema<{
|
|
2171
|
+
readonly floatingConfig: OptionalSchema<ObjectSchema<{
|
|
2172
|
+
readonly position: OptionalSchema<ObjectSchema<{
|
|
2173
|
+
readonly top: OptionalSchema<StringSchema<undefined>, undefined>;
|
|
2174
|
+
readonly left: OptionalSchema<StringSchema<undefined>, undefined>;
|
|
2175
|
+
readonly right: OptionalSchema<StringSchema<undefined>, undefined>;
|
|
2176
|
+
readonly bottom: OptionalSchema<StringSchema<undefined>, undefined>;
|
|
497
2177
|
}, undefined>, undefined>;
|
|
498
|
-
readonly width:
|
|
499
|
-
readonly height:
|
|
500
|
-
readonly borderRadius:
|
|
2178
|
+
readonly width: OptionalSchema<StringSchema<undefined>, undefined>;
|
|
2179
|
+
readonly height: OptionalSchema<StringSchema<undefined>, undefined>;
|
|
2180
|
+
readonly borderRadius: OptionalSchema<StringSchema<undefined>, undefined>;
|
|
501
2181
|
}, undefined>, undefined>;
|
|
502
|
-
readonly sidebarConfig:
|
|
503
|
-
readonly maxWidth:
|
|
504
|
-
readonly minViewportWidth:
|
|
2182
|
+
readonly sidebarConfig: OptionalSchema<ObjectSchema<{
|
|
2183
|
+
readonly maxWidth: OptionalSchema<StringSchema<undefined>, undefined>;
|
|
2184
|
+
readonly minViewportWidth: OptionalSchema<NumberSchema<undefined>, undefined>;
|
|
505
2185
|
}, undefined>, undefined>;
|
|
506
2186
|
}, undefined>, undefined>;
|
|
507
|
-
}, undefined>,
|
|
508
|
-
readonly type:
|
|
509
|
-
readonly payload:
|
|
2187
|
+
}, undefined>, ObjectSchema<{
|
|
2188
|
+
readonly type: LiteralSchema<"GA_EVENT", undefined>;
|
|
2189
|
+
readonly payload: RecordSchema<StringSchema<undefined>, AnySchema, undefined>;
|
|
510
2190
|
}, undefined>], undefined>;
|
|
511
2191
|
|
|
512
2192
|
type TapMessageRecord = TapMessage;
|
|
513
2193
|
|
|
514
|
-
/**
|
|
515
|
-
* Styling Types
|
|
516
|
-
*/
|
|
517
|
-
type PositionType = {
|
|
518
|
-
top?: string;
|
|
519
|
-
left?: string;
|
|
520
|
-
right?: string;
|
|
521
|
-
bottom?: string;
|
|
522
|
-
};
|
|
523
|
-
/**
|
|
524
|
-
* Container Layout State (SSOT - Visual State)
|
|
525
|
-
*
|
|
526
|
-
* This is the SINGLE SOURCE OF TRUTH for container visual state.
|
|
527
|
-
* Managed by Container class (tap-kit-core), streamed to iframe via messages.
|
|
528
|
-
*
|
|
529
|
-
* - floating: User-chosen floating layout
|
|
530
|
-
* - sidebar: User-chosen sidebar layout
|
|
531
|
-
* - floating-forced: Forced floating due to narrow viewport (sidebar unavailable)
|
|
532
|
-
*
|
|
533
|
-
* Both tap-kit-core (Container) and edutap (UIConfigStore) use this type.
|
|
534
|
-
* iframe receives this as read-only shadow state via container:layout:state:changed message.
|
|
535
|
-
*/
|
|
536
|
-
type ContainerLayoutState = "floating" | "sidebar" | "floating-forced";
|
|
537
|
-
/**
|
|
538
|
-
* Container Mode (Behavior Configuration)
|
|
539
|
-
*
|
|
540
|
-
* Controls toggle button visibility and layout persistence:
|
|
541
|
-
* - auto: User can toggle between layouts, remembers preference via localStorage (DEFAULT)
|
|
542
|
-
* - floating: Fixed in floating layout, no toggle button, no persistence
|
|
543
|
-
* - sidebar: Fixed in sidebar layout, no toggle button, no persistence
|
|
544
|
-
*/
|
|
545
|
-
type ContainerMode = "auto" | "floating" | "sidebar";
|
|
546
|
-
/**
|
|
547
|
-
* Floating mode configuration
|
|
548
|
-
* Includes position, size, and style settings for floating container
|
|
549
|
-
*/
|
|
550
|
-
type FloatingConfig = {
|
|
551
|
-
/** Position (default: top: "50px", right: "24px") */
|
|
552
|
-
position?: PositionType;
|
|
553
|
-
/** Width (default: "340px") */
|
|
554
|
-
width?: string;
|
|
555
|
-
/** Height (default: "calc(100% - 116px)") */
|
|
556
|
-
height?: string;
|
|
557
|
-
/** Border radius (default: "16px") */
|
|
558
|
-
borderRadius?: string;
|
|
559
|
-
/** Expanded width for PDF viewer (default: "min(90vw, 1200px)") */
|
|
560
|
-
expandedWidth?: string;
|
|
561
|
-
/** Expanded height for PDF viewer (default: "90vh") */
|
|
562
|
-
expandedHeight?: string;
|
|
563
|
-
/** Expanded top position for PDF viewer (default: "5vh") */
|
|
564
|
-
expandedTop?: string;
|
|
565
|
-
/** Expanded right position for PDF viewer (default: "5vw") */
|
|
566
|
-
expandedRight?: string;
|
|
567
|
-
};
|
|
568
|
-
/**
|
|
569
|
-
* Sidebar Configuration
|
|
570
|
-
*/
|
|
571
|
-
type SidebarConfig = {
|
|
572
|
-
/** Maximum width of the sidebar (default: "min(50%, 1000px)") */
|
|
573
|
-
maxWidth?: string;
|
|
574
|
-
/** Expanded maximum width for PDF viewer (default: "min(70%, 1400px)") */
|
|
575
|
-
expandedMaxWidth?: string;
|
|
576
|
-
/** Minimum viewport width to enable sidebar mode (default: 768) */
|
|
577
|
-
minViewportWidth?: number;
|
|
578
|
-
};
|
|
579
|
-
/**
|
|
580
|
-
* Container Configuration (SSOT - Type Level)
|
|
581
|
-
*
|
|
582
|
-
* This is the SINGLE SOURCE OF TRUTH for container configuration at the TYPE level.
|
|
583
|
-
* - Public API: TapKitInitParams.container
|
|
584
|
-
* - Internal: Container class configuration
|
|
585
|
-
* - Protocol: ConfigUpdateMessage.container mirrors this structure
|
|
586
|
-
*
|
|
587
|
-
* When modifying this type, also update ConfigUpdateMessage.container in @coxwave/tap-messages
|
|
588
|
-
*
|
|
589
|
-
* @example
|
|
590
|
-
* // Default: Auto mode with floating layout (toggle button visible)
|
|
591
|
-
* const config: ContainerConfig = {}
|
|
592
|
-
*
|
|
593
|
-
* @example
|
|
594
|
-
* // Auto mode with custom styling for both layouts
|
|
595
|
-
* const config: ContainerConfig = {
|
|
596
|
-
* floatingConfig: { width: "400px", position: { top: "80px" } },
|
|
597
|
-
* sidebarConfig: { maxWidth: "800px" }
|
|
598
|
-
* }
|
|
599
|
-
*
|
|
600
|
-
* @example
|
|
601
|
-
* // Fixed floating mode (no toggle button)
|
|
602
|
-
* const config: ContainerConfig = {
|
|
603
|
-
* mode: "floating",
|
|
604
|
-
* floatingConfig: { position: { top: "80px" }, width: "400px" }
|
|
605
|
-
* }
|
|
606
|
-
*
|
|
607
|
-
* @example
|
|
608
|
-
* // Fixed sidebar mode (no toggle button)
|
|
609
|
-
* const config: ContainerConfig = {
|
|
610
|
-
* mode: "sidebar",
|
|
611
|
-
* sidebarConfig: { maxWidth: "500px" }
|
|
612
|
-
* }
|
|
613
|
-
*
|
|
614
|
-
*/
|
|
615
|
-
type ContainerConfig = {
|
|
616
|
-
/**
|
|
617
|
-
* Container mode controls toggle button visibility and behavior (only for auto-created containers)
|
|
618
|
-
* - "auto" (default): User can toggle between layouts, starts in floating, remembers preference via localStorage
|
|
619
|
-
* - "floating": Fixed in floating layout, no toggle button
|
|
620
|
-
* - "sidebar": Fixed in sidebar layout, no toggle button
|
|
621
|
-
*
|
|
622
|
-
* NOTE: When user provides their own <tap-container>, mode is ignored and container is fully user-controlled
|
|
623
|
-
*/
|
|
624
|
-
mode?: ContainerMode;
|
|
625
|
-
/** Floating layout configuration (applied when SDK auto-creates container in floating layout) */
|
|
626
|
-
floatingConfig?: FloatingConfig;
|
|
627
|
-
/** Sidebar layout configuration (applied when SDK auto-creates container in sidebar layout) */
|
|
628
|
-
sidebarConfig?: SidebarConfig;
|
|
629
|
-
};
|
|
630
|
-
|
|
631
2194
|
/**
|
|
632
2195
|
* Core Configuration Types
|
|
633
2196
|
* Based on ConfigUpdateMessage protocol for type consistency (SSOT)
|
|
@@ -673,100 +2236,57 @@ type Course = {
|
|
|
673
2236
|
clipPlayHead?: number;
|
|
674
2237
|
};
|
|
675
2238
|
/**
|
|
676
|
-
* SDK Initialization Parameters
|
|
2239
|
+
* SDK Initialization Parameters (Legacy API)
|
|
2240
|
+
*
|
|
2241
|
+
* **Note:** This is for the legacy `new TapKit()` class API.
|
|
2242
|
+
* For new projects, use `<tap-kit>` Web Component which supports
|
|
2243
|
+
* container customization via attributes and properties.
|
|
677
2244
|
*
|
|
678
2245
|
* Button Options (choose one):
|
|
679
2246
|
* 1. buttonId: Attach to your own button element (provide element ID)
|
|
680
|
-
* 2.
|
|
681
|
-
*
|
|
682
|
-
* Container Mounting Options (Priority Resolution):
|
|
683
|
-
* 1. containerId: Use existing <tap-container id="..."> element (explicit)
|
|
684
|
-
* 2. container.parent: Mount iframe to custom parent with imperative API
|
|
685
|
-
* 3. Auto-detect: Find existing <tap-container> in DOM
|
|
686
|
-
* 4. Fallback: Auto-create container and mount to document.body (default)
|
|
687
|
-
*
|
|
688
|
-
* Debug Options:
|
|
689
|
-
* - debug: Enable debug logging (overrides environment-based suppression)
|
|
2247
|
+
* 2. Omit buttonId: SDK creates floating widget without button binding
|
|
690
2248
|
*
|
|
691
2249
|
* @example
|
|
692
2250
|
* ```typescript
|
|
693
|
-
* const sdk = new
|
|
2251
|
+
* const sdk = new TapKit({ apiKey: "your-key" });
|
|
694
2252
|
*
|
|
695
|
-
* //
|
|
2253
|
+
* // With custom button
|
|
696
2254
|
* await sdk.init({
|
|
697
2255
|
* buttonId: "my-chat-button",
|
|
698
2256
|
* course: { userId: "user1", courseId: "course1", clipId: "clip1" }
|
|
699
2257
|
* });
|
|
700
2258
|
*
|
|
701
|
-
* //
|
|
702
|
-
* // HTML: <tap-button></tap-button>
|
|
703
|
-
* await sdk.init({
|
|
704
|
-
* course: { userId: "user1", courseId: "course1", clipId: "clip1" }
|
|
705
|
-
* });
|
|
706
|
-
*
|
|
707
|
-
* // Option 3: Explicit container by ID
|
|
708
|
-
* // HTML: <tap-container id="my-chat-container"></tap-container>
|
|
2259
|
+
* // Without button (floating widget)
|
|
709
2260
|
* await sdk.init({
|
|
710
|
-
* containerId: "my-chat-container",
|
|
711
2261
|
* course: { userId: "user1", courseId: "course1", clipId: "clip1" }
|
|
712
2262
|
* });
|
|
713
2263
|
*
|
|
714
|
-
* //
|
|
715
|
-
* await sdk.init({
|
|
716
|
-
* course: { userId: "user1", courseId: "course1", clipId: "clip1" },
|
|
717
|
-
* container: {
|
|
718
|
-
* parent: document.querySelector('#my-container'),
|
|
719
|
-
* floatingConfig: { width: "100%", height: "100%" }
|
|
720
|
-
* }
|
|
721
|
-
* });
|
|
722
|
-
*
|
|
723
|
-
* // Custom floating container
|
|
724
|
-
* await sdk.init({
|
|
725
|
-
* buttonId: "tap-button",
|
|
726
|
-
* course: { userId: "user1", courseId: "course1", clipId: "clip1" },
|
|
727
|
-
* container: {
|
|
728
|
-
* mode: "floating",
|
|
729
|
-
* floatingConfig: {
|
|
730
|
-
* position: { top: "80px", right: "32px" },
|
|
731
|
-
* width: "400px"
|
|
732
|
-
* }
|
|
733
|
-
* }
|
|
734
|
-
* });
|
|
735
|
-
*
|
|
736
|
-
* // Sidebar mode with custom width
|
|
737
|
-
* await sdk.init({
|
|
738
|
-
* buttonId: "tap-button",
|
|
739
|
-
* course: { userId: "user1", courseId: "course1", clipId: "clip1" },
|
|
740
|
-
* container: {
|
|
741
|
-
* mode: "sidebar",
|
|
742
|
-
* sidebarConfig: { maxWidth: "800px" }
|
|
743
|
-
* }
|
|
744
|
-
* });
|
|
745
|
-
*
|
|
746
|
-
* // Enable debug logging (useful for production debugging)
|
|
2264
|
+
* // Enable debug logging
|
|
747
2265
|
* await sdk.init({
|
|
748
2266
|
* course: { userId: "user1", courseId: "course1", clipId: "clip1" },
|
|
749
2267
|
* debug: true
|
|
750
2268
|
* });
|
|
751
2269
|
* ```
|
|
2270
|
+
*
|
|
2271
|
+
* @deprecated Use `<tap-kit>` Web Component for container customization:
|
|
2272
|
+
* ```html
|
|
2273
|
+
* <tap-kit
|
|
2274
|
+
* user-id="user1"
|
|
2275
|
+
* course-id="course1"
|
|
2276
|
+
* clip-id="clip1"
|
|
2277
|
+
* mode="sidebar"
|
|
2278
|
+
* ></tap-kit>
|
|
2279
|
+
* ```
|
|
752
2280
|
*/
|
|
753
2281
|
type TapKitInitParams = {
|
|
754
2282
|
/**
|
|
755
2283
|
* Element ID of your custom button (optional)
|
|
756
|
-
* If omitted, SDK
|
|
2284
|
+
* If omitted, SDK creates floating widget without button binding
|
|
757
2285
|
* @see https://edutap-ai-docs.vercel.app/docs/sdk/button
|
|
758
2286
|
*/
|
|
759
2287
|
buttonId?: string;
|
|
760
|
-
/**
|
|
761
|
-
* Element ID of existing <tap-container> element (optional)
|
|
762
|
-
* If provided, SDK will use this specific container instead of auto-detection
|
|
763
|
-
* Useful when you have multiple containers or need explicit control
|
|
764
|
-
* @see https://edutap-ai-docs.vercel.app/docs/sdk/container
|
|
765
|
-
*/
|
|
766
|
-
containerId?: string;
|
|
2288
|
+
/** Course information (required) */
|
|
767
2289
|
course: Course;
|
|
768
|
-
/** Container configuration (optional, uses defaults if omitted) */
|
|
769
|
-
container?: ContainerConfig;
|
|
770
2290
|
/**
|
|
771
2291
|
* Enable debug logging (optional)
|
|
772
2292
|
* When true, forces debug logs to show even in production/demo environments
|
|
@@ -948,6 +2468,72 @@ interface TapKitInstance {
|
|
|
948
2468
|
/** TapKit constructor type */
|
|
949
2469
|
type TapKitConstructor = new (config: TapKitConfig) => TapKitInstance;
|
|
950
2470
|
|
|
2471
|
+
/**
|
|
2472
|
+
* Styling Types
|
|
2473
|
+
*/
|
|
2474
|
+
type PositionType = {
|
|
2475
|
+
top?: string;
|
|
2476
|
+
left?: string;
|
|
2477
|
+
right?: string;
|
|
2478
|
+
bottom?: string;
|
|
2479
|
+
};
|
|
2480
|
+
/**
|
|
2481
|
+
* Floating mode configuration
|
|
2482
|
+
* Includes position, size, and style settings for floating container
|
|
2483
|
+
*/
|
|
2484
|
+
type FloatingConfig = {
|
|
2485
|
+
/** Position (default: top: "50px", right: "24px") */
|
|
2486
|
+
position?: PositionType;
|
|
2487
|
+
/** Width (default: "340px") */
|
|
2488
|
+
width?: string;
|
|
2489
|
+
/** Height (default: "calc(100% - 116px)") */
|
|
2490
|
+
height?: string;
|
|
2491
|
+
/** Border radius (default: "16px") */
|
|
2492
|
+
borderRadius?: string;
|
|
2493
|
+
/** Expanded width for PDF viewer (default: "min(90vw, 1200px)") */
|
|
2494
|
+
expandedWidth?: string;
|
|
2495
|
+
/** Expanded height for PDF viewer (default: "90vh") */
|
|
2496
|
+
expandedHeight?: string;
|
|
2497
|
+
/** Expanded top position for PDF viewer (default: "5vh") */
|
|
2498
|
+
expandedTop?: string;
|
|
2499
|
+
/** Expanded right position for PDF viewer (default: "5vw") */
|
|
2500
|
+
expandedRight?: string;
|
|
2501
|
+
};
|
|
2502
|
+
/**
|
|
2503
|
+
* Sidebar Configuration
|
|
2504
|
+
*/
|
|
2505
|
+
type SidebarConfig = {
|
|
2506
|
+
/** Maximum width of the sidebar (default: "min(50%, 1000px)") */
|
|
2507
|
+
maxWidth?: string;
|
|
2508
|
+
/** Expanded maximum width for PDF viewer (default: "min(70%, 1400px)") */
|
|
2509
|
+
expandedMaxWidth?: string;
|
|
2510
|
+
/** Minimum viewport width to enable sidebar mode (default: 768) */
|
|
2511
|
+
minViewportWidth?: number;
|
|
2512
|
+
};
|
|
2513
|
+
/**
|
|
2514
|
+
* Container Configuration (SSOT - Type Level)
|
|
2515
|
+
*
|
|
2516
|
+
* This is the SINGLE SOURCE OF TRUTH for container configuration at the TYPE level.
|
|
2517
|
+
* - Public API: TapKitInitParams.container
|
|
2518
|
+
* - Internal: Container class configuration
|
|
2519
|
+
* - Protocol: ConfigUpdateMessage.container mirrors this structure
|
|
2520
|
+
*
|
|
2521
|
+
* When modifying this type, also update ConfigUpdateMessage.container in @coxwave/tap-messages
|
|
2522
|
+
*
|
|
2523
|
+
* @example
|
|
2524
|
+
* // Custom styling for floating/sidebar modes
|
|
2525
|
+
* const config: ContainerConfig = {
|
|
2526
|
+
* floatingConfig: { width: "400px", position: { top: "80px" } },
|
|
2527
|
+
* sidebarConfig: { maxWidth: "800px" }
|
|
2528
|
+
* }
|
|
2529
|
+
*/
|
|
2530
|
+
type ContainerConfig = {
|
|
2531
|
+
/** Floating layout configuration (applied when SDK auto-creates container in floating layout) */
|
|
2532
|
+
floatingConfig?: FloatingConfig;
|
|
2533
|
+
/** Sidebar layout configuration (applied when SDK auto-creates container in sidebar layout) */
|
|
2534
|
+
sidebarConfig?: SidebarConfig;
|
|
2535
|
+
};
|
|
2536
|
+
|
|
951
2537
|
/**
|
|
952
2538
|
* Type declarations for <tap-button> Web Component
|
|
953
2539
|
*
|
|
@@ -1333,9 +2919,6 @@ interface TapKitElement extends HTMLElement {
|
|
|
1333
2919
|
/** Custom button element ID (optional) */
|
|
1334
2920
|
buttonId?: string;
|
|
1335
2921
|
|
|
1336
|
-
/** Custom container element ID (optional) */
|
|
1337
|
-
containerId?: string;
|
|
1338
|
-
|
|
1339
2922
|
/** Enable debug mode (optional, default: false) */
|
|
1340
2923
|
debug: boolean;
|
|
1341
2924
|
|
|
@@ -1467,6 +3050,9 @@ interface TapKitAttributes {
|
|
|
1467
3050
|
/** React key for list rendering */
|
|
1468
3051
|
key?: string | number;
|
|
1469
3052
|
|
|
3053
|
+
/** React ref for element access */
|
|
3054
|
+
ref?: React.Ref<TapKitElement>;
|
|
3055
|
+
|
|
1470
3056
|
/** Element ID attribute */
|
|
1471
3057
|
id?: string;
|
|
1472
3058
|
|
|
@@ -1795,4 +3381,4 @@ declare global {
|
|
|
1795
3381
|
function cancelIdleCallback(handle: number): void;
|
|
1796
3382
|
}
|
|
1797
3383
|
|
|
1798
|
-
export { ALARM_DURATION, type AlarmClickMessage, AlarmClickSchema, type AlarmElement, type AlarmElementProps, AlarmElementPropsSchema, AlarmElementSchema, type AlarmFadeInMessage, AlarmFadeInSchema, AlarmMessageInstanceSchema, type AlarmMessageInstanceType, type AlarmPayload, type AlarmType, type CSSStyle, CSSStyleSchema, type ConfigUpdateMessage, ConfigUpdateSchema, type ContainerConfig, type
|
|
3384
|
+
export { ALARM_DURATION, type AlarmClickMessage, AlarmClickSchema, type AlarmElement, type AlarmElementProps, AlarmElementPropsSchema, AlarmElementSchema, type AlarmFadeInMessage, AlarmFadeInSchema, AlarmMessageInstanceSchema, type AlarmMessageInstanceType, type AlarmPayload, type AlarmType, type CSSStyle, CSSStyleSchema, type ConfigUpdateMessage, ConfigUpdateSchema, type ContainerConfig, type ContainerLayoutStateChangedMessage, ContainerLayoutStateChangedSchema, type ContainerModeChangeAckMessage, ContainerModeChangeAckSchema, type ContainerModeChangeMessage, ContainerModeChangeSchema, type ContainerVisibility, type Course, type EventManager, type FloatingConfig, type GAEventMessage, GAEventSchema, type ITapButtonElement, type ITapContainerElement, type ITapKitElement, type ITapMaterialViewerElement, TapKitInitializationError as InitializationError, type MaterialViewCloseMessage, MaterialViewCloseSchema, type MaterialViewConfig, type MaterialViewErrorMessage, MaterialViewErrorSchema, type MaterialViewOpenMessage, MaterialViewOpenSchema, MaterialViewerError, type PopUpCloseMessage, PopUpCloseSchema, type PopUpOpenMessage, PopUpOpenSchema, type PositionType, type SeekTimelineParamsType, type ShortcutKeyPropertiesType, type SidebarConfig, TAP_BUTTON_CLICK_EVENT, TAP_ERROR_MARKER, type TapButtonAttributes, type TapButtonClickEventDetail, type TapCloseMessage, TapCloseSchema, type TapContainerAttributes, type TapErrorOptions, type TapKitConfig, type TapKitConfigOptions, TapKitConfigurationError, type TapKitConstructor, type TapKitElement, type TapKitElementEventMap, TapKitError, TapKitIframeError, type TapKitInitParams, TapKitInitializationError, type TapKitInstance, TapKitLoaderError, TapKitMessageError, type TapKitRuntimeConfig, type TapMaterialViewerAttributes, type TapMessage, type TapMessageRecord, TapMessageSchema, type TapMessageType, type TapReadyMessage, TapReadySchema, type TimelineSeekMessage, TimelineSeekSchema, type VideoController, type VideoPlayerAdapter, type VideoPlayerConfig, type ViewportResizeMessage, ViewportResizeSchema };
|