@powerlines/schema 0.11.45 → 0.11.47

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.
Files changed (69) hide show
  1. package/dist/bundle.cjs +1 -1
  2. package/dist/bundle.d.cts +1 -1
  3. package/dist/bundle.d.mts +1 -1
  4. package/dist/bundle.mjs +1 -1
  5. package/dist/bundle.mjs.map +1 -1
  6. package/dist/codegen.cjs +28 -22
  7. package/dist/codegen.d.cts +11 -11
  8. package/dist/codegen.d.cts.map +1 -1
  9. package/dist/codegen.d.mts +11 -11
  10. package/dist/codegen.d.mts.map +1 -1
  11. package/dist/codegen.mjs +36 -30
  12. package/dist/codegen.mjs.map +1 -1
  13. package/dist/constants.cjs +15 -11
  14. package/dist/constants.d.cts +4 -3
  15. package/dist/constants.d.cts.map +1 -1
  16. package/dist/constants.d.mts +4 -3
  17. package/dist/constants.d.mts.map +1 -1
  18. package/dist/constants.mjs +13 -10
  19. package/dist/constants.mjs.map +1 -1
  20. package/dist/extract.cjs +158 -20
  21. package/dist/extract.d.cts +55 -16
  22. package/dist/extract.d.cts.map +1 -1
  23. package/dist/extract.d.mts +55 -16
  24. package/dist/extract.d.mts.map +1 -1
  25. package/dist/extract.mjs +158 -22
  26. package/dist/extract.mjs.map +1 -1
  27. package/dist/helpers.cjs +43 -8
  28. package/dist/helpers.d.cts +40 -6
  29. package/dist/helpers.d.cts.map +1 -1
  30. package/dist/helpers.d.mts +40 -6
  31. package/dist/helpers.d.mts.map +1 -1
  32. package/dist/helpers.mjs +43 -10
  33. package/dist/helpers.mjs.map +1 -1
  34. package/dist/index.cjs +39 -7
  35. package/dist/index.d.cts +8 -8
  36. package/dist/index.d.mts +8 -8
  37. package/dist/index.mjs +7 -7
  38. package/dist/metadata.cjs +9 -35
  39. package/dist/metadata.d.cts +5 -26
  40. package/dist/metadata.d.cts.map +1 -1
  41. package/dist/metadata.d.mts +5 -26
  42. package/dist/metadata.d.mts.map +1 -1
  43. package/dist/metadata.mjs +9 -33
  44. package/dist/metadata.mjs.map +1 -1
  45. package/dist/persistence.d.cts +4 -4
  46. package/dist/persistence.d.cts.map +1 -1
  47. package/dist/persistence.d.mts +4 -4
  48. package/dist/persistence.d.mts.map +1 -1
  49. package/dist/persistence.mjs.map +1 -1
  50. package/dist/reflection.cjs +72 -50
  51. package/dist/reflection.d.cts +1 -1
  52. package/dist/reflection.d.cts.map +1 -1
  53. package/dist/reflection.d.mts +1 -1
  54. package/dist/reflection.d.mts.map +1 -1
  55. package/dist/reflection.mjs +74 -52
  56. package/dist/reflection.mjs.map +1 -1
  57. package/dist/type-checks.cjs +363 -83
  58. package/dist/type-checks.d.cts +138 -16
  59. package/dist/type-checks.d.cts.map +1 -1
  60. package/dist/type-checks.d.mts +138 -16
  61. package/dist/type-checks.d.mts.map +1 -1
  62. package/dist/type-checks.mjs +336 -85
  63. package/dist/type-checks.mjs.map +1 -1
  64. package/dist/types.d.cts +977 -175
  65. package/dist/types.d.cts.map +1 -1
  66. package/dist/types.d.mts +977 -175
  67. package/dist/types.d.mts.map +1 -1
  68. package/dist/validate.mjs.map +1 -1
  69. package/package.json +5 -5
