@roughapp/feature 0.1.0 → 0.2.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.
Files changed (4) hide show
  1. package/index.d.ts +45 -821
  2. package/index.js +35 -24
  3. package/package.json +2 -2
  4. package/style.css +1 -1
package/index.d.ts CHANGED
@@ -2,711 +2,6 @@ import { z } from 'zod';
2
2
  import * as svelte from 'svelte';
3
3
  import { Snippet, ComponentProps } from 'svelte';
4
4
 
5
- type _JSONSchema = boolean | JSONSchema;
6
- type JSONSchema = {
7
- [k: string]: unknown;
8
- $schema?: "https://json-schema.org/draft/2020-12/schema" | "http://json-schema.org/draft-07/schema#" | "http://json-schema.org/draft-04/schema#";
9
- $id?: string;
10
- $anchor?: string;
11
- $ref?: string;
12
- $dynamicRef?: string;
13
- $dynamicAnchor?: string;
14
- $vocabulary?: Record<string, boolean>;
15
- $comment?: string;
16
- $defs?: Record<string, JSONSchema>;
17
- type?: "object" | "array" | "string" | "number" | "boolean" | "null" | "integer";
18
- additionalItems?: _JSONSchema;
19
- unevaluatedItems?: _JSONSchema;
20
- prefixItems?: _JSONSchema[];
21
- items?: _JSONSchema | _JSONSchema[];
22
- contains?: _JSONSchema;
23
- additionalProperties?: _JSONSchema;
24
- unevaluatedProperties?: _JSONSchema;
25
- properties?: Record<string, _JSONSchema>;
26
- patternProperties?: Record<string, _JSONSchema>;
27
- dependentSchemas?: Record<string, _JSONSchema>;
28
- propertyNames?: _JSONSchema;
29
- if?: _JSONSchema;
30
- then?: _JSONSchema;
31
- else?: _JSONSchema;
32
- allOf?: JSONSchema[];
33
- anyOf?: JSONSchema[];
34
- oneOf?: JSONSchema[];
35
- not?: _JSONSchema;
36
- multipleOf?: number;
37
- maximum?: number;
38
- exclusiveMaximum?: number | boolean;
39
- minimum?: number;
40
- exclusiveMinimum?: number | boolean;
41
- maxLength?: number;
42
- minLength?: number;
43
- pattern?: string;
44
- maxItems?: number;
45
- minItems?: number;
46
- uniqueItems?: boolean;
47
- maxContains?: number;
48
- minContains?: number;
49
- maxProperties?: number;
50
- minProperties?: number;
51
- required?: string[];
52
- dependentRequired?: Record<string, string[]>;
53
- enum?: Array<string | number | boolean | null>;
54
- const?: string | number | boolean | null;
55
- id?: string;
56
- title?: string;
57
- description?: string;
58
- default?: unknown;
59
- deprecated?: boolean;
60
- readOnly?: boolean;
61
- writeOnly?: boolean;
62
- nullable?: boolean;
63
- examples?: unknown[];
64
- format?: string;
65
- contentMediaType?: string;
66
- contentEncoding?: string;
67
- contentSchema?: JSONSchema;
68
- _prefault?: unknown;
69
- };
70
- type BaseSchema = JSONSchema;
71
-
72
- /** The Standard interface. */
73
- interface StandardTypedV1<Input = unknown, Output = Input> {
74
- /** The Standard properties. */
75
- readonly "~standard": StandardTypedV1.Props<Input, Output>;
76
- }
77
- declare namespace StandardTypedV1 {
78
- /** The Standard properties interface. */
79
- interface Props<Input = unknown, Output = Input> {
80
- /** The version number of the standard. */
81
- readonly version: 1;
82
- /** The vendor name of the schema library. */
83
- readonly vendor: string;
84
- /** Inferred types associated with the schema. */
85
- readonly types?: Types<Input, Output> | undefined;
86
- }
87
- /** The Standard types interface. */
88
- interface Types<Input = unknown, Output = Input> {
89
- /** The input type of the schema. */
90
- readonly input: Input;
91
- /** The output type of the schema. */
92
- readonly output: Output;
93
- }
94
- /** Infers the input type of a Standard. */
95
- type InferInput<Schema extends StandardTypedV1> = NonNullable<Schema["~standard"]["types"]>["input"];
96
- /** Infers the output type of a Standard. */
97
- type InferOutput<Schema extends StandardTypedV1> = NonNullable<Schema["~standard"]["types"]>["output"];
98
- }
99
- /** The Standard Schema interface. */
100
- interface StandardSchemaV1<Input = unknown, Output = Input> {
101
- /** The Standard Schema properties. */
102
- readonly "~standard": StandardSchemaV1.Props<Input, Output>;
103
- }
104
- declare namespace StandardSchemaV1 {
105
- /** The Standard Schema properties interface. */
106
- interface Props<Input = unknown, Output = Input> extends StandardTypedV1.Props<Input, Output> {
107
- /** Validates unknown input values. */
108
- readonly validate: (value: unknown, options?: StandardSchemaV1.Options | undefined) => Result<Output> | Promise<Result<Output>>;
109
- }
110
- /** The result interface of the validate function. */
111
- type Result<Output> = SuccessResult<Output> | FailureResult;
112
- /** The result interface if validation succeeds. */
113
- interface SuccessResult<Output> {
114
- /** The typed output value. */
115
- readonly value: Output;
116
- /** The absence of issues indicates success. */
117
- readonly issues?: undefined;
118
- }
119
- interface Options {
120
- /** Implicit support for additional vendor-specific parameters, if needed. */
121
- readonly libraryOptions?: Record<string, unknown> | undefined;
122
- }
123
- /** The result interface if validation fails. */
124
- interface FailureResult {
125
- /** The issues of failed validation. */
126
- readonly issues: ReadonlyArray<Issue>;
127
- }
128
- /** The issue interface of the failure output. */
129
- interface Issue {
130
- /** The error message of the issue. */
131
- readonly message: string;
132
- /** The path of the issue, if any. */
133
- readonly path?: ReadonlyArray<PropertyKey | PathSegment> | undefined;
134
- }
135
- /** The path segment interface of the issue. */
136
- interface PathSegment {
137
- /** The key representing a path segment. */
138
- readonly key: PropertyKey;
139
- }
140
- /** The Standard types interface. */
141
- interface Types<Input = unknown, Output = Input> extends StandardTypedV1.Types<Input, Output> {
142
- }
143
- /** Infers the input type of a Standard. */
144
- type InferInput<Schema extends StandardTypedV1> = StandardTypedV1.InferInput<Schema>;
145
- /** Infers the output type of a Standard. */
146
- type InferOutput<Schema extends StandardTypedV1> = StandardTypedV1.InferOutput<Schema>;
147
- }
148
-
149
- declare const $output: unique symbol;
150
- type $output = typeof $output;
151
- declare const $input: unique symbol;
152
- type $input = typeof $input;
153
- type $replace<Meta, S extends $ZodType> = Meta extends $output ? output<S> : Meta extends $input ? input<S> : Meta extends (infer M)[] ? $replace<M, S>[] : Meta extends (...args: infer P) => infer R ? (...args: {
154
- [K in keyof P]: $replace<P[K], S>;
155
- }) => $replace<R, S> : Meta extends object ? {
156
- [K in keyof Meta]: $replace<Meta[K], S>;
157
- } : Meta;
158
- type MetadataType = object | undefined;
159
- declare class $ZodRegistry<Meta extends MetadataType = MetadataType, Schema extends $ZodType = $ZodType> {
160
- _meta: Meta;
161
- _schema: Schema;
162
- _map: WeakMap<Schema, $replace<Meta, Schema>>;
163
- _idmap: Map<string, Schema>;
164
- add<S extends Schema>(schema: S, ..._meta: undefined extends Meta ? [$replace<Meta, S>?] : [$replace<Meta, S>]): this;
165
- clear(): this;
166
- remove(schema: Schema): this;
167
- get<S extends Schema>(schema: S): $replace<Meta, S> | undefined;
168
- has(schema: Schema): boolean;
169
- }
170
-
171
- type Processor<T extends $ZodType = $ZodType> = (schema: T, ctx: ToJSONSchemaContext, json: BaseSchema, params: ProcessParams) => void;
172
- interface ProcessParams {
173
- schemaPath: $ZodType[];
174
- path: (string | number)[];
175
- }
176
- interface Seen {
177
- /** JSON Schema result for this Zod schema */
178
- schema: BaseSchema;
179
- /** A cached version of the schema that doesn't get overwritten during ref resolution */
180
- def?: BaseSchema;
181
- defId?: string | undefined;
182
- /** Number of times this schema was encountered during traversal */
183
- count: number;
184
- /** Cycle path */
185
- cycle?: (string | number)[] | undefined;
186
- isParent?: boolean | undefined;
187
- /** Schema to inherit JSON Schema properties from (set by processor for wrappers) */
188
- ref?: $ZodType | null;
189
- /** JSON Schema property path for this schema */
190
- path?: (string | number)[] | undefined;
191
- }
192
- interface ToJSONSchemaContext {
193
- processors: Record<string, Processor>;
194
- metadataRegistry: $ZodRegistry<Record<string, any>>;
195
- target: "draft-04" | "draft-07" | "draft-2020-12" | "openapi-3.0" | ({} & string);
196
- unrepresentable: "throw" | "any";
197
- override: (ctx: {
198
- zodSchema: $ZodType;
199
- jsonSchema: BaseSchema;
200
- path: (string | number)[];
201
- }) => void;
202
- io: "input" | "output";
203
- counter: number;
204
- seen: Map<$ZodType, Seen>;
205
- cycles: "ref" | "throw";
206
- reused: "ref" | "inline";
207
- external?: {
208
- registry: $ZodRegistry<{
209
- id?: string | undefined;
210
- }>;
211
- uri?: ((id: string) => string) | undefined;
212
- defs: Record<string, BaseSchema>;
213
- } | undefined;
214
- }
215
-
216
- type IsAny<T> = 0 extends 1 & T ? true : false;
217
- type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
218
- type MakePartial<T, K extends keyof T> = Omit<T, K> & InexactPartial<Pick<T, K>>;
219
- type LoosePartial<T extends object> = InexactPartial<T> & {
220
- [k: string]: unknown;
221
- };
222
- type InexactPartial<T> = {
223
- [P in keyof T]?: T[P] | undefined;
224
- };
225
- type Identity<T> = T;
226
- type Flatten<T> = Identity<{
227
- [k in keyof T]: T[k];
228
- }>;
229
- type Prettify<T> = {
230
- [K in keyof T]: T[K];
231
- } & {};
232
- type AnyFunc = (...args: any[]) => any;
233
- type MaybeAsync<T> = T | Promise<T>;
234
- type EnumValue = string | number;
235
- type EnumLike = Readonly<Record<string, EnumValue>>;
236
- type Primitive = string | number | symbol | bigint | boolean | null | undefined;
237
- type SafeParseResult<T> = SafeParseSuccess<T> | SafeParseError<T>;
238
- type SafeParseSuccess<T> = {
239
- success: true;
240
- data: T;
241
- error?: never;
242
- };
243
- type SafeParseError<T> = {
244
- success: false;
245
- data?: never;
246
- error: $ZodError<T>;
247
- };
248
- type PropValues = Record<string, Set<Primitive>>;
249
- type PrimitiveSet = Set<Primitive>;
250
- declare abstract class Class {
251
- constructor(..._args: any[]);
252
- }
253
-
254
- declare const version: {
255
- readonly major: 4;
256
- readonly minor: 4;
257
- readonly patch: number;
258
- };
259
-
260
- interface ParseContext<T extends $ZodIssueBase = never> {
261
- /** Customize error messages. */
262
- readonly error?: $ZodErrorMap<T>;
263
- /** Include the `input` field in issue objects. Default `false`. */
264
- readonly reportInput?: boolean;
265
- /** Skip eval-based fast path. Default `false`. */
266
- readonly jitless?: boolean;
267
- }
268
- /** @internal */
269
- interface ParseContextInternal<T extends $ZodIssueBase = never> extends ParseContext<T> {
270
- readonly async?: boolean | undefined;
271
- readonly direction?: "forward" | "backward";
272
- readonly skipChecks?: boolean;
273
- }
274
- interface ParsePayload<T = unknown> {
275
- value: T;
276
- issues: $ZodRawIssue[];
277
- /** A way to mark a whole payload as aborted. Used in codecs/pipes. */
278
- aborted?: boolean;
279
- /** @internal Marks a value as a fallback that an outer wrapper (e.g.
280
- * $ZodOptional) may override with its own interpretation when input was
281
- * undefined. Set by $ZodCatch when catchValue substitutes and by every
282
- * $ZodTransform invocation. */
283
- fallback?: boolean | undefined;
284
- }
285
- type CheckFn<T> = (input: ParsePayload<T>) => MaybeAsync<void>;
286
- interface $ZodTypeDef {
287
- 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";
288
- error?: $ZodErrorMap<never> | undefined;
289
- checks?: $ZodCheck<never>[];
290
- }
291
- interface _$ZodTypeInternals {
292
- /** The `@zod/core` version of this schema */
293
- version: typeof version;
294
- /** Schema definition. */
295
- def: $ZodTypeDef;
296
- /** @internal Randomly generated ID for this schema. */
297
- /** @internal List of deferred initializers. */
298
- deferred: AnyFunc[] | undefined;
299
- /** @internal Parses input and runs all checks (refinements). */
300
- run(payload: ParsePayload<any>, ctx: ParseContextInternal): MaybeAsync<ParsePayload>;
301
- /** @internal Parses input, doesn't run checks. */
302
- parse(payload: ParsePayload<any>, ctx: ParseContextInternal): MaybeAsync<ParsePayload>;
303
- /** @internal Stores identifiers for the set of traits implemented by this schema. */
304
- traits: Set<string>;
305
- /** @internal Indicates that a schema output type should be considered optional inside objects.
306
- * @default Required
307
- */
308
- /** @internal */
309
- optin?: "optional" | undefined;
310
- /** @internal */
311
- optout?: "optional" | undefined;
312
- /** @internal The set of literal values that will pass validation. Must be an exhaustive set. Used to determine optionality in z.record().
313
- *
314
- * Defined on: enum, const, literal, null, undefined
315
- * Passthrough: optional, nullable, branded, default, catch, pipe
316
- * Todo: unions?
317
- */
318
- values?: PrimitiveSet | undefined;
319
- /** Default value bubbled up from */
320
- /** @internal A set of literal discriminators used for the fast path in discriminated unions. */
321
- propValues?: PropValues | undefined;
322
- /** @internal This flag indicates that a schema validation can be represented with a regular expression. Used to determine allowable schemas in z.templateLiteral(). */
323
- pattern: RegExp | undefined;
324
- /** @internal The constructor function of this schema. */
325
- constr: new (def: any) => $ZodType;
326
- /** @internal A catchall object for bag metadata related to this schema. Commonly modified by checks using `onattach`. */
327
- bag: Record<string, unknown>;
328
- /** @internal The set of issues this schema might throw during type checking. */
329
- isst: $ZodIssueBase;
330
- /** @internal Subject to change, not a public API. */
331
- processJSONSchema?: ((ctx: ToJSONSchemaContext, json: BaseSchema, params: ProcessParams) => void) | undefined;
332
- /** An optional method used to override `toJSONSchema` logic. */
333
- toJSONSchema?: () => unknown;
334
- /** @internal The parent of this schema. Only set during certain clone operations. */
335
- parent?: $ZodType | undefined;
336
- }
337
- /** @internal */
338
- interface $ZodTypeInternals<out O = unknown, out I = unknown> extends _$ZodTypeInternals {
339
- /** @internal The inferred output type */
340
- output: O;
341
- /** @internal The inferred input type */
342
- input: I;
343
- }
344
- type $ZodStandardSchema<T> = StandardSchemaV1.Props<input<T>, output<T>>;
345
- type SomeType$1 = {
346
- _zod: _$ZodTypeInternals;
347
- };
348
- interface _$ZodType<T extends $ZodTypeInternals = $ZodTypeInternals> extends $ZodType<T["output"], T["input"], T> {
349
- }
350
- interface $ZodType<O = unknown, I = unknown, Internals extends $ZodTypeInternals<O, I> = $ZodTypeInternals<O, I>> {
351
- _zod: Internals;
352
- "~standard": $ZodStandardSchema<this>;
353
- }
354
- declare const $ZodType: $constructor<$ZodType>;
355
-
356
- interface $ZodStringDef extends $ZodTypeDef {
357
- type: "string";
358
- coerce?: boolean;
359
- checks?: $ZodCheck<string>[];
360
- }
361
- interface $ZodStringInternals<Input> extends $ZodTypeInternals<string, Input> {
362
- def: $ZodStringDef;
363
- /** @deprecated Internal API, use with caution (not deprecated) */
364
- pattern: RegExp;
365
- /** @deprecated Internal API, use with caution (not deprecated) */
366
- isst: $ZodIssueInvalidType;
367
- bag: LoosePartial<{
368
- minimum: number;
369
- maximum: number;
370
- patterns: Set<RegExp>;
371
- format: string;
372
- contentEncoding: string;
373
- }>;
374
- }
375
- interface $ZodString<Input = unknown> extends _$ZodType<$ZodStringInternals<Input>> {
376
- }
377
- declare const $ZodString: $constructor<$ZodString>;
378
- interface $ZodStringFormatDef<Format extends string = string> extends $ZodStringDef, $ZodCheckStringFormatDef<Format> {
379
- }
380
- interface $ZodStringFormatInternals<Format extends string = string> extends $ZodStringInternals<string>, $ZodCheckStringFormatInternals {
381
- def: $ZodStringFormatDef<Format>;
382
- }
383
- interface $ZodURLDef extends $ZodStringFormatDef<"url"> {
384
- hostname?: RegExp | undefined;
385
- protocol?: RegExp | undefined;
386
- normalize?: boolean | undefined;
387
- }
388
- interface $ZodURLInternals extends $ZodStringFormatInternals<"url"> {
389
- def: $ZodURLDef;
390
- }
391
- interface $ZodNumberDef extends $ZodTypeDef {
392
- type: "number";
393
- coerce?: boolean;
394
- }
395
- interface $ZodNumberInternals<Input = unknown> extends $ZodTypeInternals<number, Input> {
396
- def: $ZodNumberDef;
397
- /** @deprecated Internal API, use with caution (not deprecated) */
398
- pattern: RegExp;
399
- /** @deprecated Internal API, use with caution (not deprecated) */
400
- isst: $ZodIssueInvalidType;
401
- bag: LoosePartial<{
402
- minimum: number;
403
- maximum: number;
404
- exclusiveMinimum: number;
405
- exclusiveMaximum: number;
406
- format: string;
407
- pattern: RegExp;
408
- }>;
409
- }
410
- interface $ZodNumber<Input = unknown> extends $ZodType {
411
- _zod: $ZodNumberInternals<Input>;
412
- }
413
- declare const $ZodNumber: $constructor<$ZodNumber>;
414
- interface $ZodUnknownDef extends $ZodTypeDef {
415
- type: "unknown";
416
- }
417
- interface $ZodUnknownInternals extends $ZodTypeInternals<unknown, unknown> {
418
- def: $ZodUnknownDef;
419
- isst: never;
420
- }
421
- type OptionalOutSchema = {
422
- _zod: {
423
- optout: "optional";
424
- };
425
- };
426
- type OptionalInSchema = {
427
- _zod: {
428
- optin: "optional";
429
- };
430
- };
431
- type $InferObjectOutput<T extends $ZodLooseShape, Extra extends Record<string, unknown>> = string extends keyof T ? IsAny<T[keyof T]> extends true ? Record<string, unknown> : Record<string, output<T[keyof T]>> : keyof (T & Extra) extends never ? Record<string, never> : Prettify<{
432
- -readonly [k in keyof T as T[k] extends OptionalOutSchema ? never : k]: T[k]["_zod"]["output"];
433
- } & {
434
- -readonly [k in keyof T as T[k] extends OptionalOutSchema ? k : never]?: T[k]["_zod"]["output"];
435
- } & Extra>;
436
- type $InferObjectInput<T extends $ZodLooseShape, Extra extends Record<string, unknown>> = string extends keyof T ? IsAny<T[keyof T]> extends true ? Record<string, unknown> : Record<string, input<T[keyof T]>> : keyof (T & Extra) extends never ? Record<string, never> : Prettify<{
437
- -readonly [k in keyof T as T[k] extends OptionalInSchema ? never : k]: T[k]["_zod"]["input"];
438
- } & {
439
- -readonly [k in keyof T as T[k] extends OptionalInSchema ? k : never]?: T[k]["_zod"]["input"];
440
- } & Extra>;
441
- type $ZodObjectConfig = {
442
- out: Record<string, unknown>;
443
- in: Record<string, unknown>;
444
- };
445
- type $strip = {
446
- out: {};
447
- in: {};
448
- };
449
- type $ZodShape = Readonly<{
450
- [k: string]: $ZodType;
451
- }>;
452
- interface $ZodObjectDef<Shape extends $ZodShape = $ZodShape> extends $ZodTypeDef {
453
- type: "object";
454
- shape: Shape;
455
- catchall?: $ZodType | undefined;
456
- }
457
- interface $ZodObjectInternals<
458
- /** @ts-ignore Cast variance */
459
- out Shape extends $ZodShape = $ZodShape, out Config extends $ZodObjectConfig = $ZodObjectConfig> extends _$ZodTypeInternals {
460
- def: $ZodObjectDef<Shape>;
461
- config: Config;
462
- isst: $ZodIssueInvalidType | $ZodIssueUnrecognizedKeys;
463
- propValues: PropValues;
464
- output: $InferObjectOutput<Shape, Config["out"]>;
465
- input: $InferObjectInput<Shape, Config["in"]>;
466
- optin?: "optional" | undefined;
467
- optout?: "optional" | undefined;
468
- }
469
- type $ZodLooseShape = Record<string, any>;
470
- interface $ZodObject<
471
- /** @ts-ignore Cast variance */
472
- out Shape extends Readonly<$ZodShape> = Readonly<$ZodShape>, out Params extends $ZodObjectConfig = $ZodObjectConfig> extends $ZodType<any, any, $ZodObjectInternals<Shape, Params>> {
473
- }
474
- declare const $ZodObject: $constructor<$ZodObject>;
475
- type $ZodRecordKey = $ZodType<string | number | symbol, unknown>;
476
- interface $ZodRecordDef<Key extends $ZodRecordKey = $ZodRecordKey, Value extends SomeType$1 = $ZodType> extends $ZodTypeDef {
477
- type: "record";
478
- keyType: Key;
479
- valueType: Value;
480
- /** @default "strict" - errors on keys not matching keyType. "loose" passes through non-matching keys unchanged. */
481
- mode?: "strict" | "loose";
482
- }
483
- 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>>;
484
- type $InferZodRecordInput<Key extends $ZodRecordKey = $ZodRecordKey, Value extends SomeType$1 = $ZodType> = Key extends $partial ? Partial<Record<input<Key> & PropertyKey, input<Value>>> : Record<input<Key> & PropertyKey, input<Value>>;
485
- interface $ZodRecordInternals<Key extends $ZodRecordKey = $ZodRecordKey, Value extends SomeType$1 = $ZodType> extends $ZodTypeInternals<$InferZodRecordOutput<Key, Value>, $InferZodRecordInput<Key, Value>> {
486
- def: $ZodRecordDef<Key, Value>;
487
- isst: $ZodIssueInvalidType | $ZodIssueInvalidKey<Record<PropertyKey, unknown>>;
488
- optin?: "optional" | undefined;
489
- optout?: "optional" | undefined;
490
- }
491
- type $partial = {
492
- "~~partial": true;
493
- };
494
- type $InferEnumOutput<T extends EnumLike> = T[keyof T] & {};
495
- type $InferEnumInput<T extends EnumLike> = T[keyof T] & {};
496
- interface $ZodEnumDef<T extends EnumLike = EnumLike> extends $ZodTypeDef {
497
- type: "enum";
498
- entries: T;
499
- }
500
- interface $ZodEnumInternals<
501
- /** @ts-ignore Cast variance */
502
- out T extends EnumLike = EnumLike> extends $ZodTypeInternals<$InferEnumOutput<T>, $InferEnumInput<T>> {
503
- def: $ZodEnumDef<T>;
504
- /** @deprecated Internal API, use with caution (not deprecated) */
505
- values: PrimitiveSet;
506
- /** @deprecated Internal API, use with caution (not deprecated) */
507
- pattern: RegExp;
508
- isst: $ZodIssueInvalidValue;
509
- }
510
- interface $ZodNullableDef<T extends SomeType$1 = $ZodType> extends $ZodTypeDef {
511
- type: "nullable";
512
- innerType: T;
513
- }
514
- interface $ZodNullableInternals<T extends SomeType$1 = $ZodType> extends $ZodTypeInternals<output<T> | null, input<T> | null> {
515
- def: $ZodNullableDef<T>;
516
- optin: T["_zod"]["optin"];
517
- optout: T["_zod"]["optout"];
518
- isst: never;
519
- values: T["_zod"]["values"];
520
- pattern: T["_zod"]["pattern"];
521
- }
522
-
523
- interface $ZodCheckDef {
524
- check: string;
525
- error?: $ZodErrorMap<never> | undefined;
526
- /** If true, no later checks will be executed if this check fails. Default `false`. */
527
- abort?: boolean | undefined;
528
- /** If provided, the check runs only when this returns `true`. By default, it is skipped if prior parsing produced aborting issues. */
529
- when?: ((payload: ParsePayload) => boolean) | undefined;
530
- }
531
- interface $ZodCheckInternals<T> {
532
- def: $ZodCheckDef;
533
- /** The set of issues this check might throw. */
534
- issc?: $ZodIssueBase;
535
- check(payload: ParsePayload<T>): MaybeAsync<void>;
536
- onattach: ((schema: $ZodType) => void)[];
537
- }
538
- interface $ZodCheck<in T = never> {
539
- _zod: $ZodCheckInternals<T>;
540
- }
541
- declare const $ZodCheck: $constructor<$ZodCheck<any>>;
542
- 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";
543
- interface $ZodCheckStringFormatDef<Format extends string = string> extends $ZodCheckDef {
544
- check: "string_format";
545
- format: Format;
546
- pattern?: RegExp | undefined;
547
- }
548
- interface $ZodCheckStringFormatInternals extends $ZodCheckInternals<string> {
549
- def: $ZodCheckStringFormatDef;
550
- issc: $ZodIssueInvalidStringFormat;
551
- }
552
-
553
- interface $ZodIssueBase {
554
- readonly code?: string;
555
- readonly input?: unknown;
556
- readonly path: PropertyKey[];
557
- readonly message: string;
558
- }
559
- type $ZodInvalidTypeExpected = "string" | "number" | "int" | "boolean" | "bigint" | "symbol" | "undefined" | "null" | "never" | "void" | "date" | "array" | "object" | "tuple" | "record" | "map" | "set" | "file" | "nonoptional" | "nan" | "function" | (string & {});
560
- interface $ZodIssueInvalidType<Input = unknown> extends $ZodIssueBase {
561
- readonly code: "invalid_type";
562
- readonly expected: $ZodInvalidTypeExpected;
563
- readonly input?: Input;
564
- }
565
- interface $ZodIssueTooBig<Input = unknown> extends $ZodIssueBase {
566
- readonly code: "too_big";
567
- readonly origin: "number" | "int" | "bigint" | "date" | "string" | "array" | "set" | "file" | (string & {});
568
- readonly maximum: number | bigint;
569
- readonly inclusive?: boolean;
570
- readonly exact?: boolean;
571
- readonly input?: Input;
572
- }
573
- interface $ZodIssueTooSmall<Input = unknown> extends $ZodIssueBase {
574
- readonly code: "too_small";
575
- readonly origin: "number" | "int" | "bigint" | "date" | "string" | "array" | "set" | "file" | (string & {});
576
- readonly minimum: number | bigint;
577
- /** True if the allowable range includes the minimum */
578
- readonly inclusive?: boolean;
579
- /** True if the allowed value is fixed (e.g.` z.length(5)`), not a range (`z.minLength(5)`) */
580
- readonly exact?: boolean;
581
- readonly input?: Input;
582
- }
583
- interface $ZodIssueInvalidStringFormat extends $ZodIssueBase {
584
- readonly code: "invalid_format";
585
- readonly format: $ZodStringFormats | (string & {});
586
- readonly pattern?: string;
587
- readonly input?: string;
588
- }
589
- interface $ZodIssueNotMultipleOf<Input extends number | bigint = number | bigint> extends $ZodIssueBase {
590
- readonly code: "not_multiple_of";
591
- readonly divisor: number;
592
- readonly input?: Input;
593
- }
594
- interface $ZodIssueUnrecognizedKeys extends $ZodIssueBase {
595
- readonly code: "unrecognized_keys";
596
- readonly keys: string[];
597
- readonly input?: Record<string, unknown>;
598
- }
599
- interface $ZodIssueInvalidUnionNoMatch extends $ZodIssueBase {
600
- readonly code: "invalid_union";
601
- readonly errors: $ZodIssue[][];
602
- readonly input?: unknown;
603
- readonly discriminator?: string | undefined;
604
- readonly options?: Primitive[];
605
- readonly inclusive?: true;
606
- }
607
- interface $ZodIssueInvalidUnionMultipleMatch extends $ZodIssueBase {
608
- readonly code: "invalid_union";
609
- readonly errors: [];
610
- readonly input?: unknown;
611
- readonly discriminator?: string | undefined;
612
- readonly inclusive: false;
613
- }
614
- type $ZodIssueInvalidUnion = $ZodIssueInvalidUnionNoMatch | $ZodIssueInvalidUnionMultipleMatch;
615
- interface $ZodIssueInvalidKey<Input = unknown> extends $ZodIssueBase {
616
- readonly code: "invalid_key";
617
- readonly origin: "map" | "record";
618
- readonly issues: $ZodIssue[];
619
- readonly input?: Input;
620
- }
621
- interface $ZodIssueInvalidElement<Input = unknown> extends $ZodIssueBase {
622
- readonly code: "invalid_element";
623
- readonly origin: "map" | "set";
624
- readonly key: unknown;
625
- readonly issues: $ZodIssue[];
626
- readonly input?: Input;
627
- }
628
- interface $ZodIssueInvalidValue<Input = unknown> extends $ZodIssueBase {
629
- readonly code: "invalid_value";
630
- readonly values: Primitive[];
631
- readonly input?: Input;
632
- }
633
- interface $ZodIssueCustom extends $ZodIssueBase {
634
- readonly code: "custom";
635
- readonly params?: Record<string, any> | undefined;
636
- readonly input?: unknown;
637
- }
638
- type $ZodIssue = $ZodIssueInvalidType | $ZodIssueTooBig | $ZodIssueTooSmall | $ZodIssueInvalidStringFormat | $ZodIssueNotMultipleOf | $ZodIssueUnrecognizedKeys | $ZodIssueInvalidUnion | $ZodIssueInvalidKey | $ZodIssueInvalidElement | $ZodIssueInvalidValue | $ZodIssueCustom;
639
- type $ZodInternalIssue<T extends $ZodIssueBase = $ZodIssue> = T extends any ? RawIssue<T> : never;
640
- type RawIssue<T extends $ZodIssueBase> = T extends any ? Flatten<MakePartial<T, "message" | "path"> & {
641
- /** The input data */
642
- readonly input: unknown;
643
- /** The schema or check that originated this issue. */
644
- readonly inst?: $ZodType | $ZodCheck;
645
- /** If `true`, Zod will continue executing checks/refinements after this issue. */
646
- readonly continue?: boolean | undefined;
647
- } & Record<string, unknown>> : never;
648
- type $ZodRawIssue<T extends $ZodIssueBase = $ZodIssue> = $ZodInternalIssue<T>;
649
- interface $ZodErrorMap<T extends $ZodIssueBase = $ZodIssue> {
650
- (issue: $ZodRawIssue<T>): {
651
- message: string;
652
- } | string | undefined | null;
653
- }
654
- interface $ZodError<T = unknown> extends Error {
655
- type: T;
656
- issues: $ZodIssue[];
657
- _zod: {
658
- output: T;
659
- def: $ZodIssue[];
660
- };
661
- stack?: string;
662
- name: string;
663
- }
664
- declare const $ZodError: $constructor<$ZodError>;
665
-
666
- type ZodTrait = {
667
- _zod: {
668
- def: any;
669
- [k: string]: any;
670
- };
671
- };
672
- interface $constructor<T extends ZodTrait, D = T["_zod"]["def"]> {
673
- new (def: D): T;
674
- init(inst: T, def: D): asserts inst is T;
675
- }
676
- declare function $constructor<T extends ZodTrait, D = T["_zod"]["def"]>(name: string, initializer: (inst: T, def: D) => void, params?: {
677
- Parent?: typeof Class;
678
- }): $constructor<T, D>;
679
- declare const $brand: unique symbol;
680
- type $brand<T extends string | number | symbol = string | number | symbol> = {
681
- [$brand]: {
682
- [k in T]: true;
683
- };
684
- };
685
- type $ZodBranded<T extends SomeType$1, Brand extends string | number | symbol, Dir extends "in" | "out" | "inout" = "out"> = T & (Dir extends "inout" ? {
686
- _zod: {
687
- input: input<T> & $brand<Brand>;
688
- output: output<T> & $brand<Brand>;
689
- };
690
- } : Dir extends "in" ? {
691
- _zod: {
692
- input: input<T> & $brand<Brand>;
693
- };
694
- } : {
695
- _zod: {
696
- output: output<T> & $brand<Brand>;
697
- };
698
- });
699
- type input<T> = T extends {
700
- _zod: {
701
- input: any;
702
- };
703
- } ? T["_zod"]["input"] : unknown;
704
- type output<T> = T extends {
705
- _zod: {
706
- output: any;
707
- };
708
- } ? T["_zod"]["output"] : unknown;
709
-
710
5
  type ToolDefinition<
