@content-collections/core 0.11.0 → 0.12.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/index.d.ts CHANGED
@@ -1,325 +1,1006 @@
1
- import { StandardSchemaV1 } from '@standard-schema/spec';
2
- import z__default, { ZodRawShape, z as z$1, ZodObject } from 'zod';
3
- export * from 'zod';
1
+ import { StandardSchemaV1 } from "@standard-schema/spec";
4
2
 
3
+ //#region src/cache.d.ts
5
4
  type Options$2 = {
6
- key: string;
5
+ key: string;
7
6
  };
8
7
  type CacheFn = <TInput, TOutput>(input: TInput, compute: (input: TInput) => Promise<TOutput> | TOutput, options?: Options$2) => Promise<TOutput>;
9
-
10
- declare const importSymbol: unique symbol;
11
- type Import<T> = {
12
- [importSymbol]: true;
13
- path: string;
14
- name?: string;
15
- };
16
- type GetTypeOfImport<T> = T extends Import<infer U> ? U : never;
17
- declare function createDefaultImport<T>(path: string): Import<T>;
18
- declare function createNamedImport<T>(name: string, path: string): Import<T>;
19
-
8
+ //#endregion
9
+ //#region ../../node_modules/.pnpm/zod@4.1.11/node_modules/zod/v4/core/standard-schema.d.cts
10
+ /** The Standard Schema interface. */
11
+ interface StandardSchemaV1$1<Input = unknown, Output = Input> {
12
+ /** The Standard Schema properties. */
13
+ readonly "~standard": StandardSchemaV1$1.Props<Input, Output>;
14
+ }
15
+ declare namespace StandardSchemaV1$1 {
16
+ /** The Standard Schema properties interface. */
17
+ interface Props<Input = unknown, Output = Input> {
18
+ /** The version number of the standard. */
19
+ readonly version: 1;
20
+ /** The vendor name of the schema library. */
21
+ readonly vendor: string;
22
+ /** Validates unknown input values. */
23
+ readonly validate: (value: unknown) => Result<Output> | Promise<Result<Output>>;
24
+ /** Inferred types associated with the schema. */
25
+ readonly types?: Types<Input, Output> | undefined;
26
+ }
27
+ /** The result interface of the validate function. */
28
+ type Result<Output> = SuccessResult<Output> | FailureResult;
29
+ /** The result interface if validation succeeds. */
30
+ interface SuccessResult<Output> {
31
+ /** The typed output value. */
32
+ readonly value: Output;
33
+ /** The non-existent issues. */
34
+ readonly issues?: undefined;
35
+ }
36
+ /** The result interface if validation fails. */
37
+ interface FailureResult {
38
+ /** The issues of failed validation. */
39
+ readonly issues: ReadonlyArray<Issue>;
40
+ }
41
+ /** The issue interface of the failure output. */
42
+ interface Issue {
43
+ /** The error message of the issue. */
44
+ readonly message: string;
45
+ /** The path of the issue, if any. */
46
+ readonly path?: ReadonlyArray<PropertyKey | PathSegment> | undefined;
47
+ }
48
+ /** The path segment interface of the issue. */
49
+ interface PathSegment {
50
+ /** The key representing a path segment. */
51
+ readonly key: PropertyKey;
52
+ }
53
+ /** The Standard Schema types interface. */
54
+ interface Types<Input = unknown, Output = Input> {
55
+ /** The input type of the schema. */
56
+ readonly input: Input;
57
+ /** The output type of the schema. */
58
+ readonly output: Output;
59
+ }
60
+ /** Infers the input type of a Standard Schema. */
61
+ type InferInput<Schema$1 extends StandardSchemaV1$1> = NonNullable<Schema$1["~standard"]["types"]>["input"];
62
+ /** Infers the output type of a Standard Schema. */
63
+ type InferOutput<Schema$1 extends StandardSchemaV1$1> = NonNullable<Schema$1["~standard"]["types"]>["output"];
64
+ }
65
+ //#endregion
66
+ //#region ../../node_modules/.pnpm/zod@4.1.11/node_modules/zod/v4/core/util.d.cts
67
+ type IsAny<T$1> = 0 extends 1 & T$1 ? true : false;
68
+ type Omit$1<T$1, K$1 extends keyof T$1> = Pick<T$1, Exclude<keyof T$1, K$1>>;
69
+ type MakePartial<T$1, K$1 extends keyof T$1> = Omit$1<T$1, K$1> & InexactPartial<Pick<T$1, K$1>>;
70
+ type LoosePartial<T$1 extends object> = InexactPartial<T$1> & {
71
+ [k: string]: unknown;
72
+ };
73
+ type InexactPartial<T$1> = { [P in keyof T$1]?: T$1[P] | undefined };
74
+ type Identity<T$1> = T$1;
75
+ type Flatten<T$1> = Identity<{ [k in keyof T$1]: T$1[k] }>;
76
+ type Prettify$1<T$1> = { [K in keyof T$1]: T$1[K] } & {};
77
+ type AnyFunc = (...args: any[]) => any;
78
+ type MaybeAsync<T$1> = T$1 | Promise<T$1>;
79
+ type Literal$1 = string | number | bigint | boolean | null | undefined;
80
+ type Primitive = string | number | symbol | bigint | boolean | null | undefined;
81
+ type SafeParseResult<T$1> = SafeParseSuccess<T$1> | SafeParseError<T$1>;
82
+ type SafeParseSuccess<T$1> = {
83
+ success: true;
84
+ data: T$1;
85
+ error?: never;
86
+ };
87
+ type SafeParseError<T$1> = {
88
+ success: false;
89
+ data?: never;
90
+ error: $ZodError<T$1>;
91
+ };
92
+ type PropValues = Record<string, Set<Primitive>>;
93
+ type PrimitiveSet = Set<Primitive>;
94
+ declare abstract class Class {
95
+ constructor(..._args: any[]);
96
+ }
97
+ //#endregion
98
+ //#region ../../node_modules/.pnpm/zod@4.1.11/node_modules/zod/v4/core/versions.d.cts
99
+ declare const version: {
100
+ readonly major: 4;
101
+ readonly minor: 1;
102
+ readonly patch: number;
103
+ };
104
+ //#endregion
105
+ //#region ../../node_modules/.pnpm/zod@4.1.11/node_modules/zod/v4/core/schemas.d.cts
106
+ interface ParseContext<T$1 extends $ZodIssueBase = never> {
107
+ /** Customize error messages. */
108
+ readonly error?: $ZodErrorMap<T$1>;
109
+ /** Include the `input` field in issue objects. Default `false`. */
110
+ readonly reportInput?: boolean;
111
+ /** Skip eval-based fast path. Default `false`. */
112
+ readonly jitless?: boolean;
113
+ }
114
+ /** @internal */
115
+ interface ParseContextInternal<T$1 extends $ZodIssueBase = never> extends ParseContext<T$1> {
116
+ readonly async?: boolean | undefined;
117
+ readonly direction?: "forward" | "backward";
118
+ readonly skipChecks?: boolean;
119
+ }
120
+ interface ParsePayload<T$1 = unknown> {
121
+ value: T$1;
122
+ issues: $ZodRawIssue[];
123
+ /** A may to mark a whole payload as aborted. Used in codecs/pipes. */
124
+ aborted?: boolean;
125
+ }
126
+ type CheckFn<T$1> = (input: ParsePayload<T$1>) => MaybeAsync<void>;
127
+ interface $ZodTypeDef {
128
+ type: "string" | "number" | "int" | "boolean" | "bigint" | "symbol" | "null" | "undefined" | "void" | "never" | "any" | "unknown" | "date" | "object" | "record" | "file" | "array" | "tuple" | "union" | "intersection" | "map" | "set" | "enum" | "literal" | "nullable" | "optional" | "nonoptional" | "success" | "transform" | "default" | "prefault" | "catch" | "nan" | "pipe" | "readonly" | "template_literal" | "promise" | "lazy" | "function" | "custom";
129
+ error?: $ZodErrorMap<never> | undefined;
130
+ checks?: $ZodCheck<never>[];
131
+ }
132
+ interface _$ZodTypeInternals {
133
+ /** The `@zod/core` version of this schema */
134
+ version: typeof version;
135
+ /** Schema definition. */
136
+ def: $ZodTypeDef;
137
+ /** @internal Randomly generated ID for this schema. */
138
+ /** @internal List of deferred initializers. */
139
+ deferred: AnyFunc[] | undefined;
140
+ /** @internal Parses input and runs all checks (refinements). */
141
+ run(payload: ParsePayload<any>, ctx: ParseContextInternal): MaybeAsync<ParsePayload>;
142
+ /** @internal Parses input, doesn't run checks. */
143
+ parse(payload: ParsePayload<any>, ctx: ParseContextInternal): MaybeAsync<ParsePayload>;
144
+ /** @internal Stores identifiers for the set of traits implemented by this schema. */
145
+ traits: Set<string>;
146
+ /** @internal Indicates that a schema output type should be considered optional inside objects.
147
+ * @default Required
148
+ */
149
+ /** @internal */
150
+ optin?: "optional" | undefined;
151
+ /** @internal */
152
+ optout?: "optional" | undefined;
153
+ /** @internal The set of literal values that will pass validation. Must be an exhaustive set. Used to determine optionality in z.record().
154
+ *
155
+ * Defined on: enum, const, literal, null, undefined
156
+ * Passthrough: optional, nullable, branded, default, catch, pipe
157
+ * Todo: unions?
158
+ */
159
+ values?: PrimitiveSet | undefined;
160
+ /** Default value bubbled up from */
161
+ /** @internal A set of literal discriminators used for the fast path in discriminated unions. */
162
+ propValues?: PropValues | undefined;
163
+ /** @internal This flag indicates that a schema validation can be represented with a regular expression. Used to determine allowable schemas in z.templateLiteral(). */
164
+ pattern: RegExp | undefined;
165
+ /** @internal The constructor function of this schema. */
166
+ constr: new (def: any) => $ZodType;
167
+ /** @internal A catchall object for bag metadata related to this schema. Commonly modified by checks using `onattach`. */
168
+ bag: Record<string, unknown>;
169
+ /** @internal The set of issues this schema might throw during type checking. */
170
+ isst: $ZodIssueBase;
171
+ /** An optional method used to override `toJSONSchema` logic. */
172
+ toJSONSchema?: () => unknown;
173
+ /** @internal The parent of this schema. Only set during certain clone operations. */
174
+ parent?: $ZodType | undefined;
175
+ }
176
+ /** @internal */
177
+ interface $ZodTypeInternals<out O = unknown, out I = unknown> extends _$ZodTypeInternals {
178
+ /** @internal The inferred output type */
179
+ output: O;
180
+ /** @internal The inferred input type */
181
+ input: I;
182
+ }
183
+ type $ZodStandardSchema<T$1> = StandardSchemaV1$1.Props<input<T$1>, output<T$1>>;
184
+ type SomeType$1 = {
185
+ _zod: _$ZodTypeInternals;
186
+ };
187
+ interface $ZodType<O = unknown, I = unknown, Internals extends $ZodTypeInternals<O, I> = $ZodTypeInternals<O, I>> {
188
+ _zod: Internals;
189
+ "~standard": $ZodStandardSchema<this>;
190
+ }
191
+ interface _$ZodType<T$1 extends $ZodTypeInternals = $ZodTypeInternals> extends $ZodType<T$1["output"], T$1["input"], T$1> {}
192
+ declare const $ZodType: $constructor<$ZodType>;
193
+ interface $ZodStringDef extends $ZodTypeDef {
194
+ type: "string";
195
+ coerce?: boolean;
196
+ checks?: $ZodCheck<string>[];
197
+ }
198
+ interface $ZodStringInternals<Input> extends $ZodTypeInternals<string, Input> {
199
+ def: $ZodStringDef;
200
+ /** @deprecated Internal API, use with caution (not deprecated) */
201
+ pattern: RegExp;
202
+ /** @deprecated Internal API, use with caution (not deprecated) */
203
+ isst: $ZodIssueInvalidType;
204
+ bag: LoosePartial<{
205
+ minimum: number;
206
+ maximum: number;
207
+ patterns: Set<RegExp>;
208
+ format: string;
209
+ contentEncoding: string;
210
+ }>;
211
+ }
212
+ interface $ZodString<Input = unknown> extends _$ZodType<$ZodStringInternals<Input>> {}
213
+ declare const $ZodString: $constructor<$ZodString>;
214
+ interface $ZodNumberDef extends $ZodTypeDef {
215
+ type: "number";
216
+ coerce?: boolean;
217
+ }
218
+ interface $ZodNumberInternals<Input = unknown> extends $ZodTypeInternals<number, Input> {
219
+ def: $ZodNumberDef;
220
+ /** @deprecated Internal API, use with caution (not deprecated) */
221
+ pattern: RegExp;
222
+ /** @deprecated Internal API, use with caution (not deprecated) */
223
+ isst: $ZodIssueInvalidType;
224
+ bag: LoosePartial<{
225
+ minimum: number;
226
+ maximum: number;
227
+ exclusiveMinimum: number;
228
+ exclusiveMaximum: number;
229
+ format: string;
230
+ pattern: RegExp;
231
+ }>;
232
+ }
233
+ interface $ZodNumber<Input = unknown> extends $ZodType {
234
+ _zod: $ZodNumberInternals<Input>;
235
+ }
236
+ declare const $ZodNumber: $constructor<$ZodNumber>;
237
+ interface $ZodBooleanDef extends $ZodTypeDef {
238
+ type: "boolean";
239
+ coerce?: boolean;
240
+ checks?: $ZodCheck<boolean>[];
241
+ }
242
+ interface $ZodBooleanInternals<T$1 = unknown> extends $ZodTypeInternals<boolean, T$1> {
243
+ pattern: RegExp;
244
+ def: $ZodBooleanDef;
245
+ isst: $ZodIssueInvalidType;
246
+ }
247
+ interface $ZodBigIntDef extends $ZodTypeDef {
248
+ type: "bigint";
249
+ coerce?: boolean;
250
+ }
251
+ interface $ZodBigIntInternals<T$1 = unknown> extends $ZodTypeInternals<bigint, T$1> {
252
+ pattern: RegExp;
253
+ /** @internal Internal API, use with caution */
254
+ def: $ZodBigIntDef;
255
+ isst: $ZodIssueInvalidType;
256
+ bag: LoosePartial<{
257
+ minimum: bigint;
258
+ maximum: bigint;
259
+ format: string;
260
+ }>;
261
+ }
262
+ interface $ZodBigInt<T$1 = unknown> extends $ZodType {
263
+ _zod: $ZodBigIntInternals<T$1>;
264
+ }
265
+ declare const $ZodBigInt: $constructor<$ZodBigInt>;
266
+ interface $ZodUndefinedDef extends $ZodTypeDef {
267
+ type: "undefined";
268
+ }
269
+ interface $ZodUndefinedInternals extends $ZodTypeInternals<undefined, undefined> {
270
+ pattern: RegExp;
271
+ def: $ZodUndefinedDef;
272
+ values: PrimitiveSet;
273
+ isst: $ZodIssueInvalidType;
274
+ }
275
+ interface $ZodNullDef extends $ZodTypeDef {
276
+ type: "null";
277
+ }
278
+ interface $ZodNullInternals extends $ZodTypeInternals<null, null> {
279
+ pattern: RegExp;
280
+ def: $ZodNullDef;
281
+ values: PrimitiveSet;
282
+ isst: $ZodIssueInvalidType;
283
+ }
284
+ interface $ZodUnknownDef extends $ZodTypeDef {
285
+ type: "unknown";
286
+ }
287
+ interface $ZodUnknownInternals extends $ZodTypeInternals<unknown, unknown> {
288
+ def: $ZodUnknownDef;
289
+ isst: never;
290
+ }
291
+ interface $ZodDateDef extends $ZodTypeDef {
292
+ type: "date";
293
+ coerce?: boolean;
294
+ }
295
+ interface $ZodDateInternals<T$1 = unknown> extends $ZodTypeInternals<Date, T$1> {
296
+ def: $ZodDateDef;
297
+ isst: $ZodIssueInvalidType;
298
+ bag: LoosePartial<{
299
+ minimum: Date;
300
+ maximum: Date;
301
+ format: string;
302
+ }>;
303
+ }
304
+ type OptionalOutSchema = {
305
+ _zod: {
306
+ optout: "optional";
307
+ };
308
+ };
309
+ type OptionalInSchema = {
310
+ _zod: {
311
+ optin: "optional";
312
+ };
313
+ };
314
+ type $InferObjectOutput<T$1 extends $ZodLooseShape, Extra extends Record<string, unknown>> = string extends keyof T$1 ? IsAny<T$1[keyof T$1]> extends true ? Record<string, unknown> : Record<string, output<T$1[keyof T$1]>> : keyof (T$1 & Extra) extends never ? Record<string, never> : Prettify$1<{ -readonly [k in keyof T$1 as T$1[k] extends OptionalOutSchema ? never : k]: T$1[k]["_zod"]["output"] } & { -readonly [k in keyof T$1 as T$1[k] extends OptionalOutSchema ? k : never]?: T$1[k]["_zod"]["output"] } & Extra>;
315
+ type $InferObjectInput<T$1 extends $ZodLooseShape, Extra extends Record<string, unknown>> = string extends keyof T$1 ? IsAny<T$1[keyof T$1]> extends true ? Record<string, unknown> : Record<string, input<T$1[keyof T$1]>> : keyof (T$1 & Extra) extends never ? Record<string, never> : Prettify$1<{ -readonly [k in keyof T$1 as T$1[k] extends OptionalInSchema ? never : k]: T$1[k]["_zod"]["input"] } & { -readonly [k in keyof T$1 as T$1[k] extends OptionalInSchema ? k : never]?: T$1[k]["_zod"]["input"] } & Extra>;
316
+ type $ZodObjectConfig = {
317
+ out: Record<string, unknown>;
318
+ in: Record<string, unknown>;
319
+ };
320
+ type $strip = {
321
+ out: {};
322
+ in: {};
323
+ };
324
+ type $ZodShape = Readonly<{
325
+ [k: string]: $ZodType;
326
+ }>;
327
+ interface $ZodObjectDef<Shape extends $ZodShape = $ZodShape> extends $ZodTypeDef {
328
+ type: "object";
329
+ shape: Shape;
330
+ catchall?: $ZodType | undefined;
331
+ }
332
+ interface $ZodObjectInternals< /** @ts-ignore Cast variance */
333
+ out Shape extends $ZodShape = $ZodShape, out Config extends $ZodObjectConfig = $ZodObjectConfig> extends _$ZodTypeInternals {
334
+ def: $ZodObjectDef<Shape>;
335
+ config: Config;
336
+ isst: $ZodIssueInvalidType | $ZodIssueUnrecognizedKeys;
337
+ propValues: PropValues;
338
+ output: $InferObjectOutput<Shape, Config["out"]>;
339
+ input: $InferObjectInput<Shape, Config["in"]>;
340
+ optin?: "optional" | undefined;
341
+ optout?: "optional" | undefined;
342
+ }
343
+ type $ZodLooseShape = Record<string, any>;
344
+ interface $ZodObject< /** @ts-ignore Cast variance */
345
+ out Shape extends Readonly<$ZodShape> = Readonly<$ZodShape>, out Params extends $ZodObjectConfig = $ZodObjectConfig> extends $ZodType<any, any, $ZodObjectInternals<Shape, Params>> {
346
+ "~standard": $ZodStandardSchema<this>;
347
+ }
348
+ declare const $ZodObject: $constructor<$ZodObject>;
349
+ type $InferUnionOutput<T$1 extends SomeType$1> = T$1 extends any ? output<T$1> : never;
350
+ type $InferUnionInput<T$1 extends SomeType$1> = T$1 extends any ? input<T$1> : never;
351
+ interface $ZodUnionDef<Options$3 extends readonly SomeType$1[] = readonly $ZodType[]> extends $ZodTypeDef {
352
+ type: "union";
353
+ options: Options$3;
354
+ }
355
+ type IsOptionalIn<T$1 extends SomeType$1> = T$1 extends OptionalInSchema ? true : false;
356
+ type IsOptionalOut<T$1 extends SomeType$1> = T$1 extends OptionalOutSchema ? true : false;
357
+ interface $ZodUnionInternals<T$1 extends readonly SomeType$1[] = readonly $ZodType[]> extends _$ZodTypeInternals {
358
+ def: $ZodUnionDef<T$1>;
359
+ isst: $ZodIssueInvalidUnion;
360
+ pattern: T$1[number]["_zod"]["pattern"];
361
+ values: T$1[number]["_zod"]["values"];
362
+ output: $InferUnionOutput<T$1[number]>;
363
+ input: $InferUnionInput<T$1[number]>;
364
+ optin: IsOptionalIn<T$1[number]> extends false ? "optional" | undefined : "optional";
365
+ optout: IsOptionalOut<T$1[number]> extends false ? "optional" | undefined : "optional";
366
+ }
367
+ type $ZodRecordKey = $ZodType<string | number | symbol, string | number | symbol>;
368
+ interface $ZodRecordDef<Key extends $ZodRecordKey = $ZodRecordKey, Value extends SomeType$1 = $ZodType> extends $ZodTypeDef {
369
+ type: "record";
370
+ keyType: Key;
371
+ valueType: Value;
372
+ }
373
+ type $InferZodRecordOutput<Key extends $ZodRecordKey = $ZodRecordKey, Value extends SomeType$1 = $ZodType> = Key extends $partial ? Partial<Record<output<Key>, output<Value>>> : Record<output<Key>, output<Value>>;
374
+ type $InferZodRecordInput<Key extends $ZodRecordKey = $ZodRecordKey, Value extends SomeType$1 = $ZodType> = Key extends $partial ? Partial<Record<input<Key>, input<Value>>> : Record<input<Key>, input<Value>>;
375
+ interface $ZodRecordInternals<Key extends $ZodRecordKey = $ZodRecordKey, Value extends SomeType$1 = $ZodType> extends $ZodTypeInternals<$InferZodRecordOutput<Key, Value>, $InferZodRecordInput<Key, Value>> {
376
+ def: $ZodRecordDef<Key, Value>;
377
+ isst: $ZodIssueInvalidType | $ZodIssueInvalidKey<Record<PropertyKey, unknown>>;
378
+ optin?: "optional" | undefined;
379
+ optout?: "optional" | undefined;
380
+ }
381
+ type $partial = {
382
+ "~~partial": true;
383
+ };
384
+ interface $ZodMapDef<Key extends SomeType$1 = $ZodType, Value extends SomeType$1 = $ZodType> extends $ZodTypeDef {
385
+ type: "map";
386
+ keyType: Key;
387
+ valueType: Value;
388
+ }
389
+ interface $ZodMapInternals<Key extends SomeType$1 = $ZodType, Value extends SomeType$1 = $ZodType> extends $ZodTypeInternals<Map<output<Key>, output<Value>>, Map<input<Key>, input<Value>>> {
390
+ def: $ZodMapDef<Key, Value>;
391
+ isst: $ZodIssueInvalidType | $ZodIssueInvalidKey | $ZodIssueInvalidElement<unknown>;
392
+ optin?: "optional" | undefined;
393
+ optout?: "optional" | undefined;
394
+ }
395
+ interface $ZodSetDef<T$1 extends SomeType$1 = $ZodType> extends $ZodTypeDef {
396
+ type: "set";
397
+ valueType: T$1;
398
+ }
399
+ interface $ZodSetInternals<T$1 extends SomeType$1 = $ZodType> extends $ZodTypeInternals<Set<output<T$1>>, Set<input<T$1>>> {
400
+ def: $ZodSetDef<T$1>;
401
+ isst: $ZodIssueInvalidType;
402
+ optin?: "optional" | undefined;
403
+ optout?: "optional" | undefined;
404
+ }
405
+ interface $ZodLiteralDef<T$1 extends Literal$1> extends $ZodTypeDef {
406
+ type: "literal";
407
+ values: T$1[];
408
+ }
409
+ interface $ZodLiteralInternals<T$1 extends Literal$1 = Literal$1> extends $ZodTypeInternals<T$1, T$1> {
410
+ def: $ZodLiteralDef<T$1>;
411
+ values: Set<T$1>;
412
+ pattern: RegExp;
413
+ isst: $ZodIssueInvalidValue;
414
+ }
415
+ interface $ZodOptionalDef<T$1 extends SomeType$1 = $ZodType> extends $ZodTypeDef {
416
+ type: "optional";
417
+ innerType: T$1;
418
+ }
419
+ interface $ZodOptionalInternals<T$1 extends SomeType$1 = $ZodType> extends $ZodTypeInternals<output<T$1> | undefined, input<T$1> | undefined> {
420
+ def: $ZodOptionalDef<T$1>;
421
+ optin: "optional";
422
+ optout: "optional";
423
+ isst: never;
424
+ values: T$1["_zod"]["values"];
425
+ pattern: T$1["_zod"]["pattern"];
426
+ }
427
+ interface $ZodOptional<T$1 extends SomeType$1 = $ZodType> extends $ZodType {
428
+ _zod: $ZodOptionalInternals<T$1>;
429
+ }
430
+ declare const $ZodOptional: $constructor<$ZodOptional>;
431
+ //#endregion
432
+ //#region ../../node_modules/.pnpm/zod@4.1.11/node_modules/zod/v4/core/checks.d.cts
433
+ interface $ZodCheckDef {
434
+ check: string;
435
+ error?: $ZodErrorMap<never> | undefined;
436
+ /** If true, no later checks will be executed if this check fails. Default `false`. */
437
+ abort?: boolean | undefined;
438
+ /** If provided, this check will only be executed if the function returns `true`. Defaults to `payload => z.util.isAborted(payload)`. */
439
+ when?: ((payload: ParsePayload) => boolean) | undefined;
440
+ }
441
+ interface $ZodCheckInternals<T$1> {
442
+ def: $ZodCheckDef;
443
+ /** The set of issues this check might throw. */
444
+ issc?: $ZodIssueBase;
445
+ check(payload: ParsePayload<T$1>): MaybeAsync<void>;
446
+ onattach: ((schema: $ZodType) => void)[];
447
+ }
448
+ interface $ZodCheck<in T$1 = never> {
449
+ _zod: $ZodCheckInternals<T$1>;
450
+ }
451
+ declare const $ZodCheck: $constructor<$ZodCheck<any>>;
452
+ type $ZodStringFormats = "email" | "url" | "emoji" | "uuid" | "guid" | "nanoid" | "cuid" | "cuid2" | "ulid" | "xid" | "ksuid" | "datetime" | "date" | "time" | "duration" | "ipv4" | "ipv6" | "cidrv4" | "cidrv6" | "base64" | "base64url" | "json_string" | "e164" | "lowercase" | "uppercase" | "regex" | "jwt" | "starts_with" | "ends_with" | "includes";
453
+ //#endregion
454
+ //#region ../../node_modules/.pnpm/zod@4.1.11/node_modules/zod/v4/core/errors.d.cts
455
+ interface $ZodIssueBase {
456
+ readonly code?: string;
457
+ readonly input?: unknown;
458
+ readonly path: PropertyKey[];
459
+ readonly message: string;
460
+ }
461
+ interface $ZodIssueInvalidType<Input = unknown> extends $ZodIssueBase {
462
+ readonly code: "invalid_type";
463
+ readonly expected: $ZodType["_zod"]["def"]["type"];
464
+ readonly input?: Input;
465
+ }
466
+ interface $ZodIssueTooBig<Input = unknown> extends $ZodIssueBase {
467
+ readonly code: "too_big";
468
+ readonly origin: "number" | "int" | "bigint" | "date" | "string" | "array" | "set" | "file" | (string & {});
469
+ readonly maximum: number | bigint;
470
+ readonly inclusive?: boolean;
471
+ readonly exact?: boolean;
472
+ readonly input?: Input;
473
+ }
474
+ interface $ZodIssueTooSmall<Input = unknown> extends $ZodIssueBase {
475
+ readonly code: "too_small";
476
+ readonly origin: "number" | "int" | "bigint" | "date" | "string" | "array" | "set" | "file" | (string & {});
477
+ readonly minimum: number | bigint;
478
+ /** True if the allowable range includes the minimum */
479
+ readonly inclusive?: boolean;
480
+ /** True if the allowed value is fixed (e.g.` z.length(5)`), not a range (`z.minLength(5)`) */
481
+ readonly exact?: boolean;
482
+ readonly input?: Input;
483
+ }
484
+ interface $ZodIssueInvalidStringFormat extends $ZodIssueBase {
485
+ readonly code: "invalid_format";
486
+ readonly format: $ZodStringFormats | (string & {});
487
+ readonly pattern?: string;
488
+ readonly input?: string;
489
+ }
490
+ interface $ZodIssueNotMultipleOf<Input extends number | bigint = number | bigint> extends $ZodIssueBase {
491
+ readonly code: "not_multiple_of";
492
+ readonly divisor: number;
493
+ readonly input?: Input;
494
+ }
495
+ interface $ZodIssueUnrecognizedKeys extends $ZodIssueBase {
496
+ readonly code: "unrecognized_keys";
497
+ readonly keys: string[];
498
+ readonly input?: Record<string, unknown>;
499
+ }
500
+ interface $ZodIssueInvalidUnion extends $ZodIssueBase {
501
+ readonly code: "invalid_union";
502
+ readonly errors: $ZodIssue[][];
503
+ readonly input?: unknown;
504
+ readonly discriminator?: string | undefined;
505
+ }
506
+ interface $ZodIssueInvalidKey<Input = unknown> extends $ZodIssueBase {
507
+ readonly code: "invalid_key";
508
+ readonly origin: "map" | "record";
509
+ readonly issues: $ZodIssue[];
510
+ readonly input?: Input;
511
+ }
512
+ interface $ZodIssueInvalidElement<Input = unknown> extends $ZodIssueBase {
513
+ readonly code: "invalid_element";
514
+ readonly origin: "map" | "set";
515
+ readonly key: unknown;
516
+ readonly issues: $ZodIssue[];
517
+ readonly input?: Input;
518
+ }
519
+ interface $ZodIssueInvalidValue<Input = unknown> extends $ZodIssueBase {
520
+ readonly code: "invalid_value";
521
+ readonly values: Primitive[];
522
+ readonly input?: Input;
523
+ }
524
+ interface $ZodIssueCustom extends $ZodIssueBase {
525
+ readonly code: "custom";
526
+ readonly params?: Record<string, any> | undefined;
527
+ readonly input?: unknown;
528
+ }
529
+ type $ZodIssue = $ZodIssueInvalidType | $ZodIssueTooBig | $ZodIssueTooSmall | $ZodIssueInvalidStringFormat | $ZodIssueNotMultipleOf | $ZodIssueUnrecognizedKeys | $ZodIssueInvalidUnion | $ZodIssueInvalidKey | $ZodIssueInvalidElement | $ZodIssueInvalidValue | $ZodIssueCustom;
530
+ type $ZodInternalIssue<T$1 extends $ZodIssueBase = $ZodIssue> = T$1 extends any ? RawIssue<T$1> : never;
531
+ type RawIssue<T$1 extends $ZodIssueBase> = T$1 extends any ? Flatten<MakePartial<T$1, "message" | "path"> & {
532
+ /** The input data */
533
+ readonly input: unknown;
534
+ /** The schema or check that originated this issue. */
535
+ readonly inst?: $ZodType | $ZodCheck;
536
+ /** If `true`, Zod will continue executing checks/refinements after this issue. */
537
+ readonly continue?: boolean | undefined;
538
+ } & Record<string, unknown>> : never;
539
+ type $ZodRawIssue<T$1 extends $ZodIssueBase = $ZodIssue> = $ZodInternalIssue<T$1>;
540
+ interface $ZodErrorMap<T$1 extends $ZodIssueBase = $ZodIssue> {
541
+ (issue: $ZodRawIssue<T$1>): {
542
+ message: string;
543
+ } | string | undefined | null;
544
+ }
545
+ interface $ZodError<T$1 = unknown> extends Error {
546
+ type: T$1;
547
+ issues: $ZodIssue[];
548
+ _zod: {
549
+ output: T$1;
550
+ def: $ZodIssue[];
551
+ };
552
+ stack?: string;
553
+ name: string;
554
+ }
555
+ declare const $ZodError: $constructor<$ZodError>;
556
+ //#endregion
557
+ //#region ../../node_modules/.pnpm/zod@4.1.11/node_modules/zod/v4/core/core.d.cts
558
+ type ZodTrait = {
559
+ _zod: {
560
+ def: any;
561
+ [k: string]: any;
562
+ };
563
+ };
564
+ interface $constructor<T$1 extends ZodTrait, D = T$1["_zod"]["def"]> {
565
+ new (def: D): T$1;
566
+ init(inst: T$1, def: D): asserts inst is T$1;
567
+ }
568
+ declare function $constructor<T$1 extends ZodTrait, D = T$1["_zod"]["def"]>(name: string, initializer: (inst: T$1, def: D) => void, params?: {
569
+ Parent?: typeof Class;
570
+ }): $constructor<T$1, D>;
571
+ declare const $brand: unique symbol;
572
+ type $brand<T$1 extends string | number | symbol = string | number | symbol> = {
573
+ [$brand]: { [k in T$1]: true };
574
+ };
575
+ type input<T$1> = T$1 extends {
576
+ _zod: {
577
+ input: any;
578
+ };
579
+ } ? T$1["_zod"]["input"] : unknown;
580
+ type output<T$1> = T$1 extends {
581
+ _zod: {
582
+ output: any;
583
+ };
584
+ } ? T$1["_zod"]["output"] : unknown;
585
+ //#endregion
586
+ //#region ../../node_modules/.pnpm/zod@4.1.11/node_modules/zod/v4/core/registries.d.cts
587
+ declare const $output: unique symbol;
588
+ type $output = typeof $output;
589
+ declare const $input: unique symbol;
590
+ type $input = typeof $input;
591
+ type $replace<Meta$1, S extends $ZodType> = Meta$1 extends $output ? output<S> : Meta$1 extends $input ? input<S> : Meta$1 extends (infer M)[] ? $replace<M, S>[] : Meta$1 extends ((...args: infer P) => infer R) ? (...args: { [K in keyof P]: $replace<P[K], S> }) => $replace<R, S> : Meta$1 extends object ? { [K in keyof Meta$1]: $replace<Meta$1[K], S> } : Meta$1;
592
+ type MetadataType = object | undefined;
593
+ declare class $ZodRegistry<Meta$1 extends MetadataType = MetadataType, Schema$1 extends $ZodType = $ZodType> {
594
+ _meta: Meta$1;
595
+ _schema: Schema$1;
596
+ _map: WeakMap<Schema$1, $replace<Meta$1, Schema$1>>;
597
+ _idmap: Map<string, Schema$1>;
598
+ add<S extends Schema$1>(schema: S, ..._meta: undefined extends Meta$1 ? [$replace<Meta$1, S>?] : [$replace<Meta$1, S>]): this;
599
+ clear(): this;
600
+ remove(schema: Schema$1): this;
601
+ get<S extends Schema$1>(schema: S): $replace<Meta$1, S> | undefined;
602
+ has(schema: Schema$1): boolean;
603
+ }
604
+ //#endregion
605
+ //#region ../../node_modules/.pnpm/zod@4.1.11/node_modules/zod/v4/mini/schemas.d.cts
606
+ type SomeType = SomeType$1;
607
+ interface ZodMiniType<out Output = unknown, out Input = unknown, out Internals extends $ZodTypeInternals<Output, Input> = $ZodTypeInternals<Output, Input>> extends $ZodType<Output, Input, Internals> {
608
+ type: Internals["def"]["type"];
609
+ check(...checks: (CheckFn<output<this>> | $ZodCheck<output<this>>)[]): this;
610
+ clone(def?: Internals["def"], params?: {
611
+ parent: boolean;
612
+ }): this;
613
+ register<R$1 extends $ZodRegistry>(registry: R$1, ...meta: this extends R$1["_schema"] ? undefined extends R$1["_meta"] ? [$replace<R$1["_meta"], this>?] : [$replace<R$1["_meta"], this>] : ["Incompatible schema"]): this;
614
+ brand<T$1 extends PropertyKey = PropertyKey>(value?: T$1): PropertyKey extends T$1 ? this : this & Record<"_zod", Record<"output", output<this> & $brand<T$1>>>;
615
+ def: Internals["def"];
616
+ parse(data: unknown, params?: ParseContext<$ZodIssue>): output<this>;
617
+ safeParse(data: unknown, params?: ParseContext<$ZodIssue>): SafeParseResult<output<this>>;
618
+ parseAsync(data: unknown, params?: ParseContext<$ZodIssue>): Promise<output<this>>;
619
+ safeParseAsync(data: unknown, params?: ParseContext<$ZodIssue>): Promise<SafeParseResult<output<this>>>;
620
+ }
621
+ interface _ZodMiniType<out Internals extends $ZodTypeInternals = $ZodTypeInternals> extends ZodMiniType<any, any, Internals> {}
622
+ declare const ZodMiniType: $constructor<ZodMiniType>;
623
+ interface _ZodMiniString<T$1 extends $ZodStringInternals<unknown> = $ZodStringInternals<unknown>> extends _ZodMiniType<T$1>, $ZodString<T$1["input"]> {
624
+ _zod: T$1;
625
+ }
626
+ interface ZodMiniString<Input = unknown> extends _ZodMiniString<$ZodStringInternals<Input>>, $ZodString<Input> {}
627
+ declare const ZodMiniString: $constructor<ZodMiniString>;
628
+ interface _ZodMiniNumber<T$1 extends $ZodNumberInternals<unknown> = $ZodNumberInternals<unknown>> extends _ZodMiniType<T$1>, $ZodNumber<T$1["input"]> {
629
+ _zod: T$1;
630
+ }
631
+ interface ZodMiniNumber<Input = unknown> extends _ZodMiniNumber<$ZodNumberInternals<Input>>, $ZodNumber<Input> {}
632
+ declare const ZodMiniNumber: $constructor<ZodMiniNumber>;
633
+ interface ZodMiniBoolean<T$1 = unknown> extends _ZodMiniType<$ZodBooleanInternals<T$1>> {}
634
+ declare const ZodMiniBoolean: $constructor<ZodMiniBoolean>;
635
+ interface ZodMiniBigInt<T$1 = unknown> extends _ZodMiniType<$ZodBigIntInternals<T$1>>, $ZodBigInt<T$1> {}
636
+ declare const ZodMiniBigInt: $constructor<ZodMiniBigInt>;
637
+ interface ZodMiniUndefined extends _ZodMiniType<$ZodUndefinedInternals> {}
638
+ declare const ZodMiniUndefined: $constructor<ZodMiniUndefined>;
639
+ interface ZodMiniNull extends _ZodMiniType<$ZodNullInternals> {}
640
+ declare const ZodMiniNull: $constructor<ZodMiniNull>;
641
+ interface ZodMiniUnknown extends _ZodMiniType<$ZodUnknownInternals> {}
642
+ declare const ZodMiniUnknown: $constructor<ZodMiniUnknown>;
643
+ interface ZodMiniDate<T$1 = unknown> extends _ZodMiniType<$ZodDateInternals<T$1>> {}
644
+ declare const ZodMiniDate: $constructor<ZodMiniDate>;
645
+ interface ZodMiniObject< /** @ts-ignore Cast variance */
646
+ out Shape extends $ZodShape = $ZodShape, out Config extends $ZodObjectConfig = $strip> extends ZodMiniType<any, any, $ZodObjectInternals<Shape, Config>>, $ZodObject<Shape, Config> {
647
+ shape: Shape;
648
+ }
649
+ declare const ZodMiniObject: $constructor<ZodMiniObject>;
650
+ interface ZodMiniUnion<T$1 extends readonly SomeType[] = readonly $ZodType[]> extends _ZodMiniType<$ZodUnionInternals<T$1>> {}
651
+ declare const ZodMiniUnion: $constructor<ZodMiniUnion>;
652
+ interface ZodMiniRecord<Key extends $ZodRecordKey = $ZodRecordKey, Value extends SomeType = $ZodType> extends _ZodMiniType<$ZodRecordInternals<Key, Value>> {}
653
+ declare const ZodMiniRecord: $constructor<ZodMiniRecord>;
654
+ interface ZodMiniMap<Key extends SomeType = $ZodType, Value extends SomeType = $ZodType> extends _ZodMiniType<$ZodMapInternals<Key, Value>> {}
655
+ declare const ZodMiniMap: $constructor<ZodMiniMap>;
656
+ interface ZodMiniSet<T$1 extends SomeType = $ZodType> extends _ZodMiniType<$ZodSetInternals<T$1>> {}
657
+ declare const ZodMiniSet: $constructor<ZodMiniSet>;
658
+ interface ZodMiniLiteral<T$1 extends Literal$1 = Literal$1> extends _ZodMiniType<$ZodLiteralInternals<T$1>> {}
659
+ declare const ZodMiniLiteral: $constructor<ZodMiniLiteral>;
660
+ interface ZodMiniOptional<T$1 extends SomeType = $ZodType> extends _ZodMiniType<$ZodOptionalInternals<T$1>>, $ZodOptional<T$1> {}
661
+ declare const ZodMiniOptional: $constructor<ZodMiniOptional>;
662
+ //#endregion
663
+ //#region src/import.d.ts
664
+ declare const importSchema: ZodMiniObject<{
665
+ __cc_import: ZodMiniLiteral<true>;
666
+ path: ZodMiniString<string>;
667
+ name: ZodMiniOptional<ZodMiniString<string>>;
668
+ }, $strip>;
669
+ type Import<T$1> = output<typeof importSchema> & {
670
+ __type?: T$1;
671
+ };
672
+ type GetTypeOfImport<T$1> = T$1 extends Import<infer U> ? U : never;
673
+ declare function createDefaultImport<T$1>(path: string): Import<T$1>;
674
+ declare function createNamedImport<T$1>(name: string, path: string): Import<T$1>;
675
+ //#endregion
676
+ //#region src/parser.d.ts
20
677
  type ParseFn = (content: string) => Record<string, unknown> | Promise<Record<string, unknown>>;
