typia 5.1.0-dev.20230922 → 5.1.0-dev.20230924
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/lib/factories/MetadataCollection.js +1 -1
- package/lib/factories/MetadataCollection.js.map +1 -1
- package/lib/functional/$HeadersReader.d.ts +6 -0
- package/lib/functional/$HeadersReader.js +17 -0
- package/lib/functional/$HeadersReader.js.map +1 -0
- package/lib/functional/$QueryReader.d.ts +7 -0
- package/lib/functional/$QueryReader.js +37 -0
- package/lib/functional/$QueryReader.js.map +1 -0
- package/lib/functional/Namespace.js +7 -0
- package/lib/functional/Namespace.js.map +1 -1
- package/lib/http.d.ts +872 -0
- package/lib/http.js +110 -0
- package/lib/http.js.map +1 -0
- package/lib/json.js +2 -2
- package/lib/json.js.map +1 -1
- package/lib/misc.js +2 -2
- package/lib/misc.js.map +1 -1
- package/lib/module.d.ts +1 -0
- package/lib/module.js +2 -1
- package/lib/module.js.map +1 -1
- package/lib/programmers/helpers/HttpMetadataUtil.d.ts +5 -0
- package/lib/programmers/helpers/HttpMetadataUtil.js +44 -0
- package/lib/programmers/helpers/HttpMetadataUtil.js.map +1 -0
- package/lib/programmers/http/HttpAssertHeadersProgrammer.d.ts +5 -0
- package/lib/programmers/http/HttpAssertHeadersProgrammer.js +41 -0
- package/lib/programmers/http/HttpAssertHeadersProgrammer.js.map +1 -0
- package/lib/programmers/http/HttpAssertQueryProgrammer.d.ts +5 -0
- package/lib/programmers/http/HttpAssertQueryProgrammer.js +41 -0
- package/lib/programmers/http/HttpAssertQueryProgrammer.js.map +1 -0
- package/lib/programmers/http/HttpHeadersProgrammer.d.ts +6 -0
- package/lib/programmers/http/HttpHeadersProgrammer.js +235 -0
- package/lib/programmers/http/HttpHeadersProgrammer.js.map +1 -0
- package/lib/programmers/http/HttpIsHeadersProgrammer.d.ts +5 -0
- package/lib/programmers/http/HttpIsHeadersProgrammer.js +45 -0
- package/lib/programmers/http/HttpIsHeadersProgrammer.js.map +1 -0
- package/lib/programmers/http/HttpIsQueryProgrammer.d.ts +5 -0
- package/lib/programmers/http/HttpIsQueryProgrammer.js +45 -0
- package/lib/programmers/http/HttpIsQueryProgrammer.js.map +1 -0
- package/lib/programmers/http/HttpParameterProgrammer.d.ts +5 -0
- package/lib/programmers/http/HttpParameterProgrammer.js +120 -0
- package/lib/programmers/http/HttpParameterProgrammer.js.map +1 -0
- package/lib/programmers/http/HttpQueryProgrammer.d.ts +6 -0
- package/lib/programmers/http/HttpQueryProgrammer.js +177 -0
- package/lib/programmers/http/HttpQueryProgrammer.js.map +1 -0
- package/lib/programmers/http/HttpValidateHeadersProgrammer.d.ts +5 -0
- package/lib/programmers/http/HttpValidateHeadersProgrammer.js +41 -0
- package/lib/programmers/http/HttpValidateHeadersProgrammer.js.map +1 -0
- package/lib/programmers/http/HttpValidateQueryProgrammer.d.ts +5 -0
- package/lib/programmers/http/HttpValidateQueryProgrammer.js +41 -0
- package/lib/programmers/http/HttpValidateQueryProgrammer.js.map +1 -0
- package/lib/protobuf.d.ts +24 -24
- package/lib/protobuf.js +4 -4
- package/lib/protobuf.js.map +1 -1
- package/lib/transformers/CallExpressionTransformer.js +40 -0
- package/lib/transformers/CallExpressionTransformer.js.map +1 -1
- package/lib/transformers/features/http/CreateHttpAssertHeadersTransformer.d.ts +4 -0
- package/lib/transformers/features/http/CreateHttpAssertHeadersTransformer.js +12 -0
- package/lib/transformers/features/http/CreateHttpAssertHeadersTransformer.js.map +1 -0
- package/lib/transformers/features/http/CreateHttpAssertQueryTransformer.d.ts +4 -0
- package/lib/transformers/features/http/CreateHttpAssertQueryTransformer.js +12 -0
- package/lib/transformers/features/http/CreateHttpAssertQueryTransformer.js.map +1 -0
- package/lib/transformers/features/http/CreateHttpHeadersTransformer.d.ts +4 -0
- package/lib/transformers/features/http/CreateHttpHeadersTransformer.js +10 -0
- package/lib/transformers/features/http/CreateHttpHeadersTransformer.js.map +1 -0
- package/lib/transformers/features/http/CreateHttpIsHeadersTransformer.d.ts +4 -0
- package/lib/transformers/features/http/CreateHttpIsHeadersTransformer.js +10 -0
- package/lib/transformers/features/http/CreateHttpIsHeadersTransformer.js.map +1 -0
- package/lib/transformers/features/http/CreateHttpIsQueryTransformer.d.ts +4 -0
- package/lib/transformers/features/http/CreateHttpIsQueryTransformer.js +10 -0
- package/lib/transformers/features/http/CreateHttpIsQueryTransformer.js.map +1 -0
- package/lib/transformers/features/http/CreateHttpParameterTransformer.d.ts +4 -0
- package/lib/transformers/features/http/CreateHttpParameterTransformer.js +10 -0
- package/lib/transformers/features/http/CreateHttpParameterTransformer.js.map +1 -0
- package/lib/transformers/features/http/CreateHttpQueryTransformer.d.ts +4 -0
- package/lib/transformers/features/http/CreateHttpQueryTransformer.js +10 -0
- package/lib/transformers/features/http/CreateHttpQueryTransformer.js.map +1 -0
- package/lib/transformers/features/http/CreateHttpValidateHeadersTransformer copy.d.ts +4 -0
- package/lib/transformers/features/http/CreateHttpValidateHeadersTransformer copy.js +12 -0
- package/lib/transformers/features/http/CreateHttpValidateHeadersTransformer copy.js.map +1 -0
- package/lib/transformers/features/http/CreateHttpValidateQueryTransformer.d.ts +4 -0
- package/lib/transformers/features/http/CreateHttpValidateQueryTransformer.js +12 -0
- package/lib/transformers/features/http/CreateHttpValidateQueryTransformer.js.map +1 -0
- package/lib/transformers/features/http/HttpAssertHeadersTransformer.d.ts +4 -0
- package/lib/transformers/features/http/HttpAssertHeadersTransformer.js +12 -0
- package/lib/transformers/features/http/HttpAssertHeadersTransformer.js.map +1 -0
- package/lib/transformers/features/http/HttpAssertQueryTransformer.d.ts +4 -0
- package/lib/transformers/features/http/HttpAssertQueryTransformer.js +12 -0
- package/lib/transformers/features/http/HttpAssertQueryTransformer.js.map +1 -0
- package/lib/transformers/features/http/HttpHeadersTransformer.d.ts +4 -0
- package/lib/transformers/features/http/HttpHeadersTransformer.js +10 -0
- package/lib/transformers/features/http/HttpHeadersTransformer.js.map +1 -0
- package/lib/transformers/features/http/HttpIsHeadersTransformer.d.ts +4 -0
- package/lib/transformers/features/http/HttpIsHeadersTransformer.js +10 -0
- package/lib/transformers/features/http/HttpIsHeadersTransformer.js.map +1 -0
- package/lib/transformers/features/http/HttpIsQueryTransformer.d.ts +4 -0
- package/lib/transformers/features/http/HttpIsQueryTransformer.js +10 -0
- package/lib/transformers/features/http/HttpIsQueryTransformer.js.map +1 -0
- package/lib/transformers/features/http/HttpParameterTransformer.d.ts +4 -0
- package/lib/transformers/features/http/HttpParameterTransformer.js +10 -0
- package/lib/transformers/features/http/HttpParameterTransformer.js.map +1 -0
- package/lib/transformers/features/http/HttpQueryTransformer.d.ts +4 -0
- package/lib/transformers/features/http/HttpQueryTransformer.js +10 -0
- package/lib/transformers/features/http/HttpQueryTransformer.js.map +1 -0
- package/lib/transformers/features/http/HttpValidateHeadersTransformer.d.ts +4 -0
- package/lib/transformers/features/http/HttpValidateHeadersTransformer.js +12 -0
- package/lib/transformers/features/http/HttpValidateHeadersTransformer.js.map +1 -0
- package/lib/transformers/features/http/HttpValidateQueryTransformer.d.ts +4 -0
- package/lib/transformers/features/http/HttpValidateQueryTransformer.js +12 -0
- package/lib/transformers/features/http/HttpValidateQueryTransformer.js.map +1 -0
- package/package.json +1 -1
- package/src/factories/MetadataCollection.ts +274 -274
- package/src/functional/$HeadersReader.ts +9 -0
- package/src/functional/$QueryReader.ts +32 -0
- package/src/functional/Namespace.ts +7 -0
- package/src/http.ts +1141 -0
- package/src/json.ts +2 -2
- package/src/misc.ts +2 -2
- package/src/module.ts +1 -0
- package/src/programmers/helpers/HttpMetadataUtil.ts +21 -0
- package/src/programmers/http/HttpAssertHeadersProgrammer.ts +77 -0
- package/src/programmers/http/HttpAssertQueryProgrammer.ts +77 -0
- package/src/programmers/http/HttpHeadersProgrammer.ts +321 -0
- package/src/programmers/http/HttpIsHeadersProgrammer.ts +87 -0
- package/src/programmers/http/HttpIsQueryProgrammer.ts +87 -0
- package/src/programmers/http/HttpParameterProgrammer.ts +168 -0
- package/src/programmers/http/HttpQueryProgrammer.ts +267 -0
- package/src/programmers/http/HttpValidateHeadersProgrammer.ts +77 -0
- package/src/programmers/http/HttpValidateQueryProgrammer.ts +77 -0
- package/src/protobuf.ts +34 -28
- package/src/transformers/CallExpressionTransformer.ts +46 -0
- package/src/transformers/features/http/CreateHttpAssertHeadersTransformer.ts +12 -0
- package/src/transformers/features/http/CreateHttpAssertQueryTransformer.ts +12 -0
- package/src/transformers/features/http/CreateHttpHeadersTransformer.ts +9 -0
- package/src/transformers/features/http/CreateHttpIsHeadersTransformer.ts +9 -0
- package/src/transformers/features/http/CreateHttpIsQueryTransformer.ts +9 -0
- package/src/transformers/features/http/CreateHttpParameterTransformer.ts +9 -0
- package/src/transformers/features/http/CreateHttpQueryTransformer.ts +9 -0
- package/src/transformers/features/http/CreateHttpValidateHeadersTransformer copy.ts +12 -0
- package/src/transformers/features/http/CreateHttpValidateQueryTransformer.ts +12 -0
- package/src/transformers/features/http/HttpAssertHeadersTransformer.ts +10 -0
- package/src/transformers/features/http/HttpAssertQueryTransformer.ts +10 -0
- package/src/transformers/features/http/HttpHeadersTransformer.ts +9 -0
- package/src/transformers/features/http/HttpIsHeadersTransformer.ts +9 -0
- package/src/transformers/features/http/HttpIsQueryTransformer.ts +9 -0
- package/src/transformers/features/http/HttpParameterTransformer.ts +9 -0
- package/src/transformers/features/http/HttpQueryTransformer.ts +9 -0
- package/src/transformers/features/http/HttpValidateHeadersTransformer.ts +10 -0
- package/src/transformers/features/http/HttpValidateQueryTransformer.ts +10 -0
package/lib/http.d.ts
ADDED
|
@@ -0,0 +1,872 @@
|
|
|
1
|
+
import { Atomic } from "./typings/Atomic";
|
|
2
|
+
import { IValidation } from "./IValidation";
|
|
3
|
+
import { Resolved } from "./Resolved";
|
|
4
|
+
/**
|
|
5
|
+
* > You must configure the generic argument `T`.
|
|
6
|
+
*
|
|
7
|
+
* URL query decoder.
|
|
8
|
+
*
|
|
9
|
+
* `typia.http.query()` is a function decoding a query string or an `URLSearchParams`
|
|
10
|
+
* instance, with automatic type casting to the expected type. When property type be
|
|
11
|
+
* defined as `boolean` or `number` type, `typia.http.query()` will cast the value to
|
|
12
|
+
* the expected type when decoding.
|
|
13
|
+
*
|
|
14
|
+
* By the way, as URL query is not enough to express complex data structures,
|
|
15
|
+
* `typia.http.query()` function has some limitations. If target type `T` is not
|
|
16
|
+
* following those restrictions, compilation errors would be occured.
|
|
17
|
+
*
|
|
18
|
+
* 1. Type `T` must be an object type
|
|
19
|
+
* 2. Do not allow dynamic property
|
|
20
|
+
* 3. Only `boolean`, `bigint`, `number`, `string` or their array types are allowed
|
|
21
|
+
* 4. By the way, union type never be not allowed
|
|
22
|
+
*
|
|
23
|
+
* Also, `typia.http.query()` function does not perform validation about the decoded
|
|
24
|
+
* value. Therefore, if you can't sure that input data is following the `T` type,
|
|
25
|
+
* it would better to call one of below functions intead.
|
|
26
|
+
*
|
|
27
|
+
* - {@link assertQuery}
|
|
28
|
+
* - {@link isQuery}
|
|
29
|
+
* - {@link validateQuery}
|
|
30
|
+
*
|
|
31
|
+
* @template T Expected type of decoded value
|
|
32
|
+
* @param input Query string or URLSearchParams instance
|
|
33
|
+
* @returns Decoded query object
|
|
34
|
+
*
|
|
35
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
36
|
+
*/
|
|
37
|
+
export declare function query(): never;
|
|
38
|
+
/**
|
|
39
|
+
* URL query decoder.
|
|
40
|
+
*
|
|
41
|
+
* `typia.http.query()` is a function decoding a query string or an `URLSearchParams`
|
|
42
|
+
* instance, with automatic type casting to the expected type. When property type be
|
|
43
|
+
* defined as `boolean` or `number` type, `typia.http.query()` will cast the value to
|
|
44
|
+
* the expected type when decoding.
|
|
45
|
+
*
|
|
46
|
+
* By the way, as URL query is not enough to express complex data structures,
|
|
47
|
+
* `typia.http.query()` function has some limitations. If target type `T` is not
|
|
48
|
+
* following those restrictions, compilation errors would be occured.
|
|
49
|
+
*
|
|
50
|
+
* 1. Type `T` must be an object type
|
|
51
|
+
* 2. Do not allow dynamic property
|
|
52
|
+
* 3. Only `boolean`, `bigint`, `number`, `string` or their array types are allowed
|
|
53
|
+
* 4. By the way, union type never be not allowed
|
|
54
|
+
*
|
|
55
|
+
* Also, `typia.http.query()` function does not perform validation about the decoded
|
|
56
|
+
* value. Therefore, if you can't sure that input data is following the `T` type,
|
|
57
|
+
* it would better to call one of below functions intead.
|
|
58
|
+
*
|
|
59
|
+
* - {@link assertQuery}
|
|
60
|
+
* - {@link isQuery}
|
|
61
|
+
* - {@link validateQuery}
|
|
62
|
+
*
|
|
63
|
+
* @template T Expected type of decoded value
|
|
64
|
+
* @param input Query string or URLSearchParams instance
|
|
65
|
+
* @returns Decoded query object
|
|
66
|
+
*
|
|
67
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
68
|
+
*/
|
|
69
|
+
export declare function query<T extends object>(input: string | URLSearchParams): Resolved<T>;
|
|
70
|
+
/**
|
|
71
|
+
* > You must configure the generic argument `T`.
|
|
72
|
+
*
|
|
73
|
+
* URL query decoder with type assertion.
|
|
74
|
+
*
|
|
75
|
+
* `typia.http.assertQuery()` is a function decoding a query string or an
|
|
76
|
+
* `URLSearchParams` instance, with automatic type casting to the expected type.
|
|
77
|
+
* When property type be defined as `boolean` or `number` type,
|
|
78
|
+
* `typia.http.assertQuery()` will cast the value to the expected type when decoding.
|
|
79
|
+
*
|
|
80
|
+
* Also, after decoding, `typia.http.assertQuery()` performs type assertion to the
|
|
81
|
+
* decoded value by combining with {@link assert} function. Therefore, when the
|
|
82
|
+
* decoded value is not following the `T` type, {@link TypeGuardError} would be
|
|
83
|
+
* thrown.
|
|
84
|
+
*
|
|
85
|
+
* By the way, as URL query is not enough to express complex data structures,
|
|
86
|
+
* `typia.http.assertQuery()` function has some limitations. If target type `T` is
|
|
87
|
+
* notfollowing those restrictions, compilation errors would be occured.
|
|
88
|
+
*
|
|
89
|
+
* 1. Type `T` must be an object type
|
|
90
|
+
* 2. Do not allow dynamic property
|
|
91
|
+
* 3. Only `boolean`, `bigint`, `number`, `string` or their array types are allowed
|
|
92
|
+
* 4. By the way, union type never be not allowed
|
|
93
|
+
*
|
|
94
|
+
* @template T Expected type of decoded value
|
|
95
|
+
* @param input Query string or URLSearchParams instance
|
|
96
|
+
* @returns Decoded query object
|
|
97
|
+
*
|
|
98
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
99
|
+
*/
|
|
100
|
+
export declare function assertQuery(): never;
|
|
101
|
+
/**
|
|
102
|
+
* URL query decoder with type assertion.
|
|
103
|
+
*
|
|
104
|
+
* `typia.http.assertQuery()` is a function decoding a query string or an
|
|
105
|
+
* `URLSearchParams` instance, with automatic type casting to the expected type.
|
|
106
|
+
* When property type be defined as `boolean` or `number` type,
|
|
107
|
+
* `typia.http.assertQuery()` will cast the value to the expected type when decoding.
|
|
108
|
+
*
|
|
109
|
+
* Also, after decoding, `typia.http.assertQuery()` performs type assertion to the
|
|
110
|
+
* decoded value by combining with {@link assert} function. Therefore, when the
|
|
111
|
+
* decoded value is not following the `T` type, {@link TypeGuardError} would be
|
|
112
|
+
* thrown.
|
|
113
|
+
*
|
|
114
|
+
* By the way, as URL query is not enough to express complex data structures,
|
|
115
|
+
* `typia.http.assertQuery()` function has some limitations. If target type `T` is
|
|
116
|
+
* notfollowing those restrictions, compilation errors would be occured.
|
|
117
|
+
*
|
|
118
|
+
* 1. Type `T` must be an object type
|
|
119
|
+
* 2. Do not allow dynamic property
|
|
120
|
+
* 3. Only `boolean`, `bigint`, `number`, `string` or their array types are allowed
|
|
121
|
+
* 4. By the way, union type never be not allowed
|
|
122
|
+
*
|
|
123
|
+
* @template T Expected type of decoded value
|
|
124
|
+
* @param input Query string or URLSearchParams instance
|
|
125
|
+
* @returns Decoded query object
|
|
126
|
+
*
|
|
127
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
128
|
+
*/
|
|
129
|
+
export declare function assertQuery<T extends object>(input: string | URLSearchParams): Resolved<T>;
|
|
130
|
+
/**
|
|
131
|
+
* > You must configure the generic argument `T`.
|
|
132
|
+
*
|
|
133
|
+
* URL query decoder with type checking.
|
|
134
|
+
*
|
|
135
|
+
* `typia.http.isQuery()` is a function decoding a query string or an
|
|
136
|
+
* `URLSearchParams` instance, with automatic type casting to the expected type.
|
|
137
|
+
* When property type be defined as `boolean` or `number` type,
|
|
138
|
+
* `typia.http.isQuery()` will cast the value to the expected type when decoding.
|
|
139
|
+
*
|
|
140
|
+
* Also, after decoding, `typia.http.isQuery()` performs type checking to the
|
|
141
|
+
* decoded value by combining with {@link is} function. Therefore, when the
|
|
142
|
+
* decoded value is not following the `T` type, `null` value would be returned.
|
|
143
|
+
*
|
|
144
|
+
* By the way, as URL query is not enough to express complex data structures,
|
|
145
|
+
* `typia.http.isQuery()` function has some limitations. If target type `T` is
|
|
146
|
+
* notfollowing those restrictions, compilation errors would be occured.
|
|
147
|
+
*
|
|
148
|
+
* 1. Type `T` must be an object type
|
|
149
|
+
* 2. Do not allow dynamic property
|
|
150
|
+
* 3. Only `boolean`, `bigint`, `number`, `string` or their array types are allowed
|
|
151
|
+
* 4. By the way, union type never be not allowed
|
|
152
|
+
*
|
|
153
|
+
* @template T Expected type of decoded value
|
|
154
|
+
* @param input Query string or URLSearchParams instance
|
|
155
|
+
* @returns Decoded query object or `null` value
|
|
156
|
+
*
|
|
157
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
158
|
+
*/
|
|
159
|
+
export declare function isQuery(): never;
|
|
160
|
+
/**
|
|
161
|
+
* URL query decoder with type checking.
|
|
162
|
+
*
|
|
163
|
+
* `typia.http.isQuery()` is a function decoding a query string or an
|
|
164
|
+
* `URLSearchParams` instance, with automatic type casting to the expected type.
|
|
165
|
+
* When property type be defined as `boolean` or `number` type,
|
|
166
|
+
* `typia.http.isQuery()` will cast the value to the expected type when decoding.
|
|
167
|
+
*
|
|
168
|
+
* Also, after decoding, `typia.http.isQuery()` performs type checking to the
|
|
169
|
+
* decoded value by combining with {@link is} function. Therefore, when the
|
|
170
|
+
* decoded value is not following the `T` type, `null` value would be returned.
|
|
171
|
+
*
|
|
172
|
+
* By the way, as URL query is not enough to express complex data structures,
|
|
173
|
+
* `typia.http.isQuery()` function has some limitations. If target type `T` is
|
|
174
|
+
* notfollowing those restrictions, compilation errors would be occured.
|
|
175
|
+
*
|
|
176
|
+
* 1. Type `T` must be an object type
|
|
177
|
+
* 2. Do not allow dynamic property
|
|
178
|
+
* 3. Only `boolean`, `bigint`, `number`, `string` or their array types are allowed
|
|
179
|
+
* 4. By the way, union type never be not allowed
|
|
180
|
+
*
|
|
181
|
+
* @template T Expected type of decoded value
|
|
182
|
+
* @param input Query string or URLSearchParams instance
|
|
183
|
+
* @returns Decoded query object or `null` value
|
|
184
|
+
*
|
|
185
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
186
|
+
*/
|
|
187
|
+
export declare function isQuery<T extends object>(input: string | URLSearchParams): Resolved<T> | null;
|
|
188
|
+
/**
|
|
189
|
+
* > You must configure the generic argument `T`.
|
|
190
|
+
*
|
|
191
|
+
* URL query decoder with type validation.
|
|
192
|
+
*
|
|
193
|
+
* `typia.http.validateQuery()` is a function decoding a query string or an
|
|
194
|
+
* `URLSearchParams` instance, with automatic type casting to the expected type.
|
|
195
|
+
* When property type be defined as `boolean` or `number` type,
|
|
196
|
+
* `typia.http.validateQuery()` will cast the value to the expected type when decoding.
|
|
197
|
+
*
|
|
198
|
+
* Also, after decoding, `typia.http.validateQuery()` performs type validation to the
|
|
199
|
+
* decoded value by combining with {@link validate} function. Therefore, when the
|
|
200
|
+
* decoded value is not following the `T` type, {@link IValidation.IFailure} would
|
|
201
|
+
* be returned. Otherwise, {@link IValidation.ISuccess} would be returned.
|
|
202
|
+
*
|
|
203
|
+
* By the way, as URL query is not enough to express complex data structures,
|
|
204
|
+
* `typia.http.validateQuery()` function has some limitations. If target type `T` is
|
|
205
|
+
* notfollowing those restrictions, compilation errors would be occured.
|
|
206
|
+
*
|
|
207
|
+
* 1. Type `T` must be an object type
|
|
208
|
+
* 2. Do not allow dynamic property
|
|
209
|
+
* 3. Only `boolean`, `bigint`, `number`, `string` or their array types are allowed
|
|
210
|
+
* 4. By the way, union type never be not allowed
|
|
211
|
+
*
|
|
212
|
+
* @template T Expected type of decoded value
|
|
213
|
+
* @param input Query string or URLSearchParams instance
|
|
214
|
+
* @returns Validation result with decoded query object
|
|
215
|
+
*
|
|
216
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
217
|
+
*/
|
|
218
|
+
export declare function validateQuery(): never;
|
|
219
|
+
/**
|
|
220
|
+
* URL query decoder with type validation.
|
|
221
|
+
*
|
|
222
|
+
* `typia.http.validateQuery()` is a function decoding a query string or an
|
|
223
|
+
* `URLSearchParams` instance, with automatic type casting to the expected type.
|
|
224
|
+
* When property type be defined as `boolean` or `number` type,
|
|
225
|
+
* `typia.http.validateQuery()` will cast the value to the expected type when decoding.
|
|
226
|
+
*
|
|
227
|
+
* Also, after decoding, `typia.http.validateQuery()` performs type validation to the
|
|
228
|
+
* decoded value by combining with {@link validate} function. Therefore, when the
|
|
229
|
+
* decoded value is not following the `T` type, {@link IValidation.IFailure} would
|
|
230
|
+
* be returned. Otherwise, {@link IValidation.ISuccess} would be returned.
|
|
231
|
+
*
|
|
232
|
+
* By the way, as URL query is not enough to express complex data structures,
|
|
233
|
+
* `typia.http.validateQuery()` function has some limitations. If target type `T` is
|
|
234
|
+
* notfollowing those restrictions, compilation errors would be occured.
|
|
235
|
+
*
|
|
236
|
+
* 1. Type `T` must be an object type
|
|
237
|
+
* 2. Do not allow dynamic property
|
|
238
|
+
* 3. Only `boolean`, `bigint`, `number`, `string` or their array types are allowed
|
|
239
|
+
* 4. By the way, union type never be not allowed
|
|
240
|
+
*
|
|
241
|
+
* @template T Expected type of decoded value
|
|
242
|
+
* @param input Query string or URLSearchParams instance
|
|
243
|
+
* @returns Validation result with decoded query object
|
|
244
|
+
*
|
|
245
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
246
|
+
*/
|
|
247
|
+
export declare function validateQuery<T extends object>(input: string | URLSearchParams): IValidation<Resolved<T>>;
|
|
248
|
+
/**
|
|
249
|
+
* > You must configure the generic argument `T`.
|
|
250
|
+
*
|
|
251
|
+
* Headers decoder.
|
|
252
|
+
*
|
|
253
|
+
* `typia.http.headers()` is a function decoding an header instance, with automatic
|
|
254
|
+
* type casting to the expected type. When property type be defined as `boolean` or
|
|
255
|
+
* `number` type, `typia.http.headers()` will cast the value to the expected type.
|
|
256
|
+
*
|
|
257
|
+
* By the way, as HTTP headers are not enough to express complex data structures,
|
|
258
|
+
* `typia.http.headers()` function has some limitations. If target type `T` is not
|
|
259
|
+
* following those restrictions, compilation errors would be occured.
|
|
260
|
+
*
|
|
261
|
+
* 1. Type `T` must be an object type
|
|
262
|
+
* 2. Do not allow dynamic property
|
|
263
|
+
* 3. Property key must be lower case
|
|
264
|
+
* 4. Property value cannot be `null`, but `undefined` is possible
|
|
265
|
+
* 5. Only `boolean`, `bigint`, `number`, `string` or their array types are allowed
|
|
266
|
+
* 6. By the way, union type never be not allowed
|
|
267
|
+
* 7. Property `set-cookie` must be array type
|
|
268
|
+
* 8. Those properties cannot be array type
|
|
269
|
+
* - age
|
|
270
|
+
* - authorization
|
|
271
|
+
* - content-length
|
|
272
|
+
* - content-type
|
|
273
|
+
* - etag
|
|
274
|
+
* - expires
|
|
275
|
+
* - from
|
|
276
|
+
* - host
|
|
277
|
+
* - if-modified-since
|
|
278
|
+
* - if-unmodified-since
|
|
279
|
+
* - last-modified
|
|
280
|
+
* - location
|
|
281
|
+
* - max-forwards
|
|
282
|
+
* - proxy-authorization
|
|
283
|
+
* - referer
|
|
284
|
+
* - retry-after
|
|
285
|
+
* - server
|
|
286
|
+
* - user-agent
|
|
287
|
+
*
|
|
288
|
+
* Also, `typia.http.headers()` function does not perform validation about the decoded
|
|
289
|
+
* value. Therefore, if you can't sure that input data is following the `T` type,
|
|
290
|
+
* it would better to call one of below functions intead.
|
|
291
|
+
*
|
|
292
|
+
* - {@link assertHeaders}
|
|
293
|
+
* - {@link isHeaders}
|
|
294
|
+
* - {@link validateHeaders}
|
|
295
|
+
*
|
|
296
|
+
* @template T Expected type of decoded value
|
|
297
|
+
* @param input Query string or URLSearchParams instance
|
|
298
|
+
* @returns Decoded headers object
|
|
299
|
+
*
|
|
300
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
301
|
+
*/
|
|
302
|
+
export declare function headers(): never;
|
|
303
|
+
/**
|
|
304
|
+
* Headers decoder.
|
|
305
|
+
*
|
|
306
|
+
* `typia.http.headers()` is a function decoding an header instance, with automatic
|
|
307
|
+
* type casting to the expected type. When property type be defined as `boolean` or
|
|
308
|
+
* `number` type, `typia.http.headers()` will cast the value to the expected type.
|
|
309
|
+
*
|
|
310
|
+
* By the way, as HTTP headers are not enough to express complex data structures,
|
|
311
|
+
* `typia.http.headers()` function has some limitations. If target type `T` is not
|
|
312
|
+
* following those restrictions, compilation errors would be occured.
|
|
313
|
+
*
|
|
314
|
+
* 1. Type `T` must be an object type
|
|
315
|
+
* 2. Do not allow dynamic property
|
|
316
|
+
* 3. Property key must be lower case
|
|
317
|
+
* 4. Property value cannot be `null`, but `undefined` is possible
|
|
318
|
+
* 5. Only `boolean`, `bigint`, `number`, `string` or their array types are allowed
|
|
319
|
+
* 6. By the way, union type never be not allowed
|
|
320
|
+
* 7. Property `set-cookie` must be array type
|
|
321
|
+
* 8. Those properties cannot be array type
|
|
322
|
+
* - age
|
|
323
|
+
* - authorization
|
|
324
|
+
* - content-length
|
|
325
|
+
* - content-type
|
|
326
|
+
* - etag
|
|
327
|
+
* - expires
|
|
328
|
+
* - from
|
|
329
|
+
* - host
|
|
330
|
+
* - if-modified-since
|
|
331
|
+
* - if-unmodified-since
|
|
332
|
+
* - last-modified
|
|
333
|
+
* - location
|
|
334
|
+
* - max-forwards
|
|
335
|
+
* - proxy-authorization
|
|
336
|
+
* - referer
|
|
337
|
+
* - retry-after
|
|
338
|
+
* - server
|
|
339
|
+
* - user-agent
|
|
340
|
+
*
|
|
341
|
+
* Also, `typia.http.headers()` function does not perform validation about the decoded
|
|
342
|
+
* value. Therefore, if you can't sure that input data is following the `T` type,
|
|
343
|
+
* it would better to call one of below functions intead.
|
|
344
|
+
*
|
|
345
|
+
* - {@link assertHeaders}
|
|
346
|
+
* - {@link isHeaders}
|
|
347
|
+
* - {@link validateHeaders}
|
|
348
|
+
*
|
|
349
|
+
* @template T Expected type of decoded value
|
|
350
|
+
* @param input Query string or URLSearchParams instance
|
|
351
|
+
* @returns Decoded headers object
|
|
352
|
+
*
|
|
353
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
354
|
+
*/
|
|
355
|
+
export declare function headers<T extends object>(input: Record<string, string | string[] | undefined>): Resolved<T>;
|
|
356
|
+
/**
|
|
357
|
+
* > You must configure the generic argument `T`.
|
|
358
|
+
*
|
|
359
|
+
* Headers decoder with type assertion.
|
|
360
|
+
*
|
|
361
|
+
* `typia.http.assertHeaders()` is a function decoding an header instance, with
|
|
362
|
+
* automatic type casting to the expected type. When property type be defined as
|
|
363
|
+
* `boolean` or `number` type, `typia.http.headers()` will cast the value to the
|
|
364
|
+
* expected type.
|
|
365
|
+
*
|
|
366
|
+
* Also, after decoding, `typia.http.assertHeaders()` performs type assertion to the
|
|
367
|
+
* decoded value by combining with {@link assert} function. Therefore, when the
|
|
368
|
+
* decoded value is not following the `T` type, {@link TypeGuardError} would be
|
|
369
|
+
* thrown.
|
|
370
|
+
*
|
|
371
|
+
* By the way, as HTTP headers are not enough to express complex data structures,
|
|
372
|
+
* `typia.http.headers()` function has some limitations. If target type `T` is not
|
|
373
|
+
* following those restrictions, compilation errors would be occured.
|
|
374
|
+
*
|
|
375
|
+
* 1. Type `T` must be an object type
|
|
376
|
+
* 2. Do not allow dynamic property
|
|
377
|
+
* 3. Property key must be lower case
|
|
378
|
+
* 4. Property value cannot be `null`, but `undefined` is possible
|
|
379
|
+
* 5. Only `boolean`, `bigint`, `number`, `string` or their array types are allowed
|
|
380
|
+
* 6. By the way, union type never be not allowed
|
|
381
|
+
* 7. Property `set-cookie` must be array type
|
|
382
|
+
* 8. Those properties cannot be array type
|
|
383
|
+
* - age
|
|
384
|
+
* - authorization
|
|
385
|
+
* - content-length
|
|
386
|
+
* - content-type
|
|
387
|
+
* - etag
|
|
388
|
+
* - expires
|
|
389
|
+
* - from
|
|
390
|
+
* - host
|
|
391
|
+
* - if-modified-since
|
|
392
|
+
* - if-unmodified-since
|
|
393
|
+
* - last-modified
|
|
394
|
+
* - location
|
|
395
|
+
* - max-forwards
|
|
396
|
+
* - proxy-authorization
|
|
397
|
+
* - referer
|
|
398
|
+
* - retry-after
|
|
399
|
+
* - server
|
|
400
|
+
* - user-agent
|
|
401
|
+
*
|
|
402
|
+
* @template T Expected type of decoded value
|
|
403
|
+
* @param input Query string or URLSearchParams instance
|
|
404
|
+
* @returns Decoded headers object
|
|
405
|
+
*
|
|
406
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
407
|
+
*/
|
|
408
|
+
export declare function assertHeaders(): never;
|
|
409
|
+
/**
|
|
410
|
+
* Headers decoder with type assertion.
|
|
411
|
+
*
|
|
412
|
+
* `typia.http.assertHeaders()` is a function decoding an header instance, with
|
|
413
|
+
* automatic type casting to the expected type. When property type be defined as
|
|
414
|
+
* `boolean` or `number` type, `typia.http.headers()` will cast the value to the
|
|
415
|
+
* expected type.
|
|
416
|
+
*
|
|
417
|
+
* Also, after decoding, `typia.http.assertHeaders()` performs type assertion to the
|
|
418
|
+
* decoded value by combining with {@link assert} function. Therefore, when the
|
|
419
|
+
* decoded value is not following the `T` type, {@link TypeGuardError} would be
|
|
420
|
+
* thrown.
|
|
421
|
+
*
|
|
422
|
+
* By the way, as HTTP headers are not enough to express complex data structures,
|
|
423
|
+
* `typia.http.headers()` function has some limitations. If target type `T` is not
|
|
424
|
+
* following those restrictions, compilation errors would be occured.
|
|
425
|
+
*
|
|
426
|
+
* 1. Type `T` must be an object type
|
|
427
|
+
* 2. Do not allow dynamic property
|
|
428
|
+
* 3. Property key must be lower case
|
|
429
|
+
* 4. Property value cannot be `null`, but `undefined` is possible
|
|
430
|
+
* 5. Only `boolean`, `bigint`, `number`, `string` or their array types are allowed
|
|
431
|
+
* 6. By the way, union type never be not allowed
|
|
432
|
+
* 7. Property `set-cookie` must be array type
|
|
433
|
+
* 8. Those properties cannot be array type
|
|
434
|
+
* - age
|
|
435
|
+
* - authorization
|
|
436
|
+
* - content-length
|
|
437
|
+
* - content-type
|
|
438
|
+
* - etag
|
|
439
|
+
* - expires
|
|
440
|
+
* - from
|
|
441
|
+
* - host
|
|
442
|
+
* - if-modified-since
|
|
443
|
+
* - if-unmodified-since
|
|
444
|
+
* - last-modified
|
|
445
|
+
* - location
|
|
446
|
+
* - max-forwards
|
|
447
|
+
* - proxy-authorization
|
|
448
|
+
* - referer
|
|
449
|
+
* - retry-after
|
|
450
|
+
* - server
|
|
451
|
+
* - user-agent
|
|
452
|
+
*
|
|
453
|
+
* @template T Expected type of decoded value
|
|
454
|
+
* @param input Query string or URLSearchParams instance
|
|
455
|
+
* @returns Decoded headers object
|
|
456
|
+
*
|
|
457
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
458
|
+
*/
|
|
459
|
+
export declare function assertHeaders<T extends object>(input: Record<string, string | string[] | undefined>): Resolved<T>;
|
|
460
|
+
/**
|
|
461
|
+
* > You must configure the generic argument `T`.
|
|
462
|
+
*
|
|
463
|
+
* Headers decoder with type checking.
|
|
464
|
+
*
|
|
465
|
+
* `typia.http.isHeaders()` is a function decoding an header instance, with
|
|
466
|
+
* automatic type casting to the expected type. When property type be defined as
|
|
467
|
+
* `boolean` or `number` type, `typia.http.headers()` will cast the value to the
|
|
468
|
+
* expected type.
|
|
469
|
+
*
|
|
470
|
+
* Also, after decoding, `typia.http.isHeaders()` performs type checking to the
|
|
471
|
+
* decoded value by combining with {@link is} function. Therefore, when the
|
|
472
|
+
* decoded value is not following the `T` type, `null` value would be returned.
|
|
473
|
+
*
|
|
474
|
+
* By the way, as HTTP headers are not enough to express complex data structures,
|
|
475
|
+
* `typia.http.headers()` function has some limitations. If target type `T` is not
|
|
476
|
+
* following those restrictions, compilation errors would be occured.
|
|
477
|
+
*
|
|
478
|
+
* 1. Type `T` must be an object type
|
|
479
|
+
* 2. Do not allow dynamic property
|
|
480
|
+
* 3. Property key must be lower case
|
|
481
|
+
* 4. Property value cannot be `null`, but `undefined` is possible
|
|
482
|
+
* 5. Only `boolean`, `bigint`, `number`, `string` or their array types are allowed
|
|
483
|
+
* 6. By the way, union type never be not allowed
|
|
484
|
+
* 7. Property `set-cookie` must be array type
|
|
485
|
+
* 8. Those properties cannot be array type
|
|
486
|
+
* - age
|
|
487
|
+
* - authorization
|
|
488
|
+
* - content-length
|
|
489
|
+
* - content-type
|
|
490
|
+
* - etag
|
|
491
|
+
* - expires
|
|
492
|
+
* - from
|
|
493
|
+
* - host
|
|
494
|
+
* - if-modified-since
|
|
495
|
+
* - if-unmodified-since
|
|
496
|
+
* - last-modified
|
|
497
|
+
* - location
|
|
498
|
+
* - max-forwards
|
|
499
|
+
* - proxy-authorization
|
|
500
|
+
* - referer
|
|
501
|
+
* - retry-after
|
|
502
|
+
* - server
|
|
503
|
+
* - user-agent
|
|
504
|
+
*
|
|
505
|
+
* @template T Expected type of decoded value
|
|
506
|
+
* @param input Query string or URLSearchParams instance
|
|
507
|
+
* @returns Decoded headers object or `null` value
|
|
508
|
+
*
|
|
509
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
510
|
+
*/
|
|
511
|
+
export declare function isHeaders(): never;
|
|
512
|
+
/**
|
|
513
|
+
* > You must configure the generic argument `T`.
|
|
514
|
+
*
|
|
515
|
+
* Headers decoder with type checking.
|
|
516
|
+
*
|
|
517
|
+
* `typia.http.isHeaders()` is a function decoding an header instance, with
|
|
518
|
+
* automatic type casting to the expected type. When property type be defined as
|
|
519
|
+
* `boolean` or `number` type, `typia.http.headers()` will cast the value to the
|
|
520
|
+
* expected type.
|
|
521
|
+
*
|
|
522
|
+
* Also, after decoding, `typia.http.isHeaders()` performs type checking to the
|
|
523
|
+
* decoded value by combining with {@link is} function. Therefore, when the
|
|
524
|
+
* decoded value is not following the `T` type, `null` value would be returned.
|
|
525
|
+
*
|
|
526
|
+
* By the way, as HTTP headers are not enough to express complex data structures,
|
|
527
|
+
* `typia.http.headers()` function has some limitations. If target type `T` is not
|
|
528
|
+
* following those restrictions, compilation errors would be occured.
|
|
529
|
+
*
|
|
530
|
+
* 1. Type `T` must be an object type
|
|
531
|
+
* 2. Do not allow dynamic property
|
|
532
|
+
* 3. Property key must be lower case
|
|
533
|
+
* 4. Property value cannot be `null`, but `undefined` is possible
|
|
534
|
+
* 5. Only `boolean`, `bigint`, `number`, `string` or their array types are allowed
|
|
535
|
+
* 6. By the way, union type never be not allowed
|
|
536
|
+
* 7. Property `set-cookie` must be array type
|
|
537
|
+
* 8. Those properties cannot be array type
|
|
538
|
+
* - age
|
|
539
|
+
* - authorization
|
|
540
|
+
* - content-length
|
|
541
|
+
* - content-type
|
|
542
|
+
* - etag
|
|
543
|
+
* - expires
|
|
544
|
+
* - from
|
|
545
|
+
* - host
|
|
546
|
+
* - if-modified-since
|
|
547
|
+
* - if-unmodified-since
|
|
548
|
+
* - last-modified
|
|
549
|
+
* - location
|
|
550
|
+
* - max-forwards
|
|
551
|
+
* - proxy-authorization
|
|
552
|
+
* - referer
|
|
553
|
+
* - retry-after
|
|
554
|
+
* - server
|
|
555
|
+
* - user-agent
|
|
556
|
+
*
|
|
557
|
+
* @template T Expected type of decoded value
|
|
558
|
+
* @param input Query string or URLSearchParams instance
|
|
559
|
+
* @returns Decoded headers object or `null` value
|
|
560
|
+
*
|
|
561
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
562
|
+
*/
|
|
563
|
+
export declare function isHeaders<T extends object>(input: Record<string, string | string[] | undefined>): Resolved<T> | null;
|
|
564
|
+
/**
|
|
565
|
+
* > You must configure the generic argument `T`.
|
|
566
|
+
*
|
|
567
|
+
* Headers decoder with type validation.
|
|
568
|
+
*
|
|
569
|
+
* `typia.http.validateHeaders()` is a function decoding an header instance, with
|
|
570
|
+
* automatic type casting to the expected type. When property type be defined as
|
|
571
|
+
* `boolean` or `number` type, `typia.http.headers()` will cast the value to the
|
|
572
|
+
* expected type.
|
|
573
|
+
*
|
|
574
|
+
* Also, after decoding, `typia.http.validateHeaders()` performs type assertion to the
|
|
575
|
+
* decoded value by combining with {@link validate} function. Therefore, when the
|
|
576
|
+
* decoded value is not following the `T` type, {@link IValidation.IError} would be
|
|
577
|
+
* returned. Otherwise, {@link IValidation.ISuccess} be returned.
|
|
578
|
+
*
|
|
579
|
+
* By the way, as HTTP headers are not enough to express complex data structures,
|
|
580
|
+
* `typia.http.headers()` function has some limitations. If target type `T` is not
|
|
581
|
+
* following those restrictions, compilation errors would be occured.
|
|
582
|
+
*
|
|
583
|
+
* 1. Type `T` must be an object type
|
|
584
|
+
* 2. Do not allow dynamic property
|
|
585
|
+
* 3. Property key must be lower case
|
|
586
|
+
* 4. Property value cannot be `null`, but `undefined` is possible
|
|
587
|
+
* 5. Only `boolean`, `bigint`, `number`, `string` or their array types are allowed
|
|
588
|
+
* 6. By the way, union type never be not allowed
|
|
589
|
+
* 7. Property `set-cookie` must be array type
|
|
590
|
+
* 8. Those properties cannot be array type
|
|
591
|
+
* - age
|
|
592
|
+
* - authorization
|
|
593
|
+
* - content-length
|
|
594
|
+
* - content-type
|
|
595
|
+
* - etag
|
|
596
|
+
* - expires
|
|
597
|
+
* - from
|
|
598
|
+
* - host
|
|
599
|
+
* - if-modified-since
|
|
600
|
+
* - if-unmodified-since
|
|
601
|
+
* - last-modified
|
|
602
|
+
* - location
|
|
603
|
+
* - max-forwards
|
|
604
|
+
* - proxy-authorization
|
|
605
|
+
* - referer
|
|
606
|
+
* - retry-after
|
|
607
|
+
* - server
|
|
608
|
+
* - user-agent
|
|
609
|
+
*
|
|
610
|
+
* @template T Expected type of decoded value
|
|
611
|
+
* @param input Query string or URLSearchParams instance
|
|
612
|
+
* @returns Decoded headers object
|
|
613
|
+
*
|
|
614
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
615
|
+
*/
|
|
616
|
+
export declare function validateHeaders(): never;
|
|
617
|
+
/**
|
|
618
|
+
* Headers decoder with type validation.
|
|
619
|
+
*
|
|
620
|
+
* `typia.http.validateHeaders()` is a function decoding an header instance, with
|
|
621
|
+
* automatic type casting to the expected type. When property type be defined as
|
|
622
|
+
* `boolean` or `number` type, `typia.http.headers()` will cast the value to the
|
|
623
|
+
* expected type.
|
|
624
|
+
*
|
|
625
|
+
* Also, after decoding, `typia.http.validateHeaders()` performs type assertion to the
|
|
626
|
+
* decoded value by combining with {@link validate} function. Therefore, when the
|
|
627
|
+
* decoded value is not following the `T` type, {@link IValidation.IError} would be
|
|
628
|
+
* returned. Otherwise, {@link IValidation.ISuccess} be returned.
|
|
629
|
+
*
|
|
630
|
+
* By the way, as HTTP headers are not enough to express complex data structures,
|
|
631
|
+
* `typia.http.headers()` function has some limitations. If target type `T` is not
|
|
632
|
+
* following those restrictions, compilation errors would be occured.
|
|
633
|
+
*
|
|
634
|
+
* 1. Type `T` must be an object type
|
|
635
|
+
* 2. Do not allow dynamic property
|
|
636
|
+
* 3. Property key must be lower case
|
|
637
|
+
* 4. Property value cannot be `null`, but `undefined` is possible
|
|
638
|
+
* 5. Only `boolean`, `bigint`, `number`, `string` or their array types are allowed
|
|
639
|
+
* 6. By the way, union type never be not allowed
|
|
640
|
+
* 7. Property `set-cookie` must be array type
|
|
641
|
+
* 8. Those properties cannot be array type
|
|
642
|
+
* - age
|
|
643
|
+
* - authorization
|
|
644
|
+
* - content-length
|
|
645
|
+
* - content-type
|
|
646
|
+
* - etag
|
|
647
|
+
* - expires
|
|
648
|
+
* - from
|
|
649
|
+
* - host
|
|
650
|
+
* - if-modified-since
|
|
651
|
+
* - if-unmodified-since
|
|
652
|
+
* - last-modified
|
|
653
|
+
* - location
|
|
654
|
+
* - max-forwards
|
|
655
|
+
* - proxy-authorization
|
|
656
|
+
* - referer
|
|
657
|
+
* - retry-after
|
|
658
|
+
* - server
|
|
659
|
+
* - user-agent
|
|
660
|
+
*
|
|
661
|
+
* @template T Expected type of decoded value
|
|
662
|
+
* @param input Query string or URLSearchParams instance
|
|
663
|
+
* @returns Decoded headers object
|
|
664
|
+
*
|
|
665
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
666
|
+
*/
|
|
667
|
+
export declare function validateHeaders<T extends object>(input: Record<string, string | string[] | undefined>): IValidation<Resolved<T>>;
|
|
668
|
+
/**
|
|
669
|
+
* > You must configure the generic argument `T`.
|
|
670
|
+
*
|
|
671
|
+
* URL path parameter decoder.
|
|
672
|
+
*
|
|
673
|
+
* `typia.http.parameter()` is a function decoding a path parameter, with automatic
|
|
674
|
+
* type casting to the expected type. When type `T` has beeen defined as `boolean` or
|
|
675
|
+
* `number` type, `typia.http.parameter()` will cast the value to the expected type.
|
|
676
|
+
*
|
|
677
|
+
* Also, `typia.http.parameter()` performs type assertion to the decoded value by
|
|
678
|
+
* combining with {@link assert} function. Therefore, when the decoded value is not
|
|
679
|
+
* following the `T` type, {@link TypeGuardError} would be thrown.
|
|
680
|
+
*
|
|
681
|
+
* @template T Expected type of decoded value
|
|
682
|
+
* @param input Path parameter string
|
|
683
|
+
* @returns Decoded path parameter value
|
|
684
|
+
*/
|
|
685
|
+
export declare function parameter(): never;
|
|
686
|
+
/**
|
|
687
|
+
* URL path parameter decoder.
|
|
688
|
+
*
|
|
689
|
+
* `typia.http.parameter()` is a function decoding a path parameter, with automatic
|
|
690
|
+
* type casting to the expected type. When type `T` has beeen defined as `boolean` or
|
|
691
|
+
* `number` type, `typia.http.parameter()` will cast the value to the expected type.
|
|
692
|
+
*
|
|
693
|
+
* Also, `typia.http.parameter()` performs type assertion to the decoded value by
|
|
694
|
+
* combining with {@link assert} function. Therefore, when the decoded value is not
|
|
695
|
+
* following the `T` type, {@link TypeGuardError} would be thrown.
|
|
696
|
+
*
|
|
697
|
+
* @template T Expected type of decoded value
|
|
698
|
+
* @param input Path parameter string
|
|
699
|
+
* @returns Decoded path parameter value
|
|
700
|
+
*/
|
|
701
|
+
export declare function parameter<T extends Atomic.Type>(input: string): Resolved<T>;
|
|
702
|
+
/**
|
|
703
|
+
* Creates a reusable {@link query} function.
|
|
704
|
+
*
|
|
705
|
+
* @danger You must configure the generic argument `T`
|
|
706
|
+
* @template T The type of the query object
|
|
707
|
+
* @throws compile error
|
|
708
|
+
*
|
|
709
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
710
|
+
*/
|
|
711
|
+
export declare function createQuery(): never;
|
|
712
|
+
/**
|
|
713
|
+
* Creates a reusable {@link query} function.
|
|
714
|
+
*
|
|
715
|
+
* @template T The type of the query object
|
|
716
|
+
* @returns A reusable `query` function
|
|
717
|
+
*
|
|
718
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
719
|
+
*/
|
|
720
|
+
export declare function createQuery<T extends object>(): (input: string | URLSearchParams) => T;
|
|
721
|
+
/**
|
|
722
|
+
* Creates a reusable {@link assertQuery} function.
|
|
723
|
+
*
|
|
724
|
+
* @danger You must configure the generic argument `T`
|
|
725
|
+
* @template T The type of the query object
|
|
726
|
+
* @throws compile error
|
|
727
|
+
*
|
|
728
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
729
|
+
*/
|
|
730
|
+
export declare function createAssertQuery(): never;
|
|
731
|
+
/**
|
|
732
|
+
* Creates a reusable {@link assertQuery} function.
|
|
733
|
+
*
|
|
734
|
+
* @template T The type of the query object
|
|
735
|
+
* @returns A reusable `assertQuery` function
|
|
736
|
+
*
|
|
737
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
738
|
+
*/
|
|
739
|
+
export declare function createAssertQuery<T extends object>(): (input: string | URLSearchParams) => T;
|
|
740
|
+
/**
|
|
741
|
+
* Creates a reusable {@link isQuery} function.
|
|
742
|
+
*
|
|
743
|
+
* @danger You must configure the generic argument `T`
|
|
744
|
+
* @template T The type of the query object
|
|
745
|
+
* @throws compile error
|
|
746
|
+
*
|
|
747
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
748
|
+
*/
|
|
749
|
+
export declare function createIsQuery(): never;
|
|
750
|
+
/**
|
|
751
|
+
* Creates a reusable {@link isQuery} function.
|
|
752
|
+
*
|
|
753
|
+
* @template T The type of the query object
|
|
754
|
+
* @returns A reusable `isQuery` function
|
|
755
|
+
*
|
|
756
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
757
|
+
*/
|
|
758
|
+
export declare function createIsQuery<T extends object>(): (input: string | URLSearchParams) => T | null;
|
|
759
|
+
/**
|
|
760
|
+
* Creates a reusable {@link validateQuery} function.
|
|
761
|
+
*
|
|
762
|
+
* @danger You must configure the generic argument `T`
|
|
763
|
+
* @template T The type of the query object
|
|
764
|
+
* @throws compile error
|
|
765
|
+
*
|
|
766
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
767
|
+
*/
|
|
768
|
+
export declare function createValidateQuery(): never;
|
|
769
|
+
/**
|
|
770
|
+
* Creates a reusable {@link validateQuery} function.
|
|
771
|
+
*
|
|
772
|
+
* @template T The type of the query object
|
|
773
|
+
* @returns A reusable `validateQuery` function
|
|
774
|
+
*
|
|
775
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
776
|
+
*/
|
|
777
|
+
export declare function createValidateQuery<T extends object>(): (input: string | URLSearchParams) => IValidation<Resolved<T>>;
|
|
778
|
+
/**
|
|
779
|
+
* Creates a reusable {@link headers} function.
|
|
780
|
+
*
|
|
781
|
+
* @danger You must configure the generic argument `T`
|
|
782
|
+
* @template T The type of the headers object
|
|
783
|
+
* @throws compile error
|
|
784
|
+
*
|
|
785
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
786
|
+
*/
|
|
787
|
+
export declare function createHeaders(): never;
|
|
788
|
+
/**
|
|
789
|
+
* Creates a reusable {@link headers} function.
|
|
790
|
+
*
|
|
791
|
+
* @template T The type of the headers object
|
|
792
|
+
* @returns A reusable `headers` function
|
|
793
|
+
*
|
|
794
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
795
|
+
*/
|
|
796
|
+
export declare function createHeaders<T extends object>(): (input: Record<string, string | string[] | undefined>) => T;
|
|
797
|
+
/**
|
|
798
|
+
* Creates a reusable {@link assertHeaders} function.
|
|
799
|
+
*
|
|
800
|
+
* @danger You must configure the generic argument `T`
|
|
801
|
+
* @template T The type of the headers object
|
|
802
|
+
* @throws compile error
|
|
803
|
+
*
|
|
804
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
805
|
+
*/
|
|
806
|
+
export declare function createAssertHeaders(): never;
|
|
807
|
+
/**
|
|
808
|
+
* Creates a reusable {@link assertHeaders} function.
|
|
809
|
+
*
|
|
810
|
+
* @template T The type of the headers object
|
|
811
|
+
* @returns A reusable `assertHeaders` function
|
|
812
|
+
*
|
|
813
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
814
|
+
*/
|
|
815
|
+
export declare function createAssertHeaders<T extends object>(): (input: Record<string, string | string[] | undefined>) => T;
|
|
816
|
+
/**
|
|
817
|
+
* Creates a reusable {@link isHeaders} function.
|
|
818
|
+
*
|
|
819
|
+
* @danger You must configure the generic argument `T`
|
|
820
|
+
* @template T The type of the headers object
|
|
821
|
+
* @throws compile error
|
|
822
|
+
*
|
|
823
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
824
|
+
*/
|
|
825
|
+
export declare function createIsHeaders(): never;
|
|
826
|
+
/**
|
|
827
|
+
* Creates a reusable {@link isHeaders} function.
|
|
828
|
+
*
|
|
829
|
+
* @template T The type of the headers object
|
|
830
|
+
* @returns A reusable `isHeaders` function
|
|
831
|
+
*
|
|
832
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
833
|
+
*/
|
|
834
|
+
export declare function createIsHeaders<T extends object>(): (input: Record<string, string | string[] | undefined>) => T | null;
|
|
835
|
+
/**
|
|
836
|
+
* Creates a reusable {@link validateHeaders} function.
|
|
837
|
+
*
|
|
838
|
+
* @danger You must configure the generic argument `T`
|
|
839
|
+
* @template T The type of the headers object
|
|
840
|
+
* @throws compile error
|
|
841
|
+
*
|
|
842
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
843
|
+
*/
|
|
844
|
+
export declare function createValidateHeaders(): never;
|
|
845
|
+
/**
|
|
846
|
+
* Creates a reusable {@link validateHeaders} function.
|
|
847
|
+
*
|
|
848
|
+
* @template T The type of the headers object
|
|
849
|
+
* @returns A reusable `validateHeaders` function
|
|
850
|
+
*
|
|
851
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
852
|
+
*/
|
|
853
|
+
export declare function createValidateHeaders<T extends object>(): (input: Record<string, string | string[] | undefined>) => IValidation<Resolved<T>>;
|
|
854
|
+
/**
|
|
855
|
+
* Creates a reusable {@link parameter} function.
|
|
856
|
+
*
|
|
857
|
+
* @danger You must configure the generic argument `T`
|
|
858
|
+
* @template T The type of the parameter value
|
|
859
|
+
* @throws compile error
|
|
860
|
+
*
|
|
861
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
862
|
+
*/
|
|
863
|
+
export declare function createParameter(): never;
|
|
864
|
+
/**
|
|
865
|
+
* Creates a reusable {@link parameter} function.
|
|
866
|
+
*
|
|
867
|
+
* @template T The type of the parameter value
|
|
868
|
+
* @returns A reusable `parameter` function
|
|
869
|
+
*
|
|
870
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
871
|
+
*/
|
|
872
|
+
export declare function createParameter<T extends Atomic.Type>(): (input: string) => T;
|