@tsgonest/types 0.0.1 → 0.1.0

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/tags.d.ts CHANGED
@@ -1,237 +1,419 @@
1
1
  /**
2
- * @tsgonest/types — Zero-runtime branded types for type-safe validation constraints.
2
+ * @tsgonest/types — Zero-runtime branded types for type-safe validation.
3
3
  *
4
4
  * These types exist purely at compile time. They produce NO runtime code.
5
- * The tsgonest compiler inspects the phantom intersection properties
6
- * (prefixed with `__tsgonest_`) to extract validation constraints.
5
+ * The tsgonest compiler reads phantom properties (`__tsgonest_*`) to generate validators.
7
6
  *
8
- * Usage:
9
- * import { tags } from "@tsgonest/types";
7
+ * Every constraint supports two forms:
8
+ * - Simple: Min<0> — clean, no custom error
9
+ * - Extended: Min<{value: 0, error: "Must be positive"}> — with per-constraint error
10
+ *
11
+ * @example
12
+ * import { Email, Min, Max, Trim, Coerce } from "@tsgonest/types";
10
13
  *
11
14
  * interface CreateUserDto {
12
- * email: string & tags.Format<"email">;
13
- * name: string & tags.MinLength<1> & tags.MaxLength<255>;
14
- * age: number & tags.Minimum<0> & tags.Maximum<150>;
15
+ * email: string & Email;
16
+ * name: string & Trim & Min<1> & Max<255>;
17
+ * age: number & Min<0> & Max<150>;
15
18
  * }
16
19
  *
17
- * This is equivalent to using JSDoc tags:
18
- * interface CreateUserDto {
19
- * // @format email
20
- * email: string;
21
- * // @minLength 1
22
- * // @maxLength 255
23
- * name: string;
24
- * // @minimum 0
25
- * // @maximum 150
26
- * age: number;
20
+ * // With per-constraint errors:
21
+ * interface StrictDto {
22
+ * email: string & Format<{type: "email", error: "Must be a valid email"}>;
23
+ * age: number & Min<{value: 0, error: "Age cannot be negative"}>;
24
+ * }
25
+ *
26
+ * // Query params with coercion:
27
+ * interface QueryDto {
28
+ * page: number & Coerce;
29
+ * active: boolean & Coerce;
27
30
  * }
28
31
  */
29
- /**
30
- * All supported string format values.
31
- * Includes standard JSON Schema formats, plus Zod 4 / typia extras.
32
- */
32
+ /** Extract the value from a dual-form number constraint. */
33
+ type NumVal<N extends number | {
34
+ value: number;
35
+ error?: string;
36
+ }> = N extends {
37
+ value: infer V;
38
+ } ? V : N;
39
+ /** Extract the value from a dual-form string constraint. */
40
+ type StrVal<S extends string | {
41
+ value: string;
42
+ error?: string;
43
+ }> = S extends {
44
+ value: infer V;
45
+ } ? V : S;
46
+ /** Extract the type from a dual-form type constraint (Format, Type). */
47
+ type TypeVal<T, Base> = T extends {
48
+ type: infer V;
49
+ } ? V : T;
50
+ /** Conditionally add a _error phantom property. */
51
+ type WithErr<Prefix extends string, C> = C extends {
52
+ error: infer E extends string;
53
+ } ? {
54
+ readonly [K in `${Prefix}_error`]: E;
55
+ } : {};
56
+ /** All supported string format values. */
33
57
  export type FormatValue = "email" | "idn-email" | "url" | "uri" | "uri-reference" | "uri-template" | "iri" | "iri-reference" | "uuid" | "ipv4" | "ipv6" | "hostname" | "idn-hostname" | "date-time" | "date" | "time" | "duration" | "json-pointer" | "relative-json-pointer" | "byte" | "password" | "regex" | "nanoid" | "cuid" | "cuid2" | "ulid" | "jwt" | "base64url" | "hex" | "mac" | "cidrv4" | "cidrv6" | "emoji";