711
6
  Id extends string = string,
712
7
  InputSchema extends z.ZodType = z.ZodType,
@@ -969,115 +264,48 @@ type AnySubscription = Subscription<string, z.ZodType, z.ZodType>
969
264
 
970
265
  type AnyTool = AnyQuery | AnyMutation | AnySubscription
971
266
 
972
- type SomeType = SomeType$1;
973
- interface _ZodMiniType<out Internals extends $ZodTypeInternals = $ZodTypeInternals> extends ZodMiniType<any, any, Internals> {
974
- }
975
- interface ZodMiniType<out Output = unknown, out Input = unknown, out Internals extends $ZodTypeInternals<Output, Input> = $ZodTypeInternals<Output, Input>> extends $ZodType<Output, Input, Internals> {
976
- type: Internals["def"]["type"];
977
- check(...checks: (CheckFn<output<this>> | $ZodCheck<output<this>>)[]): this;
978
- with(...checks: (CheckFn<output<this>> | $ZodCheck<output<this>>)[]): this;
979
- clone(def?: Internals["def"], params?: {
980
- parent: boolean;
981
- }): this;
982
- register<R extends $ZodRegistry>(registry: R, ...meta: this extends R["_schema"] ? undefined extends R["_meta"] ? [$replace<R["_meta"], this>?] : [$replace<R["_meta"], this>] : ["Incompatible schema"]): this;
983
- brand<T extends PropertyKey = PropertyKey, Dir extends "in" | "out" | "inout" = "out">(value?: T): PropertyKey extends T ? this : $ZodBranded<this, T, Dir>;
984
- def: Internals["def"];
985
- parse(data: unknown, params?: ParseContext<$ZodIssue>): output<this>;
986
- safeParse(data: unknown, params?: ParseContext<$ZodIssue>): SafeParseResult<output<this>>;
987
- parseAsync(data: unknown, params?: ParseContext<$ZodIssue>): Promise<output<this>>;
988
- safeParseAsync(data: unknown, params?: ParseContext<$ZodIssue>): Promise<SafeParseResult<output<this>>>;
989
- apply<T>(fn: (schema: this) => T): T;
990
- }
991
- declare const ZodMiniType: $constructor<ZodMiniType>;
992
- interface _ZodMiniString<T extends $ZodStringInternals<unknown> = $ZodStringInternals<unknown>> extends _ZodMiniType<T>, $ZodString<T["input"]> {
993
- _zod: T;
994
- }
995
- interface ZodMiniString<Input = unknown> extends _ZodMiniString<$ZodStringInternals<Input>>, $ZodString<Input> {
996
- }
997
- declare const ZodMiniString: $constructor<ZodMiniString>;
998
- interface ZodMiniURL extends _ZodMiniString<$ZodURLInternals> {
999
- }
1000
- declare const ZodMiniURL: $constructor<ZodMiniURL>;
1001
- interface _ZodMiniNumber<T extends $ZodNumberInternals<unknown> = $ZodNumberInternals<unknown>> extends _ZodMiniType<T>, $ZodNumber<T["input"]> {
1002
- _zod: T;
1003
- }
1004
- interface ZodMiniNumber<Input = unknown> extends _ZodMiniNumber<$ZodNumberInternals<Input>>, $ZodNumber<Input> {
1005
- }
1006
- declare const ZodMiniNumber: $constructor<ZodMiniNumber>;
1007
- interface ZodMiniUnknown extends _ZodMiniType<$ZodUnknownInternals> {
1008
- }
1009
- declare const ZodMiniUnknown: $constructor<ZodMiniUnknown>;
1010
- interface ZodMiniObject<
1011
- /** @ts-ignore Cast variance */
1012
- out Shape extends $ZodShape = $ZodShape, out Config extends $ZodObjectConfig = $strip> extends ZodMiniType<any, any, $ZodObjectInternals<Shape, Config>>, $ZodObject<Shape, Config> {
1013
- shape: Shape;
1014
- }
1015
- declare const ZodMiniObject: $constructor<ZodMiniObject>;
1016
- interface ZodMiniRecord<Key extends $ZodRecordKey = $ZodRecordKey, Value extends SomeType = $ZodType> extends _ZodMiniType<$ZodRecordInternals<Key, Value>> {
1017
- }
1018
- declare const ZodMiniRecord: $constructor<ZodMiniRecord>;
1019
- interface ZodMiniEnum<T extends EnumLike = EnumLike> extends _ZodMiniType<$ZodEnumInternals<T>> {
1020
- options: Array<T[keyof T]>;
1021
- }
1022
- declare const ZodMiniEnum: $constructor<ZodMiniEnum>;
1023
- interface ZodMiniNullable<T extends SomeType = $ZodType> extends _ZodMiniType<$ZodNullableInternals<T>> {
267
+ declare global {
268
+ interface AsyncDisposable {
269
+ }
270
+ interface SymbolConstructor {
271
+ readonly asyncDispose: unique symbol;
272
+ }
1024
273
  }
1025
- declare const ZodMiniNullable: $constructor<ZodMiniNullable>;
1026
274
 
1027
- declare const $Sprite: ZodMiniObject<{
1028
- id: ZodMiniString<string>;
1029
- name: ZodMiniString<string>;
1030
- ownedByPersonId: ZodMiniString<string>;
1031
- publishedSpriteBuild: ZodMiniNullable<ZodMiniObject<{
1032
- id: ZodMiniString<string>;
1033
- spriteId: ZodMiniString<string>;
1034
- parentSpriteBuildId: ZodMiniNullable<ZodMiniString<string>>;
1035
- createdByPerson: ZodMiniObject<{
1036
- id: ZodMiniString<string>;
1037
- name: ZodMiniString<string>;
1038
- }, $strip>;
1039
- prompt: ZodMiniString<string>;
1040
- status: ZodMiniEnum<{
1041
- PENDING: "PENDING";
1042
- IN_PROGRESS: "IN_PROGRESS";
1043
- READY: "READY";
1044
- ERROR: "ERROR";
1045
- }>;
1046
- artifactUrl: ZodMiniNullable<ZodMiniURL>;
1047
- sourceUrl: ZodMiniNullable<ZodMiniURL>;
1048
- startedAt: ZodMiniNullable<ZodMiniNumber<number>>;
1049
- stoppedAt: ZodMiniNullable<ZodMiniNumber<number>>;
1050
- error: ZodMiniNullable<ZodMiniRecord<ZodMiniString<string>, ZodMiniUnknown>>;
1051
- reasoningSummary: ZodMiniNullable<ZodMiniString<string>>;
1052
- publishedAt: ZodMiniNullable<ZodMiniNumber<number>>;
1053
- }, $strip>>;
1054
- }, $strip>;
1055
- type Sprite = output<typeof $Sprite>;
275
+ /** Identifier type for public.person */
276
+ type PersonId = string & { __brand: 'public.person' };
1056
277
 
1057
- declare const $SpriteBuild: ZodMiniObject<{
1058
- id: ZodMiniString<string>;
1059
- spriteId: ZodMiniString<string>;
1060
- parentSpriteBuildId: ZodMiniNullable<ZodMiniString<string>>;
1061
- createdByPerson: ZodMiniObject<{
1062
- id: ZodMiniString<string>;
1063
- name: ZodMiniString<string>;
1064
- }, $strip>;
1065
- prompt: ZodMiniString<string>;
1066
- status: ZodMiniEnum<{
1067
- PENDING: "PENDING";
1068
- IN_PROGRESS: "IN_PROGRESS";
1069
- READY: "READY";
1070
- ERROR: "ERROR";
1071
- }>;
1072
- artifactUrl: ZodMiniNullable<ZodMiniURL>;
1073
- sourceUrl: ZodMiniNullable<ZodMiniURL>;
1074
- startedAt: ZodMiniNullable<ZodMiniNumber<number>>;
1075
- stoppedAt: ZodMiniNullable<ZodMiniNumber<number>>;
1076
- error: ZodMiniNullable<ZodMiniRecord<ZodMiniString<string>, ZodMiniUnknown>>;
1077
- reasoningSummary: ZodMiniNullable<ZodMiniString<string>>;
1078
- publishedAt: ZodMiniNullable<ZodMiniNumber<number>>;
1079
- }, $strip>;
1080
- type SpriteBuild = output<typeof $SpriteBuild>;
278
+ /** Identifier type for public.surface */
279
+ type SurfaceId = string & { __brand: 'public.surface' };
280
+
281
+ /** Identifier type for public.sprite */
282
+ type SpriteId = string & { __brand: 'public.sprite' };
283
+
284
+ /** Identifier type for public.sprite_build */
285
+ type SpriteBuildId = string & { __brand: 'public.sprite_build' };
286
+
287
+ type SpriteBuild = {
288
+ id: SpriteBuildId;
289
+ spriteId: SpriteId;
290
+ parentSpriteBuildId: SpriteBuildId | null;
291
+ createdByPersonId: PersonId;
292
+ prompt: string;
293
+ status: 'PENDING' | 'IN_PROGRESS' | 'READY' | 'ERROR';
294
+ artifactUrl: string | null;
295
+ sourceUrl: string | null;
296
+ startedAt: number | null;
297
+ stoppedAt: number | null;
298
+ error: Record<string, unknown> | null;
299
+ reasoningSummary: string | null;
300
+ publishedAt: number | null;
301
+ };
302
+
303
+ type Sprite = {
304
+ id: SpriteId;
305
+ name: string;
306
+ ownedByPersonId: PersonId;
307
+ publishedSpriteBuildId: SpriteBuildId | null;
308
+ };
1081
309
 
1082
310
  type SurfaceDefinition = {
1083
311
  key: string;
@@ -1092,9 +320,8 @@ declare const getRoughFeatures: (surface: SurfaceDefinition, callback: (features
1092
320
  type FetchUserTokenFn = () => string | Promise<string>;
1093
321
 
1094
322
  type SurfaceEntry = {
1095
- surfaceId: string;
323
+ surfaceId: SurfaceId;
1096
324
  toolList: readonly AnyTool[];
1097
- triggerRefresh: () => void;
1098
325
  };
1099
326
  declare const registerSurfaceEntry: (key: string, entry: SurfaceEntry) => (() => void);
1100
327
 
@@ -1151,10 +378,9 @@ type ResizeHandle = ReturnType<typeof ResizeHandle>;
1151
378
 
1152
379
  type Props$7 = {
1153
380
  toolList: readonly AnyTool[];
1154
- surfaceId: string;
381
+ surfaceId: SurfaceId;
1155
382
  projectId?: string;
1156
383
  onclose?: () => void;
1157
- onpublish?: (sprite: Sprite, spriteBuild: SpriteBuild) => void;
1158
384
  };
1159
385
  declare const RoughCreateModal: svelte.Component<Props$7, {}, "">;
1160
386
  type RoughCreateModal = ReturnType<typeof RoughCreateModal>;
@@ -1163,7 +389,6 @@ type Props$6 = {
1163
389
  toolList: readonly AnyTool[];
1164
390
  label?: string;
1165
391
  spriteId: string;
1166
- onpublish?: (sprite: Sprite, spriteBuild: SpriteBuild) => void;
1167
392
  };
1168
393
  declare const RoughEditButton: svelte.Component<Props$6, {}, "">;
1169
394
  type RoughEditButton = ReturnType<typeof RoughEditButton>;
@@ -1182,8 +407,8 @@ type SpriteFrameDatastoreContext = {
1182
407
  };
1183
408
 
1184
409
  type Props$5 = {
1185
- featureId: string;
1186
- buildId: string;
410
+ featureId: SpriteId;
411
+ buildId: SpriteBuildId;
1187
412
  surfaceKey: string;
1188
413
  datastore?: SpriteFrameDatastore;
1189
414
  };
@@ -1215,7 +440,7 @@ declare const SecondaryButton: svelte.Component<Props$3, {}, "">;
1215
440
  type SecondaryButton = ReturnType<typeof SecondaryButton>;
1216
441
 
1217
442
  type Props$2 = {
1218
- surfaceId: string;
443
+ surfaceId: SurfaceId;
1219
444
  onselect?: (sprite: Sprite, spriteBuild: SpriteBuild) => Promise<void> | void;
1220
445
  };
1221
446
  declare const SpriteBuildMenu: svelte.Component<Props$2, {}, "">;
@@ -1223,7 +448,7 @@ type SpriteBuildMenu = ReturnType<typeof SpriteBuildMenu>;
1223
448
 
1224
449
  type Props$1 = {
1225
450
  spriteId: string;
1226
- spriteBuildId: string;
451
+ spriteBuildId: SpriteBuildId;
1227
452
  artifactUrl?: string;
1228
453
  toolList: readonly AnyTool[];
1229
454
  datastore?: SpriteFrameDatastore;
@@ -1239,7 +464,6 @@ type Props = {
1239
464
  toolList: readonly AnyTool[];
1240
465
  spriteId: string;
1241
466
  onclose?: () => void;
1242
- onpublish?: (sprite: Sprite, spriteBuild: SpriteBuild) => void;
1243
467
  };
1244
468
  declare const RoughEditModal: svelte.Component<Props, {}, "">;
1245
469
  type RoughEditModal = ReturnType<typeof RoughEditModal>;