@@ -1,9 +1,135 @@
1
- import { ExtractedSchema, JsonSchema, JsonSchemaObject, Schema as Schema$1 } from "./types.cjs";
1
+ import { ExtractedSchema, JsonSchema, JsonSchemaAllOf, JsonSchemaAny, JsonSchemaAnyOf, JsonSchemaArray, JsonSchemaBigint, JsonSchemaBoolean, JsonSchemaDate, JsonSchemaDecimal, JsonSchemaEnum, JsonSchemaInteger, JsonSchemaKeywords, JsonSchemaLiteral, JsonSchemaMap, JsonSchemaNativeEnum, JsonSchemaNever, JsonSchemaNull, JsonSchemaNullable, JsonSchemaNumber, JsonSchemaObject, JsonSchemaPrimitiveType, JsonSchemaPrimitiveUnion, JsonSchemaRecord, JsonSchemaRef, JsonSchemaSet, JsonSchemaString, JsonSchemaTuple, JsonSchemaType, JsonSchemaUndefined, JsonSchemaUnion, JsonSchemaUnknown, Schema as Schema$1 } from "./types.cjs";
2
2
  import { StandardSchemaV1 } from "@standard-schema/spec";
3
3
  import { InputObject, Schema } from "untyped";
4
4
  import { BaseSchema } from "valibot";
5
5
 
6
6
  //#region src/type-checks.d.ts
7
+ /**
8
+ * A helper type guard to check if a value is a JSON Schema primitive type.
9
+ *
10
+ * @param value - The value to check.
11
+ * @returns True if the value is a JSON Schema primitive type, false otherwise.
12
+ */
13
+ declare function isJsonSchemaPrimitiveType(value: unknown): value is JsonSchemaPrimitiveType;
14
+ /**
15
+ * A helper type guard to check if a value is a JSON Schema type.
16
+ *
17
+ * @param value - The value to check.
18
+ * @returns True if the value is a JSON Schema type, false otherwise.
19
+ */
20
+ declare function isJsonSchemaType(value: unknown): value is JsonSchemaType;
21
+ /**
22
+ * Type guard for shared JSON Schema keyword groups.
23
+ */
24
+ declare function isJsonSchemaKeywords(input: unknown): input is JsonSchemaKeywords;
25
+ /**
26
+ * Type guard for generic JSON Schema objects with optional `$ref`.
27
+ */
28
+ declare function isJsonSchemaAny(input: unknown): input is JsonSchemaAny;
29
+ /**
30
+ * Type guard for JSON Schema array types.
31
+ */
32
+ declare function isJsonSchemaArray(input: unknown): input is JsonSchemaArray;
33
+ /**
34
+ * Type guard for bigint-backed integer schemas.
35
+ */
36
+ declare function isJsonSchemaBigint(input: unknown): input is JsonSchemaBigint;
37
+ /**
38
+ * Type guard for boolean schemas.
39
+ */
40
+ declare function isJsonSchemaBoolean(input: unknown): input is JsonSchemaBoolean;
41
+ /**
42
+ * Type guard for date/time schemas.
43
+ */
44
+ declare function isJsonSchemaDate(input: unknown): input is JsonSchemaDate;
45
+ /**
46
+ * Type guard for enum-constrained schemas.
47
+ */
48
+ declare function isJsonSchemaEnum(input: unknown): input is JsonSchemaEnum;
49
+ /**
50
+ * Type guard for `allOf` composition schemas.
51
+ */
52
+ declare function isJsonSchemaAllOf(input: unknown): input is JsonSchemaAllOf;
53
+ /**
54
+ * Type guard for literal-value schemas.
55
+ */
56
+ declare function isJsonSchemaLiteral(input: unknown): input is JsonSchemaLiteral;
57
+ /**
58
+ * Type guard for map tuple-array schemas.
59
+ */
60
+ declare function isJsonSchemaMap(input: unknown): input is JsonSchemaMap;
61
+ /**
62
+ * Type guard for native enum schemas.
63
+ */
64
+ declare function isJsonSchemaNativeEnum(input: unknown): input is JsonSchemaNativeEnum;
65
+ /**
66
+ * Type guard for impossible/never schemas.
67
+ */
68
+ declare function isJsonSchemaNever(input: unknown): input is JsonSchemaNever;
69
+ /**
70
+ * Type guard for `null` schemas.
71
+ */
72
+ declare function isJsonSchemaNull(input: unknown): input is JsonSchemaNull;
73
+ /**
74
+ * Type guard for nullable schema unions.
75
+ */
76
+ declare function isJsonSchemaNullable(input: unknown): input is JsonSchemaNullable;
77
+ /**
78
+ * Type guard for numeric schemas.
79
+ */
80
+ declare function isJsonSchemaNumber(input: unknown): input is JsonSchemaNumber;
81
+ /**
82
+ * Type guard for integer schemas.
83
+ */
84
+ declare function isJsonSchemaInteger(input: unknown): input is JsonSchemaInteger;
85
+ /**
86
+ * Type guard for decimal schemas.
87
+ */
88
+ declare function isJsonSchemaDecimal(input: unknown): input is JsonSchemaDecimal;
89
+ /**
90
+ * Type guard for object schemas.
91
+ */
92
+ declare function isJsonSchemaObject(input: unknown): input is JsonSchemaObject;
93
+ /**
94
+ * Type guard for string schemas.
95
+ */
96
+ declare function isJsonSchemaString(input: unknown): input is JsonSchemaString;
97
+ /**
98
+ * Type guard for set-like array schemas.
99
+ */
100
+ declare function isJsonSchemaSet(input: unknown): input is JsonSchemaSet;
101
+ /**
102
+ * Type guard for record schemas.
103
+ */
104
+ declare function isJsonSchemaRecord(input: unknown): input is JsonSchemaRecord;
105
+ /**
106
+ * Type guard for tuple schemas.
107
+ */
108
+ declare function isJsonSchemaTuple(input: unknown): input is JsonSchemaTuple;
109
+ /**
110
+ * Type guard for undefined-representing schemas.
111
+ */
112
+ declare function isJsonSchemaUndefined(input: unknown): input is JsonSchemaUndefined;
113
+ /**
114
+ * Type guard for primitive-union schema variants.
115
+ */
116
+ declare function isJsonSchemaPrimitiveUnion(input: unknown): input is JsonSchemaPrimitiveUnion;
117
+ /**
118
+ * Type guard for union schemas.
119
+ */
120
+ declare function isJsonSchemaUnion(input: unknown): input is JsonSchemaUnion;
121
+ /**
122
+ * Type guard for permissive unknown schemas.
123
+ */
124
+ declare function isJsonSchemaUnknown(input: unknown): input is JsonSchemaUnknown;
125
+ /**
126
+ * Type guard for `anyOf` composition schemas.
127
+ */
128
+ declare function isJsonSchemaAnyOf(input: unknown): input is JsonSchemaAnyOf;
129
+ /**
130
+ * Type guard for reference schemas.
131
+ */
132
+ declare function isJsonSchemaRef(input: unknown): input is JsonSchemaRef;
7
133
  /**
8
134
  * Type guard for Standard Schema V1 objects.
9
135
  *
@@ -27,17 +153,7 @@ declare function isValibotSchema(input: unknown): input is BaseSchema<any, any,
27
153
  * @param input - The value to check.
28
154
  * @returns True if the input is a JSON Schema type, false otherwise.
29
155
  */