34
58
  /**
35
- * Constrain a string to match a specific format (e.g. "email", "uuid", "url").
59
+ * Validate a string matches a specific format.
36
60
  *
37
61
  * @example
38
- * type Email = string & tags.Format<"email">;
39
- * type UserId = string & tags.Format<"uuid">;
62
+ * Format<"email">
63
+ * Format<{type: "email", error: "Must be a valid email"}>
40
64
  */
41
- export type Format<F extends FormatValue> = {
42
- readonly __tsgonest_format: F;
43
- };
65
+ export type Format<F extends FormatValue | {
66
+ type: FormatValue;
67
+ error?: string;
68
+ }> = {
69
+ readonly __tsgonest_format: TypeVal<F, FormatValue>;
70
+ } & WithErr<"__tsgonest_format", F>;
44
71
  /**
45
- * Constrain minimum string length.
46
- *
47
- * @example
48
- * type NonEmpty = string & tags.MinLength<1>;
72
+ * Minimum string length.
73
+ * @example MinLength<1> or MinLength<{value: 1, error: "Cannot be empty"}>
49
74
  */
50
- export type MinLength<N extends number> = {
51
- readonly __tsgonest_minLength: N;
52
- };
75
+ export type MinLength<N extends number | {
76
+ value: number;
77
+ error?: string;
78
+ }> = {
79
+ readonly __tsgonest_minLength: NumVal<N>;
80
+ } & WithErr<"__tsgonest_minLength", N>;
53
81
  /**
54
- * Constrain maximum string length.
55
- *
56
- * @example
57
- * type ShortName = string & tags.MaxLength<50>;
82
+ * Maximum string length.
83
+ * @example MaxLength<255> or MaxLength<{value: 255, error: "Too long"}>
58
84
  */
59
- export type MaxLength<N extends number> = {
60
- readonly __tsgonest_maxLength: N;
61
- };
85
+ export type MaxLength<N extends number | {
86
+ value: number;
87
+ error?: string;
88
+ }> = {
89
+ readonly __tsgonest_maxLength: NumVal<N>;
90
+ } & WithErr<"__tsgonest_maxLength", N>;
62
91
  /**
63
- * Constrain string to exact length (sets both minLength and maxLength).
64
- *
65
- * @example
66
- * type CountryCode = string & tags.Length<2>;
92
+ * Regex pattern constraint.
93
+ * @example Pattern<"^[a-z]+$"> or Pattern<{value: "^[a-z]+$", error: "Letters only"}>
67
94
  */
68
- export type Length<N extends number> = MinLength<N> & MaxLength<N>;
95
+ export type Pattern<P extends string | {
96
+ value: string;
97
+ error?: string;
98
+ }> = {
99
+ readonly __tsgonest_pattern: StrVal<P>;
100
+ } & WithErr<"__tsgonest_pattern", P>;
69
101
  /**
70
- * Constrain a string to match a regex pattern.
71
- *
72
- * @example
73
- * type AlphaNumeric = string & tags.Pattern<"^[a-zA-Z0-9]+$">;
102
+ * String must start with prefix.
103
+ * @example StartsWith<"https://">
74
104
  */
75
- export type Pattern<P extends string> = {
76
- readonly __tsgonest_pattern: P;
77
- };
105
+ export type StartsWith<S extends string | {
106
+ value: string;
107
+ error?: string;
108
+ }> = {
109
+ readonly __tsgonest_startsWith: StrVal<S>;
110
+ } & WithErr<"__tsgonest_startsWith", S>;
78
111
  /**
79
- * Constrain a string to start with a specific prefix.
80
- *
81
- * @example
82
- * type HttpUrl = string & tags.StartsWith<"https://">;
112
+ * String must end with suffix.
113
+ * @example EndsWith<".json">
83
114
  */