21
678
  type Parser = {
22
- hasContent: boolean;
23
- parse: ParseFn;
679
+ hasContent: boolean;
680
+ parse: ParseFn;
24
681
  };
25
682
  type PredefinedParsers = typeof parsers;
26
683
  type PredefinedParser = keyof typeof parsers;
27
684
  type ConfiguredParser = PredefinedParser | Parser;
28
685
  declare function parseYaml(content: string): any;
29
686
  declare function frontmatterParser(fileContent: string): {
30
- content: string;
687
+ content: string;
31
688
  };
32
689
  declare function frontmatterOnlyParser(fileContent: string): {
33
- [key: string]: any;
690
+ [key: string]: any;
34
691
  };
35
692
  declare const parsers: {
36
- frontmatter: {
37
- hasContent: true;
38
- parse: typeof frontmatterParser;
39
- };
40
- "frontmatter-only": {
41
- hasContent: false;
42
- parse: typeof frontmatterOnlyParser;
43
- };
44
- json: {
45
- hasContent: false;
46
- parse: (text: string, reviver?: (this: any, key: string, value: any) => any) => any;
47
- };
48
- yaml: {
49
- hasContent: false;
50
- parse: typeof parseYaml;
51
- };
693
+ frontmatter: {
694
+ hasContent: true;
695
+ parse: typeof frontmatterParser;
696
+ };
697
+ "frontmatter-only": {
698
+ hasContent: false;
699
+ parse: typeof frontmatterOnlyParser;
700
+ };
701
+ json: {
702
+ hasContent: false;
703
+ parse: (text: string, reviver?: (this: any, key: string, value: any) => any) => any;
704
+ };
705
+ yaml: {
706
+ hasContent: false;
707
+ parse: typeof parseYaml;
708
+ };
52
709
  };