30
- declare function isJsonSchema<T = unknown>(input: unknown): input is JsonSchema<T>;
31
- /**
32
- * Type guard for JSON Schema object forms.
33
- *
34
- * @remarks
35
- * This function checks if the input is a JSON Schema object type, which is defined as having a `type` property equal to "object" or having a `properties` object. This is used to determine if a given input conforms to the structure of a JSON Schema object definition.
36
- *
37
- * @param input - The value to check.
38
- * @returns True if the input is a JSON Schema object type, false otherwise.
39
- */
40
- declare function isJsonSchemaObject<T extends Record<string, any> = Record<string, any>>(input: unknown): input is JsonSchemaObject<T>;
156
+ declare function isJsonSchema(input: unknown): input is JsonSchema;
41
157
  /**
42
158
  * Type guard for JSON Schemas that only accept `null`.
43
159
  *
@@ -47,7 +163,7 @@ declare function isJsonSchemaObject<T extends Record<string, any> = Record<strin
47
163
  * @param input - The value to check.
48
164
  * @returns True if the input is a JSON Schema that only accepts `null`, false otherwise.
49
165
  */
50
- declare function isNullOnlyJsonSchema(input: unknown): input is JsonSchema<null>;
166
+ declare function isNullOnlyJsonSchema(input: unknown): input is JsonSchemaNull;
51
167
  /**
52
168
  * Type guard for untyped schema objects.
53
169
  *
@@ -74,8 +190,14 @@ declare function isUntypedInput(input: unknown): input is InputObject;
74
190
  * @param input - The value to check.
75
191
  * @returns True if the input is a Powerlines Schema object, false otherwise.
76
192
  */
