Skip to content

Commit 619c233

Browse files
committed
Improve type
1 parent 3dc7ea3 commit 619c233

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed

src/compileComponentSchemas.ts

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { annotateWithJSDocComment } from './comments';
66

77
const COMMENT = `
88
Map of all components defined in the spec to their validation functions.
9+
{Object.<string, <T>(path: string[], value: T, context: any) => (T | ValidationError)>}
910
`;
1011

1112
/**

src/tests/__snapshots__/compileValueSchema.test.ts.snap

+21
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export function validateRequest(request, context) {
1212
}
1313
/**
1414
Map of all components defined in the spec to their validation functions.
15+
{Object.<string, <T>(path: string[], value: T, context: any) => (T | ValidationError)>}
1516
*/
1617
export const componentSchemas = {};
1718
export class RequestError extends Error {
@@ -55,6 +56,7 @@ export function validateRequest(request, context) {
5556
}
5657
/**
5758
Map of all components defined in the spec to their validation functions.
59+
{Object.<string, <T>(path: string[], value: T, context: any) => (T | ValidationError)>}
5860
*/
5961
export const componentSchemas = {};
6062
export class RequestError extends Error {
@@ -101,6 +103,7 @@ export function validateRequest(request, context) {
101103
}
102104
/**
103105
Map of all components defined in the spec to their validation functions.
106+
{Object.<string, <T>(path: string[], value: T, context: any) => (T | ValidationError)>}
104107
*/
105108
export const componentSchemas = {};
106109
export class RequestError extends Error {
@@ -147,6 +150,7 @@ export function validateRequest(request, context) {
147150
}
148151
/**
149152
Map of all components defined in the spec to their validation functions.
153+
{Object.<string, <T>(path: string[], value: T, context: any) => (T | ValidationError)>}
150154
*/
151155
export const componentSchemas = {};
152156
export class RequestError extends Error {
@@ -193,6 +197,7 @@ export function validateRequest(request, context) {
193197
}
194198
/**
195199
Map of all components defined in the spec to their validation functions.
200+
{Object.<string, <T>(path: string[], value: T, context: any) => (T | ValidationError)>}
196201
*/
197202
export const componentSchemas = {};
198203
export class RequestError extends Error {
@@ -239,6 +244,7 @@ export function validateRequest(request, context) {
239244
}
240245
/**
241246
Map of all components defined in the spec to their validation functions.
247+
{Object.<string, <T>(path: string[], value: T, context: any) => (T | ValidationError)>}
242248
*/
243249
export const componentSchemas = {};
244250
export class RequestError extends Error {
@@ -282,6 +288,7 @@ export function validateRequest(request, context) {
282288
}
283289
/**
284290
Map of all components defined in the spec to their validation functions.
291+
{Object.<string, <T>(path: string[], value: T, context: any) => (T | ValidationError)>}
285292
*/
286293
export const componentSchemas = {};
287294
export class RequestError extends Error {
@@ -328,6 +335,7 @@ export function validateRequest(request, context) {
328335
}
329336
/**
330337
Map of all components defined in the spec to their validation functions.
338+
{Object.<string, <T>(path: string[], value: T, context: any) => (T | ValidationError)>}
331339
*/
332340
export const componentSchemas = {};
333341
export class RequestError extends Error {
@@ -368,6 +376,7 @@ export function validateRequest(request, context) {
368376
}
369377
/**
370378
Map of all components defined in the spec to their validation functions.
379+
{Object.<string, <T>(path: string[], value: T, context: any) => (T | ValidationError)>}
371380
*/
372381
export const componentSchemas = {};
373382
export class RequestError extends Error {
@@ -412,6 +421,7 @@ export function validateRequest(request, context) {
412421
}
413422
/**
414423
Map of all components defined in the spec to their validation functions.
424+
{Object.<string, <T>(path: string[], value: T, context: any) => (T | ValidationError)>}
415425
*/
416426
export const componentSchemas = {};
417427
export class RequestError extends Error {
@@ -456,6 +466,7 @@ export function validateRequest(request, context) {
456466
}
457467
/**
458468
Map of all components defined in the spec to their validation functions.
469+
{Object.<string, <T>(path: string[], value: T, context: any) => (T | ValidationError)>}
459470
*/
460471
export const componentSchemas = {};
461472
export class RequestError extends Error {
@@ -538,6 +549,7 @@ export function validateRequest(request, context) {
538549
}
539550
/**
540551
Map of all components defined in the spec to their validation functions.
552+
{Object.<string, <T>(path: string[], value: T, context: any) => (T | ValidationError)>}
541553
*/
542554
export const componentSchemas = {};
543555
export class RequestError extends Error {
@@ -602,6 +614,7 @@ export function validateRequest(request, context) {
602614
}
603615
/**
604616
Map of all components defined in the spec to their validation functions.
617+
{Object.<string, <T>(path: string[], value: T, context: any) => (T | ValidationError)>}
605618
*/
606619
export const componentSchemas = {};
607620
export class RequestError extends Error {
@@ -643,6 +656,7 @@ export function validateRequest(request, context) {
643656
}
644657
/**
645658
Map of all components defined in the spec to their validation functions.
659+
{Object.<string, <T>(path: string[], value: T, context: any) => (T | ValidationError)>}
646660
*/
647661
export const componentSchemas = {};
648662
export class RequestError extends Error {
@@ -707,6 +721,7 @@ export function validateRequest(request, context) {
707721
}
708722
/**
709723
Map of all components defined in the spec to their validation functions.
724+
{Object.<string, <T>(path: string[], value: T, context: any) => (T | ValidationError)>}
710725
*/
711726
export const componentSchemas = {};
712727
export class RequestError extends Error {
@@ -787,6 +802,7 @@ export function validateRequest(request, context) {
787802
}
788803
/**
789804
Map of all components defined in the spec to their validation functions.
805+
{Object.<string, <T>(path: string[], value: T, context: any) => (T | ValidationError)>}
790806
*/
791807
export const componentSchemas = {};
792808
export class RequestError extends Error {
@@ -834,6 +850,7 @@ export function validateRequest(request, context) {
834850
}
835851
/**
836852
Map of all components defined in the spec to their validation functions.
853+
{Object.<string, <T>(path: string[], value: T, context: any) => (T | ValidationError)>}
837854
*/
838855
export const componentSchemas = {};
839856
export class RequestError extends Error {
@@ -896,6 +913,7 @@ export function validateRequest(request, context) {
896913
}
897914
/**
898915
Map of all components defined in the spec to their validation functions.
916+
{Object.<string, <T>(path: string[], value: T, context: any) => (T | ValidationError)>}
899917
*/
900918
export const componentSchemas = {};
901919
export class RequestError extends Error {
@@ -957,6 +975,7 @@ export function validateRequest(request, context) {
957975
}
958976
/**
959977
Map of all components defined in the spec to their validation functions.
978+
{Object.<string, <T>(path: string[], value: T, context: any) => (T | ValidationError)>}
960979
*/
961980
export const componentSchemas = {};
962981
export class RequestError extends Error {
@@ -1017,6 +1036,7 @@ export function validateRequest(request, context) {
10171036
}
10181037
/**
10191038
Map of all components defined in the spec to their validation functions.
1039+
{Object.<string, <T>(path: string[], value: T, context: any) => (T | ValidationError)>}
10201040
*/
10211041
export const componentSchemas = {};
10221042
export class RequestError extends Error {
@@ -1084,6 +1104,7 @@ export function validateRequest(request, context) {
10841104
}
10851105
/**
10861106
Map of all components defined in the spec to their validation functions.
1107+
{Object.<string, <T>(path: string[], value: T, context: any) => (T | ValidationError)>}
10871108
*/
10881109
export const componentSchemas = {};
10891110
export class RequestError extends Error {

src/tests/__snapshots__/compiler.test.ts.snap

+2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export function validateRequest(request, context) {
1212
}
1313
/**
1414
Map of all components defined in the spec to their validation functions.
15+
{Object.<string, <T>(path: string[], value: T, context: any) => (T | ValidationError)>}
1516
*/
1617
export const componentSchemas = {
1718
'A': obj0,
@@ -95,6 +96,7 @@ export function validateRequest(request, context) {
9596
}
9697
/**
9798
Map of all components defined in the spec to their validation functions.
99+
{Object.<string, <T>(path: string[], value: T, context: any) => (T | ValidationError)>}
98100
*/
99101
export const componentSchemas = {
100102
'A': obj0,

0 commit comments

Comments
 (0)