84
- export type StartsWith<S extends string> = {
85
- readonly __tsgonest_startsWith: S;
86
- };
115
+ export type EndsWith<S extends string | {
116
+ value: string;
117
+ error?: string;
118
+ }> = {
119
+ readonly __tsgonest_endsWith: StrVal<S>;
120
+ } & WithErr<"__tsgonest_endsWith", S>;
87
121
  /**
88
- * Constrain a string to end with a specific suffix.
89
- *
90
- * @example
91
- * type JsonFile = string & tags.EndsWith<".json">;
122
+ * String must contain substring.
123
+ * @example Includes<"@">
92
124
  */
93
- export type EndsWith<S extends string> = {
94
- readonly __tsgonest_endsWith: S;
95
- };
125
+ export type Includes<S extends string | {
126
+ value: string;
127
+ error?: string;
128
+ }> = {
129
+ readonly __tsgonest_includes: StrVal<S>;
130
+ } & WithErr<"__tsgonest_includes", S>;
96
131
  /**
97
- * Constrain a string to include a specific substring.
98
- *
99
- * @example
100
- * type ContainsAt = string & tags.Includes<"@">;
132
+ * Minimum value (inclusive): value >= N.
133
+ * @example Minimum<0> or Min<0> or Min<{value: 0, error: "Must be non-negative"}>
101
134
  */
102
- export type Includes<S extends string> = {
103
- readonly __tsgonest_includes: S;
104
- };
135
+ export type Minimum<N extends number | {
136
+ value: number;
137
+ error?: string;
138
+ }> = {
139
+ readonly __tsgonest_minimum: NumVal<N>;
140
+ } & WithErr<"__tsgonest_minimum", N>;
105
141
  /**
106
- * Constrain minimum numeric value (inclusive).
107
- *
108
- * @example
109
- * type NonNegative = number & tags.Minimum<0>;
142
+ * Maximum value (inclusive): value <= N.
143
+ * @example Maximum<100> or Max<100>
110
144
  */
111
- export type Minimum<N extends number> = {
112
- readonly __tsgonest_minimum: N;
113
- };
145
+ export type Maximum<N extends number | {
146
+ value: number;
147
+ error?: string;
148
+ }> = {
149
+ readonly __tsgonest_maximum: NumVal<N>;
150
+ } & WithErr<"__tsgonest_maximum", N>;
114
151
  /**
115
- * Constrain maximum numeric value (inclusive).
116
- *
117
- * @example
118
- * type Percentage = number & tags.Minimum<0> & tags.Maximum<100>;
152
+ * Exclusive minimum: value > N.
153
+ * @example ExclusiveMinimum<0> or Gt<0>
119
154
  */
120
- export type Maximum<N extends number> = {
121
- readonly __tsgonest_maximum: N;
122
- };
155
+ export type ExclusiveMinimum<N extends number | {
156
+ value: number;
157
+ error?: string;
158
+ }> = {
159
+ readonly __tsgonest_exclusiveMinimum: NumVal<N>;
160
+ } & WithErr<"__tsgonest_exclusiveMinimum", N>;
123
161
  /**
124
- * Constrain exclusive minimum (value must be > N).
125
- *
126
- * @example
127
- * type Positive = number & tags.ExclusiveMinimum<0>;
162
+ * Exclusive maximum: value < N.
163
+ * @example ExclusiveMaximum<100> or Lt<100>
128
164
  */
129
- export type ExclusiveMinimum<N extends number> = {
130
- readonly __tsgonest_exclusiveMinimum: N;
131
- };
165
+ export type ExclusiveMaximum<N extends number | {
166
+ value: number;
167
+ error?: string;
168
+ }> = {
169
+ readonly __tsgonest_exclusiveMaximum: NumVal<N>;
170
+ } & WithErr<"__tsgonest_exclusiveMaximum", N>;
132
171
  /**
133
- * Constrain exclusive maximum (value must be < N).
134
- *
135
- * @example
136
- * type Negative = number & tags.ExclusiveMaximum<0>;
172
+ * Value must be a multiple of N.
173
+ * @example MultipleOf<2> or Step<0.01>
137
174
  */