53
710
  type DefineParserResult<TArgument extends Parser | ParseFn> = TArgument extends Function ? {
54
- hasContent: false;
55
- parse: ParseFn;
711
+ hasContent: false;
712
+ parse: ParseFn;
56
713
  } : TArgument extends infer Parser ? Parser : never;
57
714
  declare function defineParser<TArgument extends Parser | ParseFn>(parser: TArgument): DefineParserResult<TArgument>;
58
-
59
- declare const literalSchema: z__default.ZodUnion<[z__default.ZodString, z__default.ZodNumber, z__default.ZodBoolean, z__default.ZodNull, z__default.ZodUndefined, z__default.ZodDate, z__default.ZodMap<z__default.ZodUnknown, z__default.ZodUnknown>, z__default.ZodSet<z__default.ZodUnknown>, z__default.ZodBigInt]>;
60
- type Literal = z__default.infer<typeof literalSchema>;
715
+ //#endregion
716
+ //#region src/serializer.d.ts
717
+ declare const literalSchema: ZodMiniUnion<readonly [ZodMiniString<string>, ZodMiniNumber<number>, ZodMiniBoolean<boolean>, ZodMiniNull, ZodMiniUndefined, ZodMiniDate<Date>, ZodMiniMap<ZodMiniUnknown, ZodMiniUnknown>, ZodMiniSet<ZodMiniUnknown>, ZodMiniBigInt<bigint>, ZodMiniObject<{
718
+ __cc_import: ZodMiniLiteral<true>;
719
+ path: ZodMiniString<string>;
720
+ name: ZodMiniOptional<ZodMiniString<string>>;
721
+ }, $strip>]>;
722
+ type Literal = output<typeof literalSchema>;
61
723
  type SchemaType = Literal | {
62
- [key: string]: SchemaType;
724
+ [key: string]: SchemaType;
63
725
  } | ReadonlyArray<SchemaType>;