77
- declare function isSchema<T = unknown>(input: unknown): input is Schema$1<T>;
78
- declare function isExtractedSchema<T = unknown>(input: unknown): input is ExtractedSchema<T>;
193
+ declare function isSchema(input: unknown): input is Schema$1;
194
+ /**
195
+ * Type guard for extracted schema objects that include source information.
196
+ *
197
+ * @param input - The value to check.
198
+ * @returns True if the input is a SchemaWithSource object, false otherwise.
199
+ */
200
+ declare function isSchemaWithSource(input: unknown): input is ExtractedSchema;
79
201
  //#endregion
80
- export { isExtractedSchema, isJsonSchema, isJsonSchemaObject, isNullOnlyJsonSchema, isSchema, isStandardSchema, isUntypedInput, isUntypedSchema, isValibotSchema };
202
+ export { isJsonSchema, isJsonSchemaAllOf, isJsonSchemaAny, isJsonSchemaAnyOf, isJsonSchemaArray, isJsonSchemaBigint, isJsonSchemaBoolean, isJsonSchemaDate, isJsonSchemaDecimal, isJsonSchemaEnum, isJsonSchemaInteger, isJsonSchemaKeywords, isJsonSchemaLiteral, isJsonSchemaMap, isJsonSchemaNativeEnum, isJsonSchemaNever, isJsonSchemaNull, isJsonSchemaNullable, isJsonSchemaNumber, isJsonSchemaObject, isJsonSchemaPrimitiveType, isJsonSchemaPrimitiveUnion, isJsonSchemaRecord, isJsonSchemaRef, isJsonSchemaSet, isJsonSchemaString, isJsonSchemaTuple, isJsonSchemaType, isJsonSchemaUndefined, isJsonSchemaUnion, isJsonSchemaUnknown, isNullOnlyJsonSchema, isSchema, isSchemaWithSource, isStandardSchema, isUntypedInput, isUntypedSchema, isValibotSchema };
81
203
  //# sourceMappingURL=type-checks.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"type-checks.d.cts","names":[],"sources":["../src/type-checks.ts"],"mappings":";;;;;;;;AAwHA;;;;iBAAgB,gBAAA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kB,KAAA,YAAiB,KAAA,IAAS,eAAe;;;;iBAgB3D,mBAAA,CACd,KAAA,YACC,KAAA,IAAS,iBAAiB;AApYG;AAyBhC;;AAzBgC,iBA2YhB,iBAAA,CAAkB,KAAA,YAAiB,KAAA,IAAS,eAAe;;;;iBAe3D,eAAA,CAAgB,KAAA,YAAiB,KAAA,IAAS,aAAa;;AAjYI;AAa3E;;;;iBAoYgB,gBAAA,CAAiB,KAAA,YAAiB,KAAA,IAAS,gBAAgB;;;;AApYF;AAoBzE;;iBAqYgB,eAAA,CACd,KAAA,YACC,KAAA,IAAS,UAAU;;;;;;AArYQ;AAmC9B;;;iBA4XgB,YAAA,CAAa,KAAA,YAAiB,KAAA,IAAS,UAAU;;;;;AA5XY;AA4B7E;;;;iBAsYgB,oBAAA,CAAqB,KAAA,YAAiB,KAAA,IAAS,cAAc;;;;AApYhD;AAO7B;;;;;iBA0YgB,eAAA,CAAgB,KAAA,YAAiB,KAAA,IAAS,MAAa;;;AAxY1C;AAO7B;;;;;;iBA4bgB,cAAA,CAAe,KAAA,YAAiB,KAAA,IAAS,WAAkB;;AA5bE;AAwC7E;;;;iBA0agB,QAAA,CAAS,KAAA,YAAiB,KAAA,IAAS,QAAM;;;;AA1aoB;AAyB7E;;iBAmagB,kBAAA,CAAmB,KAAA,YAAiB,KAAA,IAAS,eAAgB"}
