@hey-api/openapi-ts 0.88.2 → 0.89.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.
@@ -1,46 +1,8 @@
1
- import { IProject, Project, Symbol, SymbolIdentifier, SymbolIn, SymbolMeta } from "@hey-api/codegen-core";
1
+ import { AnalysisContext, File, FromRef, IProject, Language, NameConflictResolver, Node, Project, Ref, Refs, RenderContext, Renderer, Symbol, SymbolIdentifier, SymbolIn, SymbolMeta } from "@hey-api/codegen-core";
2
2
  import { RangeOptions, SemVer } from "semver";
3
3
  import * as typescript0 from "typescript";
4
4
  import ts from "typescript";
5
5
 
6
- //#region src/plugins/shared/types/refs.d.ts
7
-
8
- /**
9
- * Ref wrapper which ensures a stable reference for a value.
10
- *
11
- * @example
12
- * ```ts
13
- * type NumRef = Ref<number>; // { value: number }
14
- * const num: NumRef = { value: 42 };
15
- * console.log(num.value); // 42
16
- * ```
17
- */
18
- type Ref<T> = {
19
- value: T;
20
- };
21
-
22
- /**
23
- * Utility type: wraps a value in a Ref.
24
- *
25
- * @example
26
- * ```ts
27
- * type R = ToRef<number>; // { value: number }
28
- * ```
29
- */
30
-
31
- /**
32
- * Maps every property of `T` to a `Ref` of that property.
33
- *
34
- * @example
35
- * ```ts
36
- * type Foo = { a: number; b: string };
37
- * type Refs = ToRefs<Foo>; // { a: Ref<number>; b: Ref<string> }
38
- * const refs: Refs = { a: { value: 1 }, b: { value: 'x' } };
39
- * console.log(refs.a.value, refs.b.value); // 1 'x'
40
- * ```
41
- */
42
- type ToRefs<T> = { [K in keyof T]: Ref<T[K]> };
43
- //#endregion
44
6
  //#region src/openApi/shared/types/openapi-spec-extensions.d.ts