64
726
  type NotSerializableError = `The return type of the transform function must be an object serializable object.
65
727
  See https://www.content-collections.dev/docs/serialization for more information.
66
728
 
67
729
  The following type is not valid:`;
68
- declare const serializableSchema: z__default.ZodRecord<z__default.ZodString, z__default.ZodType<SchemaType, z__default.ZodTypeDef, SchemaType>>;
69
- type Serializable = z__default.infer<typeof serializableSchema>;
70
-
730
+ declare const serializableSchema: ZodMiniRecord<ZodMiniString<string>, ZodMiniType<SchemaType, unknown, $ZodTypeInternals<SchemaType, unknown>>>;
731
+ type Serializable = output<typeof serializableSchema>;
732
+ //#endregion
733
+ //#region src/config.d.ts
71
734
  type Meta = {
72
- filePath: string;
73
- fileName: string;
74
- directory: string;
75
- path: string;
76
- extension: string;
735
+ filePath: string;
736
+ fileName: string;
737
+ directory: string;
738
+ path: string;
739
+ extension: string;
77
740
  };
78
741
  type WithContent = {
79
- content: string;
742
+ content: string;
80
743
  };
81
744
  type AddContent<TOutput> = TOutput extends {
82
- content: any;
745
+ content: any;
83
746
  } ? TOutput : TOutput & WithContent;