138
- export type ExclusiveMaximum<N extends number> = {
139
- readonly __tsgonest_exclusiveMaximum: N;
140
- };
141
- /**
142
- * Constrain numeric value to be a multiple of N.
143
- *
144
- * @example
145
- * type Even = number & tags.MultipleOf<2>;
146
- */
147
- export type MultipleOf<N extends number> = {
148
- readonly __tsgonest_multipleOf: N;
149
- };
175
+ export type MultipleOf<N extends number | {
176
+ value: number;
177
+ error?: string;
178
+ }> = {
179
+ readonly __tsgonest_multipleOf: NumVal<N>;
180
+ } & WithErr<"__tsgonest_multipleOf", N>;
150
181
  /** Valid numeric type values. */
151
182
  export type NumericTypeValue = "int32" | "uint32" | "int64" | "uint64" | "float" | "double";
152
183
  /**
153
- * Constrain a number to a specific numeric type (range/precision).
154
- *
155
- * @example
156
- * type Port = number & tags.Type<"uint32">;
157
- * type SafeInt = number & tags.Type<"int64">;
184
+ * Constrain number to a specific numeric type.
185
+ * @example Type<"int32"> or Type<{type: "int32", error: "Must be integer"}>
186
+ */
187
+ export type Type<T extends NumericTypeValue | {
188
+ type: NumericTypeValue;
189
+ error?: string;
190
+ }> = {
191
+ readonly __tsgonest_type: TypeVal<T, NumericTypeValue>;
192
+ } & WithErr<"__tsgonest_type", T>;
193
+ /**
194
+ * Minimum array length.
195
+ * @example MinItems<1>
196
+ */
197
+ export type MinItems<N extends number | {
198
+ value: number;
199
+ error?: string;
200
+ }> = {
201
+ readonly __tsgonest_minItems: NumVal<N>;
202
+ } & WithErr<"__tsgonest_minItems", N>;
203
+ /**
204
+ * Maximum array length.
205
+ * @example MaxItems<100>
206
+ */
207
+ export type MaxItems<N extends number | {
208
+ value: number;
209
+ error?: string;
210
+ }> = {
211
+ readonly __tsgonest_maxItems: NumVal<N>;
212
+ } & WithErr<"__tsgonest_maxItems", N>;
213
+ /**
214
+ * Array items must be unique.
215
+ * @example UniqueItems or Unique or Unique<{error: "No duplicates"}>
216
+ */
217
+ export type UniqueItems<C extends {
218
+ error?: string;
219
+ } = {}> = {
220
+ readonly __tsgonest_uniqueItems: true;
221
+ } & WithErr<"__tsgonest_uniqueItems", C>;
222
+ /**
223
+ * String must be all uppercase.
224
+ * @example Uppercase or Uppercase<{error: "Must be uppercase"}>
225
+ */
226
+ export type Uppercase<C extends {
227
+ error?: string;
228
+ } = {}> = {
229
+ readonly __tsgonest_uppercase: true;
230
+ } & WithErr<"__tsgonest_uppercase", C>;
231
+ /**
232
+ * String must be all lowercase.
233
+ * @example Lowercase or Lowercase<{error: "Must be lowercase"}>
158
234
  */