45
7
  interface EnumExtensions {
46
8
  /**
@@ -58,6 +20,7 @@ interface EnumExtensions {
58
20
  }
59
21
  //#endregion
60
22
  //#region src/types/utils.d.ts
23
+
61
24
  /**
62
25
  * Accepts a value, a function returning a value, or a function returning a promise of a value.
63
26
  */
@@ -2604,6 +2567,10 @@ interface IRSchemaObject extends Pick<JsonSchemaDraft2020_12, '$ref' | 'const' |
2604
2567
  * follow a specific convention.
2605
2568
  */
2606
2569
  propertyNames?: IRSchemaObject;
2570
+ /**
2571
+ * Reference to symbol instead of `$ref` string.
2572
+ */
2573
+ symbolRef?: Symbol;
2607
2574
  /**
2608
2575
  * Each schema eventually resolves into `type`.
2609
2576
  */
@@ -6378,597 +6345,722 @@ type HeyApiSdkPlugin = DefinePlugin<UserConfig$14, Config$13>;
6378
6345
  //#endregion
6379
6346
  //#region src/ts-dsl/base.d.ts
6380
6347
  type MaybeArray$1<T> = T | ReadonlyArray<T>;
6381
- interface ITsDsl<T extends ts.Node = ts.Node> {
6382
- $render(): T;
6383
- }
6384
- declare abstract class TsDsl<T extends ts.Node = ts.Node> implements ITsDsl<T> {
6385
- abstract $render(): T;
6348
+ declare abstract class TsDsl<T extends ts.Node = ts.Node> implements Node<T> {
6349
+ analyze(_: AnalysisContext): void;
6350
+ exported?: boolean;
6351
+ file?: File;
6352
+ language: Language;
6353
+ parent?: Node;
6354
+ root?: Node;
6355
+ symbol?: Symbol;
6356
+ toAst(): T;
6357
+ readonly '~brand': any;
6358
+ /** Branding property to identify the DSL class at runtime. */
6359
+ abstract readonly '~dsl': string;
6386
6360
  /** Conditionally applies a callback to this builder. */
6387
- $if<T extends TsDsl, V$1, R extends TsDsl = T>(this: T, value: V$1, ifTrue: (self: T, v: Exclude<V$1, false | null | undefined>) => R | void, ifFalse?: (self: T, v: Extract<V$1, false | null | undefined>) => R | void): R | T;
6388
- $if<T extends TsDsl, V$1, R extends TsDsl = T>(this: T, value: V$1, ifTrue: (v: Exclude<V$1, false | null | undefined>) => R | void, ifFalse?: (v: Extract<V$1, false | null | undefined>) => R | void): R | T;
6389
- $if<T extends TsDsl, V$1, R extends TsDsl = T>(this: T, value: V$1, ifTrue: () => R | void, ifFalse?: () => R | void): R | T;
6361
+ $if<T extends TsDsl, V, R extends TsDsl = T>(this: T, value: V, ifTrue: (self: T, v: Exclude<V, false | null | undefined>) => R | void, ifFalse?: (self: T, v: Extract<V, false | null | undefined>) => R | void): R | T;
6362
+ $if<T extends TsDsl, V, R extends TsDsl = T>(this: T, value: V, ifTrue: (v: Exclude<V, false | null | undefined>) => R | void, ifFalse?: (v: Extract<V, false | null | undefined>) => R | void): R | T;
6363
+ $if<T extends TsDsl, V, R extends TsDsl = T>(this: T, value: V, ifTrue: () => R | void, ifFalse?: () => R | void): R | T;
6390
6364
  protected $maybeId<T extends string | ts.Expression>(expr: T): T extends string ? ts.Identifier : T;
6391
6365
  protected $node<I>(value: I): NodeOfMaybe<I>;
6392
6366
  protected $type<I>(value: I, args?: ReadonlyArray<ts.TypeNode>): TypeOfMaybe<I>;
6393
- protected unwrap<I>(value: I): I extends TsDsl<infer N> ? N : I;
6367
+ /** Unwraps nested nodes into raw TypeScript AST. */
6368
+ private unwrap;
6394
6369
  }
6395
- type NodeOfMaybe<I> = undefined extends I ? NodeOf<NonNullable<I>> | undefined : NodeOf<I>;
6370
+ type NodeOfMaybe<I> = undefined extends I ? NodeOf<NonNullable<FromRef<I>>> | undefined : NodeOf<FromRef<I>>;
6396
6371
  type NodeOf<I> = I extends ReadonlyArray<infer U> ? ReadonlyArray<U extends TsDsl<infer N> ? N : U> : I extends string ? ts.Expression : I extends TsDsl<infer N> ? N : I extends ts.Node ? I : never;
6397
6372
  type MaybeTsDsl<T> = T extends TsDsl<infer U> ? U | TsDsl<U> : T extends ts.Node ? T | TsDsl<T> : never;
6398
6373
  declare abstract class TypeTsDsl<T extends ts.LiteralTypeNode | ts.QualifiedName | ts.TypeElement | ts.TypeNode | ts.TypeParameterDeclaration = ts.TypeNode> extends TsDsl<T> {}
6399
- type TypeOfMaybe<I> = undefined extends I ? TypeOf<NonNullable<I>> | undefined : TypeOf<I>;
6374
+ type TypeOfMaybe<I> = undefined extends I ? TypeOf<NonNullable<FromRef<I>>> | undefined : TypeOf<FromRef<I>>;
6400
6375
  type TypeOf<I> = I extends ReadonlyArray<infer U> ? ReadonlyArray<TypeOf<U>> : I extends string ? ts.TypeNode : I extends boolean ? ts.LiteralTypeNode : I extends TsDsl<infer N> ? N : I extends ts.TypeNode ? I : never;
6401
6376
  //#endregion
6402
- //#region src/ts-dsl/layout/newline.d.ts
6403
- declare class NewlineTsDsl extends TsDsl<ts.Identifier> {
6404
- $render(): ts.Identifier;
6377
+ //#region src/ts-dsl/mixins/types.d.ts
6378
+ type BaseCtor<T> = abstract new (...args: any[]) => TsDsl<T>;
6379
+ type MixinCtor<T extends BaseCtor<any>, K$1> = abstract new (...args: any[]) => InstanceType<T> & K$1;
6380
+ //#endregion
6381
+ //#region src/ts-dsl/mixins/type-args.d.ts
6382
+ type Arg$1 = Symbol | string | MaybeTsDsl<TypeTsDsl>;
6383
+ interface TypeArgsMethods extends Node {
6384
+ /** Returns the type arguments as an array of ts.TypeNode nodes. */
6385
+ $generics(): ReadonlyArray<ts.TypeNode> | undefined;
6386
+ /** Adds a single type argument (e.g. `string` in `Foo<string>`). */
6387
+ generic(arg: Arg$1): this;
6388
+ /** Adds type arguments (e.g. `Map<string, number>`). */
6389
+ generics(...args: ReadonlyArray<Arg$1>): this;
6405
6390
  }
6406
6391
  //#endregion
6407
- //#region src/ts-dsl/mixins/args.d.ts
6408
- /**
6409
- * Adds `.arg()` and `.args()` for managing expression arguments in call-like nodes.
6410
- */
6411
- declare class ArgsMixin extends TsDsl {
6412
- protected _args?: Array<string | MaybeTsDsl<ts.Expression>>;
6413
- /** Adds a single expression argument. */
6414
- arg(arg: string | MaybeTsDsl<ts.Expression>): this;
6415
- /** Adds one or more expression arguments. */
6416
- args(...args: ReadonlyArray<string | MaybeTsDsl<ts.Expression>>): this;
6417
- /** Renders the arguments into an array of `Expression`s. */
6418
- protected $args(): ReadonlyArray<ts.Expression>;
6419
- $render(): ts.Node;
6392
+ //#region src/ts-dsl/mixins/optional.d.ts
6393
+ interface OptionalMethods extends Node {
6394
+ _optional?: boolean;
6395
+ /** Marks the node as optional when the condition is true. */
6396
+ optional(condition?: boolean): this;
6397
+ /** Marks the node as required when the condition is true. */
6398
+ required(condition?: boolean): this;
6420
6399
  }
6421
6400
  //#endregion
6422
- //#region src/ts-dsl/decl/decorator.d.ts
6423
- declare class DecoratorTsDsl extends TsDsl<ts.Decorator> {
6424
- protected name: string | ts.Expression;
6425
- constructor(name: string | ts.Expression, ...args: ReadonlyArray<string | MaybeTsDsl<ts.Expression>>);
6426
- $render(): ts.Decorator;
6401
+ //#region src/ts-dsl/expr/as.d.ts
6402
+ type AsExpr = Symbol | string | MaybeTsDsl<ts.Expression>;
6403
+ type AsType = Symbol | string | TypeTsDsl;
6404
+ declare const Mixed$52: MixinCtor<MixinCtor<abstract new () => TsDsl<ts.AsExpression>, ExprMethods>, AsMethods>;
6405
+ declare class AsTsDsl extends Mixed$52 {
6406
+ readonly '~dsl' = "AsTsDsl";
6407
+ protected expr: Ref<AsExpr>;
6408
+ protected type: Ref<AsType>;
6409
+ constructor(expr: AsExpr, type: AsType);
6410
+ analyze(ctx: AnalysisContext): void;
6411
+ toAst(): ts.AsExpression;
6427
6412
  }
6428
- interface DecoratorTsDsl extends ArgsMixin {}
6429
6413
  //#endregion
6430
- //#region src/ts-dsl/mixins/decorator.d.ts
6431
- declare class DecoratorMixin extends TsDsl {
6432
- protected decorators?: Array<DecoratorTsDsl>;
6433
- /** Adds a decorator (e.g. `@sealed({ in: 'root' })`). */
6434
- decorator(name: string | ts.Expression, ...args: ReadonlyArray<string | MaybeTsDsl<ts.Expression>>): this;
6435
- /** Renders the decorators into an array of `ts.Decorator`s. */
6436
- protected $decorators(): ReadonlyArray<ts.Decorator>;
6437
- $render(): ts.Node;
6414
+ //#region src/ts-dsl/mixins/as.d.ts
6415
+ interface AsMethods extends Node {
6416
+ /** Creates an `as` type assertion expression (e.g. `value as Type`). */
6417
+ as(type: AsType): AsTsDsl;
6438
6418
  }
6439
6419
  //#endregion
6440
- //#region src/ts-dsl/layout/doc.d.ts
6441
- declare class DocTsDsl extends TsDsl<ts.Node> {
6442
- protected _lines: Array<string>;
6443
- constructor(lines?: MaybeArray$1<string>, fn?: (d: DocTsDsl) => void);
6444
- add(...lines: ReadonlyArray<string>): this;
6445
- apply<T extends ts.Node>(node: T): T;
6446
- $render(): ts.Node;
6420
+ //#region src/ts-dsl/expr/binary.d.ts
6421
+ type Expr$3 = Symbol | string | MaybeTsDsl<ts.Expression>;
6422
+ type Op$1 = Operator | ts.BinaryOperator;
6423
+ type Operator = '!=' | '!==' | '&&' | '*' | '+' | '-' | '/' | '<' | '<=' | '=' | '==' | '===' | '>' | '>=' | '??' | '||';
6424
+ declare const Mixed$51: MixinCtor<MixinCtor<abstract new () => TsDsl<ts.BinaryExpression>, ExprMethods>, AsMethods>;
6425
+ declare class BinaryTsDsl extends Mixed$51 {
6426
+ readonly '~dsl' = "BinaryTsDsl";
6427
+ protected _base: Ref<Expr$3>;
6428
+ protected _expr?: Ref<Expr$3>;
6429
+ protected _op?: Op$1;
6430
+ constructor(base: Expr$3, op?: Op$1, expr?: Expr$3);
6431
+ analyze(ctx: AnalysisContext): void;
6432
+ /** Logical AND — `this && expr` */
6433
+ and(expr: Expr$3): this;
6434
+ /** Creates an assignment expression (e.g. `this = expr`). */
6435
+ assign(expr: Expr$3): this;
6436
+ /** Nullish coalescing — `this ?? expr` */
6437
+ coalesce(expr: Expr$3): this;
6438
+ /** Division — `this / expr` */
6439
+ div(expr: Expr$3): this;
6440
+ /** Strict equality — `this === expr` */
6441
+ eq(expr: Expr$3): this;
6442
+ /** Greater than — `this > expr` */
6443
+ gt(expr: Expr$3): this;
6444
+ /** Greater than or equal — `this >= expr` */
6445
+ gte(expr: Expr$3): this;
6446
+ /** Loose equality — `this == expr` */
6447
+ looseEq(expr: Expr$3): this;
6448
+ /** Loose inequality — `this != expr` */
6449
+ looseNeq(expr: Expr$3): this;
6450
+ /** Less than — `this < expr` */
6451
+ lt(expr: Expr$3): this;
6452
+ /** Less than or equal — `this <= expr` */
6453
+ lte(expr: Expr$3): this;
6454
+ /** Subtraction — `this - expr` */
6455
+ minus(expr: Expr$3): this;
6456
+ /** Strict inequality — `this !== expr` */
6457
+ neq(expr: Expr$3): this;
6458
+ /** Logical OR — `this || expr` */
6459
+ or(expr: Expr$3): this;
6460
+ /** Addition — `this + expr` */
6461
+ plus(expr: Expr$3): this;
6462
+ /** Multiplication — `this * expr` */
6463
+ times(expr: Expr$3): this;
6464
+ toAst(): ts.BinaryExpression;
6465
+ /** Sets the binary operator and right-hand operand for this expression. */
6466
+ private opAndExpr;
6467
+ private opToToken;
6447
6468
  }
6448
6469
  //#endregion
6449
- //#region src/ts-dsl/mixins/doc.d.ts
6450
- declare function DocMixin<TBase extends new (...args: ReadonlyArray<any>) => ITsDsl>(Base: TBase): {
6451
- new (...args: ReadonlyArray<any>): {
6452
- _doc?: DocTsDsl;
6453
- doc(lines?: MaybeArray$1<string>, fn?: (d: DocTsDsl) => void): /*elided*/any;
6454
- $render(): any;
6455
- };
6456
- } & TBase;
6457
- type DocMixin = InstanceType<ReturnType<typeof DocMixin>>;
6470
+ //#region src/ts-dsl/mixins/operator.d.ts
6471
+ type Expr$2 = Symbol | string | MaybeTsDsl<ts.Expression>;
6472
+ interface OperatorMethods extends Node {
6473
+ /** Logical AND — `this && expr` */
6474
+ and(expr: Expr$2): BinaryTsDsl;
6475
+ /** Creates an assignment expression (e.g. `this = expr`). */
6476
+ assign(expr: Expr$2): BinaryTsDsl;
6477
+ /** Nullish coalescing — `this ?? expr` */
6478
+ coalesce(expr: Expr$2): BinaryTsDsl;
6479
+ /** Division — `this / expr` */
6480
+ div(expr: Expr$2): BinaryTsDsl;
6481
+ /** Strict equality — `this === expr` */
6482
+ eq(expr: Expr$2): BinaryTsDsl;
6483
+ /** Greater than — `this > expr` */
6484
+ gt(expr: Expr$2): BinaryTsDsl;
6485
+ /** Greater than or equal — `this >= expr` */
6486
+ gte(expr: Expr$2): BinaryTsDsl;
6487
+ /** Loose equality — `this == expr` */
6488
+ looseEq(expr: Expr$2): BinaryTsDsl;
6489
+ /** Loose inequality — `this != expr` */
6490
+ looseNeq(expr: Expr$2): BinaryTsDsl;
6491
+ /** Less than — `this < expr` */
6492
+ lt(expr: Expr$2): BinaryTsDsl;
6493
+ /** Less than or equal — `this <= expr` */
6494
+ lte(expr: Expr$2): BinaryTsDsl;
6495
+ /** Subtraction — `this - expr` */
6496
+ minus(expr: Expr$2): BinaryTsDsl;
6497
+ /** Strict inequality — `this !== expr` */
6498
+ neq(expr: Expr$2): BinaryTsDsl;
6499
+ /** Logical OR — `this || expr` */
6500
+ or(expr: Expr$2): BinaryTsDsl;
6501
+ /** Addition — `this + expr` */
6502
+ plus(expr: Expr$2): BinaryTsDsl;
6503
+ /** Multiplication — `this * expr` */
6504
+ times(expr: Expr$2): BinaryTsDsl;
6505
+ }
6506
+ //#endregion
6507
+ //#region src/ts-dsl/expr/attr.d.ts
6508
+ type AttrLeft = Symbol | string | MaybeTsDsl<ts.Expression>;
6509
+ type AttrRight = Symbol | string | ts.MemberName | number;
6510
+ declare const Mixed$50: MixinCtor<MixinCtor<MixinCtor<MixinCtor<abstract new () => TsDsl<ts.PropertyAccessExpression | ts.ElementAccessExpression>, OptionalMethods>, OperatorMethods>, ExprMethods>, AsMethods>;
6511
+ declare class AttrTsDsl extends Mixed$50 {
6512
+ readonly '~dsl' = "AttrTsDsl";
6513
+ protected left: Ref<AttrLeft>;
6514
+ protected right: Ref<AttrRight>;
6515
+ constructor(left: AttrLeft, right: AttrRight);
6516
+ analyze(ctx: AnalysisContext): void;
6517
+ toAst(): ts.PropertyAccessExpression | ts.ElementAccessExpression;
6518
+ }
6519
+ //#endregion
6520
+ //#region src/ts-dsl/expr/await.d.ts
6521
+ type AwaitExpr = Symbol | string | MaybeTsDsl<ts.Expression>;
6522
+ declare const Mixed$49: MixinCtor<abstract new () => TsDsl<ts.AwaitExpression>, ExprMethods>;
6523
+ declare class AwaitTsDsl extends Mixed$49 {
6524
+ readonly '~dsl' = "AwaitTsDsl";
6525
+ protected _awaitExpr: Ref<AwaitExpr>;
6526
+ constructor(expr: AwaitExpr);
6527
+ analyze(ctx: AnalysisContext): void;
6528
+ toAst(): ts.AwaitExpression;
6529
+ }
6530
+ //#endregion
6531
+ //#region src/ts-dsl/stmt/return.d.ts
6532
+ type ReturnExpr = Symbol | string | MaybeTsDsl<ts.Expression>;
6533
+ declare const Mixed$48: abstract new () => TsDsl<ts.ReturnStatement>;
6534
+ declare class ReturnTsDsl extends Mixed$48 {
6535
+ readonly '~dsl' = "ReturnTsDsl";
6536
+ protected _returnExpr?: Ref<ReturnExpr>;
6537
+ constructor(expr?: ReturnExpr);
6538
+ analyze(ctx: AnalysisContext): void;
6539
+ toAst(): ts.ReturnStatement;
6540
+ }
6541
+ //#endregion
6542
+ //#region src/ts-dsl/mixins/expr.d.ts
6543
+ interface ExprMethods extends Node {
6544
+ /** Accesses a property on the current expression (e.g. `this.foo`). */
6545
+ attr(name: AttrRight): AttrTsDsl;
6546
+ /** Awaits the current expression (e.g. `await expr`). */
6547
+ await(): AwaitTsDsl;
6548
+ /** Calls the current expression (e.g. `fn(arg1, arg2)`). */
6549
+ call(...args: CallArgs): CallTsDsl;
6550
+ /** Produces a `return` statement returning the current expression. */
6551
+ return(): ReturnTsDsl;
6552
+ }
6553
+ //#endregion
6554
+ //#region src/ts-dsl/mixins/args.d.ts
6555
+ type Arg = Symbol | string | MaybeTsDsl<ts.Expression>;
6556
+ interface ArgsMethods extends Node {
6557
+ /** Renders the arguments into an array of `Expression`s. */
6558
+ $args(): ReadonlyArray<ts.Expression>;
6559
+ /** Adds a single expression argument. */
6560
+ arg(arg: Arg | undefined): this;
6561
+ /** Adds one or more expression arguments. */
6562
+ args(...args: ReadonlyArray<Arg | undefined>): this;
6563
+ }
6564
+ //#endregion
6565
+ //#region src/ts-dsl/expr/call.d.ts
6566
+ type CallCallee = string | MaybeTsDsl<ts.Expression>;
6567
+ type CallArg = Symbol | string | MaybeTsDsl<ts.Expression>;
6568
+ type CallArgs = ReadonlyArray<CallArg | undefined>;
6569
+ declare const Mixed$47: MixinCtor<MixinCtor<MixinCtor<MixinCtor<abstract new () => TsDsl<ts.CallExpression>, TypeArgsMethods>, ExprMethods>, AsMethods>, ArgsMethods>;
6570
+ declare class CallTsDsl extends Mixed$47 {
6571
+ readonly '~dsl' = "CallTsDsl";
6572
+ protected _callee: CallCallee;
6573
+ constructor(callee: CallCallee, ...args: CallArgs);
6574
+ analyze(ctx: AnalysisContext): void;
6575
+ toAst(): ts.CallExpression;
6576
+ }
6458
6577
  //#endregion
6459
6578
  //#region src/ts-dsl/mixins/modifiers.d.ts
6460
- type Target = object & {
6461
- _m?(kind: ts.ModifierSyntaxKind, condition?: boolean): unknown;
6579
+ type Modifiers = {
6580
+ modifiers: Array<ts.Modifier>;
6462
6581
  };
6463
- /**
6464
- * Mixin that adds an `abstract` modifier to a node.
6465
- */
6466
- declare class AbstractMixin {
6582
+ interface AbstractMethods extends Modifiers {
6467
6583
  /**
6468
6584
  * Adds the `abstract` keyword modifier if the condition is true.
6469
6585
  *
6470
6586
  * @param condition - Whether to add the modifier (default: true).
6471
6587
  * @returns The target object for chaining.
6472
6588
  */
6473
- abstract<T extends Target>(this: T, condition?: boolean): T;
6589
+ abstract(condition?: boolean): this;
6474
6590
  }
6475
- /**
6476
- * Mixin that adds an `async` modifier to a node.
6477
- */
6478
- declare class AsyncMixin {
6591
+ interface AsyncMethods extends Modifiers {
6479
6592
  /**
6480
6593
  * Adds the `async` keyword modifier if the condition is true.
6481
6594
  *
6482
6595
  * @param condition - Whether to add the modifier (default: true).
6483
6596
  * @returns The target object for chaining.
6484
6597
  */
6485
- async<T extends Target>(this: T, condition?: boolean): T;
6598
+ async(condition?: boolean): this;
6486
6599
  }
6487
- /**
6488
- * Mixin that adds a `const` modifier to a node.
6489
- */
6490
- declare class ConstMixin {
6600
+ interface ConstMethods extends Modifiers {
6491
6601
  /**
6492
6602
  * Adds the `const` keyword modifier if the condition is true.
6493
6603
  *
6494
6604
  * @param condition - Whether to add the modifier (default: true).
6495
6605
  * @returns The target object for chaining.
6496
6606
  */
6497
- const<T extends Target>(this: T, condition?: boolean): T;
6607
+ const(condition?: boolean): this;
6498
6608
  }
6499
- /**
6500
- * Mixin that adds a `default` modifier to a node.
6501
- */
6502
- declare class DefaultMixin {
6609
+ interface DefaultMethods extends Modifiers {
6503
6610
  /**
6504
6611
  * Adds the `default` keyword modifier if the condition is true.
6505
6612
  *
6506
6613
  * @param condition - Whether to add the modifier (default: true).
6507
6614
  * @returns The target object for chaining.
6508
6615
  */
6509
- default<T extends Target>(this: T, condition?: boolean): T;
6616
+ default(condition?: boolean): this;
6510
6617
  }
6511
- /**
6512
- * Mixin that adds an `export` modifier to a node.
6513
- */
6514
- declare class ExportMixin {
6618
+ interface ExportMethods extends Modifiers {
6515
6619
  /**
6516
6620
  * Adds the `export` keyword modifier if the condition is true.
6517
6621
  *
6518
6622
  * @param condition - Whether to add the modifier (default: true).
6519
6623
  * @returns The target object for chaining.
6520
6624
  */
6521
- export<T extends Target>(this: T, condition?: boolean): T;
6625
+ export(condition?: boolean): this;
6522
6626
  }
6523
- /**
6524
- * Mixin that adds a `private` modifier to a node.
6525
- */
6526
- declare class PrivateMixin {
6627
+ interface PrivateMethods extends Modifiers {
6527
6628
  /**
6528
6629
  * Adds the `private` keyword modifier if the condition is true.
6529
6630
  *
6530
6631
  * @param condition - Whether to add the modifier (default: true).
6531
6632
  * @returns The target object for chaining.
6532
6633
  */
6533
- private<T extends Target>(this: T, condition?: boolean): T;
6634
+ private(condition?: boolean): this;
6534
6635
  }
6535
- /**
6536
- * Mixin that adds a `protected` modifier to a node.
6537
- */
6538
- declare class ProtectedMixin {
6636
+ interface ProtectedMethods extends Modifiers {
6539
6637
  /**
6540
6638
  * Adds the `protected` keyword modifier if the condition is true.
6541
6639
  *
6542
6640
  * @param condition - Whether to add the modifier (default: true).
6543
6641
  * @returns The target object for chaining.
6544
6642
  */
6545
- protected<T extends Target>(this: T, condition?: boolean): T;
6643
+ protected(condition?: boolean): this;
6546
6644
  }
6547
- /**
6548
- * Mixin that adds a `public` modifier to a node.
6549
- */
6550
- declare class PublicMixin {
6645
+ interface PublicMethods extends Modifiers {
6551
6646
  /**
6552
6647
  * Adds the `public` keyword modifier if the condition is true.
6553
6648
  *
6554
6649
  * @param condition - Whether to add the modifier (default: true).
6555
6650
  * @returns The target object for chaining.
6556
6651
  */
6557
- public<T extends Target>(this: T, condition?: boolean): T;
6652
+ public(condition?: boolean): this;
6558
6653
  }
6559
- /**
6560
- * Mixin that adds a `readonly` modifier to a node.
6561
- */
6562
- declare class ReadonlyMixin {
6654
+ interface ReadonlyMethods extends Modifiers {
6563
6655
  /**
6564
6656
  * Adds the `readonly` keyword modifier if the condition is true.
6565
6657
  *
6566
6658
  * @param condition - Whether to add the modifier (default: true).
6567
6659
  * @returns The target object for chaining.
6568
6660
  */
6569
- readonly<T extends Target>(this: T, condition?: boolean): T;
6661
+ readonly(condition?: boolean): this;
6570
6662
  }
6571
- /**
6572
- * Mixin that adds a `static` modifier to a node.
6573
- */
6574
- declare class StaticMixin {
6663
+ interface StaticMethods extends Modifiers {
6575
6664
  /**
6576
6665
  * Adds the `static` keyword modifier if the condition is true.
6577
6666
  *
6578
6667
  * @param condition - Whether to add the modifier (default: true).
6579
6668
  * @returns The target object for chaining.
6580
6669
  */
6581
- static<T extends Target>(this: T, condition?: boolean): T;
6582
- }
6583
- //#endregion
6584
- //#region src/ts-dsl/type/param.d.ts
6585
- declare class TypeParamTsDsl extends TypeTsDsl<ts.TypeParameterDeclaration> {
6586
- protected name?: string | ts.Identifier;
6587
- protected constraint?: string | MaybeTsDsl<TypeTsDsl> | boolean;
6588
- protected defaultValue?: string | MaybeTsDsl<TypeTsDsl> | boolean;
6589
- constructor(name?: string | ts.Identifier, fn?: (name: TypeParamTsDsl) => void);
6590
- default(value: string | MaybeTsDsl<TypeTsDsl> | boolean): this;
6591
- extends(constraint: string | MaybeTsDsl<TypeTsDsl> | boolean): this;
6592
- $render(): ts.TypeParameterDeclaration;
6593
- }
6594
- //#endregion
6595
- //#region src/ts-dsl/mixins/type-params.d.ts
6596
- declare class TypeParamsMixin extends TsDsl {
6597
- protected _generics?: Array<string | MaybeTsDsl<TypeParamTsDsl>>;
6598
- /** Adds a single type parameter (e.g. `T` in `Array<T>`). */
6599
- generic(...args: ConstructorParameters<typeof TypeParamTsDsl>): this;
6600
- /** Adds type parameters (e.g. `Map<string, T>`). */
6601
- generics(...args: ReadonlyArray<string | MaybeTsDsl<TypeParamTsDsl>>): this;
6602
- /** Returns the type parameters as an array of ts.TypeParameterDeclaration nodes. */
6603
- protected $generics(): ReadonlyArray<ts.TypeParameterDeclaration> | undefined;
6604
- $render(): ts.Node;
6670
+ static(condition?: boolean): this;
6605
6671
  }
6606
6672
  //#endregion
6607
6673
  //#region src/ts-dsl/mixins/value.d.ts
6608
- declare class ValueMixin extends TsDsl {
6609
- protected value?: string | MaybeTsDsl<ts.Expression>;
6674
+ type ValueExpr = string | MaybeTsDsl<ts.Expression>;
6675
+ interface ValueMethods extends Node {
6676
+ $value(): ts.Expression | undefined;
6610
6677
  /** Sets the initializer expression (e.g. `= expr`). */
6611
- assign<T extends this>(this: T, expr: string | MaybeTsDsl<ts.Expression>): T;
6612
- protected $value(): ts.Expression | undefined;
6613
- $render(): ts.Node;
6614
- }
6615
- //#endregion
6616
- //#region src/ts-dsl/decl/field.d.ts
6617
- declare class FieldTsDsl extends TsDsl<ts.PropertyDeclaration> {
6618
- protected modifiers: {
6619
- list: () => ts.Modifier[];
6620
- };
6621
- protected name: string;
6622
- protected _type?: TypeTsDsl;
6623
- constructor(name: string, fn?: (f: FieldTsDsl) => void);
6624
- /** Sets the field type. */
6625
- type(type: string | TypeTsDsl): this;
6626
- /** Builds the `PropertyDeclaration` node. */
6627
- $render(): ts.PropertyDeclaration;
6628
- }
6629
- interface FieldTsDsl extends DecoratorMixin, DocMixin, PrivateMixin, ProtectedMixin, PublicMixin, ReadonlyMixin, StaticMixin, ValueMixin {}
6630
- //#endregion
6631
- //#region src/ts-dsl/mixins/do.d.ts
6632
- /**
6633
- * Adds `.do()` for appending statements or expressions to a body.
6634
- */
6635
- declare class DoMixin extends TsDsl {
6636
- protected _do?: Array<MaybeTsDsl<ts.Expression | ts.Statement>>;
6637
- /** Adds one or more expressions/statements to the body. */
6638
- do(...items: ReadonlyArray<MaybeTsDsl<ts.Expression | ts.Statement>>): this;
6639
- /** Renders the collected `.do()` calls into an array of `Statement` nodes. */
6640
- protected $do(): ReadonlyArray<ts.Statement>;
6641
- $render(): ts.Node;
6642
- }
6643
- //#endregion
6644
- //#region src/ts-dsl/mixins/optional.d.ts
6645
- declare class OptionalMixin {
6646
- protected _optional?: boolean;
6647
- /** Marks the node as optional when the condition is true. */
6648
- optional<T extends this>(this: T, condition?: boolean): T;
6649
- /** Marks the node as required when the condition is true. */
6650
- required<T extends this>(this: T, condition?: boolean): T;
6651
- }
6652
- //#endregion
6653
- //#region src/ts-dsl/decl/pattern.d.ts
6654
- /**
6655
- * Builds binding patterns (e.g. `{ foo, bar }`, `[a, b, ...rest]`).
6656
- */
6657
- declare class PatternTsDsl extends TsDsl<ts.BindingName> {
6658
- protected pattern?: {
6659
- kind: 'array';
6660
- values: ReadonlyArray<string>;
6661
- } | {
6662
- kind: 'object';
6663
- values: Record<string, string>;
6664
- };
6665
- protected _spread?: string;
6666
- /** Defines an array pattern (e.g. `[a, b, c]`). */
6667
- array(...props: ReadonlyArray<string> | [ReadonlyArray<string>]): this;
6668
- /** Defines an object pattern (e.g. `{ a, b: alias }`). */
6669
- object(...props: ReadonlyArray<MaybeArray$1<string> | Record<string, string>>): this;
6670
- /** Adds a spread element (e.g. `...rest`, `...options`, `...args`). */
6671
- spread(name: string): this;
6672
- /** Builds and returns a BindingName (ObjectBindingPattern, ArrayBindingPattern, or Identifier). */
6673
- $render(): ts.BindingName;
6674
- private createSpread;
6678
+ assign(expr: ValueExpr): this;
6675
6679
  }
6676
6680
  //#endregion
6677
6681
  //#region src/ts-dsl/mixins/pattern.d.ts
6678
- /**
6679
- * Mixin providing `.array()`, `.object()`, and `.spread()` methods for defining destructuring patterns.
6680
- */
6681
- declare class PatternMixin extends TsDsl {
6682
- protected pattern?: PatternTsDsl;
6682
+ interface PatternMethods extends Node {
6683
+ /** Renders the pattern into a `BindingName`. */
6684
+ $pattern(): ts.BindingName | undefined;
6683
6685
  /** Defines an array binding pattern. */
6684
6686
  array(...props: ReadonlyArray<string> | [ReadonlyArray<string>]): this;
6685
6687
  /** Defines an object binding pattern. */
6686
6688
  object(...props: ReadonlyArray<MaybeArray$1<string> | Record<string, string>>): this;
6687
6689
  /** Adds a spread element (e.g. `...args`, `...options`) to the pattern. */
6688
6690
  spread(name: string): this;
6689
- /** Renders the pattern into a `BindingName`. */
6690
- protected $pattern(): ts.BindingName | undefined;
6691
- $render(): ts.Node;
6691
+ }
6692
+ //#endregion
6693
+ //#region src/ts-dsl/mixins/decorator.d.ts
6694
+ interface DecoratorMethods extends Node {
6695
+ /** Renders the decorators into an array of `ts.Decorator`s. */
6696
+ $decorators(): ReadonlyArray<ts.Decorator>;
6697
+ /** Adds a decorator (e.g. `@sealed({ in: 'root' })`). */
6698
+ decorator(name: Symbol | string | MaybeTsDsl<ts.Expression>, ...args: ReadonlyArray<string | MaybeTsDsl<ts.Expression>>): this;
6692
6699
  }
6693
6700
  //#endregion
6694
6701
  //#region src/ts-dsl/decl/param.d.ts
6695
- declare class ParamTsDsl extends TsDsl<ts.ParameterDeclaration> {
6696
- protected name?: string;
6702
+ type ParamName = Symbol | string;
6703
+ type ParamCtor = (name: ParamName | ((p: ParamTsDsl) => void), fn?: (p: ParamTsDsl) => void) => ParamTsDsl;
6704
+ declare const Mixed$46: MixinCtor<MixinCtor<MixinCtor<MixinCtor<abstract new () => TsDsl<ts.ParameterDeclaration>, ValueMethods>, PatternMethods>, OptionalMethods>, DecoratorMethods>;
6705
+ declare class ParamTsDsl extends Mixed$46 {
6706
+ readonly '~dsl' = "ParamTsDsl";
6707
+ protected name?: Ref<ParamName>;
6697
6708
  protected _type?: TypeTsDsl;
6698
- constructor(name: string | ((p: ParamTsDsl) => void), fn?: (p: ParamTsDsl) => void);
6709
+ constructor(name: ParamName | ((p: ParamTsDsl) => void), fn?: (p: ParamTsDsl) => void);
6710
+ analyze(ctx: AnalysisContext): void;
6699
6711
  /** Sets the parameter type. */
6700
6712
  type(type: string | TypeTsDsl): this;
6701
- $render(): ts.ParameterDeclaration;
6713
+ toAst(): ts.ParameterDeclaration;
6702
6714
  }
6703
- interface ParamTsDsl extends DecoratorMixin, OptionalMixin, PatternMixin, ValueMixin {}
6704
6715
  //#endregion
6705
6716
  //#region src/ts-dsl/mixins/param.d.ts
6706
- declare class ParamMixin extends TsDsl {
6707
- protected _params?: Array<MaybeTsDsl<ts.ParameterDeclaration>>;
6717
+ interface ParamMethods extends Node {
6718
+ /** Renders the parameters into an array of `ParameterDeclaration`s. */
6719
+ $params(): ReadonlyArray<ts.ParameterDeclaration>;
6708
6720
  /** Adds a parameter. */
6709
- param(name: string | ((p: ParamTsDsl) => void), fn?: (p: ParamTsDsl) => void): this;
6721
+ param(...args: Parameters<ParamCtor>): this;
6710
6722
  /** Adds multiple parameters. */
6711
6723
  params(...params: ReadonlyArray<MaybeTsDsl<ts.ParameterDeclaration>>): this;
6712
- /** Renders the parameters into an array of `ParameterDeclaration`s. */
6713
- protected $params(): ReadonlyArray<ts.ParameterDeclaration>;
6714
- $render(): ts.Node;
6715
6724
  }
6716
6725
  //#endregion
6717
- //#region src/ts-dsl/decl/init.d.ts
6718
- declare class InitTsDsl extends TsDsl<ts.ConstructorDeclaration> {
6719
- protected modifiers: {
6720
- list: () => ts.Modifier[];
6721
- };
6722
- constructor(fn?: (i: InitTsDsl) => void);
6723
- /** Builds the `ConstructorDeclaration` node. */
6724
- $render(): ts.ConstructorDeclaration;
6726
+ //#region src/ts-dsl/layout/doc.d.ts
6727
+ declare class DocTsDsl extends TsDsl<ts.Node> {
6728
+ readonly '~dsl' = "DocTsDsl";
6729
+ protected _lines: Array<string>;
6730
+ constructor(lines?: MaybeArray$1<string>, fn?: (d: DocTsDsl) => void);
6731
+ analyze(ctx: AnalysisContext): void;
6732
+ add(...lines: ReadonlyArray<string>): this;
6733
+ apply<T extends ts.Node>(node: T): T;
6734
+ toAst(): ts.Node;
6725
6735
  }
6726
- interface InitTsDsl extends DecoratorMixin, DoMixin, DocMixin, ParamMixin, PrivateMixin, ProtectedMixin, PublicMixin {}
6727
6736
  //#endregion
6728
- //#region src/ts-dsl/decl/method.d.ts
6729
- declare class MethodTsDsl extends TsDsl<ts.MethodDeclaration> {
6730
- protected modifiers: {
6731
- list: () => ts.Modifier[];
6732
- };
6733
- protected name: string;
6734
- protected _returns?: TypeTsDsl;
6735
- constructor(name: string, fn?: (m: MethodTsDsl) => void);
6736
- /** Sets the return type. */
6737
- returns(type: string | TypeTsDsl): this;
6738
- /** Builds the `MethodDeclaration` node. */
6739
- $render(): ts.MethodDeclaration;
6737
+ //#region src/ts-dsl/mixins/doc.d.ts
6738
+ interface DocMethods extends Node {
6739
+ $docs<T extends ts.Node>(node: T): T;
6740
+ doc(lines?: MaybeArray$1<string>, fn?: (d: DocTsDsl) => void): this;
6740
6741
  }
6741
- interface MethodTsDsl extends AbstractMixin, AsyncMixin, DecoratorMixin, DoMixin, DocMixin, OptionalMixin, ParamMixin, PrivateMixin, ProtectedMixin, PublicMixin, StaticMixin, TypeParamsMixin {}
6742
6742
  //#endregion
6743
- //#region src/ts-dsl/decl/class.d.ts
6744
- declare class ClassTsDsl extends TsDsl<ts.ClassDeclaration> {
6745
- protected heritageClauses: Array<ts.HeritageClause>;
6746
- protected body: Array<MaybeTsDsl<ts.ClassElement | NewlineTsDsl>>;
6747
- protected modifiers: {
6748
- list: () => ts.Modifier[];
6749
- };
6750
- protected name: string;
6751
- constructor(name: string);
6752
- /** Adds one or more class members (fields, methods, etc.). */
6753
- do(...items: ReadonlyArray<MaybeTsDsl<ts.ClassElement | ts.Node>>): this;
6754
- /** Adds a base class to extend from. */
6755
- extends(base?: string | ts.Expression | false | null): this;
6756
- /** Adds a class field. */
6757
- field(name: string, fn?: (f: FieldTsDsl) => void): this;
6758
- /** Adds a class constructor. */
6759
- init(fn?: (i: InitTsDsl) => void): this;
6760
- /** Adds a class method. */
6761
- method(name: string, fn?: (m: MethodTsDsl) => void): this;
6762
- /** Inserts an empty line between members for formatting. */
6763
- newline(): this;
6764
- /** Builds the `ClassDeclaration` node. */
6765
- $render(): ts.ClassDeclaration;
6743
+ //#region src/ts-dsl/mixins/do.d.ts
6744
+ type DoExpr = MaybeTsDsl<ts.Expression | ts.Statement>;
6745
+ interface DoMethods extends Node {
6746
+ /** Renders the collected `.do()` calls into an array of `Statement` nodes. */
6747
+ $do(): ReadonlyArray<ts.Statement>;
6748
+ _do: Array<DoExpr>;
6749
+ /** Adds one or more expressions/statements to the body. */
6750
+ do(...items: ReadonlyArray<DoExpr>): this;
6766
6751
  }
6767
- interface ClassTsDsl extends AbstractMixin, DecoratorMixin, DefaultMixin, DocMixin, ExportMixin, TypeParamsMixin {}
6768
6752
  //#endregion
6769
- //#region src/ts-dsl/decl/member.d.ts
6770
- type Value$1 = string | number | MaybeTsDsl<ts.Expression>;
6771
- type ValueFn$1 = Value$1 | ((m: EnumMemberTsDsl) => void);
6772
- declare class EnumMemberTsDsl extends TsDsl<ts.EnumMember> {
6773
- private _name;
6774
- private _value?;
6775
- constructor(name: string, value?: ValueFn$1);
6776
- /** Sets the enum member value. */
6777
- value(value?: Value$1): this;
6778
- $render(): ts.EnumMember;
6753
+ //#region src/ts-dsl/decl/getter.d.ts
6754
+ type GetterName = string | ts.PropertyName;
6755
+ declare const Mixed$45: MixinCtor<MixinCtor<MixinCtor<MixinCtor<MixinCtor<MixinCtor<MixinCtor<MixinCtor<MixinCtor<MixinCtor<abstract new () => TsDsl<ts.GetAccessorDeclaration>, StaticMethods>, PublicMethods>, ProtectedMethods>, PrivateMethods>, ParamMethods>, DocMethods>, DoMethods>, DecoratorMethods>, AsyncMethods>, AbstractMethods>;
6756
+ declare class GetterTsDsl extends Mixed$45 {
6757
+ readonly '~dsl' = "GetterTsDsl";
6758
+ protected name: GetterName;
6759
+ constructor(name: GetterName, fn?: (g: GetterTsDsl) => void);
6760
+ analyze(ctx: AnalysisContext): void;
6761
+ toAst(): ts.GetAccessorDeclaration;
6779
6762
  }
6780
- interface EnumMemberTsDsl extends DocMixin {}
6781
6763
  //#endregion
6782
- //#region src/ts-dsl/decl/enum.d.ts
6783
- type Value = string | number | MaybeTsDsl<ts.Expression>;
6784
- type ValueFn = Value | ((m: EnumMemberTsDsl) => void);
6785
- declare class EnumTsDsl extends TsDsl<ts.EnumDeclaration> {
6786
- private _members;
6787
- private _name;
6788
- protected modifiers: {
6789
- list: () => ts.Modifier[];
6790
- };
6791
- constructor(name: string | ts.Identifier, fn?: (e: EnumTsDsl) => void);
6792
- /** Adds an enum member. */
6793
- member(name: string, value?: ValueFn): this;
6794
- /** Adds multiple enum members. */
6795
- members(...members: ReadonlyArray<EnumMemberTsDsl>): this;
6796
- /** Renders the enum declaration. */
6797
- $render(): ts.EnumDeclaration;
6764
+ //#region src/ts-dsl/stmt/if.d.ts
6765
+ type IfCondition = string | MaybeTsDsl<ts.Expression>;
6766
+ declare const Mixed$44: MixinCtor<abstract new () => TsDsl<ts.IfStatement>, DoMethods>;
6767
+ declare class IfTsDsl extends Mixed$44 {
6768
+ readonly '~dsl' = "IfTsDsl";
6769
+ protected _condition?: IfCondition;
6770
+ protected _else?: Array<DoExpr>;
6771
+ constructor(condition?: IfCondition);
6772
+ analyze(ctx: AnalysisContext): void;
6773
+ condition(condition: IfCondition): this;
6774
+ otherwise(...items: Array<DoExpr>): this;
6775
+ toAst(): ts.IfStatement;
6798
6776
  }
6799
- interface EnumTsDsl extends ConstMixin, DocMixin, ExportMixin {}
6800
6777
  //#endregion
6801
- //#region src/ts-dsl/expr/binary.d.ts
6802
- type Expr$3 = string | MaybeTsDsl<ts.Expression>;
6803
- type Op$1 = Operator | ts.BinaryOperator;
6804
- type Operator = '!=' | '!==' | '&&' | '*' | '+' | '-' | '/' | '<' | '<=' | '=' | '==' | '===' | '>' | '>=' | '??' | '||';
6805
- declare class BinaryTsDsl extends TsDsl<ts.BinaryExpression> {
6806
- protected _base: Expr$3;
6807
- protected _expr?: Expr$3;
6808
- protected _op?: Op$1;
6809
- constructor(base: Expr$3, op?: Op$1, expr?: Expr$3);
6810
- /** Logical AND — `this && expr` */
6811
- and(expr: Expr$3): this;
6812
- /** Creates an assignment expression (e.g. `this = expr`). */
6813
- assign(expr: Expr$3): this;
6814
- /** Nullish coalescing — `this ?? expr` */
6815
- coalesce(expr: Expr$3): this;
6816
- /** Division — `this / expr` */
6817
- div(expr: Expr$3): this;
6818
- /** Strict equality — `this === expr` */
6819
- eq(expr: Expr$3): this;
6820
- /** Greater than — `this > expr` */
6821
- gt(expr: Expr$3): this;
6822
- /** Greater than or equal — `this >= expr` */
6823
- gte(expr: Expr$3): this;
6824
- /** Loose equality — `this == expr` */
6825
- looseEq(expr: Expr$3): this;
6826
- /** Loose inequality — `this != expr` */
6827
- looseNeq(expr: Expr$3): this;
6828
- /** Less than — `this < expr` */
6829
- lt(expr: Expr$3): this;
6830
- /** Less than or equal — `this <= expr` */
6831
- lte(expr: Expr$3): this;
6832
- /** Subtraction — `this - expr` */
6833
- minus(expr: Expr$3): this;
6834
- /** Strict inequality — `this !== expr` */
6835
- neq(expr: Expr$3): this;
6836
- /** Logical OR — `this || expr` */
6837
- or(expr: Expr$3): this;
6838
- /** Addition — `this + expr` */
6839
- plus(expr: Expr$3): this;
6840
- /** Multiplication — `this * expr` */
6841
- times(expr: Expr$3): this;
6842
- $render(): ts.BinaryExpression;
6843
- /** Sets the binary operator and right-hand operand for this expression. */
6844
- private opAndExpr;
6845
- private opToToken;
6778
+ //#region src/ts-dsl/decl/setter.d.ts
6779
+ type SetterName = string | ts.PropertyName;
6780
+ declare const Mixed$43: MixinCtor<MixinCtor<MixinCtor<MixinCtor<MixinCtor<MixinCtor<MixinCtor<MixinCtor<MixinCtor<MixinCtor<abstract new () => TsDsl<ts.SetAccessorDeclaration>, StaticMethods>, PublicMethods>, ProtectedMethods>, PrivateMethods>, ParamMethods>, DocMethods>, DoMethods>, DecoratorMethods>, AsyncMethods>, AbstractMethods>;
6781
+ declare class SetterTsDsl extends Mixed$43 {
6782
+ readonly '~dsl' = "SetterTsDsl";
6783
+ protected name: SetterName;
6784
+ constructor(name: SetterName, fn?: (s: SetterTsDsl) => void);
6785
+ analyze(ctx: AnalysisContext): void;
6786
+ toAst(): ts.SetAccessorDeclaration;
6846
6787
  }
6847
- interface BinaryTsDsl extends AsMixin, ExprMixin {}
6848
6788
  //#endregion
6849
- //#region src/ts-dsl/mixins/operator.d.ts
6850
- type This = string | MaybeTsDsl<ts.Expression>;
6851
- type Expr$2 = string | MaybeTsDsl<ts.Expression>;
6852
- declare class OperatorMixin {
6853
- /** Logical AND `this && expr` */
6854
- and(this: This, expr: Expr$2): BinaryTsDsl;
6855
- /** Creates an assignment expression (e.g. `this = expr`). */
6856
- assign(this: This, expr: Expr$2): BinaryTsDsl;
6857
- /** Nullish coalescing — `this ?? expr` */
6858
- coalesce(this: This, expr: Expr$2): BinaryTsDsl;
6859
- /** Division — `this / expr` */
6860
- div(this: This, expr: Expr$2): BinaryTsDsl;
6861
- /** Strict equality — `this === expr` */
6862
- eq(this: This, expr: Expr$2): BinaryTsDsl;
6863
- /** Greater than — `this > expr` */
6864
- gt(this: This, expr: Expr$2): BinaryTsDsl;
6865
- /** Greater than or equal — `this >= expr` */
6866
- gte(this: This, expr: Expr$2): BinaryTsDsl;
6867
- /** Loose equality — `this == expr` */
6868
- looseEq(this: This, expr: Expr$2): BinaryTsDsl;
6869
- /** Loose inequality — `this != expr` */
6870
- looseNeq(this: This, expr: Expr$2): BinaryTsDsl;
6871
- /** Less than — `this < expr` */
6872
- lt(this: This, expr: Expr$2): BinaryTsDsl;
6873
- /** Less than or equal — `this <= expr` */
6874
- lte(this: This, expr: Expr$2): BinaryTsDsl;
6875
- /** Subtraction — `this - expr` */
6876
- minus(this: This, expr: Expr$2): BinaryTsDsl;
6877
- /** Strict inequality — `this !== expr` */
6878
- neq(this: This, expr: Expr$2): BinaryTsDsl;
6879
- /** Logical OR — `this || expr` */
6880
- or(this: This, expr: Expr$2): BinaryTsDsl;
6881
- /** Addition — `this + expr` */
6882
- plus(this: This, expr: Expr$2): BinaryTsDsl;
6883
- /** Multiplication — `this * expr` */
6884
- times(this: This, expr: Expr$2): BinaryTsDsl;
6789
+ //#region src/ts-dsl/type/param.d.ts
6790
+ type TypeParamName = Symbol | string;
6791
+ type TypeParamExpr = Symbol | string | boolean | MaybeTsDsl<TypeTsDsl>;
6792
+ declare const Mixed$42: abstract new () => TypeTsDsl<ts.TypeParameterDeclaration>;
6793
+ declare class TypeParamTsDsl extends Mixed$42 {
6794
+ readonly '~dsl' = "TypeParamTsDsl";
6795
+ protected constraint?: Ref<TypeParamExpr>;
6796
+ protected defaultValue?: Ref<TypeParamExpr>;
6797
+ protected name?: Ref<TypeParamName>;
6798
+ constructor(name?: TypeParamName, fn?: (name: TypeParamTsDsl) => void);
6799
+ analyze(ctx: AnalysisContext): void;
6800
+ default(value: TypeParamExpr): this;
6801
+ extends(constraint: TypeParamExpr): this;
6802
+ toAst(): ts.TypeParameterDeclaration;
6885
6803
  }
6886
6804
  //#endregion
6887
- //#region src/ts-dsl/expr/attr.d.ts
6888
- declare class AttrTsDsl extends TsDsl<ts.PropertyAccessExpression | ts.ElementAccessExpression> {
6889
- protected left: string | MaybeTsDsl<ts.Expression>;
6890
- protected right: string | ts.MemberName | number;
6891
- constructor(left: string | MaybeTsDsl<ts.Expression>, right: string | ts.MemberName | number);
6892
- $render(): ts.PropertyAccessExpression | ts.ElementAccessExpression;
6805
+ //#region src/ts-dsl/mixins/type-params.d.ts
6806
+ interface TypeParamsMethods extends Node {
6807
+ /** Returns the type parameters as an array of ts.TypeParameterDeclaration nodes. */
6808
+ $generics(): ReadonlyArray<ts.TypeParameterDeclaration> | undefined;
6809
+ /** Adds a single type parameter (e.g. `T` in `Array<T>`). */
6810
+ generic(...args: ConstructorParameters<typeof TypeParamTsDsl>): this;
6811
+ /** Adds type parameters (e.g. `Map<string, T>`). */
6812
+ generics(...args: ReadonlyArray<Symbol | string | MaybeTsDsl<TypeParamTsDsl>>): this;
6893
6813
  }
6894
- interface AttrTsDsl extends AsMixin, ExprMixin, OperatorMixin, OptionalMixin {}
6895
6814
  //#endregion
6896
- //#region src/ts-dsl/expr/await.d.ts
6897
- declare class AwaitTsDsl extends TsDsl<ts.AwaitExpression> {
6898
- protected _awaitExpr: string | MaybeTsDsl<ts.Expression>;
6815
+ //#region src/ts-dsl/expr/typeof.d.ts
6816
+ declare const Mixed$41: MixinCtor<abstract new () => TsDsl<ts.TypeOfExpression>, OperatorMethods>;
6817
+ declare class TypeOfExprTsDsl extends Mixed$41 {
6818
+ readonly '~dsl' = "TypeOfExprTsDsl";
6819
+ protected _expr: string | MaybeTsDsl<ts.Expression>;
6899
6820
  constructor(expr: string | MaybeTsDsl<ts.Expression>);
6900
- $render(): ts.AwaitExpression;
6821
+ analyze(ctx: AnalysisContext): void;
6822
+ toAst(): ts.TypeOfExpression;
6901
6823
  }
6902
- interface AwaitTsDsl extends ExprMixin {}
6903
6824
  //#endregion
6904
- //#region src/ts-dsl/mixins/type-args.d.ts
6905
- declare class TypeArgsMixin extends TsDsl {
6906
- protected _generics?: Array<string | MaybeTsDsl<TypeTsDsl>>;
6907
- /** Adds a single type argument (e.g. `string` in `Foo<string>`). */
6908
- generic(arg: string | MaybeTsDsl<TypeTsDsl>): this;
6909
- /** Adds type arguments (e.g. `Map<string, number>`). */
6910
- generics(...args: ReadonlyArray<string | MaybeTsDsl<TypeTsDsl>>): this;
6911
- /** Returns the type arguments as an array of ts.TypeNode nodes. */
6912
- protected $generics(): ReadonlyArray<ts.TypeNode> | undefined;
6913
- $render(): ts.Node;
6825
+ //#region src/ts-dsl/type/idx.d.ts
6826
+ type Base$2 = string | MaybeTsDsl<ts.TypeNode>;
6827
+ type Index = string | number | MaybeTsDsl<ts.TypeNode>;
6828
+ declare const Mixed$40: MixinCtor<abstract new () => TypeTsDsl<ts.IndexedAccessTypeNode>, TypeExprMethods>;
6829
+ declare class TypeIdxTsDsl extends Mixed$40 {
6830
+ readonly '~dsl' = "TypeIdxTsDsl";
6831
+ protected _base: Base$2;
6832
+ protected _index: Index;
6833
+ constructor(base: Base$2, index: Index);
6834
+ analyze(ctx: AnalysisContext): void;
6835
+ base(base: Base$2): this;
6836
+ index(index: Index): this;
6837
+ toAst(): ts.IndexedAccessTypeNode;
6914
6838
  }
6915
6839
  //#endregion
6916
- //#region src/ts-dsl/expr/call.d.ts
6917
- declare class CallTsDsl extends TsDsl<ts.CallExpression> {
6918
- protected _callee: string | MaybeTsDsl<ts.Expression>;
6919
- constructor(callee: string | MaybeTsDsl<ts.Expression>, ...args: ReadonlyArray<string | MaybeTsDsl<ts.Expression> | undefined>);
6920
- $render(): ts.CallExpression;
6840
+ //#region src/ts-dsl/type/operator.d.ts
6841
+ type Op = ts.SyntaxKind.KeyOfKeyword | ts.SyntaxKind.ReadonlyKeyword | ts.SyntaxKind.UniqueKeyword;
6842
+ type Type$2 = string | MaybeTsDsl<ts.TypeNode>;
6843
+ declare const Mixed$39: abstract new () => TypeTsDsl<ts.TypeOperatorNode>;
6844
+ /**
6845
+ * Builds a TypeScript `TypeOperatorNode`, such as:
6846
+ *
6847
+ * - `keyof T`
6848
+ * - `readonly U`
6849
+ * - `unique V`
6850
+ *
6851
+ * This DSL provides both a generic `.operator()` API and convenient
6852
+ * shorthand methods (`.keyof()`, `.readonly()`, `.unique()`).
6853
+ *
6854
+ * The node will throw during render if required fields are missing.
6855
+ */
6856
+ declare class TypeOperatorTsDsl extends Mixed$39 {
6857
+ readonly '~dsl' = "TypeOperatorTsDsl";
6858
+ protected _op?: Op;
6859
+ protected _type?: Type$2;
6860
+ analyze(ctx: AnalysisContext): void;
6861
+ /** Shorthand: builds `keyof T`. */
6862
+ keyof(type: Type$2): this;
6863
+ /** Sets the operator explicitly. */
6864
+ operator(op: Op): this;
6865
+ /** Shorthand: builds `readonly T`. */
6866
+ readonly(type: Type$2): this;
6867
+ /** Sets the target type of the operator. */
6868
+ type(type: Type$2): this;
6869
+ /** Shorthand: builds `unique T`. */
6870
+ unique(type: Type$2): this;
6871
+ toAst(): ts.TypeOperatorNode;
6872
+ /** Throws if required fields are not set. */
6873
+ $validate(): asserts this is this & {
6874
+ _op: Op;
6875
+ _type: Type$2;
6876
+ };
6877
+ private missingRequiredCalls;
6878
+ }
6879
+ //#endregion
6880
+ //#region src/ts-dsl/type/query.d.ts
6881
+ declare const Mixed$38: MixinCtor<abstract new () => TypeTsDsl<ts.TypeQueryNode>, TypeExprMethods>;
6882
+ declare class TypeQueryTsDsl extends Mixed$38 {
6883
+ readonly '~dsl' = "TypeQueryTsDsl";
6884
+ protected _expr: string | MaybeTsDsl<TypeTsDsl | ts.Expression>;
6885
+ constructor(expr: string | MaybeTsDsl<TypeTsDsl | ts.Expression>);
6886
+ analyze(ctx: AnalysisContext): void;
6887
+ toAst(): ts.TypeQueryNode;
6888
+ }
6889
+ //#endregion
6890
+ //#region src/ts-dsl/mixins/type-expr.d.ts
6891
+ interface TypeExprMethods extends Node {
6892
+ /** Creates an indexed-access type (e.g. `Foo<T>[K]`). */
6893
+ idx(this: MaybeTsDsl<TypeTsDsl>, index: string | number | MaybeTsDsl<ts.TypeNode>): TypeIdxTsDsl;
6894
+ /** Shorthand: builds `keyof T`. */
6895
+ keyof(this: MaybeTsDsl<TypeTsDsl>): TypeOperatorTsDsl;
6896
+ /** Shorthand: builds `readonly T`. */
6897
+ readonly(this: MaybeTsDsl<TypeTsDsl>): TypeOperatorTsDsl;
6898
+ /** Create a TypeExpr node representing ReturnType<this>. */
6899
+ returnType(this: MaybeTsDsl<ts.Expression>): TypeExprTsDsl;
6900
+ /** Create a TypeOfExpr node representing typeof this. */
6901
+ typeofExpr(this: MaybeTsDsl<ts.Expression>): TypeOfExprTsDsl;
6902
+ /** Create a TypeQuery node representing typeof this. */
6903
+ typeofType(this: MaybeTsDsl<TypeTsDsl | ts.Expression>): TypeQueryTsDsl;
6904
+ /** Shorthand: builds `unique T`. */
6905
+ unique(this: MaybeTsDsl<TypeTsDsl>): TypeOperatorTsDsl;
6906
+ }
6907
+ //#endregion
6908
+ //#region src/ts-dsl/type/attr.d.ts
6909
+ type Base$1 = Symbol | string | MaybeTsDsl<ts.EntityName>;
6910
+ type Right = Symbol | string | ts.Identifier;
6911
+ declare const Mixed$37: MixinCtor<abstract new () => TypeTsDsl<ts.QualifiedName>, TypeExprMethods>;
6912
+ declare class TypeAttrTsDsl extends Mixed$37 {
6913
+ readonly '~dsl' = "TypeAttrTsDsl";
6914
+ protected _base?: Ref<Base$1>;
6915
+ protected _right: Ref<Right>;
6916
+ constructor(base: Base$1 | Ref<Base$1>, right: string | ts.Identifier);
6917
+ constructor(right: Right);
6918
+ analyze(ctx: AnalysisContext): void;
6919
+ base(base?: Base$1 | Ref<Base$1>): this;
6920
+ right(right: Right): this;
6921
+ toAst(): ts.QualifiedName;
6922
+ }
6923
+ //#endregion
6924
+ //#region src/ts-dsl/type/expr.d.ts
6925
+ type TypeExprName = Symbol | string;
6926
+ type TypeExprExpr = TypeExprName | TypeAttrTsDsl;
6927
+ declare const Mixed$36: MixinCtor<MixinCtor<abstract new () => TypeTsDsl<ts.TypeReferenceNode>, TypeExprMethods>, TypeArgsMethods>;
6928
+ declare class TypeExprTsDsl extends Mixed$36 {
6929
+ readonly '~dsl' = "TypeExprTsDsl";
6930
+ protected _exprInput?: Ref<TypeExprExpr>;
6931
+ constructor();
6932
+ constructor(fn: (t: TypeExprTsDsl) => void);
6933
+ constructor(name: TypeExprName);
6934
+ constructor(name: TypeExprName, fn?: (t: TypeExprTsDsl) => void);
6935
+ analyze(ctx: AnalysisContext): void;
6936
+ /** Accesses a nested type (e.g. `Foo.Bar`). */
6937
+ attr(right: string | ts.Identifier | TypeAttrTsDsl): this;
6938
+ toAst(): ts.TypeReferenceNode;
6939
+ }
6940
+ //#endregion
6941
+ //#region src/ts-dsl/decl/field.d.ts
6942
+ type FieldType = TypeExprName | TypeTsDsl;
6943
+ declare const Mixed$35: MixinCtor<MixinCtor<MixinCtor<MixinCtor<MixinCtor<MixinCtor<MixinCtor<MixinCtor<abstract new () => TsDsl<ts.PropertyDeclaration>, ValueMethods>, StaticMethods>, ReadonlyMethods>, PublicMethods>, ProtectedMethods>, PrivateMethods>, DocMethods>, DecoratorMethods>;
6944
+ declare class FieldTsDsl extends Mixed$35 {
6945
+ readonly '~dsl' = "FieldTsDsl";
6946
+ protected name: string;
6947
+ protected _type?: TypeTsDsl;
6948
+ constructor(name: string, fn?: (f: FieldTsDsl) => void);
6949
+ analyze(ctx: AnalysisContext): void;
6950
+ /** Sets the field type. */
6951
+ type(type: FieldType): this;
6952
+ toAst(): ts.PropertyDeclaration;
6953
+ }
6954
+ //#endregion
6955
+ //#region src/ts-dsl/decl/init.d.ts
6956
+ declare const Mixed$34: MixinCtor<MixinCtor<MixinCtor<MixinCtor<MixinCtor<MixinCtor<MixinCtor<abstract new () => TsDsl<ts.ConstructorDeclaration>, PublicMethods>, ProtectedMethods>, PrivateMethods>, ParamMethods>, DocMethods>, DoMethods>, DecoratorMethods>;
6957
+ declare class InitTsDsl extends Mixed$34 {
6958
+ readonly '~dsl' = "InitTsDsl";
6959
+ constructor(fn?: (i: InitTsDsl) => void);
6960
+ analyze(ctx: AnalysisContext): void;
6961
+ toAst(): ts.ConstructorDeclaration;
6962
+ }
6963
+ //#endregion
6964
+ //#region src/ts-dsl/decl/method.d.ts
6965
+ declare const Mixed$33: MixinCtor<MixinCtor<MixinCtor<MixinCtor<MixinCtor<MixinCtor<MixinCtor<MixinCtor<MixinCtor<MixinCtor<MixinCtor<MixinCtor<abstract new () => TsDsl<ts.MethodDeclaration>, TypeParamsMethods>, StaticMethods>, PublicMethods>, ProtectedMethods>, PrivateMethods>, ParamMethods>, OptionalMethods>, DocMethods>, DoMethods>, DecoratorMethods>, AsyncMethods>, AbstractMethods>;
6966
+ declare class MethodTsDsl extends Mixed$33 {
6967
+ readonly '~dsl' = "MethodTsDsl";
6968
+ protected name: string;
6969
+ protected _returns?: TypeTsDsl;
6970
+ constructor(name: string, fn?: (m: MethodTsDsl) => void);
6971
+ analyze(ctx: AnalysisContext): void;
6972
+ /** Sets the return type. */
6973
+ returns(type: string | TypeTsDsl): this;
6974
+ toAst(): ts.MethodDeclaration;
6921
6975
  }
6922
- interface CallTsDsl extends ArgsMixin, AsMixin, ExprMixin, TypeArgsMixin {}
6923
6976
  //#endregion
6924
- //#region src/ts-dsl/stmt/return.d.ts
6925
- declare class ReturnTsDsl extends TsDsl<ts.ReturnStatement> {
6926
- protected _returnExpr?: string | MaybeTsDsl<ts.Expression>;
6927
- constructor(expr?: string | MaybeTsDsl<ts.Expression>);
6928
- $render(): ts.ReturnStatement;
6977
+ //#region src/ts-dsl/decl/class.d.ts
6978
+ type Base = Symbol | string;
6979
+ type Name$1 = Symbol | string;
6980
+ type Body = Array<MaybeTsDsl<ts.ClassElement | ts.Node>>;
6981
+ declare const Mixed$32: MixinCtor<MixinCtor<MixinCtor<MixinCtor<MixinCtor<MixinCtor<abstract new () => TsDsl<ts.ClassDeclaration>, TypeParamsMethods>, ExportMethods>, DocMethods>, DefaultMethods>, DecoratorMethods>, AbstractMethods>;
6982
+ declare class ClassTsDsl extends Mixed$32 {
6983
+ readonly '~dsl' = "ClassTsDsl";
6984
+ protected baseClass?: Ref<Base>;
6985
+ protected body: Body;
6986
+ protected name: Ref<Name$1>;
6987
+ constructor(name: Name$1);
6988
+ analyze(ctx: AnalysisContext): void;
6989
+ /** Adds one or more class members (fields, methods, etc.). */
6990
+ do(...items: Body): this;
6991
+ /** Records a base class to extend from. */
6992
+ extends(base?: Base): this;
6993
+ /** Adds a class field. */
6994
+ field(name: string, fn?: (f: FieldTsDsl) => void): this;
6995
+ /** Adds a class constructor. */
6996
+ init(fn?: (i: InitTsDsl) => void): this;
6997
+ /** Adds a class method. */
6998
+ method(name: string, fn?: (m: MethodTsDsl) => void): this;
6999
+ /** Inserts an empty line between members for formatting. */
7000
+ newline(): this;
7001
+ toAst(): ts.ClassDeclaration;
7002
+ /** Builds heritage clauses (extends). */
7003
+ private _heritage;
6929
7004
  }
6930
- interface ReturnTsDsl extends ExprMixin {}
6931
7005
  //#endregion
6932
- //#region src/ts-dsl/mixins/expr.d.ts
6933
- declare class ExprMixin {
6934
- /** Accesses a property on the current expression (e.g. `this.foo`). */
6935
- attr(this: string | MaybeTsDsl<ts.Expression>, name: string | ts.MemberName | number): AttrTsDsl;
6936
- /** Awaits the current expression (e.g. `await expr`). */
6937
- await(this: string | MaybeTsDsl<ts.Expression>): AwaitTsDsl;
6938
- /** Calls the current expression (e.g. `fn(arg1, arg2)`). */
6939
- call(this: string | MaybeTsDsl<ts.Expression>, ...args: ReadonlyArray<string | MaybeTsDsl<ts.Expression> | undefined>): CallTsDsl;
6940
- /** Produces a `return` statement returning the current expression. */
6941
- return(this: string | MaybeTsDsl<ts.Expression>): ReturnTsDsl;
7006
+ //#region src/ts-dsl/decl/decorator.d.ts
7007
+ type DecoratorName = Symbol | string | MaybeTsDsl<ts.Expression>;
7008
+ declare const Mixed$31: MixinCtor<abstract new () => TsDsl<ts.Decorator>, ArgsMethods>;
7009
+ declare class DecoratorTsDsl extends Mixed$31 {
7010
+ readonly '~dsl' = "DecoratorTsDsl";
7011
+ protected name: Ref<DecoratorName>;
7012
+ constructor(name: DecoratorName, ...args: ReadonlyArray<string | MaybeTsDsl<ts.Expression>>);
7013
+ analyze(ctx: AnalysisContext): void;
7014
+ toAst(): ts.Decorator;
6942
7015
  }
6943
7016
  //#endregion
6944
- //#region src/ts-dsl/expr/as.d.ts
6945
- declare class AsTsDsl extends TsDsl<ts.AsExpression> {
6946
- protected expr: string | MaybeTsDsl<ts.Expression>;
6947
- protected type: string | TypeTsDsl;
6948
- constructor(expr: string | MaybeTsDsl<ts.Expression>, type: string | TypeTsDsl);
6949
- $render(): ts.AsExpression;
7017
+ //#region src/ts-dsl/decl/member.d.ts
7018
+ type Value$2 = string | number | MaybeTsDsl<ts.Expression>;
7019
+ type ValueFn$1 = Value$2 | ((m: EnumMemberTsDsl) => void);
7020
+ declare const Mixed$30: MixinCtor<abstract new () => TsDsl<ts.EnumMember>, DocMethods>;
7021
+ declare class EnumMemberTsDsl extends Mixed$30 {
7022
+ readonly '~dsl' = "EnumMemberTsDsl";
7023
+ private _name;
7024
+ private _value?;
7025
+ constructor(name: string, value?: ValueFn$1);
7026
+ analyze(ctx: AnalysisContext): void;
7027
+ /** Sets the enum member value. */
7028
+ value(value?: Value$2): this;
7029
+ toAst(): ts.EnumMember;
6950
7030
  }
6951
- interface AsTsDsl extends AsMixin, ExprMixin {}
6952
7031
  //#endregion
6953
- //#region src/ts-dsl/mixins/as.d.ts
6954
- declare class AsMixin {
6955
- /** Creates an `as` type assertion expression (e.g. `value as Type`). */
6956
- as(this: string | MaybeTsDsl<ts.Expression>, type: string | TypeTsDsl): AsTsDsl;
7032
+ //#region src/ts-dsl/decl/enum.d.ts
7033
+ type EnumName = Symbol | string;
7034
+ type Value$1 = string | number | MaybeTsDsl<ts.Expression>;
7035
+ type ValueFn = Value$1 | ((m: EnumMemberTsDsl) => void);
7036
+ declare const Mixed$29: MixinCtor<MixinCtor<MixinCtor<abstract new () => TsDsl<ts.EnumDeclaration>, ExportMethods>, DocMethods>, ConstMethods>;
7037
+ declare class EnumTsDsl extends Mixed$29 {
7038
+ readonly '~dsl' = "EnumTsDsl";
7039
+ private _members;
7040
+ private _name;
7041
+ constructor(name: EnumName, fn?: (e: EnumTsDsl) => void);
7042
+ analyze(ctx: AnalysisContext): void;
7043
+ /** Adds an enum member. */
7044
+ member(name: string, value?: ValueFn): this;
7045
+ /** Adds multiple enum members. */
7046
+ members(...members: ReadonlyArray<EnumMemberTsDsl>): this;
7047
+ toAst(): ts.EnumDeclaration;
6957
7048
  }
6958
7049
  //#endregion
6959
7050
  //#region src/ts-dsl/decl/func.d.ts
6960
7051
  type FuncMode = 'arrow' | 'decl' | 'expr';
6961
- declare class ImplFuncTsDsl<M extends FuncMode = 'arrow'> extends TsDsl<M extends 'decl' ? ts.FunctionDeclaration : M extends 'expr' ? ts.FunctionExpression : ts.ArrowFunction> {
6962
- protected mode: FuncMode;
6963
- protected modifiers: {
6964
- list: () => ts.Modifier[];
6965
- };
6966
- protected name?: string;
7052
+ type FuncName = Symbol | string;
7053
+ declare const Mixed$28: MixinCtor<MixinCtor<MixinCtor<MixinCtor<MixinCtor<MixinCtor<MixinCtor<MixinCtor<MixinCtor<MixinCtor<MixinCtor<MixinCtor<abstract new () => TsDsl<ts.ArrowFunction>, TypeParamsMethods>, StaticMethods>, PublicMethods>, ProtectedMethods>, PrivateMethods>, ParamMethods>, DocMethods>, DoMethods>, DecoratorMethods>, AsyncMethods>, AsMethods>, AbstractMethods>;
7054
+ declare class ImplFuncTsDsl<M extends FuncMode = 'arrow'> extends Mixed$28 {
7055
+ readonly '~dsl' = "FuncTsDsl";
7056
+ protected mode?: FuncMode;
7057
+ protected name?: Ref<FuncName>;
6967
7058
  protected _returns?: TypeTsDsl;
6968
7059
  constructor();
6969
7060
  constructor(fn: (f: ImplFuncTsDsl<'arrow'>) => void);
6970
- constructor(name: string);
6971
- constructor(name: string, fn: (f: ImplFuncTsDsl<'decl'>) => void);
7061
+ constructor(name: FuncName);
7062
+ constructor(name: FuncName, fn: (f: ImplFuncTsDsl<'decl'>) => void);
7063
+ analyze(ctx: AnalysisContext): void;
6972
7064
  /** Switches the function to an arrow function form. */
6973
7065
  arrow(): FuncTsDsl<'arrow'>;
6974
7066
  /** Switches the function to a function declaration form. */
@@ -6977,9 +7069,8 @@ declare class ImplFuncTsDsl<M extends FuncMode = 'arrow'> extends TsDsl<M extend
6977
7069
  expr(): FuncTsDsl<'expr'>;
6978
7070
  /** Sets the return type. */
6979
7071
  returns(type: string | TypeTsDsl): this;
6980
- $render(): M extends 'decl' ? ts.FunctionDeclaration : M extends 'expr' ? ts.FunctionExpression : ts.ArrowFunction;
7072
+ toAst(): M extends 'decl' ? ts.FunctionDeclaration : M extends 'expr' ? ts.FunctionExpression : ts.ArrowFunction;
6981
7073
  }
6982
- interface ImplFuncTsDsl extends AbstractMixin, AsMixin, AsyncMixin, DecoratorMixin, DoMixin, DocMixin, ParamMixin, PrivateMixin, ProtectedMixin, PublicMixin, StaticMixin, TypeParamsMixin {}
6983
7074
  declare const FuncTsDsl: {
6984
7075
  new (): FuncTsDsl<"arrow">;
6985
7076
  new (fn: (f: FuncTsDsl<"arrow">) => void): FuncTsDsl<"arrow">;
@@ -6988,44 +7079,48 @@ declare const FuncTsDsl: {
6988
7079
  } & typeof ImplFuncTsDsl;
6989
7080
  type FuncTsDsl<M extends FuncMode = 'arrow'> = ImplFuncTsDsl<M>;
6990
7081
  //#endregion
6991
- //#region src/ts-dsl/decl/getter.d.ts
6992
- declare class GetterTsDsl extends TsDsl<ts.GetAccessorDeclaration> {
6993
- protected modifiers: {
6994
- list: () => ts.Modifier[];
6995
- };
6996
- protected name: string | ts.PropertyName;
6997
- constructor(name: string | ts.PropertyName, fn?: (g: GetterTsDsl) => void);
6998
- $render(): ts.GetAccessorDeclaration;
6999
- }
7000
- interface GetterTsDsl extends AbstractMixin, AsyncMixin, DecoratorMixin, DoMixin, DocMixin, ParamMixin, PrivateMixin, ProtectedMixin, PublicMixin, StaticMixin {}
7001
- //#endregion
7002
- //#region src/ts-dsl/decl/setter.d.ts
7003
- declare class SetterTsDsl extends TsDsl<ts.SetAccessorDeclaration> {
7004
- protected modifiers: {
7005
- list: () => ts.Modifier[];
7082
+ //#region src/ts-dsl/decl/pattern.d.ts
7083
+ declare const Mixed$27: abstract new () => TsDsl<ts.BindingName>;
7084
+ /**
7085
+ * Builds binding patterns (e.g. `{ foo, bar }`, `[a, b, ...rest]`).
7086
+ */
7087
+ declare class PatternTsDsl extends Mixed$27 {
7088
+ readonly '~dsl' = "PatternTsDsl";
7089
+ protected pattern?: {
7090
+ kind: 'array';
7091
+ values: ReadonlyArray<string>;
7092
+ } | {
7093
+ kind: 'object';
7094
+ values: Record<string, string>;
7006
7095
  };
7007
- protected name: string | ts.PropertyName;
7008
- constructor(name: string | ts.PropertyName, fn?: (s: SetterTsDsl) => void);
7009
- $render(): ts.SetAccessorDeclaration;
7096
+ protected _spread?: string;
7097
+ analyze(ctx: AnalysisContext): void;
7098
+ /** Defines an array pattern (e.g. `[a, b, c]`). */
7099
+ array(...props: ReadonlyArray<string> | [ReadonlyArray<string>]): this;
7100
+ /** Defines an object pattern (e.g. `{ a, b: alias }`). */
7101
+ object(...props: ReadonlyArray<MaybeArray$1<string> | Record<string, string>>): this;
7102
+ /** Adds a spread element (e.g. `...rest`, `...options`, `...args`). */
7103
+ spread(name: string): this;
7104
+ toAst(): ts.ObjectBindingPattern | ts.ArrayBindingPattern;
7105
+ private createSpread;
7010
7106
  }
7011
- interface SetterTsDsl extends AbstractMixin, AsyncMixin, DecoratorMixin, DoMixin, DocMixin, ParamMixin, PrivateMixin, ProtectedMixin, PublicMixin, StaticMixin {}
7012
7107
  //#endregion
7013
7108
  //#region src/ts-dsl/mixins/layout.d.ts
7014
- declare class LayoutMixin {
7015
- protected static readonly DEFAULT_THRESHOLD = 3;
7016
- protected layout: boolean | number | undefined;
7109
+ interface LayoutMethods extends Node {
7110
+ /** Computes whether output should be multiline based on layout setting and element count. */
7111
+ $multiline(count: number): boolean;
7017
7112
  /** Sets automatic line output with optional threshold (default: 3). */
7018
7113
  auto(threshold?: number): this;
7019
7114
  /** Sets single line output. */
7020
7115
  inline(): this;
7021
7116
  /** Sets multi line output. */
7022
7117
  pretty(): this;
7023
- /** Computes whether output should be multiline based on layout setting and element count. */
7024
- protected $multiline(count: number): boolean;
7025
7118
  }
7026
7119
  //#endregion
7027
7120
  //#region src/ts-dsl/expr/array.d.ts
7028
- declare class ArrayTsDsl extends TsDsl<ts.ArrayLiteralExpression> {
7121
+ declare const Mixed$26: MixinCtor<MixinCtor<abstract new () => TsDsl<ts.ArrayLiteralExpression>, LayoutMethods>, AsMethods>;
7122
+ declare class ArrayTsDsl extends Mixed$26 {
7123
+ readonly '~dsl' = "ArrayTsDsl";
7029
7124
  protected _elements: Array<{
7030
7125
  expr: MaybeTsDsl<ts.Expression>;
7031
7126
  kind: 'element';
@@ -7034,185 +7129,78 @@ declare class ArrayTsDsl extends TsDsl<ts.ArrayLiteralExpression> {
7034
7129
  kind: 'spread';
7035
7130
  }>;
7036
7131
  constructor(...exprs: Array<string | number | boolean | MaybeTsDsl<ts.Expression>>);
7132
+ analyze(ctx: AnalysisContext): void;
7037
7133
  /** Adds a single array element. */
7038
7134
  element(expr: string | number | boolean | MaybeTsDsl<ts.Expression>): this;
7039
7135
  /** Adds multiple array elements. */
7040
7136
  elements(...exprs: ReadonlyArray<string | number | boolean | MaybeTsDsl<ts.Expression>>): this;
7041
7137
  /** Adds a spread element (`...expr`). */
7042
7138
  spread(expr: MaybeTsDsl<ts.Expression>): this;
7043
- $render(): ts.ArrayLiteralExpression;
7044
- }
7045
- interface ArrayTsDsl extends AsMixin, LayoutMixin {}
7046
- //#endregion
7047
- //#region src/ts-dsl/expr/typeof.d.ts
7048
- declare class TypeOfExprTsDsl extends TsDsl<ts.TypeOfExpression> {
7049
- protected _expr: string | MaybeTsDsl<ts.Expression>;
7050
- constructor(expr: string | MaybeTsDsl<ts.Expression>);
7051
- $render(): ts.TypeOfExpression;
7052
- }
7053
- interface TypeOfExprTsDsl extends OperatorMixin {}
7054
- //#endregion
7055
- //#region src/ts-dsl/type/attr.d.ts
7056
- declare class TypeAttrTsDsl extends TypeTsDsl<ts.QualifiedName> {
7057
- protected _base?: string | MaybeTsDsl<ts.EntityName>;
7058
- protected right: string | ts.Identifier;
7059
- constructor(base: string | MaybeTsDsl<ts.EntityName>, right: string | ts.Identifier);
7060
- constructor(right: string | ts.Identifier);
7061
- base(base?: string | MaybeTsDsl<ts.EntityName>): this;
7062
- $render(): ts.QualifiedName;
7063
- }
7064
- interface TypeAttrTsDsl extends TypeExprMixin {}
7065
- //#endregion
7066
- //#region src/ts-dsl/type/expr.d.ts
7067
- declare class TypeExprTsDsl extends TypeTsDsl<ts.TypeReferenceNode> {
7068
- protected _exprInput?: string | ts.Identifier | TypeAttrTsDsl;
7069
- constructor();
7070
- constructor(fn: (t: TypeExprTsDsl) => void);
7071
- constructor(name: string);
7072
- constructor(name: string, fn?: (t: TypeExprTsDsl) => void);
7073
- /** Accesses a nested type (e.g. `Foo.Bar`). */
7074
- attr(right: string | ts.Identifier | TypeAttrTsDsl): this;
7075
- $render(): ts.TypeReferenceNode;
7076
- }
7077
- interface TypeExprTsDsl extends TypeArgsMixin, TypeExprMixin {}
7078
- //#endregion
7079
- //#region src/ts-dsl/type/idx.d.ts
7080
- declare class TypeIdxTsDsl extends TypeTsDsl<ts.IndexedAccessTypeNode> {
7081
- protected _base: string | MaybeTsDsl<ts.TypeNode>;
7082
- protected _index: string | MaybeTsDsl<ts.TypeNode> | number;
7083
- constructor(base: string | MaybeTsDsl<ts.TypeNode>, index: string | MaybeTsDsl<ts.TypeNode> | number);
7084
- base(base: string | MaybeTsDsl<ts.TypeNode>): this;
7085
- index(index: string | MaybeTsDsl<ts.TypeNode> | number): this;
7086
- $render(): ts.IndexedAccessTypeNode;
7087
- }
7088
- interface TypeIdxTsDsl extends TypeExprMixin {}
7089
- //#endregion
7090
- //#region src/ts-dsl/type/operator.d.ts
7091
- type Op = ts.SyntaxKind.KeyOfKeyword | ts.SyntaxKind.ReadonlyKeyword | ts.SyntaxKind.UniqueKeyword;
7092
- type Type$1 = string | MaybeTsDsl<ts.TypeNode>;
7093
- /**
7094
- * Builds a TypeScript `TypeOperatorNode`, such as:
7095
- *
7096
- * - `keyof T`
7097
- * - `readonly U`
7098
- * - `unique V`
7099
- *
7100
- * This DSL provides both a generic `.operator()` API and convenient
7101
- * shorthand methods (`.keyof()`, `.readonly()`, `.unique()`).
7102
- *
7103
- * The node will throw during render if required fields are missing.
7104
- */
7105
- declare class TypeOperatorTsDsl extends TypeTsDsl<ts.TypeOperatorNode> {
7106
- protected _op?: Op;
7107
- protected _type?: Type$1;
7108
- /** Shorthand: builds `keyof T`. */
7109
- keyof(type: Type$1): this;
7110
- /** Sets the operator explicitly. */
7111
- operator(op: Op): this;
7112
- /** Shorthand: builds `readonly T`. */
7113
- readonly(type: Type$1): this;
7114
- /** Sets the target type of the operator. */
7115
- type(type: Type$1): this;
7116
- /** Shorthand: builds `unique T`. */
7117
- unique(type: Type$1): this;
7118
- $render(): ts.TypeOperatorNode;
7119
- /** Throws if required fields are not set. */
7120
- $validate(): asserts this is this & {
7121
- _op: Op;
7122
- _type: Type$1;
7123
- };
7124
- private missingRequiredCalls;
7125
- }
7126
- //#endregion
7127
- //#region src/ts-dsl/type/query.d.ts
7128
- declare class TypeQueryTsDsl extends TypeTsDsl<ts.TypeQueryNode> {
7129
- protected _expr: string | MaybeTsDsl<TypeTsDsl | ts.Expression>;
7130
- constructor(expr: string | MaybeTsDsl<TypeTsDsl | ts.Expression>);
7131
- $render(): ts.TypeQueryNode;
7132
- }
7133
- interface TypeQueryTsDsl extends TypeExprMixin {}
7134
- //#endregion
7135
- //#region src/ts-dsl/mixins/type-expr.d.ts
7136
- declare class TypeExprMixin {
7137
- /** Creates an indexed-access type (e.g. `Foo<T>[K]`). */
7138
- idx(this: MaybeTsDsl<TypeTsDsl>, index: string | number | MaybeTsDsl<ts.TypeNode>): TypeIdxTsDsl;
7139
- /** Shorthand: builds `keyof T`. */
7140
- keyof(this: MaybeTsDsl<TypeTsDsl>): TypeOperatorTsDsl;
7141
- /** Shorthand: builds `readonly T`. */
7142
- readonly(this: MaybeTsDsl<TypeTsDsl>): TypeOperatorTsDsl;
7143
- /** Create a TypeExpr DSL node representing ReturnType<this>. */
7144
- returnType(this: MaybeTsDsl<ts.Expression>): TypeExprTsDsl;
7145
- /** Create a TypeOfExpr DSL node representing typeof this. */
7146
- typeofExpr(this: MaybeTsDsl<ts.Expression>): TypeOfExprTsDsl;
7147
- /** Create a TypeQuery DSL node representing typeof this. */
7148
- typeofType(this: MaybeTsDsl<TypeTsDsl | ts.Expression>): TypeQueryTsDsl;
7149
- /**
7150
- * Create a `typeof` operator that narrows its return type based on the receiver.
7151
- *
7152
- * - If `this` is a `TsDsl<ts.Expression>` → returns TypeOfExprTsDsl
7153
- * - If `this` is a `TsDsl<TypeTsDsl>` → returns TypeQueryTsDsl
7154
- * - If `this` is a raw ts.Expression → returns TypeOfExprTsDsl
7155
- * - Otherwise → returns TypeQueryTsDsl
7156
- */
7157
- typeof<T extends MaybeTsDsl<TypeTsDsl | ts.Expression>>(this: T): T extends MaybeTsDsl<ts.Expression> ? TypeOfExprTsDsl : T extends MaybeTsDsl<TypeTsDsl> ? TypeQueryTsDsl : TypeQueryTsDsl | TypeOfExprTsDsl;
7158
- /** Shorthand: builds `unique T`. */
7159
- unique(this: MaybeTsDsl<TypeTsDsl>): TypeOperatorTsDsl;
7139
+ toAst(): ts.ArrayLiteralExpression;
7160
7140
  }
7161
7141
  //#endregion
7162
7142
  //#region src/ts-dsl/expr/expr.d.ts
7163
- declare class ExprTsDsl extends TsDsl<ts.Expression> {
7164
- protected _exprInput: string | MaybeTsDsl<ts.Expression>;
7165
- constructor(id: string | MaybeTsDsl<ts.Expression>);
7166
- $render(): ts.Expression;
7143
+ type Id = Symbol | string | MaybeTsDsl<ts.Expression>;
7144
+ declare const Mixed$25: MixinCtor<MixinCtor<MixinCtor<MixinCtor<abstract new () => TsDsl<ts.Expression>, TypeExprMethods>, OperatorMethods>, ExprMethods>, AsMethods>;
7145
+ declare class ExprTsDsl extends Mixed$25 {
7146
+ readonly '~dsl' = "ExprTsDsl";
7147
+ protected _exprInput: Ref<Id>;
7148
+ constructor(id: Id);
7149
+ analyze(ctx: AnalysisContext): void;
7150
+ toAst(): any;
7167
7151
  }
7168
- interface ExprTsDsl extends AsMixin, ExprMixin, OperatorMixin, TypeExprMixin {}
7169
7152
  //#endregion
7170
7153
  //#region src/ts-dsl/expr/id.d.ts
7171
- declare class IdTsDsl extends TsDsl<ts.Identifier> {
7154
+ declare const Mixed$24: abstract new () => TsDsl<ts.Identifier>;
7155
+ declare class IdTsDsl extends Mixed$24 {
7156
+ readonly '~dsl' = "IdTsDsl";
7172
7157
  protected name: string;
7173
7158
  constructor(name: string);
7174
- $render(): ts.Identifier;
7159
+ analyze(ctx: AnalysisContext): void;
7160
+ toAst(): ts.Identifier;
7175
7161
  }
7176
7162
  //#endregion
7177
7163
  //#region src/ts-dsl/expr/literal.d.ts
7178
- declare class LiteralTsDsl extends TsDsl<ts.LiteralTypeNode['literal']> {
7164
+ declare const Mixed$23: MixinCtor<abstract new () => TsDsl<ts.LiteralExpression | ts.NullLiteral | ts.BooleanLiteral | ts.PrefixUnaryExpression>, AsMethods>;
7165
+ declare class LiteralTsDsl extends Mixed$23 {
7166
+ readonly '~dsl' = "LiteralTsDsl";
7179
7167
  protected value: string | number | boolean | null;
7180
7168
  constructor(value: string | number | boolean | null);
7181
- $render(): ts.LiteralTypeNode['literal'];
7169
+ analyze(ctx: AnalysisContext): void;
7170
+ toAst(): any;
7182
7171
  }
7183
- interface LiteralTsDsl extends AsMixin {}
7184
7172
  //#endregion
7185
7173
  //#region src/ts-dsl/expr/new.d.ts
7186
- declare class NewTsDsl extends TsDsl<ts.NewExpression> {
7187
- protected classExpr: string | MaybeTsDsl<ts.Expression>;
7188
- constructor(classExpr: string | MaybeTsDsl<ts.Expression>, ...args: ReadonlyArray<string | MaybeTsDsl<ts.Expression>>);
7189
- /** Builds the `NewExpression` node. */
7190
- $render(): ts.NewExpression;
7174
+ type NewExpr = Symbol | string | MaybeTsDsl<ts.Expression>;
7175
+ declare const Mixed$22: MixinCtor<MixinCtor<MixinCtor<abstract new () => TsDsl<ts.NewExpression>, TypeArgsMethods>, ExprMethods>, ArgsMethods>;
7176
+ declare class NewTsDsl extends Mixed$22 {
7177
+ readonly '~dsl' = "NewTsDsl";
7178
+ protected classExpr: Ref<NewExpr>;
7179
+ constructor(classExpr: NewExpr, ...args: ReadonlyArray<NewExpr>);
7180
+ analyze(ctx: AnalysisContext): void;
7181
+ toAst(): ts.NewExpression;
7191
7182
  }
7192
- interface NewTsDsl extends ArgsMixin, ExprMixin, TypeArgsMixin {}
7193
7183
  //#endregion
7194
7184
  //#region src/ts-dsl/layout/hint.d.ts
7195
7185
  declare class HintTsDsl extends TsDsl<ts.Node> {
7186
+ readonly '~dsl' = "HintTsDsl";
7196
7187
  protected _lines: Array<string>;
7197
7188
  constructor(lines?: MaybeArray$1<string>, fn?: (d: HintTsDsl) => void);
7189
+ analyze(ctx: AnalysisContext): void;
7198
7190
  add(...lines: ReadonlyArray<string>): this;
7199
7191
  apply<T extends ts.Node>(node: T): T;
7200
- $render(): ts.Node;
7192
+ toAst(): ts.Node;
7201
7193
  }
7202
7194
  //#endregion
7203
7195
  //#region src/ts-dsl/mixins/hint.d.ts
7204
- declare function HintMixin<TBase extends new (...args: ReadonlyArray<any>) => ITsDsl>(Base: TBase): {
7205
- new (...args: ReadonlyArray<any>): {
7206
- _hint?: HintTsDsl;
7207
- hint(lines?: MaybeArray$1<string>, fn?: (h: HintTsDsl) => void): /*elided*/any;
7208
- $render(): any;
7209
- };
7210
- } & TBase;
7211
- type HintMixin = InstanceType<ReturnType<typeof HintMixin>>;
7196
+ interface HintMethods extends Node {
7197
+ $hint<T extends ts.Node>(node: T): T;
7198
+ hint(lines?: MaybeArray$1<string>, fn?: (h: HintTsDsl) => void): this;
7199
+ }
7212
7200
  //#endregion
7213
7201
  //#region src/ts-dsl/expr/prop.d.ts
7214
- type Expr$1 = string | MaybeTsDsl<ts.Expression>;
7215
- type Stmt$1 = string | MaybeTsDsl<ts.Statement>;
7202
+ type Expr$1 = Symbol | string | MaybeTsDsl<ts.Expression>;
7203
+ type Stmt$1 = Symbol | string | MaybeTsDsl<ts.Statement>;
7216
7204
  type Kind = 'computed' | 'getter' | 'prop' | 'setter' | 'spread';
7217
7205
  type Meta = {
7218
7206
  kind: 'computed';
@@ -7230,30 +7218,35 @@ type Meta = {
7230
7218
  kind: 'spread';
7231
7219
  name?: undefined;
7232
7220
  };
7233
- declare class ObjectPropTsDsl extends TsDsl<ts.ObjectLiteralElementLike> {
7234
- protected _value?: Expr$1 | Stmt$1;
7221
+ declare const Mixed$21: MixinCtor<abstract new () => TsDsl<ts.ObjectLiteralElementLike>, DocMethods>;
7222
+ declare class ObjectPropTsDsl extends Mixed$21 {
7223
+ readonly '~dsl' = "ObjectPropTsDsl";
7224
+ protected _value?: Ref<Expr$1 | Stmt$1>;
7235
7225
  protected meta: Meta;
7236
7226
  constructor(meta: Meta);
7227
+ analyze(ctx: AnalysisContext): void;
7237
7228
  /** Returns true when all required builder calls are present. */
7238
7229
  get isValid(): boolean;
7239
7230
  value(value: Expr$1 | Stmt$1 | ((p: ObjectPropTsDsl) => void)): this;
7240
- $render(): ts.ObjectLiteralElementLike;
7231
+ toAst(): any;
7241
7232
  $validate(): asserts this is this & {
7242
7233
  _value: Expr$1 | Stmt$1;
7243
7234
  kind: Kind;
7244
7235
  };
7245
7236
  private missingRequiredCalls;
7246
7237
  }
7247
- interface ObjectPropTsDsl extends DocMixin {}
7248
7238
  //#endregion
7249
7239
  //#region src/ts-dsl/expr/object.d.ts
7250
- type Expr = string | MaybeTsDsl<ts.Expression>;
7251
- type Stmt = string | MaybeTsDsl<ts.Statement>;
7240
+ type Expr = Symbol | string | MaybeTsDsl<ts.Expression>;
7241
+ type Stmt = Symbol | string | MaybeTsDsl<ts.Statement>;
7252
7242
  type ExprFn = Expr | ((p: ObjectPropTsDsl) => void);
7253
7243
  type StmtFn = Stmt | ((p: ObjectPropTsDsl) => void);
7254
- declare class ObjectTsDsl extends TsDsl<ts.ObjectLiteralExpression> {
7244
+ declare const Mixed$20: MixinCtor<MixinCtor<MixinCtor<MixinCtor<abstract new () => TsDsl<ts.ObjectLiteralExpression>, LayoutMethods>, HintMethods>, ExprMethods>, AsMethods>;
7245
+ declare class ObjectTsDsl extends Mixed$20 {
7246
+ readonly '~dsl' = "ObjectTsDsl";
7255
7247
  protected _props: Array<ObjectPropTsDsl>;
7256
7248
  constructor(...props: Array<ObjectPropTsDsl>);
7249
+ analyze(ctx: AnalysisContext): void;
7257
7250
  /** Adds a computed property (e.g. `{ [expr]: value }`). */
7258
7251
  computed(name: string, expr: ExprFn): this;
7259
7252
  /** Adds a getter property (e.g. `{ get foo() { ... } }`). */
@@ -7270,16 +7263,17 @@ declare class ObjectTsDsl extends TsDsl<ts.ObjectLiteralExpression> {
7270
7263
  setter(name: string, stmt: StmtFn): this;
7271
7264
  /** Adds a spread property (e.g. `{ ...options }`). */
7272
7265
  spread(expr: ExprFn): this;
7273
- /** Builds and returns the object literal expression. */
7274
- $render(): ts.ObjectLiteralExpression;
7266
+ toAst(): ts.ObjectLiteralExpression;
7275
7267
  }
7276
- interface ObjectTsDsl extends AsMixin, ExprMixin, HintMixin, LayoutMixin {}
7277
7268
  //#endregion
7278
7269
  //#region src/ts-dsl/expr/prefix.d.ts
7279
- declare class PrefixTsDsl extends TsDsl<ts.PrefixUnaryExpression> {
7270
+ declare const Mixed$19: abstract new () => TsDsl<ts.PrefixUnaryExpression>;
7271
+ declare class PrefixTsDsl extends Mixed$19 {
7272
+ readonly '~dsl' = "PrefixTsDsl";
7280
7273
  protected _expr?: string | MaybeTsDsl<ts.Expression>;
7281
7274
  protected _op?: ts.PrefixUnaryOperator;
7282
7275
  constructor(expr?: string | MaybeTsDsl<ts.Expression>, op?: ts.PrefixUnaryOperator);
7276
+ analyze(ctx: AnalysisContext): void;
7283
7277
  /** Sets the operand (the expression being prefixed). */
7284
7278
  expr(expr: string | MaybeTsDsl<ts.Expression>): this;
7285
7279
  /** Sets the operator to MinusToken for negation (`-`). */
@@ -7288,98 +7282,138 @@ declare class PrefixTsDsl extends TsDsl<ts.PrefixUnaryExpression> {
7288
7282
  not(): this;
7289
7283
  /** Sets the operator (e.g. `ts.SyntaxKind.ExclamationToken` for `!`). */
7290
7284
  op(op: ts.PrefixUnaryOperator): this;
7291
- /** Renders the prefix unary expression node. */
7292
- $render(): ts.PrefixUnaryExpression;
7285
+ toAst(): ts.PrefixUnaryExpression;
7293
7286
  }
7294
7287
  //#endregion
7295
7288
  //#region src/ts-dsl/expr/regexp.d.ts
7296
7289
  type RegexFlag = 'g' | 'i' | 'm' | 's' | 'u' | 'y';
7297
7290
  type RegexFlags<Avail extends string = RegexFlag> = '' | { [K in Avail]: `${K}${RegexFlags<Exclude<Avail, K>>}` }[Avail];
7298
- declare class RegExpTsDsl extends TsDsl<ts.RegularExpressionLiteral> {
7291
+ declare const Mixed$18: abstract new () => TsDsl<ts.RegularExpressionLiteral>;
7292
+ declare class RegExpTsDsl extends Mixed$18 {
7293
+ readonly '~dsl' = "RegExpTsDsl";
7299
7294
  protected pattern: string;
7300
7295
  protected flags?: RegexFlags;
7301
7296
  constructor(pattern: string, flags?: RegexFlags);
7302
- /** Emits a RegularExpressionLiteral node. */
7303
- $render(): ts.RegularExpressionLiteral;
7297
+ analyze(ctx: AnalysisContext): void;
7298
+ toAst(): ts.RegularExpressionLiteral;
7304
7299
  }
7305
7300
  //#endregion
7306
7301
  //#region src/ts-dsl/expr/template.d.ts
7307
- declare class TemplateTsDsl extends TsDsl<ts.TemplateExpression | ts.NoSubstitutionTemplateLiteral> {
7308
- protected parts: Array<string | MaybeTsDsl<ts.Expression>>;
7309
- constructor(value?: string | MaybeTsDsl<ts.Expression>);
7310
- add(value: string | MaybeTsDsl<ts.Expression>): this;
7311
- $render(): ts.TemplateExpression | ts.NoSubstitutionTemplateLiteral;
7302
+ type TemplatePart = Symbol | string | MaybeTsDsl<ts.Expression>;
7303
+ declare const Mixed$17: abstract new () => TsDsl<ts.NoSubstitutionTemplateLiteral | ts.TemplateExpression>;
7304
+ declare class TemplateTsDsl extends Mixed$17 {
7305
+ readonly '~dsl' = "TemplateTsDsl";
7306
+ protected parts: Array<Ref<TemplatePart>>;
7307
+ constructor(value?: TemplatePart);
7308
+ analyze(ctx: AnalysisContext): void;
7309
+ add(value: TemplatePart): this;
7310
+ toAst(): ts.NoSubstitutionTemplateLiteral | ts.TemplateExpression;
7312
7311
  }
7313
7312
  //#endregion
7314
7313
  //#region src/ts-dsl/expr/ternary.d.ts
7315
- declare class TernaryTsDsl extends TsDsl<ts.ConditionalExpression> {
7314
+ declare const Mixed$16: abstract new () => TsDsl<ts.ConditionalExpression>;
7315
+ declare class TernaryTsDsl extends Mixed$16 {
7316
+ readonly '~dsl' = "TernaryTsDsl";
7316
7317
  protected _condition?: string | MaybeTsDsl<ts.Expression>;
7317
7318
  protected _then?: string | MaybeTsDsl<ts.Expression>;
7318
7319
  protected _else?: string | MaybeTsDsl<ts.Expression>;
7319
7320
  constructor(condition?: string | MaybeTsDsl<ts.Expression>);
7321
+ analyze(ctx: AnalysisContext): void;
7320
7322
  condition(condition: string | MaybeTsDsl<ts.Expression>): this;
7321
7323
  do(expr: string | MaybeTsDsl<ts.Expression>): this;
7322
7324
  otherwise(expr: string | MaybeTsDsl<ts.Expression>): this;
7323
- $render(): ts.ConditionalExpression;
7325
+ toAst(): ts.ConditionalExpression;
7326
+ }
7327
+ //#endregion
7328
+ //#region src/ts-dsl/layout/newline.d.ts
7329
+ declare class NewlineTsDsl extends TsDsl<ts.Identifier> {
7330
+ readonly '~dsl' = "NewlineTsDsl";
7331
+ analyze(ctx: AnalysisContext): void;
7332
+ toAst(): ts.Identifier;
7324
7333
  }
7325
7334
  //#endregion
7326
7335
  //#region src/ts-dsl/layout/note.d.ts
7327
7336
  declare class NoteTsDsl extends TsDsl<ts.Node> {
7337
+ readonly '~dsl' = "NoteTsDsl";
7328
7338
  protected _lines: Array<string>;
7329
7339
  constructor(lines?: MaybeArray$1<string>, fn?: (d: NoteTsDsl) => void);
7340
+ analyze(ctx: AnalysisContext): void;
7330
7341
  add(...lines: ReadonlyArray<string>): this;
7331
7342
  apply<T extends ts.Node>(node: T): T;
7332
- $render(): ts.Node;
7343
+ toAst(): ts.Node;
7333
7344
  }
7334
7345
  //#endregion
7335
- //#region src/ts-dsl/stmt/if.d.ts
7336
- declare class IfTsDsl extends TsDsl<ts.IfStatement> {
7337
- protected _condition?: string | MaybeTsDsl<ts.Expression>;
7338
- protected _else?: ReadonlyArray<MaybeTsDsl<ts.Statement>>;
7339
- constructor(condition?: string | MaybeTsDsl<ts.Expression>);
7340
- condition(condition: string | MaybeTsDsl<ts.Expression>): this;
7341
- otherwise(...statements: ReadonlyArray<MaybeTsDsl<ts.Statement>>): this;
7342
- $render(): ts.IfStatement;
7346
+ //#region src/ts-dsl/stmt/block.d.ts
7347
+ declare const Mixed$15: MixinCtor<MixinCtor<abstract new () => TsDsl<ts.Block>, LayoutMethods>, DoMethods>;
7348
+ declare class BlockTsDsl extends Mixed$15 {
7349
+ readonly '~dsl' = "BlockTsDsl";
7350
+ constructor(...items: Array<DoExpr>);
7351
+ analyze(ctx: AnalysisContext): void;
7352
+ toAst(): ts.Block;
7343
7353
  }
7344
- interface IfTsDsl extends DoMixin {}
7345
7354
  //#endregion
7346
7355
  //#region src/ts-dsl/stmt/stmt.d.ts
7347
- declare class StmtTsDsl extends TsDsl<ts.Statement> {
7356
+ declare const Mixed$14: abstract new () => TsDsl<ts.Statement>;
7357
+ declare class StmtTsDsl extends Mixed$14 {
7358
+ readonly '~dsl' = "StmtTsDsl";
7348
7359
  protected _inner: ts.Expression | ts.Statement | TsDsl<any>;
7349
7360
  constructor(inner: ts.Expression | ts.Statement | TsDsl<any>);
7350
- $render(): ts.Statement;
7361
+ analyze(ctx: AnalysisContext): void;
7362
+ toAst(): ts.Statement;
7351
7363
  }
7352
7364
  //#endregion
7353
7365
  //#region src/ts-dsl/stmt/throw.d.ts
7354
- declare class ThrowTsDsl extends TsDsl<ts.ThrowStatement> {
7366
+ declare const Mixed$13: abstract new () => TsDsl<ts.ThrowStatement>;
7367
+ declare class ThrowTsDsl extends Mixed$13 {
7368
+ readonly '~dsl' = "ThrowTsDsl";
7355
7369
  protected error: string | MaybeTsDsl<ts.Expression>;
7356
7370
  protected msg?: string | MaybeTsDsl<ts.Expression>;
7357
7371
  protected useNew: boolean;
7358
7372
  constructor(error: string | MaybeTsDsl<ts.Expression>, useNew?: boolean);
7373
+ analyze(ctx: AnalysisContext): void;
7359
7374
  message(value: string | MaybeTsDsl<ts.Expression>): this;
7360
- $render(): ts.ThrowStatement;
7375
+ toAst(): ts.ThrowStatement;
7376
+ }
7377
+ //#endregion
7378
+ //#region src/ts-dsl/stmt/try.d.ts
7379
+ declare const Mixed$12: abstract new () => TsDsl<ts.TryStatement>;
7380
+ type CatchParam = Symbol | string;
7381
+ declare class TryTsDsl extends Mixed$12 {
7382
+ readonly '~dsl' = "TryTsDsl";
7383
+ protected _catch?: Array<DoExpr>;
7384
+ protected _catchArg?: CatchParam;
7385
+ protected _finally?: Array<DoExpr>;
7386
+ protected _try?: Array<DoExpr>;
7387
+ constructor(...tryBlock: Array<DoExpr>);
7388
+ analyze(ctx: AnalysisContext): void;
7389
+ catch(...items: Array<DoExpr>): this;
7390
+ catchArg(arg: CatchParam): this;
7391
+ finally(...items: Array<DoExpr>): this;
7392
+ try(...items: Array<DoExpr>): this;
7393
+ toAst(): ts.TryStatement;
7361
7394
  }
7362
7395
  //#endregion
7363
7396
  //#region src/ts-dsl/stmt/var.d.ts
7364
- declare class VarTsDsl extends TsDsl<ts.VariableStatement> {
7397
+ type VarName = Symbol | string;
7398
+ declare const Mixed$11: MixinCtor<MixinCtor<MixinCtor<MixinCtor<MixinCtor<MixinCtor<abstract new () => TsDsl<ts.VariableStatement>, ValueMethods>, PatternMethods>, HintMethods>, ExportMethods>, DocMethods>, DefaultMethods>;
7399
+ declare class VarTsDsl extends Mixed$11 {
7400
+ readonly '~dsl' = "VarTsDsl";
7365
7401
  protected kind: ts.NodeFlags;
7366
- protected modifiers: {
7367
- list: () => ts.Modifier[];
7368
- };
7369
- protected name?: string;
7402
+ protected name?: Ref<VarName>;
7370
7403
  protected _type?: TypeTsDsl;
7371
- constructor(name?: string);
7404
+ constructor(name?: VarName);
7405
+ analyze(ctx: AnalysisContext): void;
7372
7406
  const(): this;
7373
7407
  let(): this;
7374
7408
  /** Sets the variable type. */
7375
7409
  type(type: string | TypeTsDsl): this;
7376
7410
  var(): this;
7377
- $render(): ts.VariableStatement;
7411
+ toAst(): ts.VariableStatement;
7378
7412
  }
7379
- interface VarTsDsl extends DefaultMixin, DocMixin, ExportMixin, HintMixin, PatternMixin, ValueMixin {}
7380
7413
  //#endregion
7381
7414
  //#region src/ts-dsl/token.d.ts
7382
7415
  declare class TokenTsDsl<K$1 extends ts.SyntaxKind = never> extends TsDsl<ts.Token<K$1>> {
7416
+ readonly '~dsl' = "TokenTsDsl";
7383
7417
  protected _kind?: K$1;
7384
7418
  /** Sets the token kind */
7385
7419
  kind(kind: K$1): this;
@@ -7395,57 +7429,68 @@ declare class TokenTsDsl<K$1 extends ts.SyntaxKind = never> extends TsDsl<ts.Tok
7395
7429
  readonly(): TokenTsDsl<ts.SyntaxKind.ReadonlyKeyword>;
7396
7430
  /** Creates `...` (spread / rest) */
7397
7431
  spread(): TokenTsDsl<ts.SyntaxKind.DotDotDotToken>;
7398
- /** Renders the final token */
7399
- $render(): ts.Token<K$1>;
7432
+ toAst(): ts.Token<K$1>;
7400
7433
  }
7401
7434
  //#endregion
7402
7435
  //#region src/ts-dsl/type/alias.d.ts
7403
- declare class TypeAliasTsDsl extends TsDsl<ts.TypeAliasDeclaration> {
7404
- protected value?: MaybeTsDsl<ts.TypeNode>;
7405
- protected modifiers: {
7406
- list: () => ts.Modifier[];
7407
- };
7408
- protected name: string;
7409
- constructor(name: string, fn?: (t: TypeAliasTsDsl) => void);
7436
+ type Name = Symbol | string;
7437
+ type Value = MaybeTsDsl<ts.TypeNode>;
7438
+ declare const Mixed$10: MixinCtor<MixinCtor<MixinCtor<abstract new () => TsDsl<ts.TypeAliasDeclaration>, TypeParamsMethods>, ExportMethods>, DocMethods>;
7439
+ declare class TypeAliasTsDsl extends Mixed$10 {
7440
+ readonly '~dsl' = "TypeAliasTsDsl";
7441
+ protected name: Ref<Name>;
7442
+ protected value?: Value;
7443
+ constructor(name: Name, fn?: (t: TypeAliasTsDsl) => void);
7444
+ analyze(ctx: AnalysisContext): void;
7410
7445
  /** Sets the type expression on the right-hand side of `= ...`. */
7411
- type(node: MaybeTsDsl<ts.TypeNode>): this;
7412
- /** Renders a `TypeAliasDeclaration` node. */
7413
- $render(): ts.TypeAliasDeclaration;
7446
+ type(node: Value): this;
7447
+ toAst(): ts.TypeAliasDeclaration;
7414
7448
  }
7415
- interface TypeAliasTsDsl extends DocMixin, ExportMixin, TypeParamsMixin {}
7416
7449
  //#endregion
7417
7450
  //#region src/ts-dsl/type/and.d.ts
7418
- declare class TypeAndTsDsl extends TypeTsDsl<ts.IntersectionTypeNode> {
7419
- protected _types: Array<string | ts.TypeNode | TypeTsDsl>;
7420
- constructor(...nodes: Array<string | ts.TypeNode | TypeTsDsl>);
7421
- types(...nodes: Array<string | ts.TypeNode | TypeTsDsl>): this;
7422
- $render(): ts.IntersectionTypeNode;
7451
+ type Type$1 = Symbol | string | ts.TypeNode | TypeTsDsl;
7452
+ declare const Mixed$9: abstract new () => TypeTsDsl<ts.IntersectionTypeNode>;
7453
+ declare class TypeAndTsDsl extends Mixed$9 {
7454
+ readonly '~dsl' = "TypeAndTsDsl";
7455
+ protected _types: Array<Ref<Type$1>>;
7456
+ constructor(...nodes: Array<Type$1>);
7457
+ analyze(ctx: AnalysisContext): void;
7458
+ types(...nodes: Array<Type$1>): this;
7459
+ toAst(): ts.IntersectionTypeNode;
7423
7460
  }
7424
7461
  //#endregion
7425
7462
  //#region src/ts-dsl/type/func.d.ts
7426
- declare class TypeFuncTsDsl extends TypeTsDsl<ts.FunctionTypeNode> {
7463
+ declare const Mixed$8: MixinCtor<MixinCtor<MixinCtor<abstract new () => TypeTsDsl<ts.FunctionTypeNode>, TypeParamsMethods>, ParamMethods>, DocMethods>;
7464
+ declare class TypeFuncTsDsl extends Mixed$8 {
7465
+ readonly '~dsl' = "TypeFuncTsDsl";
7427
7466
  protected _returns?: TypeTsDsl;
7467
+ analyze(ctx: AnalysisContext): void;
7428
7468
  /** Sets the return type. */
7429
7469
  returns(type: string | TypeTsDsl): this;
7430
- $render(): ts.FunctionTypeNode;
7470
+ toAst(): ts.FunctionTypeNode;
7431
7471
  }
7432
- interface TypeFuncTsDsl extends DocMixin, ParamMixin, TypeParamsMixin {}
7433
7472
  //#endregion
7434
7473
  //#region src/ts-dsl/type/literal.d.ts
7435
- declare class TypeLiteralTsDsl extends TypeTsDsl<ts.LiteralTypeNode> {
7474
+ declare const Mixed$7: abstract new () => TypeTsDsl<ts.LiteralTypeNode>;
7475
+ declare class TypeLiteralTsDsl extends Mixed$7 {
7476
+ readonly '~dsl' = "TypeLiteralTsDsl";
7436
7477
  protected value: string | number | boolean | null;
7437
7478
  constructor(value: string | number | boolean | null);
7438
- $render(): ts.LiteralTypeNode;
7479
+ analyze(ctx: AnalysisContext): void;
7480
+ toAst(): ts.LiteralTypeNode;
7439
7481
  }
7440
7482
  //#endregion
7441
7483
  //#region src/ts-dsl/type/mapped.d.ts
7442
- declare class TypeMappedTsDsl extends TypeTsDsl<ts.MappedTypeNode> {
7484
+ declare const Mixed$6: abstract new () => TypeTsDsl<ts.MappedTypeNode>;
7485
+ declare class TypeMappedTsDsl extends Mixed$6 {
7486
+ readonly '~dsl' = "TypeMappedTsDsl";
7443
7487
  protected questionToken?: TokenTsDsl<ts.SyntaxKind.QuestionToken | ts.SyntaxKind.PlusToken | ts.SyntaxKind.MinusToken>;
7444
7488
  protected readonlyToken?: TokenTsDsl<ts.SyntaxKind.ReadonlyKeyword | ts.SyntaxKind.MinusToken | ts.SyntaxKind.PlusToken>;
7445
7489
  protected _key?: string | MaybeTsDsl<ts.TypeNode>;
7446
7490
  protected _name?: string;
7447
7491
  protected _type?: string | MaybeTsDsl<ts.TypeNode>;
7448
7492
  constructor(name?: string);
7493
+ analyze(ctx: AnalysisContext): void;
7449
7494
  /** Returns true when all required builder calls are present. */
7450
7495
  get isValid(): boolean;
7451
7496
  /** Sets the key constraint: `[K in Constraint]` */
@@ -7462,7 +7507,7 @@ declare class TypeMappedTsDsl extends TypeTsDsl<ts.MappedTypeNode> {
7462
7507
  required(): this;
7463
7508
  /** Sets the mapped value type: `[K in X]: ValueType` */
7464
7509
  type(type: string | MaybeTsDsl<ts.TypeNode>): this;
7465
- $render(): ts.MappedTypeNode;
7510
+ toAst(): ts.MappedTypeNode;
7466
7511
  $validate(): asserts this is this & {
7467
7512
  _key: string | MaybeTsDsl<ts.TypeNode>;
7468
7513
  _name: string;
@@ -7472,49 +7517,52 @@ declare class TypeMappedTsDsl extends TypeTsDsl<ts.MappedTypeNode> {
7472
7517
  }
7473
7518
  //#endregion
7474
7519
  //#region src/ts-dsl/type/idx-sig.d.ts
7475
- type Type = string | MaybeTsDsl<ts.TypeNode>;
7476
- declare class TypeIdxSigTsDsl extends TypeTsDsl<ts.IndexSignatureDeclaration> {
7477
- protected modifiers: {
7478
- list: () => ts.Modifier[];
7479
- };
7480
- protected _key?: Type;
7481
- protected _name: string;
7482
- protected _type?: Type;
7483
- constructor(name: string, fn?: (i: TypeIdxSigTsDsl) => void);
7520
+ type TypeIdxSigName = string;
7521
+ type TypeIdxSigType = string | MaybeTsDsl<ts.TypeNode>;
7522
+ declare const Mixed$5: MixinCtor<MixinCtor<abstract new () => TypeTsDsl<ts.IndexSignatureDeclaration>, ReadonlyMethods>, DocMethods>;
7523
+ declare class TypeIdxSigTsDsl extends Mixed$5 {
7524
+ readonly '~dsl' = "TypeIdxSigTsDsl";
7525
+ protected _key?: TypeIdxSigType;
7526
+ protected _name: TypeIdxSigName;
7527
+ protected _type?: TypeIdxSigType;
7528
+ constructor(name: TypeIdxSigName, fn?: (i: TypeIdxSigTsDsl) => void);
7529
+ analyze(ctx: AnalysisContext): void;
7484
7530
  /** Returns true when all required builder calls are present. */
7485
7531
  get isValid(): boolean;
7486
7532
  /** Sets the key type: `[name: T]` */
7487
- key(type: Type): this;
7533
+ key(type: TypeIdxSigType): this;
7488
7534
  /** Sets the property type. */
7489
- type(type: Type): this;
7490
- $render(): ts.IndexSignatureDeclaration;
7535
+ type(type: TypeIdxSigType): this;
7536
+ toAst(): ts.IndexSignatureDeclaration;
7491
7537
  $validate(): asserts this is this & {
7492
- _key: Type;
7493
- _name: string;
7494
- _type: Type;
7538
+ _key: TypeIdxSigType;
7539
+ _name: TypeIdxSigName;
7540
+ _type: TypeIdxSigType;
7495
7541
  };
7496
7542
  private missingRequiredCalls;
7497
7543
  }
7498
- interface TypeIdxSigTsDsl extends DocMixin, ReadonlyMixin {}
7499
7544
  //#endregion
7500
7545
  //#region src/ts-dsl/type/prop.d.ts
7501
- declare class TypePropTsDsl extends TypeTsDsl<ts.TypeElement> {
7502
- protected modifiers: {
7503
- list: () => ts.Modifier[];
7504
- };
7505
- protected name: string;
7506
- protected _type?: string | MaybeTsDsl<ts.TypeNode>;
7507
- constructor(name: string, fn: (p: TypePropTsDsl) => void);
7546
+ type TypePropName = string;
7547
+ type TypePropType = Symbol | string | MaybeTsDsl<ts.TypeNode>;
7548
+ declare const Mixed$4: MixinCtor<MixinCtor<MixinCtor<abstract new () => TypeTsDsl<ts.TypeElement>, ReadonlyMethods>, OptionalMethods>, DocMethods>;
7549
+ declare class TypePropTsDsl extends Mixed$4 {
7550
+ readonly '~dsl' = "TypePropTsDsl";
7551
+ protected name: TypePropName;
7552
+ protected _type?: Ref<TypePropType>;
7553
+ constructor(name: TypePropName, fn: (p: TypePropTsDsl) => void);
7554
+ analyze(ctx: AnalysisContext): void;
7508
7555
  /** Sets the property type. */
7509
- type(type: string | MaybeTsDsl<ts.TypeNode>): this;
7510
- /** Builds and returns the property signature. */
7511
- $render(): ts.TypeElement;
7556
+ type(type: TypePropType): this;
7557
+ toAst(): ts.PropertySignature;
7512
7558
  }
7513
- interface TypePropTsDsl extends DocMixin, OptionalMixin, ReadonlyMixin {}
7514
7559
  //#endregion
7515
7560
  //#region src/ts-dsl/type/object.d.ts
7516
- declare class TypeObjectTsDsl extends TypeTsDsl<ts.TypeNode> {
7561
+ declare const Mixed$3: abstract new () => TypeTsDsl<ts.TypeNode>;
7562
+ declare class TypeObjectTsDsl extends Mixed$3 {
7563
+ readonly '~dsl' = "TypeObjectTsDsl";
7517
7564
  protected props: Array<TypePropTsDsl | TypeIdxSigTsDsl>;
7565
+ analyze(ctx: AnalysisContext): void;
7518
7566
  /** Returns true if object has at least one property or spread. */
7519
7567
  hasProps(): boolean;
7520
7568
  /** Adds an index signature to the object type. */
@@ -7523,61 +7571,165 @@ declare class TypeObjectTsDsl extends TypeTsDsl<ts.TypeNode> {
7523
7571
  get isEmpty(): boolean;
7524
7572
  /** Adds a property signature (returns property builder). */
7525
7573
  prop(name: string, fn: (p: TypePropTsDsl) => void): this;
7526
- $render(): ts.TypeNode;
7574
+ toAst(): ts.TypeLiteralNode;
7527
7575
  }
7528
7576
  //#endregion
7529
7577
  //#region src/ts-dsl/type/or.d.ts
7530
- declare class TypeOrTsDsl extends TypeTsDsl<ts.UnionTypeNode> {
7531
- protected _types: Array<string | ts.TypeNode | TypeTsDsl>;
7532
- constructor(...nodes: Array<string | ts.TypeNode | TypeTsDsl>);
7533
- types(...nodes: Array<string | ts.TypeNode | TypeTsDsl>): this;
7534
- $render(): ts.UnionTypeNode;
7578
+ type Type = Symbol | string | ts.TypeNode | TypeTsDsl;
7579
+ declare const Mixed$2: abstract new () => TypeTsDsl<ts.UnionTypeNode>;
7580
+ declare class TypeOrTsDsl extends Mixed$2 {
7581
+ readonly '~dsl' = "TypeOrTsDsl";
7582
+ protected _types: Array<Ref<Type>>;
7583
+ constructor(...nodes: Array<Type>);
7584
+ analyze(ctx: AnalysisContext): void;
7585
+ types(...nodes: Array<Type>): this;
7586
+ toAst(): ts.UnionTypeNode;
7535
7587
  }
7536
7588
  //#endregion
7537
7589
  //#region src/ts-dsl/type/template.d.ts
7538
- declare class TypeTemplateTsDsl extends TypeTsDsl<ts.TemplateLiteralTypeNode> {
7590
+ declare const Mixed$1: abstract new () => TypeTsDsl<ts.TemplateLiteralTypeNode>;
7591
+ declare class TypeTemplateTsDsl extends Mixed$1 {
7592
+ readonly '~dsl' = "TypeTemplateTsDsl";
7539
7593
  protected parts: Array<string | MaybeTsDsl<ts.TypeNode>>;
7540
7594
  constructor(value?: string | MaybeTsDsl<ts.TypeNode>);
7595
+ analyze(ctx: AnalysisContext): void;
7541
7596
  /** Adds a raw string segment or embedded type expression. */
7542
7597
  add(part: string | MaybeTsDsl<ts.TypeNode>): this;
7543
- /** Renders a TemplateLiteralTypeNode. */
7544
- $render(): ts.TemplateLiteralTypeNode;
7598
+ toAst(): ts.TemplateLiteralTypeNode;
7545
7599
  }
7546
7600
  //#endregion
7547
7601
  //#region src/ts-dsl/type/tuple.d.ts
7548
- declare class TypeTupleTsDsl extends TypeTsDsl<ts.TupleTypeNode> {
7602
+ declare const Mixed: abstract new () => TypeTsDsl<ts.TupleTypeNode>;
7603
+ declare class TypeTupleTsDsl extends Mixed {
7604
+ readonly '~dsl' = "TypeTupleTsDsl";
7549
7605
  protected _elements: Array<string | ts.TypeNode | TypeTsDsl>;
7550
7606
  constructor(...nodes: Array<string | ts.TypeNode | TypeTsDsl>);
7607
+ analyze(ctx: AnalysisContext): void;
7551
7608
  elements(...types: Array<string | ts.TypeNode | TypeTsDsl>): this;
7552
- $render(): ts.TupleTypeNode;
7609
+ toAst(): ts.TupleTypeNode;
7610
+ }
7611
+ //#endregion
7612
+ //#region src/ts-dsl/render/typescript.d.ts
7613
+ declare class TypeScriptRenderer implements Renderer {
7614
+ /**
7615
+ * Whether `export * from 'module'` should be used when possible instead of named exports.
7616
+ *
7617
+ * @private
7618
+ */
7619
+ private preferExportAll;
7620
+ /**
7621
+ * Controls whether imports/exports include a file extension (e.g., '.ts' or '.js').
7622
+ *
7623
+ * @private
7624
+ */
7625
+ private preferFileExtension;
7626
+ /**
7627
+ * Optional function to transform module specifiers.
7628
+ *
7629
+ * @private
7630
+ */
7631
+ private resolveModuleName?;
7632
+ constructor(args?: {
7633
+ preferExportAll?: boolean;
7634
+ preferFileExtension?: string;
7635
+ resolveModuleName?: (moduleName: string) => string | undefined;
7636
+ });
7637
+ render(ctx: RenderContext): string;
7638
+ supports(ctx: RenderContext): boolean;
7639
+ private getExports;
7640
+ private getImports;
7641
+ private renderExport;
7642
+ private renderImport;
7643
+ }
7644
+ //#endregion
7645
+ //#region src/ts-dsl/utils/keywords.d.ts
7646
+ declare const keywords: {
7647
+ browserGlobals: string[];
7648
+ javaScriptGlobals: string[];
7649
+ javaScriptKeywords: string[];
7650
+ nodeGlobals: string[];
7651
+ typeScriptKeywords: string[];
7652
+ };
7653
+ //#endregion
7654
+ //#region src/ts-dsl/utils/regexp.d.ts
7655
+ declare const regexp: {
7656
+ /**
7657
+ * Matches characters from the start as long as they're not allowed.
7658
+ */
7659
+ illegalStartCharacters: RegExp;
7660
+ /**
7661
+ * Matches string if it contains only digits and optionally decimal point or
7662
+ * leading minus sign.
7663
+ */
7664
+ number: RegExp;
7665
+ /**
7666
+ * Javascript identifier regexp pattern retrieved from
7667
+ * {@link} https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#identifiers
7668
+ */
7669
+ typeScriptIdentifier: RegExp;
7670
+ };
7671
+ //#endregion
7672
+ //#region src/ts-dsl/utils/reserved.d.ts
7673
+ type List = ReadonlyArray<string>;
7674
+ declare class ReservedList {
7675
+ private _array;
7676
+ private _set;
7677
+ constructor(values: List);
7678
+ get '~values'(): Set<string>;
7679
+ /**
7680
+ * Updates the reserved list with new values.
7681
+ *
7682
+ * @param values New reserved values or a function that receives the previous
7683
+ * reserved values and returns the new ones.
7684
+ */
7685
+ set(values: List | ((prev: List) => List)): void;
7553
7686
  }
7687
+ /**
7688
+ * Reserved names for identifiers. These names will not be used
7689
+ * for variables, functions, classes, or other identifiers in generated code.
7690
+ */
7691
+ declare const reserved: {
7692
+ /**
7693
+ * Reserved names for runtime identifiers. These names will not be used
7694
+ * for variables, functions, classes, or other runtime identifiers in
7695
+ * generated code.
7696
+ */
7697
+ runtime: ReservedList;
7698
+ /**
7699
+ * Reserved names for type identifiers. These names will not be used
7700
+ * for type or interface identifiers in generated code.
7701
+ */
7702
+ type: ReservedList;
7703
+ };
7554
7704
  //#endregion
7555
7705
  //#region src/ts-dsl/index.d.ts
7556
- declare const $: ((id: string | typescript0.Expression | TsDsl<typescript0.Expression>) => ExprTsDsl) & {
7706
+ declare const $: ((id: any) => ExprTsDsl) & {
7557
7707
  /** Creates an array literal expression (e.g. `[1, 2, 3]`). */
7558
7708
  array: (...args: ConstructorParameters<typeof ArrayTsDsl>) => ArrayTsDsl;
7559
7709
  /** Creates an `as` type assertion expression (e.g. `value as Type`). */
7560
- as: (expr: string | typescript0.Expression | TsDsl<typescript0.Expression>, type: string | TypeTsDsl<typescript0.TypeNode>) => AsTsDsl;
7710
+ as: (expr: any, type: any) => AsTsDsl;
7561
7711
  /** Creates a property access expression (e.g. `obj.foo`). */
7562
- attr: (left: string | typescript0.Expression | TsDsl<typescript0.Expression>, right: string | number | typescript0.MemberName) => AttrTsDsl;
7712
+ attr: (left: any, right: any) => AttrTsDsl;
7563
7713
  /** Creates an await expression (e.g. `await promise`). */
7564
- await: (expr: string | typescript0.Expression | TsDsl<typescript0.Expression>) => AwaitTsDsl;
7714
+ await: (expr: any) => AwaitTsDsl;
7565
7715
  /** Creates a binary expression (e.g. `a + b`). */
7566
- binary: (base: string | typescript0.Expression | TsDsl<typescript0.Expression>, op?: (("!=" | "!==" | "&&" | "*" | "+" | "-" | "/" | "<" | "<=" | "=" | "==" | "===" | ">" | ">=" | "??" | "||") | typescript0.BinaryOperator) | undefined, expr?: (string | typescript0.Expression | TsDsl<typescript0.Expression>) | undefined) => BinaryTsDsl;
7716
+ binary: (base: any, op?: (("!=" | "!==" | "&&" | "*" | "+" | "-" | "/" | "<" | "<=" | "=" | "==" | "===" | ">" | ">=" | "??" | "||") | typescript0.BinaryOperator) | undefined, expr?: any) => BinaryTsDsl;
7717
+ /** Creates a statement block (`{ ... }`). */
7718
+ block: (...args: ConstructorParameters<typeof BlockTsDsl>) => BlockTsDsl;
7567
7719
  /** Creates a function or method call expression (e.g. `fn(arg)`). */
7568
- call: (callee: string | typescript0.Expression | TsDsl<typescript0.Expression>, ...args: (string | typescript0.Expression | TsDsl<typescript0.Expression> | undefined)[]) => CallTsDsl;
7720
+ call: (callee: CallCallee, ...args: any[]) => CallTsDsl;
7569
7721
  /** Creates a class declaration or expression. */
7570
- class: (name: string) => ClassTsDsl;
7722
+ class: (name: any) => ClassTsDsl;
7571
7723
  /** Creates a constant variable declaration (`const`). */
7572
- const: (name?: string | undefined) => VarTsDsl;
7724
+ const: (name?: any) => VarTsDsl;
7573
7725
  /** Creates a decorator expression (e.g. `@decorator`). */
7574
- decorator: (name: string | typescript0.Expression, ...args: (string | typescript0.Expression | TsDsl<typescript0.Expression>)[]) => DecoratorTsDsl;
7726
+ decorator: (name: any, ...args: (string | typescript0.Expression | TsDsl<typescript0.Expression>)[]) => DecoratorTsDsl;
7575
7727
  /** Creates a JSDoc documentation block. */
7576
7728
  doc: (lines?: MaybeArray$1<string> | undefined, fn?: ((d: DocTsDsl) => void) | undefined) => DocTsDsl;
7577
7729
  /** Creates an enum declaration. */
7578
- enum: (name: string | typescript0.Identifier, fn?: ((e: EnumTsDsl) => void) | undefined) => EnumTsDsl;
7730
+ enum: (name: any, fn?: ((e: EnumTsDsl) => void) | undefined) => EnumTsDsl;
7579
7731
  /** Creates a general expression node. */
7580
- expr: (id: string | typescript0.Expression | TsDsl<typescript0.Expression>) => ExprTsDsl;
7732
+ expr: (id: any) => ExprTsDsl;
7581
7733
  /** Creates a field declaration in a class or object. */
7582
7734
  field: (name: string, fn?: ((f: FieldTsDsl) => void) | undefined) => FieldTsDsl;
7583
7735
  /** Converts a runtime value into a corresponding expression node. */
@@ -7593,17 +7745,17 @@ declare const $: ((id: string | typescript0.Expression | TsDsl<typescript0.Expre
7593
7745
  (name?: string, fn?: (f: FuncTsDsl<"decl">) => void): FuncTsDsl<"arrow"> | FuncTsDsl<"decl">;
7594
7746
  };
7595
7747
  /** Creates a getter method declaration. */
7596
- getter: (name: string | typescript0.PropertyName, fn?: ((g: GetterTsDsl) => void) | undefined) => GetterTsDsl;
7748
+ getter: (name: GetterName, fn?: ((g: GetterTsDsl) => void) | undefined) => GetterTsDsl;
7597
7749
  /** Creates a single-line comment (//). */
7598
7750
  hint: (lines?: MaybeArray$1<string> | undefined, fn?: ((d: HintTsDsl) => void) | undefined) => HintTsDsl;
7599
7751
  /** Creates an identifier (e.g. `foo`). */
7600
7752
  id: (name: string) => IdTsDsl;
7601
7753
  /** Creates an if statement. */
7602
- if: (condition?: string | typescript0.Expression | TsDsl<typescript0.Expression> | undefined) => IfTsDsl;
7754
+ if: (condition?: IfCondition | undefined) => IfTsDsl;
7603
7755
  /** Creates an initialization block or statement. */
7604
7756
  init: (fn?: ((i: InitTsDsl) => void) | undefined) => InitTsDsl;
7605
7757
  /** Creates a let variable declaration (`let`). */
7606
- let: (name?: string | undefined) => VarTsDsl;
7758
+ let: (name?: any) => VarTsDsl;
7607
7759
  /** Creates a literal value (e.g. string, number, boolean). */
7608
7760
  literal: (value: string | number | boolean | null) => LiteralTsDsl;
7609
7761
  /** Creates an enum member declaration. */
@@ -7613,7 +7765,7 @@ declare const $: ((id: string | typescript0.Expression | TsDsl<typescript0.Expre
7613
7765
  /** Creates a negation expression (`-x`). */
7614
7766
  neg: (expr?: string | typescript0.Expression | TsDsl<typescript0.Expression> | undefined, op?: typescript0.PrefixUnaryOperator | undefined) => PrefixTsDsl;
7615
7767
  /** Creates a new expression (e.g. `new ClassName()`). */
7616
- new: (classExpr: string | typescript0.Expression | TsDsl<typescript0.Expression>, ...args: (string | typescript0.Expression | TsDsl<typescript0.Expression>)[]) => NewTsDsl;
7768
+ new: (classExpr: any, ...args: any[]) => NewTsDsl;
7617
7769
  /** Creates a newline (for formatting purposes). */
7618
7770
  newline: () => NewlineTsDsl;
7619
7771
  /** Creates a logical NOT expression (`!x`). */
@@ -7623,7 +7775,7 @@ declare const $: ((id: string | typescript0.Expression | TsDsl<typescript0.Expre
7623
7775
  /** Creates an object literal expression. */
7624
7776
  object: (...args: ConstructorParameters<typeof ObjectTsDsl>) => ObjectTsDsl;
7625
7777
  /** Creates a parameter declaration for functions or methods. */
7626
- param: (name: string | ((p: ParamTsDsl) => void), fn?: ((p: ParamTsDsl) => void) | undefined) => ParamTsDsl;
7778
+ param: (name: any, fn?: ((p: ParamTsDsl) => void) | undefined) => ParamTsDsl;
7627
7779
  /** Creates a pattern for destructuring or matching. */
7628
7780
  pattern: () => PatternTsDsl;
7629
7781
  /** Creates a prefix unary expression (e.g. `-x`, `!x`, `~x`). */
@@ -7648,33 +7800,35 @@ declare const $: ((id: string | typescript0.Expression | TsDsl<typescript0.Expre
7648
7800
  /** Creates a regular expression literal (e.g. `/foo/gi`). */
7649
7801
  regexp: (pattern: string, flags?: ("" | "g" | "i" | "m" | "s" | "u" | "y" | "uy" | "yu" | "su" | "sy" | "suy" | "syu" | "ys" | "us" | "usy" | "uys" | "ysu" | "yus" | "ms" | "mu" | "my" | "muy" | "myu" | "msu" | "msy" | "msuy" | "msyu" | "mys" | "mus" | "musy" | "muys" | "mysu" | "myus" | "ym" | "um" | "umy" | "uym" | "ymu" | "yum" | "sm" | "smu" | "smy" | "smuy" | "smyu" | "sym" | "sum" | "sumy" | "suym" | "symu" | "syum" | "yms" | "ysm" | "ums" | "umsy" | "umys" | "usm" | "usmy" | "usym" | "uyms" | "uysm" | "ymsu" | "ymus" | "ysmu" | "ysum" | "yums" | "yusm" | "im" | "is" | "iu" | "iy" | "iuy" | "iyu" | "isu" | "isy" | "isuy" | "isyu" | "iys" | "ius" | "iusy" | "iuys" | "iysu" | "iyus" | "ims" | "imu" | "imy" | "imuy" | "imyu" | "imsu" | "imsy" | "imsuy" | "imsyu" | "imys" | "imus" | "imusy" | "imuys" | "imysu" | "imyus" | "iym" | "ium" | "iumy" | "iuym" | "iymu" | "iyum" | "ism" | "ismu" | "ismy" | "ismuy" | "ismyu" | "isym" | "isum" | "isumy" | "isuym" | "isymu" | "isyum" | "iyms" | "iysm" | "iums" | "iumsy" | "iumys" | "iusm" | "iusmy" | "iusym" | "iuyms" | "iuysm" | "iymsu" | "iymus" | "iysmu" | "iysum" | "iyums" | "iyusm" | "yi" | "ui" | "uiy" | "uyi" | "yiu" | "yui" | "si" | "siu" | "siy" | "siuy" | "siyu" | "syi" | "sui" | "suiy" | "suyi" | "syiu" | "syui" | "yis" | "ysi" | "uis" | "uisy" | "uiys" | "usi" | "usiy" | "usyi" | "uyis" | "uysi" | "yisu" | "yius" | "ysiu" | "ysui" | "yuis" | "yusi" | "mi" | "mis" | "miu" | "miy" | "miuy" | "miyu" | "misu" | "misy" | "misuy" | "misyu" | "miys" | "mius" | "miusy" | "miuys" | "miysu" | "miyus" | "myi" | "mui" | "muiy" | "muyi" | "myiu" | "myui" | "msi" | "msiu" | "msiy" | "msiuy" | "msiyu" | "msyi" | "msui" | "msuiy" | "msuyi" | "msyiu" | "msyui" | "myis" | "mysi" | "muis" | "muisy" | "muiys" | "musi" | "musiy" | "musyi" | "muyis" | "muysi" | "myisu" | "myius" | "mysiu" | "mysui" | "myuis" | "myusi" | "yim" | "ymi" | "uim" | "uimy" | "uiym" | "umi" | "umiy" | "umyi" | "uyim" | "uymi" | "yimu" | "yium" | "ymiu" | "ymui" | "yuim" | "yumi" | "sim" | "simu" | "simy" | "simuy" | "simyu" | "siym" | "sium" | "siumy" | "siuym" | "siymu" | "siyum" | "smi" | "smiu" | "smiy" | "smiuy" | "smiyu" | "smyi" | "smui" | "smuiy" | "smuyi" | "smyiu" | "smyui" | "syim" | "symi" | "suim" | "suimy" | "suiym" | "sumi" | "sumiy" | "sumyi" | "suyim" | "suymi" | "syimu" | "syium" | "symiu" | "symui" | "syuim" | "syumi" | "yims" | "yism" | "ymis" | "ymsi" | "ysim" | "ysmi" | "uims" | "uimsy" | "uimys" | "uism" | "uismy" | "uisym" | "uiyms" | "uiysm" | "umis" | "umisy" | "umiys" | "umsi" | "umsiy" | "umsyi" | "umyis" | "umysi" | "usim" | "usimy" | "usiym" | "usmi" | "usmiy" | "usmyi" | "usyim" | "usymi" | "uyims" | "uyism" | "uymis" | "uymsi" | "uysim" | "uysmi" | "yimsu" | "yimus" | "yismu" | "yisum" | "yiums" | "yiusm" | "ymisu" | "ymius" | "ymsiu" | "ymsui" | "ymuis" | "ymusi" | "ysimu" | "ysium" | "ysmiu" | "ysmui" | "ysuim" | "ysumi" | "yuims" | "yuism" | "yumis" | "yumsi" | "yusim" | "yusmi" | "gi" | "gm" | "gs" | "gu" | "gy" | "guy" | "gyu" | "gsu" | "gsy" | "gsuy" | "gsyu" | "gys" | "gus" | "gusy" | "guys" | "gysu" | "gyus" | "gms" | "gmu" | "gmy" | "gmuy" | "gmyu" | "gmsu" | "gmsy" | "gmsuy" | "gmsyu" | "gmys" | "gmus" | "gmusy" | "gmuys" | "gmysu" | "gmyus" | "gym" | "gum" | "gumy" | "guym" | "gymu" | "gyum" | "gsm" | "gsmu" | "gsmy" | "gsmuy" | "gsmyu" | "gsym" | "gsum" | "gsumy" | "gsuym" | "gsymu" | "gsyum" | "gyms" | "gysm" | "gums" | "gumsy" | "gumys" | "gusm" | "gusmy" | "gusym" | "guyms" | "guysm" | "gymsu" | "gymus" | "gysmu" | "gysum" | "gyums" | "gyusm" | "gim" | "gis" | "giu" | "giy" | "giuy" | "giyu" | "gisu" | "gisy" | "gisuy" | "gisyu" | "giys" | "gius" | "giusy" | "giuys" | "giysu" | "giyus" | "gims" | "gimu" | "gimy" | "gimuy" | "gimyu" | "gimsu" | "gimsy" | "gimsuy" | "gimsyu" | "gimys" | "gimus" | "gimusy" | "gimuys" | "gimysu" | "gimyus" | "giym" | "gium" | "giumy" | "giuym" | "giymu" | "giyum" | "gism" | "gismu" | "gismy" | "gismuy" | "gismyu" | "gisym" | "gisum" | "gisumy" | "gisuym" | "gisymu" | "gisyum" | "giyms" | "giysm" | "giums" | "giumsy" | "giumys" | "giusm" | "giusmy" | "giusym" | "giuyms" | "giuysm" | "giymsu" | "giymus" | "giysmu" | "giysum" | "giyums" | "giyusm" | "gyi" | "gui" | "guiy" | "guyi" | "gyiu" | "gyui" | "gsi" | "gsiu" | "gsiy" | "gsiuy" | "gsiyu" | "gsyi" | "gsui" | "gsuiy" | "gsuyi" | "gsyiu" | "gsyui" | "gyis" | "gysi" | "guis" | "guisy" | "guiys" | "gusi" | "gusiy" | "gusyi" | "guyis" | "guysi" | "gyisu" | "gyius" | "gysiu" | "gysui" | "gyuis" | "gyusi" | "gmi" | "gmis" | "gmiu" | "gmiy" | "gmiuy" | "gmiyu" | "gmisu" | "gmisy" | "gmisuy" | "gmisyu" | "gmiys" | "gmius" | "gmiusy" | "gmiuys" | "gmiysu" | "gmiyus" | "gmyi" | "gmui" | "gmuiy" | "gmuyi" | "gmyiu" | "gmyui" | "gmsi" | "gmsiu" | "gmsiy" | "gmsiuy" | "gmsiyu" | "gmsyi" | "gmsui" | "gmsuiy" | "gmsuyi" | "gmsyiu" | "gmsyui" | "gmyis" | "gmysi" | "gmuis" | "gmuisy" | "gmuiys" | "gmusi" | "gmusiy" | "gmusyi" | "gmuyis" | "gmuysi" | "gmyisu" | "gmyius" | "gmysiu" | "gmysui" | "gmyuis" | "gmyusi" | "gyim" | "gymi" | "guim" | "guimy" | "guiym" | "gumi" | "gumiy" | "gumyi" | "guyim" | "guymi" | "gyimu" | "gyium" | "gymiu" | "gymui" | "gyuim" | "gyumi" | "gsim" | "gsimu" | "gsimy" | "gsimuy" | "gsimyu" | "gsiym" | "gsium" | "gsiumy" | "gsiuym" | "gsiymu" | "gsiyum" | "gsmi" | "gsmiu" | "gsmiy" | "gsmiuy" | "gsmiyu" | "gsmyi" | "gsmui" | "gsmuiy" | "gsmuyi" | "gsmyiu" | "gsmyui" | "gsyim" | "gsymi" | "gsuim" | "gsuimy" | "gsuiym" | "gsumi" | "gsumiy" | "gsumyi" | "gsuyim" | "gsuymi" | "gsyimu" | "gsyium" | "gsymiu" | "gsymui" | "gsyuim" | "gsyumi" | "gyims" | "gyism" | "gymis" | "gymsi" | "gysim" | "gysmi" | "guims" | "guimsy" | "guimys" | "guism" | "guismy" | "guisym" | "guiyms" | "guiysm" | "gumis" | "gumisy" | "gumiys" | "gumsi" | "gumsiy" | "gumsyi" | "gumyis" | "gumysi" | "gusim" | "gusimy" | "gusiym" | "gusmi" | "gusmiy" | "gusmyi" | "gusyim" | "gusymi" | "guyims" | "guyism" | "guymis" | "guymsi" | "guysim" | "guysmi" | "gyimsu" | "gyimus" | "gyismu" | "gyisum" | "gyiums" | "gyiusm" | "gymisu" | "gymius" | "gymsiu" | "gymsui" | "gymuis" | "gymusi" | "gysimu" | "gysium" | "gysmiu" | "gysmui" | "gysuim" | "gysumi" | "gyuims" | "gyuism" | "gyumis" | "gyumsi" | "gyusim" | "gyusmi" | "yg" | "ug" | "ugy" | "uyg" | "ygu" | "yug" | "sg" | "sgu" | "sgy" | "sguy" | "sgyu" | "syg" | "sug" | "sugy" | "suyg" | "sygu" | "syug" | "ygs" | "ysg" | "ugs" | "ugsy" | "ugys" | "usg" | "usgy" | "usyg" | "uygs" | "uysg" | "ygsu" | "ygus" | "ysgu" | "ysug" | "yugs" | "yusg" | "mg" | "mgs" | "mgu" | "mgy" | "mguy" | "mgyu" | "mgsu" | "mgsy" | "mgsuy" | "mgsyu" | "mgys" | "mgus" | "mgusy" | "mguys" | "mgysu" | "mgyus" | "myg" | "mug" | "mugy" | "muyg" | "mygu" | "myug" | "msg" | "msgu" | "msgy" | "msguy" | "msgyu" | "msyg" | "msug" | "msugy" | "msuyg" | "msygu" | "msyug" | "mygs" | "mysg" | "mugs" | "mugsy" | "mugys" | "musg" | "musgy" | "musyg" | "muygs" | "muysg" | "mygsu" | "mygus" | "mysgu" | "mysug" | "myugs" | "myusg" | "ygm" | "ymg" | "ugm" | "ugmy" | "ugym" | "umg" | "umgy" | "umyg" | "uygm" | "uymg" | "ygmu" | "ygum" | "ymgu" | "ymug" | "yugm" | "yumg" | "sgm" | "sgmu" | "sgmy" | "sgmuy" | "sgmyu" | "sgym" | "sgum" | "sgumy" | "sguym" | "sgymu" | "sgyum" | "smg" | "smgu" | "smgy" | "smguy" | "smgyu" | "smyg" | "smug" | "smugy" | "smuyg" | "smygu" | "smyug" | "sygm" | "symg" | "sugm" | "sugmy" | "sugym" | "sumg" | "sumgy" | "sumyg" | "suygm" | "suymg" | "sygmu" | "sygum" | "symgu" | "symug" | "syugm" | "syumg" | "ygms" | "ygsm" | "ymgs" | "ymsg" | "ysgm" | "ysmg" | "ugms" | "ugmsy" | "ugmys" | "ugsm" | "ugsmy" | "ugsym" | "ugyms" | "ugysm" | "umgs" | "umgsy" | "umgys" | "umsg" | "umsgy" | "umsyg" | "umygs" | "umysg" | "usgm" | "usgmy" | "usgym" | "usmg" | "usmgy" | "usmyg" | "usygm" | "usymg" | "uygms" | "uygsm" | "uymgs" | "uymsg" | "uysgm" | "uysmg" | "ygmsu" | "ygmus" | "ygsmu" | "ygsum" | "ygums" | "ygusm" | "ymgsu" | "ymgus" | "ymsgu" | "ymsug" | "ymugs" | "ymusg" | "ysgmu" | "ysgum" | "ysmgu" | "ysmug" | "ysugm" | "ysumg" | "yugms" | "yugsm" | "yumgs" | "yumsg" | "yusgm" | "yusmg" | "ig" | "igm" | "igs" | "igu" | "igy" | "iguy" | "igyu" | "igsu" | "igsy" | "igsuy" | "igsyu" | "igys" | "igus" | "igusy" | "iguys" | "igysu" | "igyus" | "igms" | "igmu" | "igmy" | "igmuy" | "igmyu" | "igmsu" | "igmsy" | "igmsuy" | "igmsyu" | "igmys" | "igmus" | "igmusy" | "igmuys" | "igmysu" | "igmyus" | "igym" | "igum" | "igumy" | "iguym" | "igymu" | "igyum" | "igsm" | "igsmu" | "igsmy" | "igsmuy" | "igsmyu" | "igsym" | "igsum" | "igsumy" | "igsuym" | "igsymu" | "igsyum" | "igyms" | "igysm" | "igums" | "igumsy" | "igumys" | "igusm" | "igusmy" | "igusym" | "iguyms" | "iguysm" | "igymsu" | "igymus" | "igysmu" | "igysum" | "igyums" | "igyusm" | "iyg" | "iug" | "iugy" | "iuyg" | "iygu" | "iyug" | "isg" | "isgu" | "isgy" | "isguy" | "isgyu" | "isyg" | "isug" | "isugy" | "isuyg" | "isygu" | "isyug" | "iygs" | "iysg" | "iugs" | "iugsy" | "iugys" | "iusg" | "iusgy" | "iusyg" | "iuygs" | "iuysg" | "iygsu" | "iygus" | "iysgu" | "iysug" | "iyugs" | "iyusg" | "img" | "imgs" | "imgu" | "imgy" | "imguy" | "imgyu" | "imgsu" | "imgsy" | "imgsuy" | "imgsyu" | "imgys" | "imgus" | "imgusy" | "imguys" | "imgysu" | "imgyus" | "imyg" | "imug" | "imugy" | "imuyg" | "imygu" | "imyug" | "imsg" | "imsgu" | "imsgy" | "imsguy" | "imsgyu" | "imsyg" | "imsug" | "imsugy" | "imsuyg" | "imsygu" | "imsyug" | "imygs" | "imysg" | "imugs" | "imugsy" | "imugys" | "imusg" | "imusgy" | "imusyg" | "imuygs" | "imuysg" | "imygsu" | "imygus" | "imysgu" | "imysug" | "imyugs" | "imyusg" | "iygm" | "iymg" | "iugm" | "iugmy" | "iugym" | "iumg" | "iumgy" | "iumyg" | "iuygm" | "iuymg" | "iygmu" | "iygum" | "iymgu" | "iymug" | "iyugm" | "iyumg" | "isgm" | "isgmu" | "isgmy" | "isgmuy" | "isgmyu" | "isgym" | "isgum" | "isgumy" | "isguym" | "isgymu" | "isgyum" | "ismg" | "ismgu" | "ismgy" | "ismguy" | "ismgyu" | "ismyg" | "ismug" | "ismugy" | "ismuyg" | "ismygu" | "ismyug" | "isygm" | "isymg" | "isugm" | "isugmy" | "isugym" | "isumg" | "isumgy" | "isumyg" | "isuygm" | "isuymg" | "isygmu" | "isygum" | "isymgu" | "isymug" | "isyugm" | "isyumg" | "iygms" | "iygsm" | "iymgs" | "iymsg" | "iysgm" | "iysmg" | "iugms" | "iugmsy" | "iugmys" | "iugsm" | "iugsmy" | "iugsym" | "iugyms" | "iugysm" | "iumgs" | "iumgsy" | "iumgys" | "iumsg" | "iumsgy" | "iumsyg" | "iumygs" | "iumysg" | "iusgm" | "iusgmy" | "iusgym" | "iusmg" | "iusmgy" | "iusmyg" | "iusygm" | "iusymg" | "iuygms" | "iuygsm" | "iuymgs" | "iuymsg" | "iuysgm" | "iuysmg" | "iygmsu" | "iygmus" | "iygsmu" | "iygsum" | "iygums" | "iygusm" | "iymgsu" | "iymgus" | "iymsgu" | "iymsug" | "iymugs" | "iymusg" | "iysgmu" | "iysgum" | "iysmgu" | "iysmug" | "iysugm" | "iysumg" | "iyugms" | "iyugsm" | "iyumgs" | "iyumsg" | "iyusgm" | "iyusmg" | "ygi" | "yig" | "ugi" | "ugiy" | "ugyi" | "uig" | "uigy" | "uiyg" | "uygi" | "uyig" | "ygiu" | "ygui" | "yigu" | "yiug" | "yugi" | "yuig" | "sgi" | "sgiu" | "sgiy" | "sgiuy" | "sgiyu" | "sgyi" | "sgui" | "sguiy" | "sguyi" | "sgyiu" | "sgyui" | "sig" | "sigu" | "sigy" | "siguy" | "sigyu" | "siyg" | "siug" | "siugy" | "siuyg" | "siygu" | "siyug" | "sygi" | "syig" | "sugi" | "sugiy" | "sugyi" | "suig" | "suigy" | "suiyg" | "suygi" | "suyig" | "sygiu" | "sygui" | "syigu" | "syiug" | "syugi" | "syuig" | "ygis" | "ygsi" | "yigs" | "yisg" | "ysgi" | "ysig" | "ugis" | "ugisy" | "ugiys" | "ugsi" | "ugsiy" | "ugsyi" | "ugyis" | "ugysi" | "uigs" | "uigsy" | "uigys" | "uisg" | "uisgy" | "uisyg" | "uiygs" | "uiysg" | "usgi" | "usgiy" | "usgyi" | "usig" | "usigy" | "usiyg" | "usygi" | "usyig" | "uygis" | "uygsi" | "uyigs" | "uyisg" | "uysgi" | "uysig" | "ygisu" | "ygius" | "ygsiu" | "ygsui" | "yguis" | "ygusi" | "yigsu" | "yigus" | "yisgu" | "yisug" | "yiugs" | "yiusg" | "ysgiu" | "ysgui" | "ysigu" | "ysiug" | "ysugi" | "ysuig" | "yugis" | "yugsi" | "yuigs" | "yuisg" | "yusgi" | "yusig" | "mgi" | "mgis" | "mgiu" | "mgiy" | "mgiuy" | "mgiyu" | "mgisu" | "mgisy" | "mgisuy" | "mgisyu" | "mgiys" | "mgius" | "mgiusy" | "mgiuys" | "mgiysu" | "mgiyus" | "mgyi" | "mgui" | "mguiy" | "mguyi" | "mgyiu" | "mgyui" | "mgsi" | "mgsiu" | "mgsiy" | "mgsiuy" | "mgsiyu" | "mgsyi" | "mgsui" | "mgsuiy" | "mgsuyi" | "mgsyiu" | "mgsyui" | "mgyis" | "mgysi" | "mguis" | "mguisy" | "mguiys" | "mgusi" | "mgusiy" | "mgusyi" | "mguyis" | "mguysi" | "mgyisu" | "mgyius" | "mgysiu" | "mgysui" | "mgyuis" | "mgyusi" | "mig" | "migs" | "migu" | "migy" | "miguy" | "migyu" | "migsu" | "migsy" | "migsuy" | "migsyu" | "migys" | "migus" | "migusy" | "miguys" | "migysu" | "migyus" | "miyg" | "miug" | "miugy" | "miuyg" | "miygu" | "miyug" | "misg" | "misgu" | "misgy" | "misguy" | "misgyu" | "misyg" | "misug" | "misugy" | "misuyg" | "misygu" | "misyug" | "miygs" | "miysg" | "miugs" | "miugsy" | "miugys" | "miusg" | "miusgy" | "miusyg" | "miuygs" | "miuysg" | "miygsu" | "miygus" | "miysgu" | "miysug" | "miyugs" | "miyusg" | "mygi" | "myig" | "mugi" | "mugiy" | "mugyi" | "muig" | "muigy" | "muiyg" | "muygi" | "muyig" | "mygiu" | "mygui" | "myigu" | "myiug" | "myugi" | "myuig" | "msgi" | "msgiu" | "msgiy" | "msgiuy" | "msgiyu" | "msgyi" | "msgui" | "msguiy" | "msguyi" | "msgyiu" | "msgyui" | "msig" | "msigu" | "msigy" | "msiguy" | "msigyu" | "msiyg" | "msiug" | "msiugy" | "msiuyg" | "msiygu" | "msiyug" | "msygi" | "msyig" | "msugi" | "msugiy" | "msugyi" | "msuig" | "msuigy" | "msuiyg" | "msuygi" | "msuyig" | "msygiu" | "msygui" | "msyigu" | "msyiug" | "msyugi" | "msyuig" | "mygis" | "mygsi" | "myigs" | "myisg" | "mysgi" | "mysig" | "mugis" | "mugisy" | "mugiys" | "mugsi" | "mugsiy" | "mugsyi" | "mugyis" | "mugysi" | "muigs" | "muigsy" | "muigys" | "muisg" | "muisgy" | "muisyg" | "muiygs" | "muiysg" | "musgi" | "musgiy" | "musgyi" | "musig" | "musigy" | "musiyg" | "musygi" | "musyig" | "muygis" | "muygsi" | "muyigs" | "muyisg" | "muysgi" | "muysig" | "mygisu" | "mygius" | "mygsiu" | "mygsui" | "myguis" | "mygusi" | "myigsu" | "myigus" | "myisgu" | "myisug" | "myiugs" | "myiusg" | "mysgiu" | "mysgui" | "mysigu" | "mysiug" | "mysugi" | "mysuig" | "myugis" | "myugsi" | "myuigs" | "myuisg" | "myusgi" | "myusig" | "ygim" | "ygmi" | "yigm" | "yimg" | "ymgi" | "ymig" | "ugim" | "ugimy" | "ugiym" | "ugmi" | "ugmiy" | "ugmyi" | "ugyim" | "ugymi" | "uigm" | "uigmy" | "uigym" | "uimg" | "uimgy" | "uimyg" | "uiygm" | "uiymg" | "umgi" | "umgiy" | "umgyi" | "umig" | "umigy" | "umiyg" | "umygi" | "umyig" | "uygim" | "uygmi" | "uyigm" | "uyimg" | "uymgi" | "uymig" | "ygimu" | "ygium" | "ygmiu" | "ygmui" | "yguim" | "ygumi" | "yigmu" | "yigum" | "yimgu" | "yimug" | "yiugm" | "yiumg" | "ymgiu" | "ymgui" | "ymigu" | "ymiug" | "ymugi" | "ymuig" | "yugim" | "yugmi" | "yuigm" | "yuimg" | "yumgi" | "yumig" | "sgim" | "sgimu" | "sgimy" | "sgimuy" | "sgimyu" | "sgiym" | "sgium" | "sgiumy" | "sgiuym" | "sgiymu" | "sgiyum" | "sgmi" | "sgmiu" | "sgmiy" | "sgmiuy" | "sgmiyu" | "sgmyi" | "sgmui" | "sgmuiy" | "sgmuyi" | "sgmyiu" | "sgmyui" | "sgyim" | "sgymi" | "sguim" | "sguimy" | "sguiym" | "sgumi" | "sgumiy" | "sgumyi" | "sguyim" | "sguymi" | "sgyimu" | "sgyium" | "sgymiu" | "sgymui" | "sgyuim" | "sgyumi" | "sigm" | "sigmu" | "sigmy" | "sigmuy" | "sigmyu" | "sigym" | "sigum" | "sigumy" | "siguym" | "sigymu" | "sigyum" | "simg" | "simgu" | "simgy" | "simguy" | "simgyu" | "simyg" | "simug" | "simugy" | "simuyg" | "simygu" | "simyug" | "siygm" | "siymg" | "siugm" | "siugmy" | "siugym" | "siumg" | "siumgy" | "siumyg" | "siuygm" | "siuymg" | "siygmu" | "siygum" | "siymgu" | "siymug" | "siyugm" | "siyumg" | "smgi" | "smgiu" | "smgiy" | "smgiuy" | "smgiyu" | "smgyi" | "smgui" | "smguiy" | "smguyi" | "smgyiu" | "smgyui" | "smig" | "smigu" | "smigy" | "smiguy" | "smigyu" | "smiyg" | "smiug" | "smiugy" | "smiuyg" | "smiygu" | "smiyug" | "smygi" | "smyig" | "smugi" | "smugiy" | "smugyi" | "smuig" | "smuigy" | "smuiyg" | "smuygi" | "smuyig" | "smygiu" | "smygui" | "smyigu" | "smyiug" | "smyugi" | "smyuig" | "sygim" | "sygmi" | "syigm" | "syimg" | "symgi" | "symig" | "sugim" | "sugimy" | "sugiym" | "sugmi" | "sugmiy" | "sugmyi" | "sugyim" | "sugymi" | "suigm" | "suigmy" | "suigym" | "suimg" | "suimgy" | "suimyg" | "suiygm" | "suiymg" | "sumgi" | "sumgiy" | "sumgyi" | "sumig" | "sumigy" | "sumiyg" | "sumygi" | "sumyig" | "suygim" | "suygmi" | "suyigm" | "suyimg" | "suymgi" | "suymig" | "sygimu" | "sygium" | "sygmiu" | "sygmui" | "syguim" | "sygumi" | "syigmu" | "syigum" | "syimgu" | "syimug" | "syiugm" | "syiumg" | "symgiu" | "symgui" | "symigu" | "symiug" | "symugi" | "symuig" | "syugim" | "syugmi" | "syuigm" | "syuimg" | "syumgi" | "syumig" | "ygims" | "ygism" | "ygmis" | "ygmsi" | "ygsim" | "ygsmi" | "yigms" | "yigsm" | "yimgs" | "yimsg" | "yisgm" | "yismg" | "ymgis" | "ymgsi" | "ymigs" | "ymisg" | "ymsgi" | "ymsig" | "ysgim" | "ysgmi" | "ysigm" | "ysimg" | "ysmgi" | "ysmig" | "ugims" | "ugimsy" | "ugimys" | "ugism" | "ugismy" | "ugisym" | "ugiyms" | "ugiysm" | "ugmis" | "ugmisy" | "ugmiys" | "ugmsi" | "ugmsiy" | "ugmsyi" | "ugmyis" | "ugmysi" | "ugsim" | "ugsimy" | "ugsiym" | "ugsmi" | "ugsmiy" | "ugsmyi" | "ugsyim" | "ugsymi" | "ugyims" | "ugyism" | "ugymis" | "ugymsi" | "ugysim" | "ugysmi" | "uigms" | "uigmsy" | "uigmys" | "uigsm" | "uigsmy" | "uigsym" | "uigyms" | "uigysm" | "uimgs" | "uimgsy" | "uimgys" | "uimsg" | "uimsgy" | "uimsyg" | "uimygs" | "uimysg" | "uisgm" | "uisgmy" | "uisgym" | "uismg" | "uismgy" | "uismyg" | "uisygm" | "uisymg" | "uiygms" | "uiygsm" | "uiymgs" | "uiymsg" | "uiysgm" | "uiysmg" | "umgis" | "umgisy" | "umgiys" | "umgsi" | "umgsiy" | "umgsyi" | "umgyis" | "umgysi" | "umigs" | "umigsy" | "umigys" | "umisg" | "umisgy" | "umisyg" | "umiygs" | "umiysg" | "umsgi" | "umsgiy" | "umsgyi" | "umsig" | "umsigy" | "umsiyg" | "umsygi" | "umsyig" | "umygis" | "umygsi" | "umyigs" | "umyisg" | "umysgi" | "umysig" | "usgim" | "usgimy" | "usgiym" | "usgmi" | "usgmiy" | "usgmyi" | "usgyim" | "usgymi" | "usigm" | "usigmy" | "usigym" | "usimg" | "usimgy" | "usimyg" | "usiygm" | "usiymg" | "usmgi" | "usmgiy" | "usmgyi" | "usmig" | "usmigy" | "usmiyg" | "usmygi" | "usmyig" | "usygim" | "usygmi" | "usyigm" | "usyimg" | "usymgi" | "usymig" | "uygims" | "uygism" | "uygmis" | "uygmsi" | "uygsim" | "uygsmi" | "uyigms" | "uyigsm" | "uyimgs" | "uyimsg" | "uyisgm" | "uyismg" | "uymgis" | "uymgsi" | "uymigs" | "uymisg" | "uymsgi" | "uymsig" | "uysgim" | "uysgmi" | "uysigm" | "uysimg" | "uysmgi" | "uysmig" | "ygimsu" | "ygimus" | "ygismu" | "ygisum" | "ygiums" | "ygiusm" | "ygmisu" | "ygmius" | "ygmsiu" | "ygmsui" | "ygmuis" | "ygmusi" | "ygsimu" | "ygsium" | "ygsmiu" | "ygsmui" | "ygsuim" | "ygsumi" | "yguims" | "yguism" | "ygumis" | "ygumsi" | "ygusim" | "ygusmi" | "yigmsu" | "yigmus" | "yigsmu" | "yigsum" | "yigums" | "yigusm" | "yimgsu" | "yimgus" | "yimsgu" | "yimsug" | "yimugs" | "yimusg" | "yisgmu" | "yisgum" | "yismgu" | "yismug" | "yisugm" | "yisumg" | "yiugms" | "yiugsm" | "yiumgs" | "yiumsg" | "yiusgm" | "yiusmg" | "ymgisu" | "ymgius" | "ymgsiu" | "ymgsui" | "ymguis" | "ymgusi" | "ymigsu" | "ymigus" | "ymisgu" | "ymisug" | "ymiugs" | "ymiusg" | "ymsgiu" | "ymsgui" | "ymsigu" | "ymsiug" | "ymsugi" | "ymsuig" | "ymugis" | "ymugsi" | "ymuigs" | "ymuisg" | "ymusgi" | "ymusig" | "ysgimu" | "ysgium" | "ysgmiu" | "ysgmui" | "ysguim" | "ysgumi" | "ysigmu" | "ysigum" | "ysimgu" | "ysimug" | "ysiugm" | "ysiumg" | "ysmgiu" | "ysmgui" | "ysmigu" | "ysmiug" | "ysmugi" | "ysmuig" | "ysugim" | "ysugmi" | "ysuigm" | "ysuimg" | "ysumgi" | "ysumig" | "yugims" | "yugism" | "yugmis" | "yugmsi" | "yugsim" | "yugsmi" | "yuigms" | "yuigsm" | "yuimgs" | "yuimsg" | "yuisgm" | "yuismg" | "yumgis" | "yumgsi" | "yumigs" | "yumisg" | "yumsgi" | "yumsig" | "yusgim" | "yusgmi" | "yusigm" | "yusimg" | "yusmgi" | "yusmig") | undefined) => RegExpTsDsl;
7650
7802
  /** Creates a return statement. */
7651
- return: (expr?: string | typescript0.Expression | TsDsl<typescript0.Expression> | undefined) => ReturnTsDsl;
7803
+ return: (expr?: any) => ReturnTsDsl;
7652
7804
  /** Creates a setter method declaration. */
7653
- setter: (name: string | typescript0.PropertyName, fn?: ((s: SetterTsDsl) => void) | undefined) => SetterTsDsl;
7805
+ setter: (name: SetterName, fn?: ((s: SetterTsDsl) => void) | undefined) => SetterTsDsl;
7654
7806
  /** Wraps an expression or statement-like value into a `StmtTsDsl`. */
7655
7807
  stmt: (inner: typescript0.Expression | typescript0.Statement | TsDsl<any>) => StmtTsDsl;
7656
7808
  /** Creates a template literal expression. */
7657
- template: (value?: string | typescript0.Expression | TsDsl<typescript0.Expression> | undefined) => TemplateTsDsl;
7809
+ template: (value?: any) => TemplateTsDsl;
7658
7810
  /** Creates a ternary conditional expression (if ? then : else). */
7659
7811
  ternary: (condition?: string | typescript0.Expression | TsDsl<typescript0.Expression> | undefined) => TernaryTsDsl;
7660
7812
  /** Creates a throw statement. */
7661
7813
  throw: (error: string | typescript0.Expression | TsDsl<typescript0.Expression>, useNew?: boolean | undefined) => ThrowTsDsl;
7662
7814
  /** Creates a syntax token (e.g. `?`, `readonly`, `+`, `-`). */
7663
7815
  token: () => TokenTsDsl<never>;
7816
+ /** Creates a try/catch/finally statement. */
7817
+ try: (...args: ConstructorParameters<typeof TryTsDsl>) => TryTsDsl;
7664
7818
  /** Creates a basic type reference or type expression (e.g. Foo or Foo<T>). */
7665
- type: ((name: string, fn?: ((t: TypeExprTsDsl) => void) | undefined) => TypeExprTsDsl) & {
7819
+ type: ((name: any, fn?: ((t: TypeExprTsDsl) => void) | undefined) => TypeExprTsDsl) & {
7666
7820
  /** Creates a type alias declaration (e.g. `type Foo = Bar`). */
7667
- alias: (name: string, fn?: ((t: TypeAliasTsDsl) => void) | undefined) => TypeAliasTsDsl;
7821
+ alias: (name: any, fn?: ((t: TypeAliasTsDsl) => void) | undefined) => TypeAliasTsDsl;
7668
7822
  /** Creates an intersection type (e.g. `A & B`). */
7669
7823
  and: (...args: ConstructorParameters<typeof TypeAndTsDsl>) => TypeAndTsDsl;
7670
7824
  /** Creates a qualified type reference (e.g. Foo.Bar). */
7671
- attr: (right: string | typescript0.Identifier) => TypeAttrTsDsl;
7825
+ attr: (right: any) => TypeAttrTsDsl;
7672
7826
  /** Creates a basic type reference or type expression (e.g. Foo or Foo<T>). */
7673
- expr: (name: string, fn?: ((t: TypeExprTsDsl) => void) | undefined) => TypeExprTsDsl;
7827
+ expr: (name: any, fn?: ((t: TypeExprTsDsl) => void) | undefined) => TypeExprTsDsl;
7674
7828
  /** Converts a runtime value into a corresponding type expression node. */
7675
7829
  fromValue: (input: unknown) => TsDsl<typescript0.TypeNode>;
7676
7830
  /** Creates a function type node (e.g. `(a: string) => number`). */
7677
- func: () => TypeFuncTsDsl;
7831
+ func: (...args: ConstructorParameters<typeof TypeFuncTsDsl>) => TypeFuncTsDsl;
7678
7832
  /** Creates an indexed-access type (e.g. `Foo<T>[K]`). */
7679
7833
  idx: (base: string | typescript0.TypeNode | TsDsl<typescript0.TypeNode>, index: string | number | typescript0.TypeNode | TsDsl<typescript0.TypeNode>) => TypeIdxTsDsl;
7680
7834
  /** Creates a literal type node (e.g. 'foo', 42, or true). */
@@ -7688,7 +7842,7 @@ declare const $: ((id: string | typescript0.Expression | TsDsl<typescript0.Expre
7688
7842
  /** Represents a union type (e.g. `A | B | C`). */
7689
7843
  or: (...args: ConstructorParameters<typeof TypeOrTsDsl>) => TypeOrTsDsl;
7690
7844
  /** Creates a type parameter (e.g. `<T>`). */
7691
- param: (name?: string | typescript0.Identifier | undefined, fn?: ((name: TypeParamTsDsl) => void) | undefined) => TypeParamTsDsl;
7845
+ param: (name?: any, fn?: ((name: TypeParamTsDsl) => void) | undefined) => TypeParamTsDsl;
7692
7846
  /** Creates a type query node (e.g. `typeof Foo`). */
7693
7847
  query: (expr: string | MaybeTsDsl<typescript0.Expression | TypeTsDsl<typescript0.TypeNode>>) => TypeQueryTsDsl;
7694
7848
  /** Builds a TypeScript template literal *type* (e.g. `${Foo}-${Bar}` as a type). */
@@ -7699,7 +7853,7 @@ declare const $: ((id: string | typescript0.Expression | TsDsl<typescript0.Expre
7699
7853
  /** Creates a runtime `typeof` expression (e.g. typeof x). */
7700
7854
  typeofExpr: (expr: string | typescript0.Expression | TsDsl<typescript0.Expression>) => TypeOfExprTsDsl;
7701
7855
  /** Creates a variable declaration (var). */
7702
- var: (name?: string | undefined) => VarTsDsl;
7856
+ var: (name?: any) => VarTsDsl;
7703
7857
  };
7704
7858
  type DollarTsDsl = {
7705
7859
  /**
@@ -7805,7 +7959,7 @@ type HeyApiTransformersPlugin = DefinePlugin<UserConfig$13, Config$12>;
7805
7959
  //#region src/plugins/@hey-api/typescript/shared/types.d.ts
7806
7960
  type IrSchemaToAstOptions = {
7807
7961
  plugin: HeyApiTypeScriptPlugin['Instance'];
7808
- state: ToRefs<PluginState>;
7962
+ state: Refs<PluginState>;
7809
7963
  };
7810
7964
  type PluginState = Pick<Required<SymbolMeta>, 'path'> & Pick<Partial<SymbolMeta>, 'tags'>;
7811
7965
  //#endregion
@@ -13982,6 +14136,8 @@ declare class PluginInstance<T extends Plugin.Types = Plugin.Types> {
13982
14136
  gen: IProject;
13983
14137
  name: string;
13984
14138
  });
14139
+ addNode(node: Node | null): number;
14140
+ updateNode(index: number, node: Node | null): void;
13985
14141
  /**
13986
14142
  * Iterates over various input elements as specified by the event types, in
13987
14143
  * a specific order: servers, schemas, parameters, request bodies, then
@@ -14034,12 +14190,15 @@ declare class PluginInstance<T extends Plugin.Types = Plugin.Types> {
14034
14190
  isSymbolRegistered(identifier: SymbolIdentifier): boolean;
14035
14191
  querySymbol(filter: SymbolMeta): Symbol | undefined;
14036
14192
  referenceSymbol(meta: SymbolMeta): Symbol;
14193
+ /**
14194
+ * @deprecated use `plugin.symbol()` instead
14195
+ */
14037
14196
  registerSymbol(symbol: SymbolIn): Symbol;
14038
14197
  /**
14039
14198
  * Executes plugin's handler function.
14040
14199
  */
14041
14200
  run(): Promise<void>;
14042
- setSymbolValue(symbol: Symbol, value: unknown): void;
14201
+ symbol(name: SymbolIn['name'], symbol?: Omit<SymbolIn, 'name'>): Symbol;
14043
14202
  private buildEventHooks;
14044
14203
  private forEachError;
14045
14204
  private getSymbolFilePath;
@@ -14052,6 +14211,34 @@ type Hooks = {
14052
14211
  * Event hooks.
14053
14212
  */
14054
14213
  events?: {
14214
+ /**
14215
+ * Triggered after adding or updating a node.
14216
+ *
14217
+ * You can use this to perform actions after a node is added or updated.
14218
+ *
14219
+ * @param args Arguments object.
14220
+ * @returns void
14221
+ */
14222
+ 'node:set:after'?: (args: {
14223
+ /** The node added or updated. */
14224
+ node: Node | null;
14225
+ /** Plugin that added or updated the node. */
14226
+ plugin: PluginInstance;
14227
+ }) => void;
14228
+ /**
14229
+ * Triggered before adding or updating a node.
14230
+ *
14231
+ * You can use this to modify the node before it's added or updated.
14232
+ *
14233
+ * @param args Arguments object.
14234
+ * @returns void
14235
+ */
14236
+ 'node:set:before'?: (args: {
14237
+ /** The node to be added or updated. */
14238
+ node: Node | null;
14239
+ /** Plugin adding or updating the node. */
14240
+ plugin: PluginInstance;
14241
+ }) => void;
14055
14242
  /**
14056
14243
  * Triggered after executing a plugin handler.
14057
14244
  *
@@ -14100,38 +14287,6 @@ type Hooks = {
14100
14287
  /** Symbol to register. */
14101
14288
  symbol: SymbolIn;
14102
14289
  }) => void;
14103
- /**
14104
- * Triggered after setting a symbol value.
14105
- *
14106
- * You can use this to perform actions after a symbol's value is set.
14107
- *
14108
- * @param args Arguments object.
14109
- * @returns void
14110
- */
14111
- 'symbol:setValue:after'?: (args: {
14112
- /** Plugin that set the symbol value. */
14113
- plugin: PluginInstance;
14114
- /** The symbol. */
14115
- symbol: Symbol;
14116
- /** The value that was set. */
14117
- value: unknown;
14118
- }) => void;
14119
- /**
14120
- * Triggered before setting a symbol value.
14121
- *
14122
- * You can use this to modify the value before it's set.
14123
- *
14124
- * @param args Arguments object.
14125
- * @returns void
14126
- */
14127
- 'symbol:setValue:before'?: (args: {
14128
- /** Plugin setting the symbol value. */
14129
- plugin: PluginInstance;
14130
- /** The symbol. */
14131
- symbol: Symbol;
14132
- /** The value to set. */
14133
- value: unknown;
14134
- }) => void;
14135
14290
  };
14136
14291
  /**
14137
14292
  * Hooks specifically for overriding operations behavior.
@@ -14293,8 +14448,8 @@ declare namespace Plugin {
14293
14448
  * Generic wrapper for plugin hooks.
14294
14449
  */
14295
14450
  export type Hooks = Pick<BaseConfig, '~hooks'>;
14296
- export interface Name<Name extends PluginNames> {
14297
- name: Name;
14451
+ export interface Name<Name$2 extends PluginNames> {
14452
+ name: Name$2;
14298
14453
  }
14299
14454
 
14300
14455
  /**
@@ -14631,10 +14786,28 @@ type UserOutput = {
14631
14786
  * @default null
14632
14787
  */
14633
14788
  lint?: Linters | null;
14789
+ /**
14790
+ * Optional name conflict resolver to customize how naming conflicts
14791
+ * are handled.
14792
+ */
14793
+ nameConflictResolver?: NameConflictResolver;
14634
14794
  /**
14635
14795
  * The absolute path to the output folder.
14636
14796
  */
14637
14797
  path: string;
14798
+ /**
14799
+ * Whether `export * from 'module'` should be used when possible
14800
+ * instead of named exports.
14801
+ *
14802
+ * @default false
14803
+ */
14804
+ preferExportAll?: boolean;
14805
+ /**
14806
+ * Optional function to transform module specifiers.
14807
+ *
14808
+ * @default undefined
14809
+ */
14810
+ resolveModuleName?: (moduleName: string) => string | undefined;
14638
14811
  /**
14639
14812
  * Relative or absolute path to the tsconfig file we should use to
14640
14813
  * generate the output. If a path to tsconfig file is not provided, we
@@ -14649,17 +14822,13 @@ type Output = {
14649
14822
  /**
14650
14823
  * Defines casing of the output fields. By default, we preserve `input`
14651
14824
  * values as data transforms incur a performance penalty at runtime.
14652
- *
14653
- * @default undefined
14654
14825
  */
14655
- case?: StringCase;
14826
+ case: StringCase | undefined;
14656
14827
  /**
14657
14828
  * Clean the `output` folder on every run? If disabled, this folder may
14658
14829
  * be used to store additional files. The default option is `true` to
14659
14830
  * reduce the risk of keeping outdated files around when configuration,
14660
14831
  * input, or package version changes.
14661
- *
14662
- * @default true
14663
14832
  */
14664
14833
  clean: boolean;
14665
14834
  /**
@@ -14671,21 +14840,16 @@ type Output = {
14671
14840
  fileName: {
14672
14841
  /**
14673
14842
  * The casing convention to use for generated file names.
14674
- *
14675
- * @default 'preserve'
14676
14843
  */
14677
14844
  case: StringCase;
14678
14845
  /**
14679
14846
  * Custom naming pattern for generated file names.
14680
- *
14681
- * @default '{{name}}'
14682
14847
  */
14683
14848
  name: StringName;
14684
14849
  /**
14685
14850
  * Suffix to append to file names (before the extension). For example,
14686
14851
  * with a suffix of `.gen`, `example.ts` becomes `example.gen.ts`.
14687
14852
  *
14688
- * @default '.gen'
14689
14853
  * @example
14690
14854
  * // Given a suffix of `.gen`
14691
14855
  * 'index.ts' -> 'index.ts' (index files are not renamed)
@@ -14696,8 +14860,6 @@ type Output = {
14696
14860
  };
14697
14861
  /**
14698
14862
  * Which formatter to use to process output folder?
14699
- *
14700
- * @default null
14701
14863
  */
14702
14864
  format: Formatters | null;
14703
14865
  /**
@@ -14705,28 +14867,36 @@ type Output = {
14705
14867
  * other modules. By default, we don't add a file extension and let the
14706
14868
  * runtime resolve it. If you're using moduleResolution `nodenext`, we
14707
14869
  * default to `.js`.
14708
- *
14709
- * @default undefined
14710
14870
  */
14711
14871
  importFileExtension: ImportFileExtensions | (string & {}) | null | undefined;
14712
14872
  /**
14713
14873
  * Should the exports from plugin files be re-exported in the index
14714
14874
  * barrel file? By default, this is enabled and only default plugins
14715
14875
  * are re-exported.
14716
- *
14717
- * @default true
14718
14876
  */
14719
14877
  indexFile: boolean;
14720
14878
  /**
14721
14879
  * Which linter to use to process output folder?
14722
- *
14723
- * @default null
14724
14880
  */
14725
14881
  lint: Linters | null;
14882
+ /**
14883
+ * Optional name conflict resolver to customize how naming conflicts
14884
+ * are handled.
14885
+ */
14886
+ nameConflictResolver: NameConflictResolver | undefined;
14726
14887
  /**
14727
14888
  * The absolute path to the output folder.
14728
14889
  */
14729
14890
  path: string;
14891
+ /**
14892
+ * Whether `export * from 'module'` should be used when possible
14893
+ * instead of named exports.
14894
+ */
14895
+ preferExportAll: boolean;
14896
+ /**
14897
+ * Optional function to transform module specifiers.
14898
+ */
14899
+ resolveModuleName: ((moduleName: string) => string | undefined) | undefined;
14730
14900
  /**
14731
14901
  * The parsed TypeScript configuration used to generate the output.
14732
14902
  * If no `tsconfig` file path was provided or found, this will be `null`.
@@ -14737,8 +14907,6 @@ type Output = {
14737
14907
  * generate the output. If a path to tsconfig file is not provided, we
14738
14908
  * attempt to find one starting from the location of the
14739
14909
  * `@hey-api/openapi-ts` configuration file and traversing up.
14740
- *
14741
- * @default undefined
14742
14910
  */
14743
14911
  tsConfigPath: (string & {}) | null | undefined;
14744
14912
  };
@@ -15384,5 +15552,5 @@ type Config = Omit<Required<UserConfig>, 'input' | 'logs' | 'output' | 'parser'
15384
15552
  plugins: { [K in PluginNames]?: Plugin.Config<PluginConfigMap[K]> };
15385
15553
  };
15386
15554
  //#endregion
15387
- export { PluginHandler as C, MaybeArray as D, LazyOrAsync as E, Client as S, IR$1 as T, $ as _, Plugin as a, TsDsl as b, OpenApiOperationObject as c, OpenApiResponseObject as d, OpenApiSchemaObject as f, ExpressionTransformer as g, TypeTransformer as h, DefinePlugin as i, OpenApiParameterObject as l, Logger as m, UserConfig as n, OpenApi as o, Context as p, Input as r, OpenApiMetaObject as s, Config as t, OpenApiRequestBodyObject as u, DollarTsDsl as v, StringCase as w, TypeTsDsl as x, MaybeTsDsl as y };
15388
- //# sourceMappingURL=config-C5xWXzTz.d.cts.map
15555
+ export { LazyOrAsync as A, MaybeTsDsl as C, PluginHandler as D, Client as E, StringCase as O, TypeScriptRenderer as S, TypeTsDsl as T, $ as _, Plugin as a, regexp as b, OpenApiOperationObject as c, OpenApiResponseObject as d, OpenApiSchemaObject as f, ExpressionTransformer as g, TypeTransformer as h, DefinePlugin as i, MaybeArray as j, IR$1 as k, OpenApiParameterObject as l, Logger as m, UserConfig as n, OpenApi as o, Context as p, Input as r, OpenApiMetaObject as s, Config as t, OpenApiRequestBodyObject as u, DollarTsDsl as v, TsDsl as w, keywords as x, reserved as y };
15556
+ //# sourceMappingURL=config-CBa-XLy8.d.cts.map