84
747
  type GetParser<TParser extends ConfiguredParser> = TParser extends PredefinedParser ? PredefinedParsers[TParser] : TParser;
85
748
  type HasContent<TParser extends ConfiguredParser> = GetParser<TParser>["hasContent"];
86
- type LegacySchema<TResult extends ZodRawShape = ZodRawShape> = (z: Z) => TResult;
87
- type TSchemaProp = StandardSchemaV1 | LegacySchema;
88
- type GetLegacySchemaShape<LegacySchema> = LegacySchema extends (z: Z) => infer TObjectShape ? TObjectShape : never;
89
- type GetOutputShape<TShape extends TSchemaProp> = TShape extends StandardSchemaV1 ? StandardSchemaV1.InferOutput<TShape> : TShape extends ZodObject<any> ? z$1.infer<TShape> : TShape extends LegacySchema ? z$1.infer<ZodObject<GetLegacySchemaShape<TShape>>> : never;
749
+ type TSchemaProp = StandardSchemaV1;
750
+ type GetOutputShape<TShape extends TSchemaProp> = TShape extends StandardSchemaV1 ? StandardSchemaV1.InferOutput<TShape> : never;
90
751
  type GetOutput<TParser extends ConfiguredParser, TShape extends TSchemaProp, TOutput = GetOutputShape<TShape>> = HasContent<TParser> extends true ? AddContent<TOutput> : TOutput;