@@ -1,9 +1,135 @@
1
- import { ExtractedSchema, JsonSchema, JsonSchemaObject, Schema as Schema$1 } from "./types.mjs";
1
+ import { ExtractedSchema, JsonSchema, JsonSchemaAllOf, JsonSchemaAny, JsonSchemaAnyOf, JsonSchemaArray, JsonSchemaBigint, JsonSchemaBoolean, JsonSchemaDate, JsonSchemaDecimal, JsonSchemaEnum, JsonSchemaInteger, JsonSchemaKeywords, JsonSchemaLiteral, JsonSchemaMap, JsonSchemaNativeEnum, JsonSchemaNever, JsonSchemaNull, JsonSchemaNullable, JsonSchemaNumber, JsonSchemaObject, JsonSchemaPrimitiveType, JsonSchemaPrimitiveUnion, JsonSchemaRecord, JsonSchemaRef, JsonSchemaSet, JsonSchemaString, JsonSchemaTuple, JsonSchemaType, JsonSchemaUndefined, JsonSchemaUnion, JsonSchemaUnknown, Schema as Schema$1 } from "./types.mjs";
2
2
  import { StandardSchemaV1 } from "@standard-schema/spec";
3
3
  import { InputObject, Schema } from "untyped";
4
4
  import { BaseSchema } from "valibot";
5
5
 
6
6
  //#region src/type-checks.d.ts
7
+ /**
8
+ * A helper type guard to check if a value is a JSON Schema primitive type.
9
+ *
10
+ * @param value - The value to check.
11
+ * @returns True if the value is a JSON Schema primitive type, false otherwise.
12
+ */
13
+ declare function isJsonSchemaPrimitiveType(value: unknown): value is JsonSchemaPrimitiveType;
14
+ /**
15
+ * A helper type guard to check if a value is a JSON Schema type.
16
+ *
17
+ * @param value - The value to check.
18
+ * @returns True if the value is a JSON Schema type, false otherwise.
19
+ */
20
+ declare function isJsonSchemaType(value: unknown): value is JsonSchemaType;
21
+ /**
22
+ * Type guard for shared JSON Schema keyword groups.
23
+ */
24
+ declare function isJsonSchemaKeywords(input: unknown): input is JsonSchemaKeywords;
25
+ /**
26
+ * Type guard for generic JSON Schema objects with optional `$ref`.
27
+ */
28
+ declare function isJsonSchemaAny(input: unknown): input is JsonSchemaAny;
29
+ /**
30
+ * Type guard for JSON Schema array types.
31
+ */
32
+ declare function isJsonSchemaArray(input: unknown): input is JsonSchemaArray;
33
+ /**
34
+ * Type guard for bigint-backed integer schemas.
35
+ */
36
+ declare function isJsonSchemaBigint(input: unknown): input is JsonSchemaBigint;
37
+ /**
38
+ * Type guard for boolean schemas.
39
+ */
40
+ declare function isJsonSchemaBoolean(input: unknown): input is JsonSchemaBoolean;
41
+ /**
42
+ * Type guard for date/time schemas.
43
+ */
44
+ declare function isJsonSchemaDate(input: unknown): input is JsonSchemaDate;
45
+ /**
46
+ * Type guard for enum-constrained schemas.
47
+ */
48
+ declare function isJsonSchemaEnum(input: unknown): input is JsonSchemaEnum;
49
+ /**
50
+ * Type guard for `allOf` composition schemas.
51
+ */
52
+ declare function isJsonSchemaAllOf(input: unknown): input is JsonSchemaAllOf;
53
+ /**
54
+ * Type guard for literal-value schemas.
55
+ */
56
+ declare function isJsonSchemaLiteral(input: unknown): input is JsonSchemaLiteral;
57
+ /**
58
+ * Type guard for map tuple-array schemas.
59
+ */
60
+ declare function isJsonSchemaMap(input: unknown): input is JsonSchemaMap;
61
+ /**
62
+ * Type guard for native enum schemas.
63
+ */
64
+ declare function isJsonSchemaNativeEnum(input: unknown): input is JsonSchemaNativeEnum;
65
+ /**
66
+ * Type guard for impossible/never schemas.
67
+ */
68
+ declare function isJsonSchemaNever(input: unknown): input is JsonSchemaNever;
69
+ /**
70
+ * Type guard for `null` schemas.
71
+ */
72
+ declare function isJsonSchemaNull(input: unknown): input is JsonSchemaNull;
73
+ /**
74
+ * Type guard for nullable schema unions.
75
+ */
76
+ declare function isJsonSchemaNullable(input: unknown): input is JsonSchemaNullable;
77
+ /**
78
+ * Type guard for numeric schemas.
79
+ */
80
+ declare function isJsonSchemaNumber(input: unknown): input is JsonSchemaNumber;
81
+ /**
82
+ * Type guard for integer schemas.
83
+ */
84
+ declare function isJsonSchemaInteger(input: unknown): input is JsonSchemaInteger;
85
+ /**
86
+ * Type guard for decimal schemas.
87
+ */
88
+ declare function isJsonSchemaDecimal(input: unknown): input is JsonSchemaDecimal;
89
+ /**
90
+ * Type guard for object schemas.
91
+ */
92
+ declare function isJsonSchemaObject(input: unknown): input is JsonSchemaObject;
93
+ /**
94
+ * Type guard for string schemas.
95
+ */
96
+ declare function isJsonSchemaString(input: unknown): input is JsonSchemaString;
97
+ /**
98
+ * Type guard for set-like array schemas.
99
+ */
100
+ declare function isJsonSchemaSet(input: unknown): input is JsonSchemaSet;
101
+ /**
102
+ * Type guard for record schemas.
103
+ */
104
+ declare function isJsonSchemaRecord(input: unknown): input is JsonSchemaRecord;
105
+ /**
106
+ * Type guard for tuple schemas.
107
+ */
108
+ declare function isJsonSchemaTuple(input: unknown): input is JsonSchemaTuple;
109
+ /**
110
+ * Type guard for undefined-representing schemas.
111
+ */
112
+ declare function isJsonSchemaUndefined(input: unknown): input is JsonSchemaUndefined;
113
+ /**
114
+ * Type guard for primitive-union schema variants.
115
+ */
116
+ declare function isJsonSchemaPrimitiveUnion(input: unknown): input is JsonSchemaPrimitiveUnion;
117
+ /**
118
+ * Type guard for union schemas.
119
+ */
120
+ declare function isJsonSchemaUnion(input: unknown): input is JsonSchemaUnion;
121
+ /**
122
+ * Type guard for permissive unknown schemas.
123
+ */
124
+ declare function isJsonSchemaUnknown(input: unknown): input is JsonSchemaUnknown;
125
+ /**
126
+ * Type guard for `anyOf` composition schemas.
127
+ */
128
+ declare function isJsonSchemaAnyOf(input: unknown): input is JsonSchemaAnyOf;
129
+ /**
130
+ * Type guard for reference schemas.
131
+ */
132
+ declare function isJsonSchemaRef(input: unknown): input is JsonSchemaRef;
7
133
  /**
8
134
  * Type guard for Standard Schema V1 objects.
9
135
  *
@@ -27,17 +153,7 @@ declare function isValibotSchema(input: unknown): input is BaseSchema<any, any,
27
153
  * @param input - The value to check.
28
154
  * @returns True if the input is a JSON Schema type, false otherwise.
29
155
  */