159
- export type Type<T extends NumericTypeValue> = {
160
- readonly __tsgonest_type: T;
235
+ export type Lowercase<C extends {
236
+ error?: string;
237
+ } = {}> = {
238
+ readonly __tsgonest_lowercase: true;
239
+ } & WithErr<"__tsgonest_lowercase", C>;
240
+ /** Trim whitespace before validation. */
241
+ export type Trim = {
242
+ readonly __tsgonest_transform_trim: true;
243
+ };
244
+ /** Convert to lowercase before validation. */
245
+ export type ToLowerCase = {
246
+ readonly __tsgonest_transform_toLowerCase: true;
247
+ };
248
+ /** Convert to uppercase before validation. */
249
+ export type ToUpperCase = {
250
+ readonly __tsgonest_transform_toUpperCase: true;
161
251
  };
162
252
  /**
163
- * Constrain minimum array length.
253
+ * Coerce string inputs to the declared type before validation.
254
+ * - "123" → 123 (string to number)
255
+ * - "true"/"false" → true/false (string to boolean)
164
256
  *
165
257
  * @example
166
- * type NonEmptyArray<T> = T[] & tags.MinItems<1>;
258
+ * page: number & Coerce
259
+ * active: boolean & Coerce
167
260
  */
168
- export type MinItems<N extends number> = {
169
- readonly __tsgonest_minItems: N;
261
+ export type Coerce = {
262
+ readonly __tsgonest_coerce: true;
170
263
  };
171
264
  /**
172
- * Constrain maximum array length.
265
+ * Validate using a custom function. The function must be a predicate:
266
+ * `(value: T) => boolean`. tsgonest resolves the function's source file
267
+ * and emits an import + call in the generated validator.
173
268
  *
174
269
  * @example
175
- * type LimitedArray<T> = T[] & tags.MaxItems<100>;
270
+ * import { isValidCard } from "./validators/credit-card";
271
+ *
272
+ * interface PaymentDto {
273
+ * card: string & Validate<typeof isValidCard>;
274
+ * card: string & Validate<{fn: typeof isValidCard, error: "Invalid card"}>;
275
+ * }
276
+ */
277
+ export type Validate<F extends ((...args: any[]) => boolean) | {
278
+ fn: (...args: any[]) => boolean;
279
+ error?: string;
280
+ }> = {
281
+ readonly __tsgonest_validate: F extends {
282
+ fn: infer Fn;
283
+ } ? Fn : F;
284
+ } & WithErr<"__tsgonest_validate", F>;
285
+ /**
286
+ * Global error message — applies to all validation failures on this property.
287
+ * Per-constraint errors (via `error` field) take precedence.
288
+ * @example string & Format<"email"> & Error<"Invalid email">
176
289
  */
177
- export type MaxItems<N extends number> = {
178
- readonly __tsgonest_maxItems: N;
290
+ export type Error<M extends string> = {
291
+ readonly __tsgonest_error: M;
179
292
  };
180
293
  /**
181
- * Constrain array items to be unique.
182
- *
183
- * @example
184
- * type UniqueIds = string[] & tags.UniqueItems;
294
+ * Default value for optional properties. Assigned when value is undefined.
295
+ * @example theme?: string & Default<"light">
185
296
  */
186
- export type UniqueItems = {
187
- readonly __tsgonest_uniqueItems: true;
297
+ export type Default<V extends string | number | boolean> = {
298
+ readonly __tsgonest_default: V;
188
299
  };
189
- /** String validated as email format. */
300
+ /**
301
+ * Exact length (sets both MinLength and MaxLength).
302
+ * @example Length<2> or Length<{value: 2, error: "Must be exactly 2 chars"}>
303
+ */
304
+ export type Length<N extends number | {
305
+ value: number;
306
+ error?: string;
307
+ }> = MinLength<N> & MaxLength<N>;
308
+ /**
309
+ * Numeric range (inclusive). Sets Minimum and Maximum.
310
+ * @example Range<{min: 0, max: 100}> or Range<{min: 0, max: 100, error: "Out of range"}>
311
+ */
312
+ export type Range<R extends {
313
+ min: number;
314
+ max: number;
315
+ error?: string;
316
+ }> = Minimum<R extends {
317
+ error: string;
318
+ } ? {
319
+ value: R["min"];
320
+ error: R["error"];
321
+ } : R["min"]> & Maximum<R extends {
322
+ error: string;
323
+ } ? {
324
+ value: R["max"];
325
+ error: R["error"];
326
+ } : R["max"]>;
327
+ /**
328
+ * String length range. Sets MinLength and MaxLength.
329
+ * @example Between<{min: 1, max: 255}> or Between<{min: 1, max: 255, error: "Bad length"}>
330
+ */
331
+ export type Between<R extends {
332
+ min: number;
333
+ max: number;
334
+ error?: string;
335
+ }> = MinLength<R extends {
336
+ error: string;
337
+ } ? {
338
+ value: R["min"];
339
+ error: R["error"];
340
+ } : R["min"]> & MaxLength<R extends {
341
+ error: string;
342
+ } ? {
343
+ value: R["max"];
344
+ error: R["error"];
345
+ } : R["max"]>;
346
+ /** Alias for Minimum. `Min<0>` = `Minimum<0>` */
347
+ export type Min<N extends number | {
348
+ value: number;
349
+ error?: string;
350
+ }> = Minimum<N>;
351
+ /** Alias for Maximum. `Max<100>` = `Maximum<100>` */
352
+ export type Max<N extends number | {
353
+ value: number;
354
+ error?: string;
355
+ }> = Maximum<N>;
356
+ /** Alias for ExclusiveMinimum. `Gt<0>` = "greater than 0" */
357
+ export type Gt<N extends number | {
358
+ value: number;
359
+ error?: string;
360
+ }> = ExclusiveMinimum<N>;
361
+ /** Alias for ExclusiveMaximum. `Lt<100>` = "less than 100" */
362
+ export type Lt<N extends number | {
363
+ value: number;
364
+ error?: string;
365
+ }> = ExclusiveMaximum<N>;
366
+ /** Alias for Minimum + ExclusiveMinimum combo. `Gte<0>` = `Min<0>` */
367
+ export type Gte<N extends number | {
368
+ value: number;
369
+ error?: string;
370
+ }> = Minimum<N>;
371
+ /** Alias for Maximum + ExclusiveMaximum combo. `Lte<100>` = `Max<100>` */
372
+ export type Lte<N extends number | {
373
+ value: number;
374
+ error?: string;
375
+ }> = Maximum<N>;
376
+ /** Alias for MultipleOf. `Step<0.01>` */
377
+ export type Step<N extends number | {
378
+ value: number;
379
+ error?: string;
380
+ }> = MultipleOf<N>;
381
+ /** Alias for UniqueItems. `Unique` */
382
+ export type Unique<C extends {
383
+ error?: string;
384
+ } = {}> = UniqueItems<C>;
190
385
  export type Email = Format<"email">;
191
- /** String validated as UUID format. */
192
386
  export type Uuid = Format<"uuid">;
193
- /** String validated as URL format. */
194
387
  export type Url = Format<"url">;
195
- /** String validated as URI format. */
196
388
  export type Uri = Format<"uri">;
197
- /** String validated as IPv4 format. */
198
389
  export type IPv4 = Format<"ipv4">;
199
- /** String validated as IPv6 format. */
200
390
  export type IPv6 = Format<"ipv6">;
201
- /** String validated as date-time (ISO 8601) format. */
202
391
  export type DateTime = Format<"date-time">;
203
- /** String validated as date (YYYY-MM-DD) format. */
204
392
  export type DateOnly = Format<"date">;
205
- /** String validated as time (HH:MM:SS) format. */
206
393
  export type Time = Format<"time">;
207
- /** String validated as duration (ISO 8601 duration) format. */
208
394
  export type Duration = Format<"duration">;
209
- /** String validated as JWT format. */
210
395
  export type Jwt = Format<"jwt">;
211
- /** String validated as ULID format. */
212
396
  export type Ulid = Format<"ulid">;
213
- /** String validated as CUID format. */
214
397
  export type Cuid = Format<"cuid">;
215
- /** String validated as CUID2 format. */
216
398
  export type Cuid2 = Format<"cuid2">;
217
- /** String validated as Nano ID format. */
218
399
  export type NanoId = Format<"nanoid">;
219
- /** Number constrained to be > 0. */
400
+ /** number & Gt<0> */
220
401
  export type Positive = ExclusiveMinimum<0>;
221
- /** Number constrained to be < 0. */
402
+ /** number & Lt<0> */
222
403
  export type Negative = ExclusiveMaximum<0>;
223
- /** Number constrained to be >= 0. */
404
+ /** number & Min<0> */
224
405
  export type NonNegative = Minimum<0>;
225
- /** Number constrained to be <= 0. */
406
+ /** number & Max<0> */
226
407
  export type NonPositive = Maximum<0>;
227
- /** Number constrained to 32-bit integer range. */
408
+ /** number & Type<"int32"> */
228
409
  export type Int = Type<"int32">;
229
- /** Number constrained to JS safe integer range (-2^53+1 to 2^53-1). */
410
+ /** number & Type<"int64"> (JS safe integer range) */
230
411
  export type SafeInt = Type<"int64">;
231
- /** Number constrained to finite values (no Infinity/NaN). */
412
+ /** number & Type<"float"> (finite, no Infinity/NaN) */
232
413
  export type Finite = Type<"float">;
233
- /** Number constrained to 32-bit unsigned integer range. */
414
+ /** number & Type<"uint32"> */
234
415
  export type Uint = Type<"uint32">;
235
- /** Number constrained to double precision float. */
416
+ /** number & Type<"double"> */
236
417
  export type Double = Type<"double">;
418
+ export {};
237
419
  //# sourceMappingURL=tags.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tags.d.ts","sourceRoot":"","sources":["../src/tags.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAIH;;;GAGG;AACH,MAAM,MAAM,WAAW,GAEnB,OAAO,GACP,WAAW,GACX,KAAK,GACL,KAAK,GACL,eAAe,GACf,cAAc,GACd,KAAK,GACL,eA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BAA8B;AAC9B,MAAM,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC;AAElC,8BAA8B;AAC9B,MAAM,MAAM,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC"}
package/dist/tags.js CHANGED
@@ -1,29 +1,32 @@
1
1
  /**
2
- * @tsgonest/types — Zero-runtime branded types for type-safe validation constraints.
2
+ * @tsgonest/types — Zero-runtime branded types for type-safe validation.
3
3
  *
4
4
  * These types exist purely at compile time. They produce NO runtime code.
5
- * The tsgonest compiler inspects the phantom intersection properties
6
- * (prefixed with `__tsgonest_`) to extract validation constraints.
5
+ * The tsgonest compiler reads phantom properties (`__tsgonest_*`) to generate validators.
7
6
  *
8
- * Usage:
9
- * import { tags } from "@tsgonest/types";
7
+ * Every constraint supports two forms:
8
+ * - Simple: Min<0> — clean, no custom error
9
+ * - Extended: Min<{value: 0, error: "Must be positive"}> — with per-constraint error
10
+ *
11
+ * @example
12
+ * import { Email, Min, Max, Trim, Coerce } from "@tsgonest/types";
10
13
  *
11
14
  * interface CreateUserDto {
12
- * email: string & tags.Format<"email">;
13
- * name: string & tags.MinLength<1> & tags.MaxLength<255>;
14
- * age: number & tags.Minimum<0> & tags.Maximum<150>;
15
+ * email: string & Email;
16
+ * name: string & Trim & Min<1> & Max<255>;
17
+ * age: number & Min<0> & Max<150>;
15
18
  * }
16
19
  *
17
- * This is equivalent to using JSDoc tags:
18
- * interface CreateUserDto {
19
- * // @format email
20
- * email: string;
21
- * // @minLength 1
22
- * // @maxLength 255
23
- * name: string;
24
- * // @minimum 0
25
- * // @maximum 150
26
- * age: number;
20
+ * // With per-constraint errors:
21
+ * interface StrictDto {
22
+ * email: string & Format<{type: "email", error: "Must be a valid email"}>;
23
+ * age: number & Min<{value: 0, error: "Age cannot be negative"}>;
24
+ * }
25
+ *
26
+ * // Query params with coercion:
27
+ * interface QueryDto {
28
+ * page: number & Coerce;
29
+ * active: boolean & Coerce;
27
30
  * }
28
31
  */
29
32
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tsgonest/types",
3
- "version": "0.0.1",
3
+ "version": "0.1.0",
4
4
  "description": "Zero-runtime branded types for tsgonest validation constraints — type-safe alternative to JSDoc tags",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",