91
752
  type Schema<TParser extends ConfiguredParser, TShape extends TSchemaProp> = GetOutput<TParser, TShape> & {
92
- _meta: Meta;
753
+ _meta: Meta;
93
754
  };
94
- type Prettify<T> = {
95
- [K in keyof T]: T[K];
96
- } & {};
97
- type GetSchema<TCollection extends AnyCollection> = TCollection extends Collection<any, any, any, infer TSchema, any, any> ? Prettify<TSchema> : never;
755
+ type Prettify<T$1> = { [K in keyof T$1]: T$1[K] } & {};
756
+ type GetSchema<TCollection$1 extends AnyCollection> = TCollection$1 extends Collection<any, any, any, infer TSchema, any, any> ? Prettify<TSchema> : never;
98
757
  declare const skippedSymbol: unique symbol;
99
758
  type SkippedSignal = {
100
- [skippedSymbol]: true;
101
- reason?: string;
102
- };
103
- type Context<TSchema = unknown> = {
104
- documents<TCollection extends AnyCollection>(collection: TCollection): Array<GetSchema<TCollection>>;
105
- cache: CacheFn;
106
- collection: {
107
- name: string;
108
- directory: string;
109
- documents: () => Promise<Array<TSchema>>;
110
- };
111
- skip: (reason?: string) => SkippedSignal;
112
- };
113
- type Z = typeof z$1;
114
- type CollectionRequest<TName extends string, TShape extends TSchemaProp, TParser, TSchema, TTransformResult, TDocument> = {
115
- name: TName;
116
- parser?: TParser;
117
- typeName?: string;
118
- schema: TShape;
119
- transform?: (data: TSchema, context: Context<TSchema>) => TTransformResult;
759
+ [skippedSymbol]: true;
760
+ reason?: string;
761
+ };
762
+ type Context<TSchema$1 = unknown> = {
763
+ documents<TCollection$1 extends AnyCollection>(collection: TCollection$1): Array<GetSchema<TCollection$1>>;
764
+ cache: CacheFn;
765
+ collection: {
766
+ name: string;
120
767
  directory: string;
121
- include: string | string[];
122
- exclude?: string | string[];
123
- onSuccess?: (documents: Array<TDocument>) => void | Promise<void>;
124
- };
125
- type Collection<TName extends string, TShape extends TSchemaProp, TParser extends ConfiguredParser, TSchema, TTransformResult, TDocument> = Omit<CollectionRequest<TName, TShape, TParser, TSchema, TTransformResult, TDocument>, "schema"> & {
126
- typeName: string;
127
- schema: StandardSchemaV1;
128
- parser: TParser;
768
+ documents: () => Promise<Array<TSchema$1>>;
769
+ };
770
+ skip: (reason?: string) => SkippedSignal;
771
+ };
772
+ type CollectionRequest<TName extends string, TShape extends TSchemaProp, TParser, TSchema$1, TTransformResult, TDocument$1> = {
773
+ name: TName;
774
+ parser?: TParser;
775
+ typeName?: string;
776
+ schema: TShape;
777
+ transform?: (data: TSchema$1, context: Context<TSchema$1>) => TTransformResult;
778
+ directory: string;
779
+ include: string | string[];
780
+ exclude?: string | string[];
781
+ onSuccess?: (documents: Array<TDocument$1>) => void | Promise<void>;
782
+ };
783
+ type Collection<TName extends string, TShape extends TSchemaProp, TParser extends ConfiguredParser, TSchema$1, TTransformResult, TDocument$1> = Omit<CollectionRequest<TName, TShape, TParser, TSchema$1, TTransformResult, TDocument$1>, "schema"> & {
784
+ typeName: string;
785
+ schema: StandardSchemaV1;
786
+ parser: TParser;
129
787
  };
130
788
  type AnyCollection = Collection<any, TSchemaProp, ConfiguredParser, any, any, any>;
131
789
  declare const InvalidReturnTypeSymbol: unique symbol;