30
- declare function isJsonSchema<T = unknown>(input: unknown): input is JsonSchema<T>;
31
- /**
32
- * Type guard for JSON Schema object forms.
33
- *
34
- * @remarks
35
- * This function checks if the input is a JSON Schema object type, which is defined as having a `type` property equal to "object" or having a `properties` object. This is used to determine if a given input conforms to the structure of a JSON Schema object definition.
36
- *
37
- * @param input - The value to check.
38
- * @returns True if the input is a JSON Schema object type, false otherwise.
39
- */
40
- declare function isJsonSchemaObject<T extends Record<string, any> = Record<string, any>>(input: unknown): input is JsonSchemaObject<T>;
156
+ declare function isJsonSchema(input: unknown): input is JsonSchema;
41
157
  /**
42
158
  * Type guard for JSON Schemas that only accept `null`.
43
159
  *
@@ -47,7 +163,7 @@ declare function isJsonSchemaObject<T extends Record<string, any> = Record<strin
47
163
  * @param input - The value to check.
48
164
  * @returns True if the input is a JSON Schema that only accepts `null`, false otherwise.
49
165
  */
50
- declare function isNullOnlyJsonSchema(input: unknown): input is JsonSchema<null>;
166
+ declare function isNullOnlyJsonSchema(input: unknown): input is JsonSchemaNull;
51
167
  /**
52
168
  * Type guard for untyped schema objects.
53
169
  *
@@ -74,8 +190,14 @@ declare function isUntypedInput(input: unknown): input is InputObject;
74
190
  * @param input - The value to check.
75
191
  * @returns True if the input is a Powerlines Schema object, false otherwise.
76
192
  */
