@jarenjs/linq 0.67.0 → 0.72.2

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.
@@ -0,0 +1,45 @@
1
+ /** Structural JSON input: readonly documents and schema interfaces participate.
2
+ * Unknown schema extension members still cross the runtime JSON boundary. */
3
+ type JsonData = string | number | boolean | null | readonly JsonData[] | { readonly [key: string]: JsonData };
4
+ export type JsonInput<T> = unknown extends T ? unknown
5
+ : T extends JsonData ? T
6
+ : T extends (...args: never[]) => unknown ? never
7
+ : T extends object ? { readonly [K in keyof T]: JsonInput<T[K]> } : never;
8
+
9
+ export type FileKind = 'app' | 'jslt' | 'query' | 'state' | 'data' | 'schema' | 'fsm' | 'dag' | 'model' | 'contract';
10
+ export interface ProjectFile<Name extends string = string, Kind extends FileKind = FileKind> {
11
+ readonly name: Name;
12
+ readonly kind: Kind;
13
+ readonly text: string;
14
+ }
15
+ export interface ProjectLayout {
16
+ readonly mode?: 'classic' | 'right' | 'top';
17
+ readonly ratio?: number;
18
+ readonly autorun?: boolean;
19
+ }
20
+ export interface ProjectDocument {
21
+ readonly project: '0.1';
22
+ readonly files: readonly ProjectFile[];
23
+ readonly active?: string;
24
+ readonly layout?: ProjectLayout;
25
+ }
26
+ export const FILE_KINDS: readonly FileKind[];
27
+ export function file<const N extends string, K extends FileKind>(name: N, kind: K, text: string): ProjectFile<N, K>;
28
+ export function jsonFile<const N extends string, K extends FileKind, const D>(name: N, kind: K, document: D & JsonInput<D>): ProjectFile<N, K>;
29
+ /** Names are a phantom; the public document has no extra registry. */
30
+ export class ProjectBuilder<Names extends string = never> {
31
+ protected constructor();
32
+ readonly __names: Names;
33
+ readonly schema: ProjectDocument;
34
+ toJSON(): ProjectDocument;
35
+ files<const F extends readonly ProjectFile[]>(files: F): ProjectBuilder<F[number]['name']>;
36
+ file<const N extends string>(file: ProjectFile<N>): ProjectBuilder<Names | N>;
37
+ active(name: Names): ProjectBuilder<Names>;
38
+ layout(layout: ProjectLayout): ProjectBuilder<Names>;
39
+ }
40
+ export function defineProject<const F extends readonly ProjectFile[] = []>(files?: F, options?: {
41
+ readonly active?: F[number]['name'];
42
+ readonly layout?: ProjectLayout;
43
+ }): ProjectBuilder<F[number]['name']>;
44
+ /** No filename inference is claimed for an arbitrary raw document. */
45
+ export function from(document: ProjectDocument): ProjectBuilder<string>;
package/types/schema.d.ts CHANGED
@@ -161,6 +161,42 @@ export class SchemaBuilder<Out = unknown, In = Out, F extends Flag = never> {
161
161
  readonly schema: JsonSchema | boolean;
162
162
  /** `JSON.stringify(builder)` is the document. */
163
163
  toJSON(): JsonSchema | boolean;
164
+ /** `$id`: resource identity; the phantom is unchanged. */
165
+ id(uri: string): this;
166
+ /** Raw constraint escape hatch, without inferred narrowing. */
167
+ keyword(key: string, value: Json): this;
168
+ /** Validation or annotation only; retains the current phantom. */
169
+ anchor(value: string): this;
170
+ /** Validation or annotation only; retains the current phantom. */
171
+ dynamicRef(value: string): this;
172
+ /** Validation or annotation only; retains the current phantom. */
173
+ dynamicAnchor(value: string): this;
174
+ /** Validation or annotation only; retains the current phantom. */
175
+ recursiveRef(value: string): this;
176
+ /** Validation or annotation only; retains the current phantom. */
177
+ recursiveAnchor(value: boolean): this;
178
+ /** Validation or annotation only; retains the current phantom. */
179
+ dollarData(value: string): this;
180
+ /** Validation or annotation only; retains the current phantom. */
181
+ vocabulary(value: Readonly<Record<string, boolean>>): this;
182
+ /** Validation or annotation only; retains the current phantom. */
183
+ data(value: Readonly<Record<string, string>>): this;
184
+ /** Validation or annotation only; retains the current phantom. */
185
+ not(value: AnyBuilder): this;
186
+ /** Validation or annotation only; retains the current phantom. */
187
+ unevaluatedProperties(value: AnyBuilder): this;
188
+ /** Validation or annotation only; retains the current phantom. */
189
+ unevaluatedItems(value: AnyBuilder): this;
190
+ /** Validation or annotation only; retains the current phantom. */
191
+ dependentSchemas(value: Props): this;
192
+ /** Validation or annotation only; retains the current phantom. */
193
+ definitions(value: Props): this;
194
+ /** Validation or annotation only; retains the current phantom. */
195
+ additionalItems(value: AnyBuilder): this;
196
+ /** Validation or annotation only; retains the current phantom. */
197
+ dependencies(value: Readonly<Record<string, AnyBuilder | readonly string[]>>): this;
198
+ /** Legacy nullable may widen acceptance; no inferred shape is claimed. */
199
+ legacyNullable(value: boolean): SchemaBuilder<unknown, unknown, F>;
164
200
  /** As an object member: left out of `required`. */
165
201
  optional(): SchemaBuilder<Out, In, F | 'optional'>;
166
202
  /** Admit `null`. */
@@ -183,6 +219,20 @@ export class SchemaBuilder<Out = unknown, In = Out, F extends Flag = never> {
183
219
 
184
220
  /** `{ type: 'string' }` and the string constraints. */
185
221
  export class StringBuilder<Out = string, In = Out, F extends Flag = never> extends SchemaBuilder<Out, In, F> {
222
+ /** `contentEncoding`; retains the current phantom. */
223
+ contentEncoding(value: string): this;
224
+ /** `contentMediaType`; retains the current phantom. */
225
+ contentMediaType(value: string): this;
226
+ /** `contentSchema`; retains the current phantom. */
227
+ contentSchema(value: AnyBuilder): this;
228
+ /** `formatMinimum`; retains the current phantom. */
229
+ formatMinimum(value: string): this;
230
+ /** `formatMaximum`; retains the current phantom. */
231
+ formatMaximum(value: string): this;
232
+ /** `formatExclusiveMinimum`; retains the current phantom. */
233
+ formatExclusiveMinimum(value: string): this;
234
+ /** `formatExclusiveMaximum`; retains the current phantom. */
235
+ formatExclusiveMaximum(value: string): this;
186
236
  optional(): StringBuilder<Out, In, F | 'optional'>;
187
237
  nullable(): StringBuilder<Out | null, In | null, F>;
188
238
  default(value: Out): StringBuilder<Out, In, F | 'defaulted'>;
@@ -254,6 +304,10 @@ declare class NullBuilder<Out = null, In = Out, F extends Flag = never> extends
254
304
 
255
305
  /** `{ type: 'array', items }` and the array constraints. */
256
306
  export class ArrayBuilder<Out = unknown[], In = Out, F extends Flag = never> extends SchemaBuilder<Out, In, F> {
307
+ /** `minContains`; retains the current phantom. */
308
+ minContains(value: number): this;
309
+ /** `maxContains`; retains the current phantom. */
310
+ maxContains(value: number): this;
257
311
  optional(): ArrayBuilder<Out, In, F | 'optional'>;
258
312
  nullable(): ArrayBuilder<Out | null, In | null, F>;
259
313
  default(value: Out): ArrayBuilder<Out, In, F | 'defaulted'>;