132
790
  type InvalidReturnType<TMessage extends string, TObject> = {
133
- [InvalidReturnTypeSymbol]: TMessage;
134
- object: TObject;
791
+ [InvalidReturnTypeSymbol]: TMessage;
792
+ object: TObject;
135
793
  };
136
- type ResolveImports<TTransformResult> = TTransformResult extends Import<any> ? GetTypeOfImport<TTransformResult> : TTransformResult extends Array<infer U> ? Array<ResolveImports<U>> : TTransformResult extends (...args: any[]) => any ? TTransformResult : TTransformResult extends object ? {
137
- [K in keyof TTransformResult]: ResolveImports<TTransformResult[K]>;
138
- } : TTransformResult;
139
- declare function defineCollection<TName extends string, TShape extends TSchemaProp, TParser extends ConfiguredParser = "frontmatter", TSchema = Schema<TParser, TShape>, TTransformResult = never, TDocument = [TTransformResult] extends [never] ? Schema<TParser, TShape> : Exclude<Awaited<TTransformResult>, SkippedSignal>, TResult = TDocument extends Serializable ? Collection<TName, TShape, TParser, TSchema, TTransformResult, ResolveImports<TDocument>> : InvalidReturnType<NotSerializableError, TDocument>>(collection: CollectionRequest<TName, TShape, TParser, TSchema, TTransformResult, TDocument>): TResult;
794
+ type ResolveImports<TTransformResult> = TTransformResult extends Import<any> ? GetTypeOfImport<TTransformResult> : TTransformResult extends Array<infer U> ? Array<ResolveImports<U>> : TTransformResult extends ((...args: any[]) => any) ? TTransformResult : TTransformResult extends object ? { [K in keyof TTransformResult]: ResolveImports<TTransformResult[K]> } : TTransformResult;
795
+ declare function defineCollection<TName extends string, TShape extends TSchemaProp, TParser extends ConfiguredParser = "frontmatter", TSchema$1 = Schema<TParser, TShape>, TTransformResult = never, TDocument$1 = ([TTransformResult] extends [never] ? Schema<TParser, TShape> : Exclude<Awaited<TTransformResult>, SkippedSignal>), TResult = (TDocument$1 extends Serializable ? Collection<TName, TShape, TParser, TSchema$1, TTransformResult, ResolveImports<TDocument$1>> : InvalidReturnType<NotSerializableError, TDocument$1>)>(collection: CollectionRequest<TName, TShape, TParser, TSchema$1, TTransformResult, TDocument$1>): TResult;
140
796
  type Cache = "memory" | "file" | "none";
141
797
  type Configuration<TCollections extends Array<AnyCollection>> = {
142
- collections: TCollections;
143
- cache?: Cache;
798
+ collections: TCollections;
799
+ cache?: Cache;
144
800
  };
145
801
  type AnyConfiguration = Configuration<Array<AnyCollection>>;
146
802
  declare function defineConfig<TConfig extends AnyConfiguration>(config: TConfig): TConfig;
147
-
803
+ //#endregion
804
+ //#region src/types.d.ts
148
805
  type Modification = "create" | "update" | "delete";
149
806
  type Document = {
150
- _meta: Meta;
807
+ _meta: Meta;
151
808
  };
152
809
  type CollectionFile = {
153
- data: {
154
- content?: string;
155
- [key: string]: unknown;
156
- };
157
- path: string;
158
- };
159
- type CollectionByName<TConfiguration extends AnyConfiguration> = {
160
- [TCollection in TConfiguration["collections"][number] as TCollection["name"]]: TCollection;
161
- };
162
- type GetDocument<TCollection extends AnyCollection> = TCollection extends Collection<any, any, any, any, any, infer TDocument> ? TDocument : never;
163
- type GetTypeByName<TConfiguration extends AnyConfiguration, TName extends keyof CollectionByName<TConfiguration>, TCollection = CollectionByName<TConfiguration>[TName]> = TCollection extends AnyCollection ? GetDocument<TCollection> : never;
164
-
810
+ data: {
811
+ content?: string;
812
+ [key: string]: unknown;
813
+ };
814
+ path: string;
815
+ };
816
+ type CollectionByName<TConfiguration extends AnyConfiguration> = { [TCollection in TConfiguration["collections"][number] as TCollection["name"]]: TCollection };
817
+ type GetDocument<TCollection$1 extends AnyCollection> = TCollection$1 extends Collection<any, any, any, any, any, infer TDocument> ? TDocument : never;
818
+ type GetTypeByName<TConfiguration extends AnyConfiguration, TName extends keyof CollectionByName<TConfiguration>, TCollection$1 = CollectionByName<TConfiguration>[TName]> = TCollection$1 extends AnyCollection ? GetDocument<TCollection$1> : never;
819
+ //#endregion
820
+ //#region src/collector.d.ts
165
821
  type CollectorEvents = {
166
- "collector:read-error": {
167
- filePath: string;
168
- error: CollectError;
169
- };
170
- "collector:parse-error": {
171
- filePath: string;
172
- error: CollectError;
173
- };
822
+ "collector:read-error": {
823
+ filePath: string;
824
+ error: CollectError;
825
+ };
826
+ "collector:parse-error": {
827
+ filePath: string;
828
+ error: CollectError;
829
+ };
174
830
  };
175
831
  type ErrorType$2 = "Parse" | "Read";
176
832
  declare class CollectError extends Error {
177
- type: ErrorType$2;
178
- constructor(type: ErrorType$2, message: string);
833
+ type: ErrorType$2;
834
+ constructor(type: ErrorType$2, message: string);
179
835
  }
180
-
836
+ //#endregion
837
+ //#region src/transformer.d.ts
181
838
  type TransformerEvents = {
182
- "transformer:validation-error": {
183
- collection: AnyCollection;
184
- file: CollectionFile;
185
- error: TransformError;
186
- };
187
- "transformer:result-error": {
188
- collection: AnyCollection;
189
- document: any;
190
- error: TransformError;
191
- };
192
- "transformer:error": {
193
- collection: AnyCollection;
194
- error: TransformError;
195
- };
196
- "transformer:document-skipped": {
197
- collection: AnyCollection;
198
- filePath: string;
199
- reason?: string;
200
- };
839
+ "transformer:validation-error": {
840
+ collection: AnyCollection;
841
+ file: CollectionFile;
842
+ error: TransformError;
843
+ };
844
+ "transformer:result-error": {
845
+ collection: AnyCollection;
846
+ document: any;
847
+ error: TransformError;
848
+ };
849
+ "transformer:error": {
850
+ collection: AnyCollection;
851
+ error: TransformError;
852
+ };
853
+ "transformer:document-skipped": {
854
+ collection: AnyCollection;
855
+ filePath: string;
856
+ reason?: string;
857
+ };
201
858
  };
202
859
  type ErrorType$1 = "Validation" | "Configuration" | "Transform" | "Result";
203
860
  declare class TransformError extends Error {
204
- type: ErrorType$1;
205
- constructor(type: ErrorType$1, message: string);
861
+ type: ErrorType$1;
862
+ constructor(type: ErrorType$1, message: string);
206
863
  }
207
-
864
+ //#endregion
865
+ //#region src/watcher.d.ts
208
866
  type WatcherEvents = {
209
- "watcher:subscribe-error": {
210
- paths: Array<string>;
211
- error: Error;
212
- };
213
- "watcher:subscribed": {
214
- paths: Array<string>;
215
- };
216
- "watcher:unsubscribed": {
217
- paths: Array<string>;
218
- };
867
+ "watcher:subscribe-error": {
868
+ paths: Array<string>;
869
+ error: Error;
870
+ };
871
+ "watcher:subscribed": {
872
+ paths: Array<string>;
873
+ };
874
+ "watcher:unsubscribed": {
875
+ paths: Array<string>;
876
+ };
219
877
  };
220
878
  type SyncFn = (modification: Modification, path: string) => Promise<unknown>;
221
879
  type WatchableCollection = {
222
- directory: string;
880
+ directory: string;
223
881
  };
224
882
  type WatcherConfiguration = {
225
- inputPaths: Array<string>;
226
- collections: Array<WatchableCollection>;
883
+ inputPaths: Array<string>;
884
+ collections: Array<WatchableCollection>;
227
885
  };
228
886
  declare function createWatcher(emitter: Emitter, baseDirectory: string, configuration: WatcherConfiguration, sync: SyncFn): Promise<{
229
- unsubscribe: () => Promise<void>;
887
+ unsubscribe: () => Promise<void>;
230
888
  }>;
231
889
  type Watcher = Awaited<ReturnType<typeof createWatcher>>;
232
-
890
+ //#endregion
891
+ //#region src/events.d.ts
233
892
  type EventMap = Record<string, object>;
234
893
  type EventWithError = {
235
- error: Error;
894
+ error: Error;
236
895
  };