77
- declare function isSchema<T = unknown>(input: unknown): input is Schema$1<T>;
78
- declare function isExtractedSchema<T = unknown>(input: unknown): input is ExtractedSchema<T>;
193
+ declare function isSchema(input: unknown): input is Schema$1;
194
+ /**
195
+ * Type guard for extracted schema objects that include source information.
196
+ *
197
+ * @param input - The value to check.
198
+ * @returns True if the input is a SchemaWithSource object, false otherwise.
199
+ */
200
+ declare function isSchemaWithSource(input: unknown): input is ExtractedSchema;
79
201
  //#endregion
80
- export { isExtractedSchema, isJsonSchema, isJsonSchemaObject, isNullOnlyJsonSchema, isSchema, isStandardSchema, isUntypedInput, isUntypedSchema, isValibotSchema };
202
+ export { isJsonSchema, isJsonSchemaAllOf, isJsonSchemaAny, isJsonSchemaAnyOf, isJsonSchemaArray, isJsonSchemaBigint, isJsonSchemaBoolean, isJsonSchemaDate, isJsonSchemaDecimal, isJsonSchemaEnum, isJsonSchemaInteger, isJsonSchemaKeywords, isJsonSchemaLiteral, isJsonSchemaMap, isJsonSchemaNativeEnum, isJsonSchemaNever, isJsonSchemaNull, isJsonSchemaNullable, isJsonSchemaNumber, isJsonSchemaObject, isJsonSchemaPrimitiveType, isJsonSchemaPrimitiveUnion, isJsonSchemaRecord, isJsonSchemaRef, isJsonSchemaSet, isJsonSchemaString, isJsonSchemaTuple, isJsonSchemaType, isJsonSchemaUndefined, isJsonSchemaUnion, isJsonSchemaUnknown, isNullOnlyJsonSchema, isSchema, isSchemaWithSource, isStandardSchema, isUntypedInput, isUntypedSchema, isValibotSchema };
81
203
  //# sourceMappingURL=type-checks.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"type-checks.d.mts","names":[],"sources":["../src/type-checks.ts"],"mappings":";;;;;;;;AAwHA;;;;iBAAgB,gBAAA,CAAiB,KAAA,YAAiB,KAAA,IAAS,gBAAgB;;;;AAAA;AAqB3E;;iBAAgB,eAAA,CACd,KAAA,YACC,KAAA,IAAS,UAAU;;;;;;AAAA;AA0BtB;;;iBAAgB,YAAA,aAAA,CACd,KAAA,YACC,KAAA,IAAS,UAAU,CAAC,CAAA;;;;;;;AAAC;AA4FxB;;iBAAgB,kBAAA,WACJ,MAAA,gBAAsB,MAAA,cAAA,CAChC,KAAA,YAAiB,KAAA,IAAS,gBAAA,CAAiB,CAAA;;;;;;;;;;iBAgB7B,oBAAA,CACd,KAAA,YACC,KAAA,IAAS,UAAU;;;;;AAlBwB;AAgB9C;;;;iBAegB,eAAA,CAAgB,KAAA,YAAiB,KAAA,IAAS,MAAa;;;;AAbjD;AAatB;;;;;iBA2DgB,cAAA,CAAe,KAAA,YAAiB,KAAA,IAAS,WAAkB;;;AA3DJ;AA2DvE;;;iBAsBgB,QAAA,aAAA,CAAsB,KAAA,YAAiB,KAAA,IAAS,QAAM,CAAC,CAAA;AAAA,iBAYvD,iBAAA,aAAA,CACd,KAAA,YACC,KAAA,IAAS,eAAe,CAAC,CAAA"}
1
+ {"version":3,"file":"type-checks.d.mts","names":[],"sources":["../src/type-checks.ts"],"mappings":";;;;;;;;AAkGA;;;;iBAAgB,yBAAA,CACd,KAAA,YACC,KAAA,IAAS,uBAAuB;;;;AAAA;AAanC;;iBAAgB,gBAAA,CAAiB,KAAA,YAAiB,KAAA,IAAS,cAAc;;;;iBAkLzD,oBAAA,CACd,KAAA,YACC,KAAA,IAAS,kBAAkB;;AApL2C;AAkLzE;iBAagB,eAAA,CAAgB,KAAA,YAAiB,KAAA,IAAS,aAAa;;;;iBAavD,iBAAA,CAAkB,KAAA,YAAiB,KAAA,IAAS,eAAe;;;AAxB7C;iBAoDd,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