237
896
  type SystemEvent = {
238
- _event: string;
897
+ _event: string;
239
898
  };
240
899
  type ErrorEvent = EventWithError & SystemEvent;
241
900
  type Events = BuilderEvents & CollectorEvents & TransformerEvents & WatcherEvents;
242
901
  type SystemEvents = {
243
- _error: ErrorEvent;
244
- _all: SystemEvent;
902
+ _error: ErrorEvent;
903
+ _all: SystemEvent;
245
904
  };
246
905
  type Keys<TEvents extends EventMap> = keyof TEvents & string;
247
906
  type Listener<TEvent> = (event: TEvent) => void;
248
907
  declare function createEmitter<TEvents extends EventMap>(): {
249
- on: {
250
- <TKey extends Keys<TEvents>>(key: TKey, listener: Listener<TEvents[TKey]>): void;
251
- <TKey extends Keys<SystemEvents>>(key: TKey, listener: Listener<SystemEvents[TKey]>): void;
252
- };
253
- emit: <TKey extends Keys<TEvents>>(key: TKey, event: TEvents[TKey]) => void;
908
+ on: {
909
+ <TKey extends Keys<TEvents>>(key: TKey, listener: Listener<TEvents[TKey]>): void;
910
+ <TKey extends Keys<SystemEvents>>(key: TKey, listener: Listener<SystemEvents[TKey]>): void;
911
+ };
912
+ emit: <TKey extends Keys<TEvents>>(key: TKey, event: TEvents[TKey]) => void;
254
913
  };
255
914
  type Emitter = ReturnType<typeof createEmitter<Events>>;
256
-
915
+ //#endregion
916
+ //#region src/configurationReader.d.ts
257
917
  type ErrorType = "Read" | "Compile";
258
918
  declare class ConfigurationError extends Error {
259
- type: ErrorType;
260
- constructor(type: ErrorType, message: string);
919
+ type: ErrorType;
920
+ constructor(type: ErrorType, message: string);
261
921
  }
262
- type Options$1 = {
263
- configName: string;
264
- cacheDir?: string;
265
- };
266
-
922
+ type InternalConfiguration = {
923
+ collections: Array<AnyCollection>;
924
+ path: string;
925
+ inputPaths: Array<string>;
926
+ checksum: string;
927
+ generateTypes?: boolean;
928
+ };
929
+ type Options = {
930
+ configName: string;
931
+ cacheDir?: string;
932
+ };
933
+ //#endregion
934
+ //#region src/build.d.ts
267
935
  type BuildEvents = {
268
- "builder:start": {
269
- startedAt: number;
270
- };
271
- "builder:end": {
272
- startedAt: number;
273
- endedAt: number;
274
- stats: {
275
- collections: number;
276
- documents: number;
277
- };
936
+ "builder:start": {
937
+ startedAt: number;
938
+ };
939
+ "builder:end": {
940
+ startedAt: number;
941
+ endedAt: number;
942
+ stats: {
943
+ collections: number;
944
+ documents: number;
278
945
  };
946
+ };
279
947
  };
280
-
948
+ //#endregion
949
+ //#region src/builder.d.ts
281
950
  type BuilderEvents = BuildEvents & {
282
- "builder:created": {
283
- createdAt: number;
284
- configurationPath: string;
285
- outputDirectory: string;
286
- };
287
- "watcher:file-changed": {
288
- filePath: string;
289
- modification: Modification;
290
- };
291
- "watcher:config-changed": {
292
- filePath: string;
293
- modification: Modification;
294
- };
295
- "watcher:config-reload-error": {
296
- error: Error;
297
- configurationPath: string;
298
- };
951
+ "builder:created": {
952
+ createdAt: number;
953
+ configurationPath: string;
954
+ outputDirectory: string;
955
+ };
956
+ "watcher:file-changed": {
957
+ filePath: string;
958
+ modification: Modification;
959
+ };
960
+ "watcher:config-changed": {
961
+ filePath: string;
962
+ modification: Modification;
963
+ };
964
+ "watcher:config-reload-error": {
965
+ error: Error;
966
+ configurationPath: string;
967
+ };
299
968
  };
300
- type Options = Options$1 & {
301
- outputDir?: string;
969
+ type Options$1 = Options & {
970
+ outputDir?: string;
302
971
  };
303
972
  declare class ConfigurationReloadError extends Error {
304
- constructor(message: string);
305
- }
306
- declare function createBuilder(configurationPath: string, options?: Options, emitter?: Emitter): Promise<{
307
- build: () => Promise<void>;
308
- sync: (modification: Modification, filePath: string) => Promise<boolean>;
309
- watch: () => Promise<{
310
- unsubscribe: () => Promise<void>;
311
- }>;
312
- on: {
313
- <TKey extends "builder:start" | "builder:end" | "builder:created" | "watcher:file-changed" | "watcher:config-changed" | "watcher:config-reload-error" | "collector:read-error" | "collector:parse-error" | "transformer:validation-error" | "transformer:result-error" | "transformer:error" | "transformer:document-skipped" | "watcher:subscribe-error" | "watcher:subscribed" | "watcher:unsubscribed">(key: TKey, listener: (event: Events[TKey]) => void): void;
314
- <TKey extends "_error" | "_all">(key: TKey, listener: (event: SystemEvents[TKey]) => void): void;
315
- };
973
+ constructor(message: string);
974
+ }
975
+ declare function createBuilder(configurationPath: string, options?: Options$1, emitter?: Emitter): Promise<{
976
+ build: () => Promise<void>;
977
+ sync: (modification: Modification, filePath: string) => Promise<boolean>;
978
+ watch: () => Promise<{
979
+ unsubscribe: () => Promise<void>;
980
+ }>;
981
+ on: {
982
+ <TKey extends "builder:start" | "builder:end" | "builder:created" | "watcher:file-changed" | "watcher:config-changed" | "watcher:config-reload-error" | "collector:read-error" | "collector:parse-error" | "transformer:validation-error" | "transformer:result-error" | "transformer:error" | "transformer:document-skipped" | "watcher:subscribe-error" | "watcher:subscribed" | "watcher:unsubscribed">(key: TKey, listener: (event: Events[TKey]) => void): void;
983
+ <TKey extends "_error" | "_all">(key: TKey, listener: (event: SystemEvents[TKey]) => void): void;
984
+ };
985
+ }>;
986
+ declare function createInternalBuilder(initialConfiguration: InternalConfiguration, baseDirectory: string, options: Options$1, emitter: Emitter): Promise<{
987
+ build: () => Promise<void>;
988
+ sync: (modification: Modification, filePath: string) => Promise<boolean>;
989
+ watch: () => Promise<{
990
+ unsubscribe: () => Promise<void>;
991
+ }>;
992
+ on: {
993
+ <TKey extends "builder:start" | "builder:end" | "builder:created" | "watcher:file-changed" | "watcher:config-changed" | "watcher:config-reload-error" | "collector:read-error" | "collector:parse-error" | "transformer:validation-error" | "transformer:result-error" | "transformer:error" | "transformer:document-skipped" | "watcher:subscribe-error" | "watcher:subscribed" | "watcher:unsubscribed">(key: TKey, listener: (event: Events[TKey]) => void): void;
994
+ <TKey extends "_error" | "_all">(key: TKey, listener: (event: SystemEvents[TKey]) => void): void;
995
+ };
316
996
  }>;
317
997
  type Builder = Awaited<ReturnType<typeof createBuilder>>;
318
-
998
+ //#endregion
999
+ //#region src/features.d.ts
319
1000
  declare const deprecations: {
320
- legacySchema: string;
1001
+ implicitContentProperty: string;
321
1002
  };
322
1003
  type Deprecation = keyof typeof deprecations;
323
- declare function suppressDeprecatedWarnings(...deprecations: Array<Deprecation | "all">): void;
324
-
325
- export { type AnyCollection, type AnyConfiguration, type Builder, type BuilderEvents, CollectError, type Collection, type CollectionRequest, type Configuration, ConfigurationError, ConfigurationReloadError, type Context, type Document, type GetTypeByName, type Meta, type Modification, type Schema, type SkippedSignal, TransformError, type Watcher, createBuilder, createDefaultImport, createNamedImport, defineCollection, defineConfig, defineParser, skippedSymbol, suppressDeprecatedWarnings };
1004
+ declare function suppressDeprecatedWarnings(...suppresses: Array<Deprecation | "all">): void;
1005
+ //#endregion
1006
+ export { AnyCollection, AnyConfiguration, Builder, BuilderEvents, CollectError, Collection, CollectionRequest, Configuration, ConfigurationError, ConfigurationReloadError, Context, type Document, type GetTypeByName, Meta, type Modification, Schema, SkippedSignal, TransformError, type Watcher, createBuilder, createDefaultImport, createInternalBuilder, createNamedImport, defineCollection, defineConfig, defineParser, skippedSymbol, suppressDeprecatedWarnings };