@hey-api/openapi-ts 0.88.2 → 0.89.1

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 * as _hey_api_codegen_core0 from "@hey-api/codegen-core";
2
+ import { AnalysisContext, AstContext, File, FromRef, IProject, Language, NameConflictResolver, Node, Project, Ref, Refs, RenderContext, Renderer, Symbol, SymbolIdentifier, SymbolIn, SymbolMeta } from "@hey-api/codegen-core";
2
3
  import { RangeOptions, SemVer } from "semver";
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
  */
@@ -68,12 +31,20 @@ type LazyOrAsync<T> = T | (() => T) | (() => Promise<T>);
68
31
  type MaybeArray<T> = T | ReadonlyArray<T>;
69
32
  //#endregion
70
33
  //#region src/openApi/3.1.x/types/spec.d.ts
34
+ /**
35
+ * OpenAPI Specification Extensions.
36
+ *
37
+ * See {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specification-extensions Specification Extensions}.
38
+ */
39
+ interface SpecificationExtensions$2 {
40
+ [extension: `x-${string}`]: unknown;
41
+ }
71
42
  /**
72
43
  * This is the root object of the {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#openapi-document OpenAPI document}.
73
44
  *
74
45
  * This object MAY be extended with {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specification-extensions Specification Extensions}.
75
46
  */
76
- interface OpenApiV3_1_X {
47
+ interface OpenApiV3_1_X extends SpecificationExtensions$2 {
77
48
  /**
78
49
  * An element to hold various schemas for the document.
79
50
  */
@@ -196,11 +167,11 @@ interface OpenApiV3_1_X {
196
167
  * description: callback successfully processed
197
168
  * ```
198
169
  */
199
- interface CallbackObject$1 {
170
+ interface CallbackObject$1 extends SpecificationExtensions$2 {
200
171
  /**
201
172
  * A Path Item Object, or a reference to one, used to define a callback request and expected responses. A {@link https://github.com/OAI/OpenAPI-Specification/blob/main/examples/v3.0/callback-example.yaml complete example} is available.
202
173
  */
203
- [expression: string]: PathItemObject$2 | ReferenceObject$1;
174
+ [expression: string]: PathItemObject$2 | ReferenceObject$1 | unknown;
204
175
  }
205
176
  /**
206
177
  * Holds a set of reusable objects for different aspects of the OAS. All objects defined within the components object will have no effect on the API unless they are explicitly referenced from properties outside the components object.
@@ -291,7 +262,7 @@ interface CallbackObject$1 {
291
262
  * read:pets: read your pets
292
263
  * ```
293
264
  */
294
- interface ComponentsObject$1 {
265
+ interface ComponentsObject$1 extends SpecificationExtensions$2 {
295
266
  /**
296
267
  * An object to hold reusable {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#callback-object Callback Objects}.
297
268
  */
@@ -345,7 +316,7 @@ interface ComponentsObject$1 {
345
316
  * email: support@example.com
346
317
  * ```
347
318
  */
348
- interface ContactObject$2 {
319
+ interface ContactObject$2 extends SpecificationExtensions$2 {
349
320
  /**
350
321
  * The email address of the contact person/organization. This MUST be in the form of an email address.
351
322
  */
@@ -485,7 +456,7 @@ interface ContactObject$2 {
485
456
  *
486
457
  * will map to `Dog` because of the definition in the `mapping` element.
487
458
  */
488
- interface DiscriminatorObject$1 {
459
+ interface DiscriminatorObject$1 extends SpecificationExtensions$2 {
489
460
  /**
490
461
  * An object to hold mappings between payload values and schema names or references.
491
462
  */
@@ -536,7 +507,7 @@ interface DiscriminatorObject$1 {
536
507
  * type: integer
537
508
  * ```
538
509
  */
539
- interface EncodingObject$1 {
510
+ interface EncodingObject$1 extends SpecificationExtensions$2 {
540
511
  /**
541
512
  * Determines whether the parameter value SHOULD allow reserved characters, as defined by {@link https://tools.ietf.org/html/rfc3986#section-2.2 RFC3986} `:/?#[]@!$&'()*+,;=` to be included without percent-encoding. The default value is `false`. This property SHALL be ignored if the request body media type is not `application/x-www-form-urlencoded` or `multipart/form-data`. If a value is explicitly defined, then the value of {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#encodingContentType `contentType`} (implicit or explicit) SHALL be ignored.
542
513
  */
@@ -624,7 +595,7 @@ interface EncodingObject$1 {
624
595
  * $ref: '#/components/examples/confirmation-success'
625
596
  * ```
626
597
  */
627
- interface ExampleObject$2 {
598
+ interface ExampleObject$2 extends SpecificationExtensions$2 {
628
599
  /**
629
600
  * Long description for the example. {@link https://spec.commonmark.org/ CommonMark syntax} MAY be used for rich text representation.
630
601
  */
@@ -653,7 +624,7 @@ interface ExampleObject$2 {
653
624
  * url: https://example.com
654
625
  * ```
655
626
  */
656
- interface ExternalDocumentationObject$2 {
627
+ interface ExternalDocumentationObject$2 extends SpecificationExtensions$2 {
657
628
  /**
658
629
  * A description of the target documentation. {@link https://spec.commonmark.org/ CommonMark syntax} MAY be used for rich text representation.
659
630
  */
@@ -699,7 +670,7 @@ type HeaderObject$2 = Omit<ParameterObject, 'in' | 'name'>;
699
670
  * version: 1.0.1
700
671
  * ```
701
672
  */
702
- interface InfoObject {
673
+ interface InfoObject extends SpecificationExtensions$2 {
703
674
  /**
704
675
  * The contact information for the exposed API.
705
676
  */
@@ -740,7 +711,7 @@ interface InfoObject {
740
711
  * identifier: Apache-2.0
741
712
  * ```
742
713
  */
743
- interface LicenseObject$2 {
714
+ interface LicenseObject$2 extends SpecificationExtensions$2 {
744
715
  /**
745
716
  * An {@link https://spdx.org/licenses/ SPDX} license expression for the API. The `identifier` field is mutually exclusive of the `url` field.
746
717
  */
@@ -901,7 +872,7 @@ interface LicenseObject$2 {
901
872
  *
902
873
  * Runtime expressions preserve the type of the referenced value. Expressions can be embedded into string values by surrounding the expression with `{}` curly braces.
903
874
  */
904
- interface LinkObject$1 {
875
+ interface LinkObject$1 extends SpecificationExtensions$2 {
905
876
  /**
906
877
  * A description of the link. {@link https://spec.commonmark.org/ CommonMark syntax} MAY be used for rich text representation.
907
878
  */
@@ -960,7 +931,7 @@ interface LinkObject$1 {
960
931
  * $ref: "#/components/examples/frog-example"
961
932
  * ```
962
933
  */
963
- interface MediaTypeObject$1 {
934
+ interface MediaTypeObject$1 extends SpecificationExtensions$2 {
964
935
  /**
965
936
  * A map between a property name and its encoding information. The key, being the property name, MUST exist in the schema as a property. The encoding object SHALL only apply to `requestBody` objects when the media type is `multipart` or `application/x-www-form-urlencoded`.
966
937
  */
@@ -1001,7 +972,7 @@ interface MediaTypeObject$1 {
1001
972
  * read:pets: read your pets
1002
973
  * ```
1003
974
  */
1004
- interface OAuthFlowObject$1 {
975
+ interface OAuthFlowObject$1 extends SpecificationExtensions$2 {
1005
976
  /**
1006
977
  * **REQUIRED (`"implicit"`, `"authorizationCode"`)**. The authorization URL to be used for this flow. This MUST be in the form of a URL. The OAuth2 standard requires the use of TLS.
1007
978
  */
@@ -1024,7 +995,7 @@ interface OAuthFlowObject$1 {
1024
995
  *
1025
996
  * This object MAY be extended with {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specification-extensions Specification Extensions}.
1026
997
  */
1027
- interface OAuthFlowsObject$1 {
998
+ interface OAuthFlowsObject$1 extends SpecificationExtensions$2 {
1028
999
  /**
1029
1000
  * Configuration for the OAuth Authorization Code flow. Previously called `accessCode` in OpenAPI 2.0.
1030
1001
  */
@@ -1091,7 +1062,7 @@ interface OAuthFlowsObject$1 {
1091
1062
  * - read:pets
1092
1063
  * ```
1093
1064
  */
1094
- interface OperationObject {
1065
+ interface OperationObject extends SpecificationExtensions$2 {
1095
1066
  /**
1096
1067
  * A map of possible out-of band callbacks related to the parent operation. The key is a unique identifier for the Callback Object. Each value in the map is a {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#callback-object Callback Object} that describes a request that may be initiated by the API provider and the expected responses.
1097
1068
  */
@@ -1238,7 +1209,7 @@ interface OperationObject {
1238
1209
  * type: number
1239
1210
  * ```
1240
1211
  */
1241
- interface ParameterObject {
1212
+ interface ParameterObject extends SpecificationExtensions$2 {
1242
1213
  /**
1243
1214
  * Sets the ability to pass empty-valued parameters. This is valid only for `query` parameters and allows sending a parameter with an empty value. Default value is `false`. If {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#parameterStyle `style`} is used, and if behavior is `n/a` (cannot be serialized), the value of `allowEmptyValue` SHALL be ignored. Use of this property is NOT RECOMMENDED, as it is likely to be removed in a later revision.
1244
1215
  */
@@ -1333,7 +1304,7 @@ interface ParameterObject {
1333
1304
  * style: simple
1334
1305
  * ```
1335
1306
  */
1336
- interface PathItemObject$2 {
1307
+ interface PathItemObject$2 extends SpecificationExtensions$2 {
1337
1308
  /**
1338
1309
  * Allows for a referenced definition of this path item. The referenced structure MUST be in the form of a {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#path-item-object Path Item Object}. In case a Path Item Object field appears both in the defined object and the referenced object, the behavior is undefined. See the rules for resolving {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#relative-references-in-uris Relative References}.
1339
1310
  */
@@ -1432,7 +1403,7 @@ interface PathItemObject$2 {
1432
1403
  * $ref: '#/components/schemas/pet'
1433
1404
  * ```
1434
1405
  */
1435
- interface PathsObject$2 {
1406
+ interface PathsObject$2 extends SpecificationExtensions$2 {
1436
1407
  /**
1437
1408
  * A relative path to an individual endpoint. The field name MUST begin with a forward slash (`/`). The path is **appended** (no relative URL resolution) to the expanded URL from the {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#server-object `Server Object`}'s `url` field in order to construct the full URL. {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#path-templating Path templating} is allowed. When matching URLs, concrete (non-templated) paths would be matched before their templated counterparts. Templated paths with the same hierarchy but different templated names MUST NOT exist as they are identical. In case of ambiguous matching, it's up to the tooling to decide which one to use.
1438
1409
  */
@@ -1535,7 +1506,7 @@ interface ReferenceObject$1 {
1535
1506
  * type: string
1536
1507
  * ```
1537
1508
  */
1538
- interface RequestBodyObject {
1509
+ interface RequestBodyObject extends SpecificationExtensions$2 {
1539
1510
  /**
1540
1511
  * **REQUIRED**. The content of the request body. The key is a media type or {@link https://tools.ietf.org/html/rfc7231#appendix-D media type range} and the value describes it. For requests that match multiple keys, only the most specific key is applicable. e.g. text/plain overrides text/*
1541
1512
  */
@@ -1610,7 +1581,7 @@ interface RequestBodyObject {
1610
1581
  * description: object created
1611
1582
  * ```
1612
1583
  */
1613
- interface ResponseObject {
1584
+ interface ResponseObject extends SpecificationExtensions$2 {
1614
1585
  /**
1615
1586
  * A map containing descriptions of potential response payloads. The key is a media type or {@link https://datatracker.ietf.org/doc/html/rfc7231#appendix-D media type range} and the value describes it. For responses that match multiple keys, only the most specific key is applicable. e.g. text/plain overrides text/*
1616
1587
  */
@@ -1657,11 +1628,11 @@ interface ResponseObject {
1657
1628
  * $ref: '#/components/schemas/ErrorModel'
1658
1629
  * ```
1659
1630
  */
1660
- interface ResponsesObject$2 {
1631
+ interface ResponsesObject$2 extends SpecificationExtensions$2 {
1661
1632
  /**
1662
1633
  * Any {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#http-status-codes HTTP status code} can be used as the property name, but only one property per code, to describe the expected response for that HTTP status code. This field MUST be enclosed in quotation marks (for example, "200") for compatibility between JSON and YAML. To define a range of response codes, this field MAY contain the uppercase wildcard character `X`. For example, `2XX` represents all response codes between `[200-299]`. Only the following range definitions are allowed: `1XX`, `2XX`, `3XX`, `4XX`, and `5XX`. If a response is defined using an explicit code, the explicit code definition takes precedence over the range definition for that code.
1663
1634
  */
1664
- [httpStatusCode: string]: ResponseObject | ReferenceObject$1 | undefined;
1635
+ [httpStatusCode: string]: ResponseObject | ReferenceObject$1 | undefined | unknown;
1665
1636
  /**
1666
1637
  * The documentation of responses other than the ones declared for specific HTTP response codes. Use this field to cover undeclared responses.
1667
1638
  */
@@ -1691,7 +1662,7 @@ interface ResponsesObject$2 {
1691
1662
  *
1692
1663
  * This object MAY be extended with {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specification-extensions Specification Extensions}, though as noted, additional properties MAY omit the `x-` prefix within this object.
1693
1664
  */
1694
- type SchemaObject = JsonSchemaDraft2020_12;
1665
+ type SchemaObject = JsonSchemaDraft2020_12 & SpecificationExtensions$2;
1695
1666
  /**
1696
1667
  * Lists the required security schemes to execute this operation. The name used for each property MUST correspond to a security scheme declared in the {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#componentsSecuritySchemes Security Schemes} under the {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#components-object Components Object}.
1697
1668
  *
@@ -1776,7 +1747,7 @@ interface SecurityRequirementObject$2 {
1776
1747
  * read:pets: read your pets
1777
1748
  * ```
1778
1749
  */
1779
- type SecuritySchemeObject$2 = {
1750
+ type SecuritySchemeObject$2 = SpecificationExtensions$2 & {
1780
1751
  /**
1781
1752
  * A description for security scheme. {@link https://spec.commonmark.org/ CommonMark syntax} MAY be used for rich text representation.
1782
1753
  */
@@ -1842,7 +1813,7 @@ type SecuritySchemeObject$2 = {
1842
1813
  * description: Development server
1843
1814
  * ```
1844
1815
  */
1845
- interface ServerObject$1 {
1816
+ interface ServerObject$1 extends SpecificationExtensions$2 {
1846
1817
  /**
1847
1818
  * An optional string describing the host designated by the URL. {@link https://spec.commonmark.org/ CommonMark syntax} MAY be used for rich text representation.
1848
1819
  */
@@ -1861,7 +1832,7 @@ interface ServerObject$1 {
1861
1832
  *
1862
1833
  * This object MAY be extended with {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specification-extensions Specification Extensions}.
1863
1834
  */
1864
- interface ServerVariableObject$1 {
1835
+ interface ServerVariableObject$1 extends SpecificationExtensions$2 {
1865
1836
  /**
1866
1837
  * **REQUIRED**. The default value to use for substitution, which SHALL be sent if an alternate value is _not_ supplied. Note this behavior is different than the {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#schema-object Schema Object's} treatment of default values, because in those cases parameter values are optional. If the {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#serverVariableEnum `enum`} is defined, the value MUST exist in the enum's values.
1867
1838
  */
@@ -1886,7 +1857,7 @@ interface ServerVariableObject$1 {
1886
1857
  * description: Pets operations
1887
1858
  * ```
1888
1859
  */
1889
- interface TagObject$2 {
1860
+ interface TagObject$2 extends SpecificationExtensions$2 {
1890
1861
  /**
1891
1862
  * A description for the tag. {@link https://spec.commonmark.org/ CommonMark syntax} MAY be used for rich text representation.
1892
1863
  */
@@ -2092,7 +2063,7 @@ interface TagObject$2 {
2092
2063
  * </aliens>
2093
2064
  * ```
2094
2065
  */
2095
- interface XMLObject$2 {
2066
+ interface XMLObject$2 extends SpecificationExtensions$2 {
2096
2067
  /**
2097
2068
  * Declares whether the property definition translates to an attribute instead of an element. Default value is `false`.
2098
2069
  */
@@ -2139,7 +2110,7 @@ interface OpenApiSchemaExtensions {
2139
2110
  //#endregion
2140
2111
  //#region src/openApi/3.1.x/types/json-schema-draft-2020-12.d.ts
2141
2112
  // TODO: left out some keywords related to structuring a complex schema and declaring a dialect
2142
- interface JsonSchemaDraft2020_12 extends ArrayKeywords, NumberKeywords, ObjectKeywords, StringKeywords, EnumExtensions, OpenApiSchemaExtensions {
2113
+ interface JsonSchemaDraft2020_12 extends ArrayKeywords, NumberKeywords, ObjectKeywords, StringKeywords, EnumExtensions, OpenApiSchemaExtensions, SpecificationExtensions$2 {
2143
2114
  /**
2144
2115
  * The `$comment` {@link https://json-schema.org/learn/glossary#keyword keyword} is strictly intended for adding comments to a schema. Its value must always be a string. Unlike the annotations `title`, `description`, and `examples`, JSON schema {@link https://json-schema.org/learn/glossary#implementation implementations} aren't allowed to attach any meaning or behavior to it whatsoever, and may even strip them at any time. Therefore, they are useful for leaving notes to future editors of a JSON schema, but should not be used to communicate to users of the schema.
2145
2116
  */
@@ -2464,6 +2435,14 @@ type JsonSchemaTypes$1 = 'array' | 'boolean' | 'integer' | 'null' | 'number' | '
2464
2435
  type IRMediaType = 'form-data' | 'json' | 'text' | 'url-search-params' | 'octet-stream';
2465
2436
  //#endregion
2466
2437
  //#region src/ir/types.d.ts
2438
+ /**
2439
+ * OpenAPI Specification Extensions.
2440
+ *
2441
+ * See {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specification-extensions Specification Extensions}.
2442
+ */
2443
+ interface SpecificationExtensions$1 {
2444
+ [extension: `x-${string}`]: unknown;
2445
+ }
2467
2446
  interface IRBodyObject {
2468
2447
  mediaType: string;
2469
2448
  /**
@@ -2480,7 +2459,7 @@ interface IRComponentsObject {
2480
2459
  requestBodies?: Record<string, IRRequestBodyObject>;
2481
2460
  schemas?: Record<string, IRSchemaObject>;
2482
2461
  }
2483
- interface IROperationObject {
2462
+ interface IROperationObject extends SpecificationExtensions$1 {
2484
2463
  body?: IRBodyObject;
2485
2464
  deprecated?: boolean;
2486
2465
  description?: string;
@@ -2501,7 +2480,7 @@ interface IRParametersObject {
2501
2480
  path?: Record<string, IRParameterObject>;
2502
2481
  query?: Record<string, IRParameterObject>;
2503
2482
  }
2504
- interface IRParameterObject extends Pick<JsonSchemaDraft2020_12, 'deprecated' | 'description'> {
2483
+ interface IRParameterObject extends Pick<JsonSchemaDraft2020_12, 'deprecated' | 'description'>, SpecificationExtensions$1 {
2505
2484
  /**
2506
2485
  * Determines whether the parameter value SHOULD allow reserved characters, as defined by RFC3986 `:/?#[]@!$&'()*+,;=` to be included without percent-encoding. The default value is `false`. This property SHALL be ignored if the request body media type is not `application/x-www-form-urlencoded` or `multipart/form-data`. If a value is explicitly defined, then the value of `contentType` (implicit or explicit) SHALL be ignored.
2507
2486
  */
@@ -2559,7 +2538,7 @@ interface IRResponseObject {
2559
2538
  mediaType?: string;
2560
2539
  schema: IRSchemaObject;
2561
2540
  }
2562
- interface IRSchemaObject extends Pick<JsonSchemaDraft2020_12, '$ref' | 'const' | 'default' | 'deprecated' | 'description' | 'exclusiveMaximum' | 'exclusiveMinimum' | 'maximum' | 'maxItems' | 'maxLength' | 'minimum' | 'minItems' | 'minLength' | 'pattern' | 'required' | 'title' | 'example'> {
2541
+ interface IRSchemaObject extends Pick<JsonSchemaDraft2020_12, '$ref' | 'const' | 'default' | 'deprecated' | 'description' | 'exclusiveMaximum' | 'exclusiveMinimum' | 'maximum' | 'maxItems' | 'maxLength' | 'minimum' | 'minItems' | 'minLength' | 'pattern' | 'required' | 'title' | 'example'>, SpecificationExtensions$1 {
2563
2542
  /**
2564
2543
  * If the schema is intended to be used as an object property, it can be
2565
2544
  * marked as read-only or write-only. This value controls whether the schema
@@ -2604,6 +2583,10 @@ interface IRSchemaObject extends Pick<JsonSchemaDraft2020_12, '$ref' | 'const' |
2604
2583
  * follow a specific convention.
2605
2584
  */
2606
2585
  propertyNames?: IRSchemaObject;
2586
+ /**
2587
+ * Reference to symbol instead of `$ref` string.
2588
+ */
2589
+ symbolRef?: Symbol;
2607
2590
  /**
2608
2591
  * Each schema eventually resolves into `type`.
2609
2592
  */
@@ -4779,12 +4762,20 @@ interface OpenApiV2_0_XTypes {
4779
4762
  }
4780
4763
  //#endregion
4781
4764
  //#region src/openApi/3.0.x/types/spec.d.ts
4765
+ /**
4766
+ * OpenAPI Specification Extensions.
4767
+ *
4768
+ * See {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#specification-extensions Specification Extensions}.
4769
+ */
4770
+ interface SpecificationExtensions {
4771
+ [extension: `x-${string}`]: unknown;
4772
+ }
4782
4773
  /**
4783
4774
  * This is the root object of the {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#openapi-description OpenAPI Description}.
4784
4775
  *
4785
4776
  * This object MAY be extended with {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#specification-extensions Specification Extensions}.
4786
4777
  */
4787
- interface OpenApiV3_0_X {
4778
+ interface OpenApiV3_0_X extends SpecificationExtensions {
4788
4779
  /**
4789
4780
  * An element to hold various Objects for the OpenAPI Description.
4790
4781
  */
@@ -4825,11 +4816,11 @@ interface OpenApiV3_0_X {
4825
4816
  *
4826
4817
  * TODO: examples
4827
4818
  */
4828
- interface CallbackObject {
4819
+ interface CallbackObject extends SpecificationExtensions {
4829
4820
  /**
4830
4821
  * A Path Item Object used to define a callback request and expected responses. A {@link https://learn.openapis.org/examples/v3.0/callback-example.html complete example} is available.
4831
4822
  */
4832
- [expression: string]: PathItemObject | ReferenceObject$2;
4823
+ [expression: string]: PathItemObject | ReferenceObject$2 | unknown;
4833
4824
  }
4834
4825
  /**
4835
4826
  * Holds a set of reusable objects for different aspects of the OAS. All objects defined within the Components Object will have no effect on the API unless they are explicitly referenced from outside the Components Object.
@@ -4840,7 +4831,7 @@ interface CallbackObject {
4840
4831
  *
4841
4832
  * TODO: examples
4842
4833
  */
4843
- interface ComponentsObject {
4834
+ interface ComponentsObject extends SpecificationExtensions {
4844
4835
  /**
4845
4836
  * An object to hold reusable {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#callback-object Callback Objects}.
4846
4837
  */
@@ -4889,7 +4880,7 @@ interface ComponentsObject {
4889
4880
  * email: support@example.com
4890
4881
  * ```
4891
4882
  */
4892
- interface ContactObject {
4883
+ interface ContactObject extends SpecificationExtensions {
4893
4884
  /**
4894
4885
  * The email address of the contact person/organization. This MUST be in the form of an email address.
4895
4886
  */
@@ -4934,7 +4925,7 @@ interface DiscriminatorObject {
4934
4925
  * TODO: default values examples
4935
4926
  * TODO: examples
4936
4927
  */
4937
- interface EncodingObject {
4928
+ interface EncodingObject extends SpecificationExtensions {
4938
4929
  /**
4939
4930
  * When this is true, parameter values are serialized using reserved expansion, as defined by {@link https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.3 RFC6570}, which allows {@link https://datatracker.ietf.org/doc/html/rfc3986#section-2.2 RFC3986's reserved character set}, as well as percent-encoded triples, to pass through unchanged, while still percent-encoding all other disallowed characters (including `%` outside of percent-encoded triples). Applications are still responsible for percent-encoding reserved characters that are {@link https://datatracker.ietf.org/doc/html/rfc3986#section-3.4 not allowed in the query string} (`[`, `]`, `#`), or have a special meaning in `application/x-www-form-urlencoded` (`-`, `&`, `+`); see Appendices {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#appendix-c-using-rfc6570-based-serialization C} and {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#appendix-e-percent-encoding-and-form-media-types E} for details. The default value is `false`. This field SHALL be ignored if the request body media type is not `application/x-www-form-urlencoded`.
4940
4931
  */
@@ -4967,7 +4958,7 @@ interface EncodingObject {
4967
4958
  *
4968
4959
  * TODO: examples
4969
4960
  */
4970
- interface ExampleObject {
4961
+ interface ExampleObject extends SpecificationExtensions {
4971
4962
  /**
4972
4963
  * Long description for the example. {@link https://spec.commonmark.org/ CommonMark syntax} MAY be used for rich text representation.
4973
4964
  */
@@ -4997,7 +4988,7 @@ interface ExampleObject {
4997
4988
  * url: https://example.com
4998
4989
  * ```
4999
4990
  */
5000
- interface ExternalDocumentationObject {
4991
+ interface ExternalDocumentationObject extends SpecificationExtensions {
5001
4992
  /**
5002
4993
  * A description of the target documentation. {@link https://spec.commonmark.org/ CommonMark syntax} MAY be used for rich text representation.
5003
4994
  */
@@ -5039,7 +5030,7 @@ type HeaderObject = Omit<ParameterObject$1, 'in' | 'name'>;
5039
5030
  * version: 1.0.1
5040
5031
  * ```
5041
5032
  */
5042
- interface InfoObject$1 {
5033
+ interface InfoObject$1 extends SpecificationExtensions {
5043
5034
  /**
5044
5035
  * The contact information for the exposed API.
5045
5036
  */
@@ -5075,7 +5066,7 @@ interface InfoObject$1 {
5075
5066
  * url: https://www.apache.org/licenses/LICENSE-2.0.html
5076
5067
  * ```
5077
5068
  */
5078
- interface LicenseObject {
5069
+ interface LicenseObject extends SpecificationExtensions {
5079
5070
  /**
5080
5071
  * **REQUIRED**. The license name used for the API.
5081
5072
  */
@@ -5100,7 +5091,7 @@ interface LicenseObject {
5100
5091
  *
5101
5092
  * TODO: examples
5102
5093
  */
5103
- interface LinkObject {
5094
+ interface LinkObject extends SpecificationExtensions {
5104
5095
  /**
5105
5096
  * A description of the link. {@link https://spec.commonmark.org/ CommonMark syntax} MAY be used for rich text representation.
5106
5097
  */
@@ -5135,7 +5126,7 @@ interface LinkObject {
5135
5126
  *
5136
5127
  * TODO: examples
5137
5128
  */
5138
- interface MediaTypeObject {
5129
+ interface MediaTypeObject extends SpecificationExtensions {
5139
5130
  /**
5140
5131
  * A map between a property name and its encoding information. The key, being the property name, MUST exist in the schema as a property. The `encoding` field SHALL only apply to {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#request-body-object Request Body Objects}, and only when the media type is `multipart` or `application/x-www-form-urlencoded`. If no Encoding Object is provided for a property, the behavior is determined by the default values documented for the Encoding Object.
5141
5132
  */
@@ -5160,7 +5151,7 @@ interface MediaTypeObject {
5160
5151
  *
5161
5152
  * TODO: examples
5162
5153
  */
5163
- interface OAuthFlowObject {
5154
+ interface OAuthFlowObject extends SpecificationExtensions {
5164
5155
  /**
5165
5156
  * **REQUIRED (`"implicit"`, `"authorizationCode"`)**. The authorization URL to be used for this flow. This MUST be in the form of a URL. The OAuth2 standard requires the use of TLS.
5166
5157
  */
@@ -5183,7 +5174,7 @@ interface OAuthFlowObject {
5183
5174
  *
5184
5175
  * This object MAY be extended with {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#specification-extensions Specification Extensions}.
5185
5176
  */
5186
- interface OAuthFlowsObject {
5177
+ interface OAuthFlowsObject extends SpecificationExtensions {
5187
5178
  /**
5188
5179
  * Configuration for the OAuth Authorization Code flow. Previously called `accessCode` in OpenAPI 2.0.
5189
5180
  */
@@ -5208,7 +5199,7 @@ interface OAuthFlowsObject {
5208
5199
  *
5209
5200
  * TODO: examples
5210
5201
  */
5211
- interface OperationObject$1 {
5202
+ interface OperationObject$1 extends SpecificationExtensions {
5212
5203
  /**
5213
5204
  * A map of possible out-of band callbacks related to the parent operation. The key is a unique identifier for the Callback Object. Each value in the map is a {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#callback-object Callback Object} that describes a request that may be initiated by the API provider and the expected responses.
5214
5205
  */
@@ -5302,7 +5293,7 @@ interface OperationObject$1 {
5302
5293
  *
5303
5294
  * TODO: examples
5304
5295
  */
5305
- interface ParameterObject$1 {
5296
+ interface ParameterObject$1 extends SpecificationExtensions {
5306
5297
  /**
5307
5298
  * If `true`, clients MAY pass a zero-length string value in place of parameters that would otherwise be omitted entirely, which the server SHOULD interpret as the parameter being unused. Default value is `false`. If {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#parameter-style `style`} is used, and if {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#style-examples behavior is _n/a_ (cannot be serialized)}, the value of `allowEmptyValue` SHALL be ignored. Interactions between this field and the parameter's {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#schema-object Schema Object} are implementation-defined. This field is valid only for `query` parameters. Use of this field is NOT RECOMMENDED, and it is likely to be removed in a later revision.
5308
5299
  */
@@ -5366,7 +5357,7 @@ interface ParameterObject$1 {
5366
5357
  *
5367
5358
  * TODO: examples
5368
5359
  */
5369
- interface PathItemObject {
5360
+ interface PathItemObject extends SpecificationExtensions {
5370
5361
  /**
5371
5362
  * Allows for a referenced definition of this path item. The value MUST be in the form of a URL, and the referenced structure MUST be in the form of a {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#path-item-object Path Item Object}. In case a Path Item Object field appears both in the defined object and the referenced object, the behavior is undefined. See the rules for resolving {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#relative-references-in-urls Relative References}.
5372
5363
  */
@@ -5427,7 +5418,7 @@ interface PathItemObject {
5427
5418
  *
5428
5419
  * TODO: examples
5429
5420
  */
5430
- interface PathsObject {
5421
+ interface PathsObject extends SpecificationExtensions {
5431
5422
  /**
5432
5423
  * A relative path to an individual endpoint. The field name MUST begin with a forward slash (`/`). The path is **appended** (no relative URL resolution) to the expanded URL from the {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#server-object Server Object}'s `url` field in order to construct the full URL. {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#path-templating Path templating} is allowed. When matching URLs, concrete (non-templated) paths would be matched before their templated counterparts. Templated paths with the same hierarchy but different templated names MUST NOT exist as they are identical. In case of ambiguous matching, it's up to the tooling to decide which one to use.
5433
5424
  */
@@ -5473,7 +5464,7 @@ interface ReferenceObject$2 {
5473
5464
  *
5474
5465
  * TODO: examples
5475
5466
  */
5476
- interface RequestBodyObject$1 {
5467
+ interface RequestBodyObject$1 extends SpecificationExtensions {
5477
5468
  /**
5478
5469
  * **REQUIRED**. The content of the request body. The key is a media type or {@link https://tools.ietf.org/html/rfc7231#appendix-D media type range} and the value describes it. For requests that match multiple keys, only the most specific key is applicable. e.g. `"text/plain"` overrides `"text/*"`
5479
5470
  */
@@ -5494,7 +5485,7 @@ interface RequestBodyObject$1 {
5494
5485
  *
5495
5486
  * TODO: examples
5496
5487
  */
5497
- interface ResponseObject$1 {
5488
+ interface ResponseObject$1 extends SpecificationExtensions {
5498
5489
  /**
5499
5490
  * A map containing descriptions of potential response payloads. The key is a media type or {@link https://tools.ietf.org/html/rfc7231#appendix-D media type range} and the value describes it. For responses that match multiple keys, only the most specific key is applicable. e.g. `"text/plain"` overrides `"text/*"`
5500
5491
  */
@@ -5525,11 +5516,11 @@ interface ResponseObject$1 {
5525
5516
  *
5526
5517
  * TODO: examples
5527
5518
  */
5528
- interface ResponsesObject {
5519
+ interface ResponsesObject extends SpecificationExtensions {
5529
5520
  /**
5530
5521
  * Any {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#http-status-codes HTTP status code} can be used as the property name, but only one property per code, to describe the expected response for that HTTP status code. A {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#reference-object Reference Object} can link to a response that is defined in the {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#components-responses OpenAPI Object's `components.responses`} section. This field MUST be enclosed in quotation marks (for example, "200") for compatibility between JSON and YAML. To define a range of response codes, this field MAY contain the uppercase wildcard character `X`. For example, `2XX` represents all response codes between `200` and `299`. Only the following range definitions are allowed: `1XX`, `2XX`, `3XX`, `4XX`, and `5XX`. If a response is defined using an explicit code, the explicit code definition takes precedence over the range definition for that code.
5531
5522
  */
5532
- [httpStatusCode: string]: ResponseObject$1 | ReferenceObject$2 | undefined;
5523
+ [httpStatusCode: string]: ResponseObject$1 | ReferenceObject$2 | undefined | unknown;
5533
5524
  /**
5534
5525
  * The documentation of responses other than the ones declared for specific HTTP response codes. Use this field to cover undeclared responses. A {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#reference-object Reference Object} can link to a response that the {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#components-responses OpenAPI Object's `components.responses`} section defines.
5535
5526
  */
@@ -5586,7 +5577,7 @@ interface ResponsesObject {
5586
5577
  *
5587
5578
  * TODO: content, examples
5588
5579
  */
5589
- interface SchemaObject$1 extends EnumExtensions {
5580
+ interface SchemaObject$1 extends EnumExtensions, SpecificationExtensions {
5590
5581
  /**
5591
5582
  * The value of "additionalProperties" MUST be a boolean or a schema.
5592
5583
  *
@@ -5837,7 +5828,7 @@ interface SecurityRequirementObject {
5837
5828
  *
5838
5829
  * TODO: examples
5839
5830
  */
5840
- type SecuritySchemeObject = {
5831
+ type SecuritySchemeObject = SpecificationExtensions & {
5841
5832
  /**
5842
5833
  * A description for security scheme. {@link https://spec.commonmark.org/ CommonMark syntax} MAY be used for rich text representation.
5843
5834
  */
@@ -5894,7 +5885,7 @@ type SecuritySchemeObject = {
5894
5885
  *
5895
5886
  * TODO: examples
5896
5887
  */
5897
- interface ServerObject {
5888
+ interface ServerObject extends SpecificationExtensions {
5898
5889
  /**
5899
5890
  * An optional string describing the host designated by the URL. {@link https://spec.commonmark.org/ CommonMark syntax} MAY be used for rich text representation.
5900
5891
  */
@@ -5913,7 +5904,7 @@ interface ServerObject {
5913
5904
  *
5914
5905
  * This object MAY be extended with {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#specification-extensions Specification Extensions}.
5915
5906
  */
5916
- interface ServerVariableObject {
5907
+ interface ServerVariableObject extends SpecificationExtensions {
5917
5908
  /**
5918
5909
  * **REQUIRED**. The default value to use for substitution, which SHALL be sent if an alternate value is _not_ supplied. If the {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#server-variable-enum `enum`} is defined, the value SHOULD exist in the enum's values. Note that this behavior is different from the {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#schema-object Schema Object}'s `default` keyword, which documents the receiver's behavior rather than inserting the value into the data.
5919
5910
  */
@@ -5939,7 +5930,7 @@ interface ServerVariableObject {
5939
5930
  * description: Pets operations
5940
5931
  * ```
5941
5932
  */
5942
- interface TagObject {
5933
+ interface TagObject extends SpecificationExtensions {
5943
5934
  /**
5944
5935
  * A description for the tag. {@link https://spec.commonmark.org/ CommonMark syntax} MAY be used for rich text representation.
5945
5936
  */
@@ -5967,7 +5958,7 @@ interface TagObject {
5967
5958
  *
5968
5959
  * TODO: examples
5969
5960
  */
5970
- interface XMLObject {
5961
+ interface XMLObject extends SpecificationExtensions {
5971
5962
  /**
5972
5963
  * Declares whether the property definition translates to an attribute instead of an element. Default value is `false`.
5973
5964
  */
@@ -6283,10 +6274,8 @@ type Config$13 = Plugin.Name<'@hey-api/sdk'> & Plugin.Hooks & {
6283
6274
  * Set `instance` to create an instantiable SDK. Using `true` will use the
6284
6275
  * default instance name; in practice, you want to define your own by passing
6285
6276
  * a string value.
6286
- *
6287
- * @default false
6288
6277
  */
6289
- instance: string | boolean;
6278
+ instance: string;
6290
6279
  /**
6291
6280
  * Customise the name of methods within the service. By default,
6292
6281
  * {@link IR.OperationObject.id} is used.
@@ -6378,608 +6367,874 @@ type HeyApiSdkPlugin = DefinePlugin<UserConfig$14, Config$13>;
6378
6367
  //#endregion
6379
6368
  //#region src/ts-dsl/base.d.ts
6380
6369
  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;
6370
+ declare abstract class TsDsl<T extends ts.Node = ts.Node> implements Node<T> {
6371
+ analyze(_: AnalysisContext): void;
6372
+ exported?: boolean;
6373
+ file?: File;
6374
+ language: Language;
6375
+ parent?: Node;
6376
+ root?: Node;
6377
+ symbol?: Symbol;
6378
+ toAst(_: AstContext): T;
6379
+ readonly '~brand' = "heyapi.node";
6380
+ /** Branding property to identify the DSL class at runtime. */
6381
+ abstract readonly '~dsl': string;
6386
6382
  /** 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;
6383
+ $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;
6384
+ $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;
6385
+ $if<T extends TsDsl, V, R extends TsDsl = T>(this: T, value: V, ifTrue: () => R | void, ifFalse?: () => R | void): R | T;
6390
6386
  protected $maybeId<T extends string | ts.Expression>(expr: T): T extends string ? ts.Identifier : T;
6391
- protected $node<I>(value: I): NodeOfMaybe<I>;
6392
- protected $type<I>(value: I, args?: ReadonlyArray<ts.TypeNode>): TypeOfMaybe<I>;
6393
- protected unwrap<I>(value: I): I extends TsDsl<infer N> ? N : I;
6387
+ protected $node<I>(ctx: AstContext, value: I): NodeOfMaybe<I>;
6388
+ protected $type<I>(ctx: AstContext, value: I, args?: ReadonlyArray<ts.TypeNode>): TypeOfMaybe<I>;
6389
+ /** Unwraps nested nodes into raw TypeScript AST. */
6390
+ private unwrap;
6394
6391
  }
6395
- type NodeOfMaybe<I> = undefined extends I ? NodeOf<NonNullable<I>> | undefined : NodeOf<I>;
6392
+ type NodeOfMaybe<I> = undefined extends I ? NodeOf<NonNullable<FromRef<I>>> | undefined : NodeOf<FromRef<I>>;
6396
6393
  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
6394
  type MaybeTsDsl<T> = T extends TsDsl<infer U> ? U | TsDsl<U> : T extends ts.Node ? T | TsDsl<T> : never;
6398
6395
  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>;
6396
+ type TypeOfMaybe<I> = undefined extends I ? TypeOf<NonNullable<FromRef<I>>> | undefined : TypeOf<FromRef<I>>;
6400
6397
  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
6398
  //#endregion
6402
- //#region src/ts-dsl/layout/newline.d.ts
6403
- declare class NewlineTsDsl extends TsDsl<ts.Identifier> {
6404
- $render(): ts.Identifier;
6399
+ //#region src/ts-dsl/mixins/types.d.ts
6400
+ type BaseCtor<T> = abstract new (...args: Array<any>) => TsDsl<T>;
6401
+ type DropFirst<T extends Array<any>> = T extends [any, ...infer Rest] ? Rest : never;
6402
+ type MixinCtor<T extends BaseCtor<any>, K$1> = abstract new (...args: Array<any>) => InstanceType<T> & K$1;
6403
+ //#endregion
6404
+ //#region src/ts-dsl/mixins/optional.d.ts
6405
+ interface OptionalMethods extends Node {
6406
+ _optional?: boolean;
6407
+ /** Marks the node as optional when the condition is true. */
6408
+ optional(condition?: boolean): this;
6409
+ /** Marks the node as required when the condition is true. */
6410
+ required(condition?: boolean): this;
6411
+ }
6412
+ //#endregion
6413
+ //#region src/ts-dsl/mixins/as.d.ts
6414
+ interface AsMethods extends Node {
6415
+ /** Creates an `as` type assertion expression (e.g. `value as Type`). */
6416
+ as(...args: DropFirst<Parameters<typeof f.as>>): ReturnType<typeof f.as>;
6417
+ }
6418
+ //#endregion
6419
+ //#region src/ts-dsl/expr/binary.d.ts
6420
+ type Expr$3 = Symbol | string | MaybeTsDsl<ts.Expression>;
6421
+ type Op$1 = Operator | ts.BinaryOperator;
6422
+ type Operator = '!=' | '!==' | '&&' | '*' | '+' | '-' | '/' | '<' | '<=' | '=' | '==' | '===' | '>' | '>=' | '??' | '??=' | '||';
6423
+ declare const Mixed$52: MixinCtor<MixinCtor<abstract new () => TsDsl<ts.BinaryExpression>, ExprMethods>, AsMethods>;
6424
+ declare class BinaryTsDsl extends Mixed$52 {
6425
+ readonly '~dsl' = "BinaryTsDsl";
6426
+ protected _base: Ref<Expr$3>;
6427
+ protected _expr?: Ref<Expr$3>;
6428
+ protected _op?: Op$1;
6429
+ constructor(base: Expr$3, op?: Op$1, expr?: Expr$3);
6430
+ analyze(ctx: AnalysisContext): void;
6431
+ /** Logical AND — `this && expr` */
6432
+ and(expr: Expr$3): this;
6433
+ /** Creates an assignment expression (e.g. `this = expr`). */
6434
+ assign(expr: Expr$3): this;
6435
+ /** Nullish coalescing — `this ?? expr` */
6436
+ coalesce(expr: Expr$3): this;
6437
+ /** Division — `this / expr` */
6438
+ div(expr: Expr$3): this;
6439
+ /** Strict equality — `this === expr` */
6440
+ eq(expr: Expr$3): this;
6441
+ /** Greater than — `this > expr` */
6442
+ gt(expr: Expr$3): this;
6443
+ /** Greater than or equal — `this >= expr` */
6444
+ gte(expr: Expr$3): this;
6445
+ /** Loose equality — `this == expr` */
6446
+ looseEq(expr: Expr$3): this;
6447
+ /** Loose inequality — `this != expr` */
6448
+ looseNeq(expr: Expr$3): this;
6449
+ /** Less than — `this < expr` */
6450
+ lt(expr: Expr$3): this;
6451
+ /** Less than or equal — `this <= expr` */
6452
+ lte(expr: Expr$3): this;
6453
+ /** Subtraction — `this - expr` */
6454
+ minus(expr: Expr$3): this;
6455
+ /** Strict inequality — `this !== expr` */
6456
+ neq(expr: Expr$3): this;
6457
+ /** Nullish assignment — `this ??= expr` */
6458
+ nullishAssign(expr: Expr$3): this;
6459
+ /** Logical OR — `this || expr` */
6460
+ or(expr: Expr$3): this;
6461
+ /** Addition — `this + expr` */
6462
+ plus(expr: Expr$3): this;
6463
+ /** Multiplication — `this * expr` */
6464
+ times(expr: Expr$3): this;
6465
+ toAst(ctx: AstContext): ts.BinaryExpression;
6466
+ /** Sets the binary operator and right-hand operand for this expression. */
6467
+ private opAndExpr;
6468
+ private opToToken;
6469
+ }
6470
+ //#endregion
6471
+ //#region src/ts-dsl/mixins/operator.d.ts
6472
+ type Expr$2 = Symbol | string | MaybeTsDsl<ts.Expression>;
6473
+ interface OperatorMethods extends Node {
6474
+ /** Logical AND — `this && expr` */
6475
+ and(expr: Expr$2): BinaryTsDsl;
6476
+ /** Creates an assignment expression (e.g. `this = expr`). */
6477
+ assign(expr: Expr$2): BinaryTsDsl;
6478
+ /** Nullish coalescing — `this ?? expr` */
6479
+ coalesce(expr: Expr$2): BinaryTsDsl;
6480
+ /** Division — `this / expr` */
6481
+ div(expr: Expr$2): BinaryTsDsl;
6482
+ /** Strict equality — `this === expr` */
6483
+ eq(expr: Expr$2): BinaryTsDsl;
6484
+ /** Greater than — `this > expr` */
6485
+ gt(expr: Expr$2): BinaryTsDsl;
6486
+ /** Greater than or equal — `this >= expr` */
6487
+ gte(expr: Expr$2): BinaryTsDsl;
6488
+ /** Loose equality — `this == expr` */
6489
+ looseEq(expr: Expr$2): BinaryTsDsl;
6490
+ /** Loose inequality — `this != expr` */
6491
+ looseNeq(expr: Expr$2): BinaryTsDsl;
6492
+ /** Less than — `this < expr` */
6493
+ lt(expr: Expr$2): BinaryTsDsl;
6494
+ /** Less than or equal — `this <= expr` */
6495
+ lte(expr: Expr$2): BinaryTsDsl;
6496
+ /** Subtraction — `this - expr` */
6497
+ minus(expr: Expr$2): BinaryTsDsl;
6498
+ /** Strict inequality — `this !== expr` */
6499
+ neq(expr: Expr$2): BinaryTsDsl;
6500
+ /** Nullish assignment — `this ??= expr` */
6501
+ nullishAssign(expr: Expr$2): BinaryTsDsl;
6502
+ /** Logical OR — `this || expr` */
6503
+ or(expr: Expr$2): BinaryTsDsl;
6504
+ /** Addition — `this + expr` */
6505
+ plus(expr: Expr$2): BinaryTsDsl;
6506
+ /** Multiplication — `this * expr` */
6507
+ times(expr: Expr$2): BinaryTsDsl;
6508
+ }
6509
+ //#endregion
6510
+ //#region src/ts-dsl/expr/attr.d.ts
6511
+ type AttrLeft = Symbol | string | MaybeTsDsl<ts.Expression>;
6512
+ type AttrRight = Symbol | string | ts.MemberName | number;
6513
+ type AttrCtor = (left: AttrLeft, right: AttrRight) => AttrTsDsl;
6514
+ declare const Mixed$51: MixinCtor<MixinCtor<MixinCtor<MixinCtor<abstract new () => TsDsl<ts.PropertyAccessExpression | ts.ElementAccessExpression>, OptionalMethods>, OperatorMethods>, ExprMethods>, AsMethods>;
6515
+ declare class AttrTsDsl extends Mixed$51 {
6516
+ readonly '~dsl' = "AttrTsDsl";
6517
+ protected left: Ref<AttrLeft>;
6518
+ protected right: Ref<AttrRight>;
6519
+ constructor(left: AttrLeft, right: AttrRight);
6520
+ analyze(ctx: AnalysisContext): void;
6521
+ toAst(ctx: AstContext): ts.PropertyAccessExpression | ts.ElementAccessExpression;
6522
+ }
6523
+ //#endregion
6524
+ //#region src/ts-dsl/expr/await.d.ts
6525
+ type AwaitExpr = Symbol | string | MaybeTsDsl<ts.Expression>;
6526
+ type AwaitCtor = (expr: AwaitExpr) => AwaitTsDsl;
6527
+ declare const Mixed$50: MixinCtor<abstract new () => TsDsl<ts.AwaitExpression>, ExprMethods>;
6528
+ declare class AwaitTsDsl extends Mixed$50 {
6529
+ readonly '~dsl' = "AwaitTsDsl";
6530
+ protected _awaitExpr: Ref<AwaitExpr>;
6531
+ constructor(expr: AwaitExpr);
6532
+ analyze(ctx: AnalysisContext): void;
6533
+ toAst(ctx: AstContext): ts.AwaitExpression;
6534
+ }
6535
+ //#endregion
6536
+ //#region src/ts-dsl/mixins/type-args.d.ts
6537
+ type Arg$1 = Symbol | string | MaybeTsDsl<TypeTsDsl>;
6538
+ interface TypeArgsMethods extends Node {
6539
+ /** Returns the type arguments as an array of ts.TypeNode nodes. */
6540
+ $generics(ctx: AstContext): ReadonlyArray<ts.TypeNode> | undefined;
6541
+ /** Adds a single type argument (e.g. `string` in `Foo<string>`). */
6542
+ generic(arg: Arg$1): this;
6543
+ /** Adds type arguments (e.g. `Map<string, number>`). */
6544
+ generics(...args: ReadonlyArray<Arg$1>): this;
6405
6545
  }
6406
6546
  //#endregion
6407
6547
  //#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>>;
6548
+ type Arg = Symbol | string | MaybeTsDsl<ts.Expression>;
6549
+ interface ArgsMethods extends Node {
6550
+ /** Renders the arguments into an array of `Expression`s. */
6551
+ $args(ctx: AstContext): ReadonlyArray<ts.Expression>;
6413
6552
  /** Adds a single expression argument. */
6414
- arg(arg: string | MaybeTsDsl<ts.Expression>): this;
6553
+ arg(arg: Arg | undefined): this;
6415
6554
  /** 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;
6555
+ args(...args: ReadonlyArray<Arg | undefined>): this;
6420
6556
  }
6421
6557
  //#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;
6558
+ //#region src/ts-dsl/expr/call.d.ts
6559
+ type CallCallee = string | MaybeTsDsl<ts.Expression>;
6560
+ type CallArg = Symbol | string | MaybeTsDsl<ts.Expression>;
6561
+ type CallArgs = ReadonlyArray<CallArg | undefined>;
6562
+ type CallCtor = (callee: CallCallee, ...args: CallArgs) => CallTsDsl;
6563
+ declare const Mixed$49: MixinCtor<MixinCtor<MixinCtor<MixinCtor<abstract new () => TsDsl<ts.CallExpression>, TypeArgsMethods>, ExprMethods>, AsMethods>, ArgsMethods>;
6564
+ declare class CallTsDsl extends Mixed$49 {
6565
+ readonly '~dsl' = "CallTsDsl";
6566
+ protected _callee: CallCallee;
6567
+ constructor(callee: CallCallee, ...args: CallArgs);
6568
+ analyze(ctx: AnalysisContext): void;
6569
+ toAst(ctx: AstContext): ts.CallExpression;
6427
6570
  }
6428
- interface DecoratorTsDsl extends ArgsMixin {}
6429
6571
  //#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;
6572
+ //#region src/ts-dsl/expr/typeof.d.ts
6573
+ type TypeOfExpr = string | MaybeTsDsl<ts.Expression>;
6574
+ type TypeOfExprCtor = (expr: TypeOfExpr) => TypeOfExprTsDsl;
6575
+ declare const Mixed$48: MixinCtor<abstract new () => TsDsl<ts.TypeOfExpression>, OperatorMethods>;
6576
+ declare class TypeOfExprTsDsl extends Mixed$48 {
6577
+ readonly '~dsl' = "TypeOfExprTsDsl";
6578
+ protected _expr: TypeOfExpr;
6579
+ constructor(expr: TypeOfExpr);
6580
+ analyze(ctx: AnalysisContext): void;
6581
+ toAst(ctx: AstContext): ts.TypeOfExpression;
6438
6582
  }
6439
6583
  //#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;
6584
+ //#region src/ts-dsl/stmt/return.d.ts
6585
+ type ReturnExpr = Symbol | string | MaybeTsDsl<ts.Expression>;
6586
+ type ReturnCtor = (expr?: ReturnExpr) => ReturnTsDsl;
6587
+ declare const Mixed$47: abstract new () => TsDsl<ts.ReturnStatement>;
6588
+ declare class ReturnTsDsl extends Mixed$47 {
6589
+ readonly '~dsl' = "ReturnTsDsl";
6590
+ protected _returnExpr?: Ref<ReturnExpr>;
6591
+ constructor(expr?: ReturnExpr);
6592
+ analyze(ctx: AnalysisContext): void;
6593
+ toAst(ctx: AstContext): ts.ReturnStatement;
6447
6594
  }
6448
6595
  //#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;
6596
+ //#region src/ts-dsl/mixins/type-expr.d.ts
6597
+ interface TypeExprMethods extends Node {
6598
+ /** Creates an indexed-access type (e.g. `Foo<T>[K]`). */
6599
+ idx(this: Parameters<typeof f.type.idx>[0], ...args: DropFirst<Parameters<typeof f.type.idx>>): ReturnType<typeof f.type.idx>;
6600
+ /** Shorthand: builds `keyof T`. */
6601
+ keyof(this: MaybeTsDsl<TypeTsDsl>): ReturnType<typeof f.type.operator>;
6602
+ /** Shorthand: builds `readonly T`. */
6603
+ readonly(this: MaybeTsDsl<TypeTsDsl>): ReturnType<typeof f.type.operator>;
6604
+ /** Create a TypeExpr node representing ReturnType<this>. */
6605
+ returnType(this: Parameters<typeof f.type.query>[0], ...args: DropFirst<Parameters<typeof f.type.query>>): ReturnType<typeof f.type.expr>;
6606
+ /** Create a TypeOfExpr node representing typeof this. */
6607
+ typeofExpr(this: Parameters<typeof f.typeofExpr>[0], ...args: DropFirst<Parameters<typeof f.typeofExpr>>): ReturnType<typeof f.typeofExpr>;
6608
+ /** Create a TypeQuery node representing typeof this. */
6609
+ typeofType(this: Parameters<typeof f.type.query>[0], ...args: DropFirst<Parameters<typeof f.type.query>>): ReturnType<typeof f.type.query>;
6610
+ /** Shorthand: builds `unique T`. */
6611
+ unique(this: MaybeTsDsl<TypeTsDsl>): ReturnType<typeof f.type.operator>;
6612
+ }
6613
+ //#endregion
6614
+ //#region src/ts-dsl/type/attr.d.ts
6615
+ type Base$2 = Symbol | string | MaybeTsDsl<ts.EntityName>;
6616
+ type Right = Symbol | string | ts.Identifier;
6617
+ declare const Mixed$46: MixinCtor<abstract new () => TsDsl<ts.QualifiedName>, TypeExprMethods>;
6618
+ declare class TypeAttrTsDsl extends Mixed$46 {
6619
+ readonly '~dsl' = "TypeAttrTsDsl";
6620
+ protected _base?: Ref<Base$2>;
6621
+ protected _right: Ref<Right>;
6622
+ constructor(base: Base$2 | Ref<Base$2>, right: string | ts.Identifier);
6623
+ constructor(right: Right);
6624
+ analyze(ctx: AnalysisContext): void;
6625
+ base(base?: Base$2 | Ref<Base$2>): this;
6626
+ right(right: Right): this;
6627
+ toAst(ctx: AstContext): ts.QualifiedName;
6628
+ }
6629
+ //#endregion
6630
+ //#region src/ts-dsl/type/expr.d.ts
6631
+ type TypeExprName = Symbol | string;
6632
+ type TypeExprExpr = TypeExprName | TypeAttrTsDsl;
6633
+ type TypeExprFn = (t: TypeExprTsDsl) => void;
6634
+ type TypeExprCtor = (nameOrFn?: TypeExprName | TypeExprFn, fn?: TypeExprFn) => TypeExprTsDsl;
6635
+ declare const Mixed$45: MixinCtor<MixinCtor<abstract new () => TsDsl<ts.TypeReferenceNode>, TypeExprMethods>, TypeArgsMethods>;
6636
+ declare class TypeExprTsDsl extends Mixed$45 {
6637
+ readonly '~dsl' = "TypeExprTsDsl";
6638
+ protected _exprInput?: Ref<TypeExprExpr>;
6639
+ constructor();
6640
+ constructor(fn: TypeExprFn);
6641
+ constructor(name: TypeExprName);
6642
+ constructor(name: TypeExprName, fn?: TypeExprFn);
6643
+ analyze(ctx: AnalysisContext): void;
6644
+ /** Accesses a nested type (e.g. `Foo.Bar`). */
6645
+ attr(right: string | ts.Identifier | TypeAttrTsDsl): this;
6646
+ toAst(ctx: AstContext): ts.TypeReferenceNode;
6647
+ }
6648
+ //#endregion
6649
+ //#region src/ts-dsl/type/idx.d.ts
6650
+ type Base$1 = string | MaybeTsDsl<ts.TypeNode>;
6651
+ type Index = string | number | MaybeTsDsl<ts.TypeNode>;
6652
+ type TypeIdxCtor = (base: Base$1, index: Index) => TypeIdxTsDsl;
6653
+ declare const Mixed$44: MixinCtor<abstract new () => TsDsl<ts.IndexedAccessTypeNode>, TypeExprMethods>;
6654
+ declare class TypeIdxTsDsl extends Mixed$44 {
6655
+ readonly '~dsl' = "TypeIdxTsDsl";
6656
+ protected _base: Base$1;
6657
+ protected _index: Index;
6658
+ constructor(base: Base$1, index: Index);
6659
+ analyze(ctx: AnalysisContext): void;
6660
+ base(base: Base$1): this;
6661
+ index(index: Index): this;
6662
+ toAst(ctx: AstContext): ts.IndexedAccessTypeNode;
6663
+ }
6664
+ //#endregion
6665
+ //#region src/ts-dsl/type/operator.d.ts
6666
+ type Op = ts.SyntaxKind.KeyOfKeyword | ts.SyntaxKind.ReadonlyKeyword | ts.SyntaxKind.UniqueKeyword;
6667
+ type Type$2 = string | MaybeTsDsl<ts.TypeNode>;
6668
+ type TypeOperatorCtor = () => TypeOperatorTsDsl;
6669
+ declare const Mixed$43: abstract new () => TsDsl<ts.TypeOperatorNode>;
6670
+ /**
6671
+ * Builds a TypeScript `TypeOperatorNode`, such as:
6672
+ *
6673
+ * - `keyof T`
6674
+ * - `readonly U`
6675
+ * - `unique V`
6676
+ *
6677
+ * This DSL provides both a generic `.operator()` API and convenient
6678
+ * shorthand methods (`.keyof()`, `.readonly()`, `.unique()`).
6679
+ *
6680
+ * The node will throw during render if required fields are missing.
6681
+ */
6682
+ declare class TypeOperatorTsDsl extends Mixed$43 {
6683
+ readonly '~dsl' = "TypeOperatorTsDsl";
6684
+ protected _op?: Op;
6685
+ protected _type?: Type$2;
6686
+ analyze(ctx: AnalysisContext): void;
6687
+ /** Shorthand: builds `keyof T`. */
6688
+ keyof(type: Type$2): this;
6689
+ /** Sets the operator explicitly. */
6690
+ operator(op: Op): this;
6691
+ /** Shorthand: builds `readonly T`. */
6692
+ readonly(type: Type$2): this;
6693
+ /** Sets the target type of the operator. */
6694
+ type(type: Type$2): this;
6695
+ /** Shorthand: builds `unique T`. */
6696
+ unique(type: Type$2): this;
6697
+ toAst(ctx: AstContext): ts.TypeOperatorNode;
6698
+ /** Throws if required fields are not set. */
6699
+ $validate(): asserts this is this & {
6700
+ _op: Op;
6701
+ _type: Type$2;
6455
6702
  };
6456
- } & TBase;
6457
- type DocMixin = InstanceType<ReturnType<typeof DocMixin>>;
6703
+ private missingRequiredCalls;
6704
+ }
6705
+ //#endregion
6706
+ //#region src/ts-dsl/type/query.d.ts
6707
+ type TypeQueryExpr = string | MaybeTsDsl<TypeTsDsl | ts.Expression>;
6708
+ type TypeQueryCtor = (expr: TypeQueryExpr) => TypeQueryTsDsl;
6709
+ declare const Mixed$42: MixinCtor<abstract new () => TsDsl<ts.TypeQueryNode>, TypeExprMethods>;
6710
+ declare class TypeQueryTsDsl extends Mixed$42 {
6711
+ readonly '~dsl' = "TypeQueryTsDsl";
6712
+ protected _expr: TypeQueryExpr;
6713
+ constructor(expr: TypeQueryExpr);
6714
+ analyze(ctx: AnalysisContext): void;
6715
+ toAst(ctx: AstContext): ts.TypeQueryNode;
6716
+ }
6717
+ //#endregion
6718
+ //#region src/ts-dsl/utils/factories.d.ts
6719
+ type Ctor = (...args: Array<any>) => any;
6720
+ type Factory<T extends Ctor> = {
6721
+ (...args: Parameters<T>): ReturnType<T>;
6722
+ /** Sets the implementation of this factory. */
6723
+ set(fn: T): void;
6724
+ };
6725
+ declare const f: {
6726
+ /** Factory for creating `as` type assertion expressions (e.g. `value as Type`). */
6727
+ as: Factory<AsCtor>;
6728
+ /** Factory for creating property access expressions (e.g. `obj.foo`). */
6729
+ attr: Factory<AttrCtor>;
6730
+ /** Factory for creating await expressions (e.g. `await promise`). */
6731
+ await: Factory<AwaitCtor>;
6732
+ /** Factory for creating function or method call expressions (e.g. `fn(arg)`). */
6733
+ call: Factory<CallCtor>;
6734
+ /** Factory for creating return statements. */
6735
+ return: Factory<ReturnCtor>;
6736
+ /** Factories for creating type nodes. */
6737
+ type: {
6738
+ /** Factory for creating basic type references or type expressions (e.g. Foo or Foo<T>). */
6739
+ expr: Factory<TypeExprCtor>;
6740
+ /** Factory for creating indexed-access types (e.g. `Foo<T>[K]`). */
6741
+ idx: Factory<TypeIdxCtor>;
6742
+ /** Factory for creating type operator nodes (e.g. `readonly T`, `keyof T`, `unique T`). */
6743
+ operator: Factory<TypeOperatorCtor>;
6744
+ /** Factory for creating type query nodes (e.g. `typeof Foo`). */
6745
+ query: Factory<TypeQueryCtor>;
6746
+ };
6747
+ /** Factory for creating `typeof` expressions (e.g. `typeof value`). */
6748
+ typeofExpr: Factory<TypeOfExprCtor>;
6749
+ };
6750
+ //#endregion
6751
+ //#region src/ts-dsl/mixins/expr.d.ts
6752
+ interface ExprMethods extends Node {
6753
+ /** Accesses a property on the current expression (e.g. `this.foo`). */
6754
+ attr(...args: DropFirst<Parameters<typeof f.attr>>): ReturnType<typeof f.attr>;
6755
+ /** Awaits the current expression (e.g. `await expr`). */
6756
+ await(): ReturnType<typeof f.await>;
6757
+ /** Calls the current expression (e.g. `fn(arg1, arg2)`). */
6758
+ call(...args: DropFirst<Parameters<typeof f.call>>): ReturnType<typeof f.call>;
6759
+ /** Produces a `return` statement returning the current expression. */
6760
+ return(): ReturnType<typeof f.return>;
6761
+ }
6762
+ //#endregion
6763
+ //#region src/ts-dsl/expr/as.d.ts
6764
+ type AsExpr = Symbol | string | MaybeTsDsl<ts.Expression>;
6765
+ type AsType = Symbol | string | TypeTsDsl;
6766
+ type AsCtor = (expr: AsExpr, type: AsType) => AsTsDsl;
6767
+ declare const Mixed$41: MixinCtor<MixinCtor<abstract new () => TsDsl<ts.AsExpression>, ExprMethods>, AsMethods>;
6768
+ declare class AsTsDsl extends Mixed$41 {
6769
+ readonly '~dsl' = "AsTsDsl";
6770
+ protected expr: Ref<AsExpr>;
6771
+ protected type: Ref<AsType>;
6772
+ constructor(expr: AsExpr, type: AsType);
6773
+ analyze(ctx: AnalysisContext): void;
6774
+ toAst(ctx: AstContext): ts.AsExpression;
6775
+ }
6776
+ //#endregion
6777
+ //#region src/ts-dsl/mixins/value.d.ts
6778
+ type ValueExpr = string | MaybeTsDsl<ts.Expression>;
6779
+ interface ValueMethods extends Node {
6780
+ $value(ctx: AstContext): ts.Expression | undefined;
6781
+ /** Sets the initializer expression (e.g. `= expr`). */
6782
+ assign(expr: ValueExpr): this;
6783
+ }
6784
+ //#endregion
6785
+ //#region src/ts-dsl/mixins/pattern.d.ts
6786
+ interface PatternMethods extends Node {
6787
+ /** Renders the pattern into a `BindingName`. */
6788
+ $pattern(ctx: AstContext): ts.BindingName | undefined;
6789
+ /** Defines an array binding pattern. */
6790
+ array(...props: ReadonlyArray<string> | [ReadonlyArray<string>]): this;
6791
+ /** Defines an object binding pattern. */
6792
+ object(...props: ReadonlyArray<MaybeArray$1<string> | Record<string, string>>): this;
6793
+ /** Adds a spread element (e.g. `...args`, `...options`) to the pattern. */
6794
+ spread(name: string): this;
6795
+ }
6796
+ //#endregion
6797
+ //#region src/ts-dsl/layout/hint.d.ts
6798
+ type HintMaybeLazy<T> = ((ctx: AstContext) => T) | T;
6799
+ type HintFn = (d: HintTsDsl) => void;
6800
+ type HintLines = HintMaybeLazy<MaybeArray$1<string>>;
6801
+ declare class HintTsDsl extends TsDsl<ts.Node> {
6802
+ readonly '~dsl' = "HintTsDsl";
6803
+ protected _lines: Array<HintLines>;
6804
+ constructor(lines?: HintLines, fn?: HintFn);
6805
+ analyze(ctx: AnalysisContext): void;
6806
+ add(lines: HintLines): this;
6807
+ apply<T extends ts.Node>(ctx: AstContext, node: T): T;
6808
+ toAst(ctx: AstContext): ts.Node;
6809
+ }
6810
+ //#endregion
6811
+ //#region src/ts-dsl/mixins/hint.d.ts
6812
+ interface HintMethods extends Node {
6813
+ $hint<T extends ts.Node>(ctx: AstContext, node: T): T;
6814
+ hint(lines?: HintLines, fn?: HintFn): this;
6815
+ }
6458
6816
  //#endregion
6459
6817
  //#region src/ts-dsl/mixins/modifiers.d.ts
6460
- type Target = object & {
6461
- _m?(kind: ts.ModifierSyntaxKind, condition?: boolean): unknown;
6818
+ type Modifiers = {
6819
+ modifiers: Array<ts.Modifier>;
6462
6820
  };
6463
- /**
6464
- * Mixin that adds an `abstract` modifier to a node.
6465
- */
6466
- declare class AbstractMixin {
6821
+ interface AbstractMethods extends Modifiers {
6467
6822
  /**
6468
6823
  * Adds the `abstract` keyword modifier if the condition is true.
6469
6824
  *
6470
6825
  * @param condition - Whether to add the modifier (default: true).
6471
6826
  * @returns The target object for chaining.
6472
6827
  */
6473
- abstract<T extends Target>(this: T, condition?: boolean): T;
6828
+ abstract(condition?: boolean): this;
6474
6829
  }
6475
- /**
6476
- * Mixin that adds an `async` modifier to a node.
6477
- */
6478
- declare class AsyncMixin {
6830
+ interface AsyncMethods extends Modifiers {
6479
6831
  /**
6480
6832
  * Adds the `async` keyword modifier if the condition is true.
6481
6833
  *
6482
6834
  * @param condition - Whether to add the modifier (default: true).
6483
6835
  * @returns The target object for chaining.
6484
6836
  */
6485
- async<T extends Target>(this: T, condition?: boolean): T;
6837
+ async(condition?: boolean): this;
6486
6838
  }
6487
- /**
6488
- * Mixin that adds a `const` modifier to a node.
6489
- */
6490
- declare class ConstMixin {
6839
+ interface ConstMethods extends Modifiers {
6491
6840
  /**
6492
6841
  * Adds the `const` keyword modifier if the condition is true.
6493
6842
  *
6494
6843
  * @param condition - Whether to add the modifier (default: true).
6495
6844
  * @returns The target object for chaining.
6496
6845
  */
6497
- const<T extends Target>(this: T, condition?: boolean): T;
6846
+ const(condition?: boolean): this;
6498
6847
  }
6499
- /**
6500
- * Mixin that adds a `default` modifier to a node.
6501
- */
6502
- declare class DefaultMixin {
6848
+ interface DefaultMethods extends Modifiers {
6503
6849
  /**
6504
6850
  * Adds the `default` keyword modifier if the condition is true.
6505
6851
  *
6506
6852
  * @param condition - Whether to add the modifier (default: true).
6507
6853
  * @returns The target object for chaining.
6508
6854
  */
6509
- default<T extends Target>(this: T, condition?: boolean): T;
6855
+ default(condition?: boolean): this;
6510
6856
  }
6511
- /**
6512
- * Mixin that adds an `export` modifier to a node.
6513
- */
6514
- declare class ExportMixin {
6857
+ interface ExportMethods extends Modifiers {
6515
6858
  /**
6516
6859
  * Adds the `export` keyword modifier if the condition is true.
6517
6860
  *
6518
6861
  * @param condition - Whether to add the modifier (default: true).
6519
6862
  * @returns The target object for chaining.
6520
6863
  */
6521
- export<T extends Target>(this: T, condition?: boolean): T;
6864
+ export(condition?: boolean): this;
6522
6865
  }
6523
- /**
6524
- * Mixin that adds a `private` modifier to a node.
6525
- */
6526
- declare class PrivateMixin {
6866
+ interface PrivateMethods extends Modifiers {
6527
6867
  /**
6528
6868
  * Adds the `private` keyword modifier if the condition is true.
6529
6869
  *
6530
6870
  * @param condition - Whether to add the modifier (default: true).
6531
6871
  * @returns The target object for chaining.
6532
6872
  */
6533
- private<T extends Target>(this: T, condition?: boolean): T;
6873
+ private(condition?: boolean): this;
6534
6874
  }
6535
- /**
6536
- * Mixin that adds a `protected` modifier to a node.
6537
- */
6538
- declare class ProtectedMixin {
6875
+ interface ProtectedMethods extends Modifiers {
6539
6876
  /**
6540
6877
  * Adds the `protected` keyword modifier if the condition is true.
6541
6878
  *
6542
6879
  * @param condition - Whether to add the modifier (default: true).
6543
6880
  * @returns The target object for chaining.
6544
6881
  */
6545
- protected<T extends Target>(this: T, condition?: boolean): T;
6882
+ protected(condition?: boolean): this;
6546
6883
  }
6547
- /**
6548
- * Mixin that adds a `public` modifier to a node.
6549
- */
6550
- declare class PublicMixin {
6884
+ interface PublicMethods extends Modifiers {
6551
6885
  /**
6552
6886
  * Adds the `public` keyword modifier if the condition is true.
6553
6887
  *
6554
6888
  * @param condition - Whether to add the modifier (default: true).
6555
6889
  * @returns The target object for chaining.
6556
6890
  */
6557
- public<T extends Target>(this: T, condition?: boolean): T;
6891
+ public(condition?: boolean): this;
6558
6892
  }
6559
- /**
6560
- * Mixin that adds a `readonly` modifier to a node.
6561
- */
6562
- declare class ReadonlyMixin {
6893
+ interface ReadonlyMethods extends Modifiers {
6563
6894
  /**
6564
6895
  * Adds the `readonly` keyword modifier if the condition is true.
6565
6896
  *
6566
6897
  * @param condition - Whether to add the modifier (default: true).
6567
6898
  * @returns The target object for chaining.
6568
6899
  */
6569
- readonly<T extends Target>(this: T, condition?: boolean): T;
6900
+ readonly(condition?: boolean): this;
6570
6901
  }
6571
- /**
6572
- * Mixin that adds a `static` modifier to a node.
6573
- */
6574
- declare class StaticMixin {
6902
+ interface StaticMethods extends Modifiers {
6575
6903
  /**
6576
6904
  * Adds the `static` keyword modifier if the condition is true.
6577
6905
  *
6578
6906
  * @param condition - Whether to add the modifier (default: true).
6579
6907
  * @returns The target object for chaining.
6580
6908
  */
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;
6909
+ static(condition?: boolean): this;
6593
6910
  }
6594
6911
  //#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;
6912
+ //#region src/ts-dsl/layout/doc.d.ts
6913
+ type DocMaybeLazy<T> = ((ctx: AstContext) => T) | T;
6914
+ type DocFn = (d: DocTsDsl) => void;
6915
+ type DocLines = DocMaybeLazy<MaybeArray$1<string>>;
6916
+ declare class DocTsDsl extends TsDsl<ts.Node> {
6917
+ readonly '~dsl' = "DocTsDsl";
6918
+ protected _lines: Array<DocLines>;
6919
+ constructor(lines?: DocLines, fn?: DocFn);
6920
+ analyze(ctx: AnalysisContext): void;
6921
+ add(lines: DocLines): this;
6922
+ apply<T extends ts.Node>(ctx: AstContext, node: T): T;
6923
+ toAst(ctx: AstContext): ts.Node;
6605
6924
  }
6606
6925
  //#endregion
6607
- //#region src/ts-dsl/mixins/value.d.ts
6608
- declare class ValueMixin extends TsDsl {
6609
- protected value?: string | MaybeTsDsl<ts.Expression>;
6610
- /** 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;
6926
+ //#region src/ts-dsl/mixins/doc.d.ts
6927
+ interface DocMethods extends Node {
6928
+ $docs<T extends ts.Node>(ctx: AstContext, node: T): T;
6929
+ doc(lines?: DocLines, fn?: DocFn): this;
6614
6930
  }
6615
6931
  //#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;
6932
+ //#region src/ts-dsl/stmt/var.d.ts
6933
+ type VarName = Symbol | string;
6934
+ declare const Mixed$40: MixinCtor<MixinCtor<MixinCtor<MixinCtor<MixinCtor<MixinCtor<abstract new () => TsDsl<ts.VariableStatement>, ValueMethods>, PatternMethods>, HintMethods>, ExportMethods>, DocMethods>, DefaultMethods>;
6935
+ declare class VarTsDsl extends Mixed$40 {
6936
+ readonly '~dsl' = "VarTsDsl";
6937
+ protected kind: ts.NodeFlags;
6938
+ protected name?: Ref<VarName>;
6622
6939
  protected _type?: TypeTsDsl;
6623
- constructor(name: string, fn?: (f: FieldTsDsl) => void);
6624
- /** Sets the field type. */
6940
+ constructor(name?: VarName);
6941
+ analyze(ctx: AnalysisContext): void;
6942
+ const(): this;
6943
+ let(): this;
6944
+ /** Sets the variable type. */
6625
6945
  type(type: string | TypeTsDsl): this;
6626
- /** Builds the `PropertyDeclaration` node. */
6627
- $render(): ts.PropertyDeclaration;
6946
+ var(): this;
6947
+ toAst(ctx: AstContext): ts.VariableStatement;
6628
6948
  }
6629
- interface FieldTsDsl extends DecoratorMixin, DocMixin, PrivateMixin, ProtectedMixin, PublicMixin, ReadonlyMixin, StaticMixin, ValueMixin {}
6630
6949
  //#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;
6950
+ //#region src/ts-dsl/decl/decorator.d.ts
6951
+ type DecoratorName = Symbol | string | MaybeTsDsl<ts.Expression>;
6952
+ declare const Mixed$39: MixinCtor<abstract new () => TsDsl<ts.Decorator>, ArgsMethods>;
6953
+ declare class DecoratorTsDsl extends Mixed$39 {
6954
+ readonly '~dsl' = "DecoratorTsDsl";
6955
+ protected name: Ref<DecoratorName>;
6956
+ constructor(name: DecoratorName, ...args: ReadonlyArray<string | MaybeTsDsl<ts.Expression>>);
6957
+ analyze(ctx: AnalysisContext): void;
6958
+ toAst(ctx: AstContext): ts.Decorator;
6642
6959
  }
6643
6960
  //#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;
6961
+ //#region src/ts-dsl/decl/member.d.ts
6962
+ type Value$2 = string | number | MaybeTsDsl<ts.Expression>;
6963
+ type ValueFn$1 = Value$2 | ((m: EnumMemberTsDsl) => void);
6964
+ declare const Mixed$38: MixinCtor<abstract new () => TsDsl<ts.EnumMember>, DocMethods>;
6965
+ declare class EnumMemberTsDsl extends Mixed$38 {
6966
+ readonly '~dsl' = "EnumMemberTsDsl";
6967
+ private _name;
6968
+ private _value?;
6969
+ constructor(name: string, value?: ValueFn$1);
6970
+ analyze(ctx: AnalysisContext): void;
6971
+ /** Sets the enum member value. */
6972
+ value(value?: Value$2): this;
6973
+ toAst(ctx: AstContext): ts.EnumMember;
6651
6974
  }
6652
6975
  //#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;
6976
+ //#region src/ts-dsl/decl/enum.d.ts
6977
+ type EnumName = Symbol | string;
6978
+ type Value$1 = string | number | MaybeTsDsl<ts.Expression>;
6979
+ type ValueFn = Value$1 | ((m: EnumMemberTsDsl) => void);
6980
+ declare const Mixed$37: MixinCtor<MixinCtor<MixinCtor<abstract new () => TsDsl<ts.EnumDeclaration>, ExportMethods>, DocMethods>, ConstMethods>;
6981
+ declare class EnumTsDsl extends Mixed$37 {
6982
+ readonly '~dsl' = "EnumTsDsl";
6983
+ private _members;
6984
+ private _name;
6985
+ constructor(name: EnumName, fn?: (e: EnumTsDsl) => void);
6986
+ analyze(ctx: AnalysisContext): void;
6987
+ /** Adds an enum member. */
6988
+ member(name: string, value?: ValueFn): this;
6989
+ /** Adds multiple enum members. */
6990
+ members(...members: ReadonlyArray<EnumMemberTsDsl>): this;
6991
+ toAst(ctx: AstContext): ts.EnumDeclaration;
6675
6992
  }
6676
6993
  //#endregion
6677
- //#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;
6683
- /** Defines an array binding pattern. */
6684
- array(...props: ReadonlyArray<string> | [ReadonlyArray<string>]): this;
6685
- /** Defines an object binding pattern. */
6686
- object(...props: ReadonlyArray<MaybeArray$1<string> | Record<string, string>>): this;
6687
- /** Adds a spread element (e.g. `...args`, `...options`) to the pattern. */
6688
- spread(name: string): this;
6689
- /** Renders the pattern into a `BindingName`. */
6690
- protected $pattern(): ts.BindingName | undefined;
6691
- $render(): ts.Node;
6994
+ //#region src/ts-dsl/mixins/decorator.d.ts
6995
+ interface DecoratorMethods extends Node {
6996
+ /** Renders the decorators into an array of `ts.Decorator`s. */
6997
+ $decorators(ctx: AstContext): ReadonlyArray<ts.Decorator>;
6998
+ /** Adds a decorator (e.g. `@sealed({ in: 'root' })`). */
6999
+ decorator(name: Symbol | string | MaybeTsDsl<ts.Expression>, ...args: ReadonlyArray<string | MaybeTsDsl<ts.Expression>>): this;
7000
+ }
7001
+ //#endregion
7002
+ //#region src/ts-dsl/decl/field.d.ts
7003
+ type FieldName = Symbol | string;
7004
+ type FieldType = TypeExprName | TypeTsDsl;
7005
+ declare const Mixed$36: MixinCtor<MixinCtor<MixinCtor<MixinCtor<MixinCtor<MixinCtor<MixinCtor<MixinCtor<MixinCtor<abstract new () => TsDsl<ts.PropertyDeclaration>, ValueMethods>, StaticMethods>, ReadonlyMethods>, PublicMethods>, ProtectedMethods>, PrivateMethods>, OptionalMethods>, DocMethods>, DecoratorMethods>;
7006
+ declare class FieldTsDsl extends Mixed$36 {
7007
+ readonly '~dsl' = "FieldTsDsl";
7008
+ protected name: FieldName;
7009
+ protected _type?: TypeTsDsl;
7010
+ constructor(name: FieldName, fn?: (f: FieldTsDsl) => void);
7011
+ analyze(ctx: AnalysisContext): void;
7012
+ /** Sets the field type. */
7013
+ type(type: FieldType): this;
7014
+ toAst(ctx: AstContext): ts.PropertyDeclaration;
7015
+ }
7016
+ //#endregion
7017
+ //#region src/ts-dsl/mixins/type-returns.d.ts
7018
+ interface TypeReturnsMethods extends Node {
7019
+ /** Returns the return type node. */
7020
+ $returns(ctx: AstContext): ts.TypeNode | undefined;
7021
+ /** Sets the return type. */
7022
+ returns(type: TypeExprName | TypeTsDsl): this;
6692
7023
  }
6693
7024
  //#endregion
6694
7025
  //#region src/ts-dsl/decl/param.d.ts
6695
- declare class ParamTsDsl extends TsDsl<ts.ParameterDeclaration> {
6696
- protected name?: string;
7026
+ type ParamName = Symbol | string;
7027
+ type ParamCtor = (name: ParamName | ((p: ParamTsDsl) => void), fn?: (p: ParamTsDsl) => void) => ParamTsDsl;
7028
+ declare const Mixed$35: MixinCtor<MixinCtor<MixinCtor<MixinCtor<abstract new () => TsDsl<ts.ParameterDeclaration>, ValueMethods>, PatternMethods>, OptionalMethods>, DecoratorMethods>;
7029
+ declare class ParamTsDsl extends Mixed$35 {
7030
+ readonly '~dsl' = "ParamTsDsl";
7031
+ protected name?: Ref<ParamName>;
6697
7032
  protected _type?: TypeTsDsl;
6698
- constructor(name: string | ((p: ParamTsDsl) => void), fn?: (p: ParamTsDsl) => void);
7033
+ constructor(name: ParamName | ((p: ParamTsDsl) => void), fn?: (p: ParamTsDsl) => void);
7034
+ analyze(ctx: AnalysisContext): void;
6699
7035
  /** Sets the parameter type. */
6700
7036
  type(type: string | TypeTsDsl): this;
6701
- $render(): ts.ParameterDeclaration;
7037
+ toAst(ctx: AstContext): ts.ParameterDeclaration;
6702
7038
  }
6703
- interface ParamTsDsl extends DecoratorMixin, OptionalMixin, PatternMixin, ValueMixin {}
6704
7039
  //#endregion
6705
7040
  //#region src/ts-dsl/mixins/param.d.ts
6706
- declare class ParamMixin extends TsDsl {
6707
- protected _params?: Array<MaybeTsDsl<ts.ParameterDeclaration>>;
7041
+ interface ParamMethods extends Node {
7042
+ /** Renders the parameters into an array of `ParameterDeclaration`s. */
7043
+ $params(ast: AstContext): ReadonlyArray<ts.ParameterDeclaration>;
6708
7044
  /** Adds a parameter. */
6709
- param(name: string | ((p: ParamTsDsl) => void), fn?: (p: ParamTsDsl) => void): this;
7045
+ param(...args: Parameters<ParamCtor>): this;
6710
7046
  /** Adds multiple parameters. */
6711
7047
  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
- }
6716
- //#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;
6725
- }
6726
- interface InitTsDsl extends DecoratorMixin, DoMixin, DocMixin, ParamMixin, PrivateMixin, ProtectedMixin, PublicMixin {}
6727
- //#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;
6740
- }
6741
- interface MethodTsDsl extends AbstractMixin, AsyncMixin, DecoratorMixin, DoMixin, DocMixin, OptionalMixin, ParamMixin, PrivateMixin, ProtectedMixin, PublicMixin, StaticMixin, TypeParamsMixin {}
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;
6766
7048
  }
6767
- interface ClassTsDsl extends AbstractMixin, DecoratorMixin, DefaultMixin, DocMixin, ExportMixin, TypeParamsMixin {}
6768
7049
  //#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;
7050
+ //#region src/ts-dsl/mixins/do.d.ts
7051
+ type DoExpr = MaybeTsDsl<ts.Expression | ts.Statement>;
7052
+ interface DoMethods extends Node {
7053
+ /** Renders the collected `.do()` calls into an array of `Statement` nodes. */
7054
+ $do(ctx: AstContext): ReadonlyArray<ts.Statement>;
7055
+ _do: Array<DoExpr>;
7056
+ /** Adds one or more expressions/statements to the body. */
7057
+ do(...items: ReadonlyArray<DoExpr>): this;
6779
7058
  }
6780
- interface EnumMemberTsDsl extends DocMixin {}
6781
7059
  //#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;
7060
+ //#region src/ts-dsl/decl/getter.d.ts
7061
+ type GetterName = string | ts.PropertyName;
7062
+ declare const Mixed$34: MixinCtor<MixinCtor<MixinCtor<MixinCtor<MixinCtor<MixinCtor<MixinCtor<MixinCtor<MixinCtor<MixinCtor<MixinCtor<abstract new () => TsDsl<ts.GetAccessorDeclaration>, TypeReturnsMethods>, StaticMethods>, PublicMethods>, ProtectedMethods>, PrivateMethods>, ParamMethods>, DocMethods>, DoMethods>, DecoratorMethods>, AsyncMethods>, AbstractMethods>;
7063
+ declare class GetterTsDsl extends Mixed$34 {
7064
+ readonly '~dsl' = "GetterTsDsl";
7065
+ protected name: GetterName;
7066
+ constructor(name: GetterName, fn?: (g: GetterTsDsl) => void);
7067
+ analyze(ctx: AnalysisContext): void;
7068
+ toAst(ctx: AstContext): ts.GetAccessorDeclaration;
6798
7069
  }
6799
- interface EnumTsDsl extends ConstMixin, DocMixin, ExportMixin {}
6800
7070
  //#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;
7071
+ //#region src/ts-dsl/stmt/if.d.ts
7072
+ type IfCondition = string | MaybeTsDsl<ts.Expression>;
7073
+ declare const Mixed$33: MixinCtor<abstract new () => TsDsl<ts.IfStatement>, DoMethods>;
7074
+ declare class IfTsDsl extends Mixed$33 {
7075
+ readonly '~dsl' = "IfTsDsl";
7076
+ protected _condition?: IfCondition;
7077
+ protected _else?: Array<DoExpr>;
7078
+ constructor(condition?: IfCondition);
7079
+ analyze(ctx: AnalysisContext): void;
7080
+ condition(condition: IfCondition): this;
7081
+ otherwise(...items: Array<DoExpr>): this;
7082
+ toAst(ctx: AstContext): ts.IfStatement;
7083
+ }
7084
+ //#endregion
7085
+ //#region src/ts-dsl/utils/lazy.d.ts
7086
+ type LazyThunk<T extends ts.Node> = (ctx: AstContext) => TsDsl<T>;
7087
+ declare class LazyTsDsl<T extends ts.Node = ts.Node> extends TsDsl<T> {
7088
+ readonly '~dsl' = "LazyTsDsl";
7089
+ private _thunk;
7090
+ constructor(thunk: LazyThunk<T>);
7091
+ analyze(ctx: AnalysisContext): void;
7092
+ toAst(ctx: AstContext): T;
6846
7093
  }
6847
- interface BinaryTsDsl extends AsMixin, ExprMixin {}
6848
7094
  //#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;
7095
+ //#region src/ts-dsl/expr/new.d.ts
7096
+ type NewExpr = Symbol | string | MaybeTsDsl<ts.Expression>;
7097
+ declare const Mixed$32: MixinCtor<MixinCtor<MixinCtor<abstract new () => TsDsl<ts.NewExpression>, TypeArgsMethods>, ExprMethods>, ArgsMethods>;
7098
+ declare class NewTsDsl extends Mixed$32 {
7099
+ readonly '~dsl' = "NewTsDsl";
7100
+ protected classExpr: Ref<NewExpr>;
7101
+ constructor(classExpr: NewExpr, ...args: ReadonlyArray<NewExpr>);
7102
+ analyze(ctx: AnalysisContext): void;
7103
+ toAst(ctx: AstContext): ts.NewExpression;
6885
7104
  }
6886
7105
  //#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;
7106
+ //#region src/ts-dsl/layout/note.d.ts
7107
+ type NoteMaybeLazy<T> = ((ctx: AstContext) => T) | T;
7108
+ type NoteFn = (d: NoteTsDsl) => void;
7109
+ type NoteLines = NoteMaybeLazy<MaybeArray$1<string>>;
7110
+ declare class NoteTsDsl extends TsDsl<ts.Node> {
7111
+ readonly '~dsl' = "NoteTsDsl";
7112
+ protected _lines: Array<NoteLines>;
7113
+ constructor(lines?: NoteLines, fn?: NoteFn);
7114
+ analyze(ctx: AnalysisContext): void;
7115
+ add(lines: NoteLines): this;
7116
+ apply<T extends ts.Node>(ctx: AstContext, node: T): T;
7117
+ toAst(ctx: AstContext): ts.Node;
6893
7118
  }
6894
- interface AttrTsDsl extends AsMixin, ExprMixin, OperatorMixin, OptionalMixin {}
6895
7119
  //#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>;
6899
- constructor(expr: string | MaybeTsDsl<ts.Expression>);
6900
- $render(): ts.AwaitExpression;
7120
+ //#region src/ts-dsl/decl/setter.d.ts
7121
+ type SetterName = string | ts.PropertyName;
7122
+ declare const Mixed$31: 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>;
7123
+ declare class SetterTsDsl extends Mixed$31 {
7124
+ readonly '~dsl' = "SetterTsDsl";
7125
+ protected name: SetterName;
7126
+ constructor(name: SetterName, fn?: (s: SetterTsDsl) => void);
7127
+ analyze(ctx: AnalysisContext): void;
7128
+ toAst(ctx: AstContext): ts.SetAccessorDeclaration;
6901
7129
  }
6902
- interface AwaitTsDsl extends ExprMixin {}
6903
7130
  //#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;
7131
+ //#region src/ts-dsl/expr/template.d.ts
7132
+ type TemplatePart = Symbol | string | MaybeTsDsl<ts.Expression>;
7133
+ declare const Mixed$30: abstract new () => TsDsl<ts.NoSubstitutionTemplateLiteral | ts.TemplateExpression>;
7134
+ declare class TemplateTsDsl extends Mixed$30 {
7135
+ readonly '~dsl' = "TemplateTsDsl";
7136
+ protected parts: Array<Ref<TemplatePart>>;
7137
+ constructor(value?: TemplatePart);
7138
+ analyze(ctx: AnalysisContext): void;
7139
+ add(value: TemplatePart): this;
7140
+ toAst(ctx: AstContext): ts.NoSubstitutionTemplateLiteral | ts.TemplateExpression;
6914
7141
  }
6915
7142
  //#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;
7143
+ //#region src/ts-dsl/type/param.d.ts
7144
+ type TypeParamName = Symbol | string;
7145
+ type TypeParamExpr = Symbol | string | boolean | MaybeTsDsl<TypeTsDsl>;
7146
+ declare const Mixed$29: abstract new () => TsDsl<ts.TypeParameterDeclaration>;
7147
+ declare class TypeParamTsDsl extends Mixed$29 {
7148
+ readonly '~dsl' = "TypeParamTsDsl";
7149
+ protected constraint?: Ref<TypeParamExpr>;
7150
+ protected defaultValue?: Ref<TypeParamExpr>;
7151
+ protected name?: Ref<TypeParamName>;
7152
+ constructor(name?: TypeParamName, fn?: (name: TypeParamTsDsl) => void);
7153
+ analyze(ctx: AnalysisContext): void;
7154
+ default(value: TypeParamExpr): this;
7155
+ extends(constraint: TypeParamExpr): this;
7156
+ toAst(ctx: AstContext): ts.TypeParameterDeclaration;
6921
7157
  }
6922
- interface CallTsDsl extends ArgsMixin, AsMixin, ExprMixin, TypeArgsMixin {}
6923
7158
  //#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;
7159
+ //#region src/ts-dsl/mixins/type-params.d.ts
7160
+ interface TypeParamsMethods extends Node {
7161
+ /** Returns the type parameters as an array of ts.TypeParameterDeclaration nodes. */
7162
+ $generics(ast: AstContext): ReadonlyArray<ts.TypeParameterDeclaration> | undefined;
7163
+ /** Adds a single type parameter (e.g. `T` in `Array<T>`). */
7164
+ generic(...args: ConstructorParameters<typeof TypeParamTsDsl>): this;
7165
+ /** Adds type parameters (e.g. `Map<string, T>`). */
7166
+ generics(...args: ReadonlyArray<Symbol | string | MaybeTsDsl<TypeParamTsDsl>>): this;
6929
7167
  }
6930
- interface ReturnTsDsl extends ExprMixin {}
6931
7168
  //#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;
7169
+ //#region src/ts-dsl/decl/init.d.ts
7170
+ declare const Mixed$28: MixinCtor<MixinCtor<MixinCtor<MixinCtor<MixinCtor<MixinCtor<MixinCtor<abstract new () => TsDsl<ts.ConstructorDeclaration>, PublicMethods>, ProtectedMethods>, PrivateMethods>, ParamMethods>, DocMethods>, DoMethods>, DecoratorMethods>;
7171
+ declare class InitTsDsl extends Mixed$28 {
7172
+ readonly '~dsl' = "InitTsDsl";
7173
+ constructor(fn?: (i: InitTsDsl) => void);
7174
+ analyze(ctx: AnalysisContext): void;
7175
+ toAst(ctx: AstContext): ts.ConstructorDeclaration;
6942
7176
  }
6943
7177
  //#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;
7178
+ //#region src/ts-dsl/decl/method.d.ts
7179
+ declare const Mixed$27: MixinCtor<MixinCtor<MixinCtor<MixinCtor<MixinCtor<MixinCtor<MixinCtor<MixinCtor<MixinCtor<MixinCtor<MixinCtor<MixinCtor<MixinCtor<abstract new () => TsDsl<ts.MethodDeclaration>, TypeReturnsMethods>, TypeParamsMethods>, StaticMethods>, PublicMethods>, ProtectedMethods>, PrivateMethods>, ParamMethods>, OptionalMethods>, DocMethods>, DoMethods>, DecoratorMethods>, AsyncMethods>, AbstractMethods>;
7180
+ declare class MethodTsDsl extends Mixed$27 {
7181
+ readonly '~dsl' = "MethodTsDsl";
7182
+ protected name: string;
7183
+ constructor(name: string, fn?: (m: MethodTsDsl) => void);
7184
+ analyze(ctx: AnalysisContext): void;
7185
+ toAst(ctx: AstContext): ts.MethodDeclaration;
6950
7186
  }
6951
- interface AsTsDsl extends AsMixin, ExprMixin {}
6952
7187
  //#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;
7188
+ //#region src/ts-dsl/decl/class.d.ts
7189
+ type Base = Symbol | string;
7190
+ type Name$1 = Symbol | string;
7191
+ type Body = Array<MaybeTsDsl<ts.ClassElement | ts.Node>>;
7192
+ declare const Mixed$26: MixinCtor<MixinCtor<MixinCtor<MixinCtor<MixinCtor<MixinCtor<abstract new () => TsDsl<ts.ClassDeclaration>, TypeParamsMethods>, ExportMethods>, DocMethods>, DefaultMethods>, DecoratorMethods>, AbstractMethods>;
7193
+ declare class ClassTsDsl extends Mixed$26 {
7194
+ readonly '~dsl' = "ClassTsDsl";
7195
+ protected baseClass?: Ref<Base>;
7196
+ protected body: Body;
7197
+ protected name: Ref<Name$1>;
7198
+ constructor(name: Name$1);
7199
+ analyze(ctx: AnalysisContext): void;
7200
+ /** Adds one or more class members (fields, methods, etc.). */
7201
+ do(...items: Body): this;
7202
+ /** Records a base class to extend from. */
7203
+ extends(base?: Base): this;
7204
+ /** Adds a class field. */
7205
+ field(name: FieldName, fn?: (f: FieldTsDsl) => void): this;
7206
+ /** Adds a class constructor. */
7207
+ init(fn?: (i: InitTsDsl) => void): this;
7208
+ /** Adds a class method. */
7209
+ method(name: string, fn?: (m: MethodTsDsl) => void): this;
7210
+ /** Inserts an empty line between members for formatting. */
7211
+ newline(): this;
7212
+ toAst(ctx: AstContext): ts.ClassDeclaration;
7213
+ /** Builds heritage clauses (extends). */
7214
+ private _heritage;
6957
7215
  }
6958
7216
  //#endregion
6959
7217
  //#region src/ts-dsl/decl/func.d.ts
6960
7218
  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;
6967
- protected _returns?: TypeTsDsl;
7219
+ type FuncName = Symbol | string;
7220
+ declare const Mixed$25: MixinCtor<MixinCtor<MixinCtor<MixinCtor<MixinCtor<MixinCtor<MixinCtor<MixinCtor<MixinCtor<MixinCtor<MixinCtor<MixinCtor<MixinCtor<abstract new () => TsDsl<ts.ArrowFunction>, TypeReturnsMethods>, TypeParamsMethods>, StaticMethods>, PublicMethods>, ProtectedMethods>, PrivateMethods>, ParamMethods>, DocMethods>, DoMethods>, DecoratorMethods>, AsyncMethods>, AsMethods>, AbstractMethods>;
7221
+ declare class ImplFuncTsDsl<M extends FuncMode = 'arrow'> extends Mixed$25 {
7222
+ readonly '~dsl' = "FuncTsDsl";
7223
+ protected mode?: FuncMode;
7224
+ protected name?: Ref<FuncName>;
6968
7225
  constructor();
6969
7226
  constructor(fn: (f: ImplFuncTsDsl<'arrow'>) => void);
6970
- constructor(name: string);
6971
- constructor(name: string, fn: (f: ImplFuncTsDsl<'decl'>) => void);
7227
+ constructor(name: FuncName);
7228
+ constructor(name: FuncName, fn: (f: ImplFuncTsDsl<'decl'>) => void);
7229
+ analyze(ctx: AnalysisContext): void;
6972
7230
  /** Switches the function to an arrow function form. */
6973
7231
  arrow(): FuncTsDsl<'arrow'>;
6974
7232
  /** Switches the function to a function declaration form. */
6975
7233
  decl(): FuncTsDsl<'decl'>;
6976
7234
  /** Switches the function to a function expression form. */
6977
7235
  expr(): FuncTsDsl<'expr'>;
6978
- /** Sets the return type. */
6979
- returns(type: string | TypeTsDsl): this;
6980
- $render(): M extends 'decl' ? ts.FunctionDeclaration : M extends 'expr' ? ts.FunctionExpression : ts.ArrowFunction;
7236
+ toAst(ctx: AstContext): M extends 'decl' ? ts.FunctionDeclaration : M extends 'expr' ? ts.FunctionExpression : ts.ArrowFunction;
6981
7237
  }
6982
- interface ImplFuncTsDsl extends AbstractMixin, AsMixin, AsyncMixin, DecoratorMixin, DoMixin, DocMixin, ParamMixin, PrivateMixin, ProtectedMixin, PublicMixin, StaticMixin, TypeParamsMixin {}
6983
7238
  declare const FuncTsDsl: {
6984
7239
  new (): FuncTsDsl<"arrow">;
6985
7240
  new (fn: (f: FuncTsDsl<"arrow">) => void): FuncTsDsl<"arrow">;
@@ -6988,44 +7243,48 @@ declare const FuncTsDsl: {
6988
7243
  } & typeof ImplFuncTsDsl;
6989
7244
  type FuncTsDsl<M extends FuncMode = 'arrow'> = ImplFuncTsDsl<M>;
6990
7245
  //#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[];
7246
+ //#region src/ts-dsl/decl/pattern.d.ts
7247
+ declare const Mixed$24: abstract new () => TsDsl<ts.BindingName>;
7248
+ /**
7249
+ * Builds binding patterns (e.g. `{ foo, bar }`, `[a, b, ...rest]`).
7250
+ */
7251
+ declare class PatternTsDsl extends Mixed$24 {
7252
+ readonly '~dsl' = "PatternTsDsl";
7253
+ protected pattern?: {
7254
+ kind: 'array';
7255
+ values: ReadonlyArray<string>;
7256
+ } | {
7257
+ kind: 'object';
7258
+ values: Record<string, string>;
7006
7259
  };
7007
- protected name: string | ts.PropertyName;
7008
- constructor(name: string | ts.PropertyName, fn?: (s: SetterTsDsl) => void);
7009
- $render(): ts.SetAccessorDeclaration;
7260
+ protected _spread?: string;
7261
+ analyze(ctx: AnalysisContext): void;
7262
+ /** Defines an array pattern (e.g. `[a, b, c]`). */
7263
+ array(...props: ReadonlyArray<string> | [ReadonlyArray<string>]): this;
7264
+ /** Defines an object pattern (e.g. `{ a, b: alias }`). */
7265
+ object(...props: ReadonlyArray<MaybeArray$1<string> | Record<string, string>>): this;
7266
+ /** Adds a spread element (e.g. `...rest`, `...options`, `...args`). */
7267
+ spread(name: string): this;
7268
+ toAst(ctx: AstContext): ts.ObjectBindingPattern | ts.ArrayBindingPattern;
7269
+ private createSpread;
7010
7270
  }
7011
- interface SetterTsDsl extends AbstractMixin, AsyncMixin, DecoratorMixin, DoMixin, DocMixin, ParamMixin, PrivateMixin, ProtectedMixin, PublicMixin, StaticMixin {}
7012
7271
  //#endregion
7013
7272
  //#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;
7273
+ interface LayoutMethods extends Node {
7274
+ /** Computes whether output should be multiline based on layout setting and element count. */
7275
+ $multiline(count: number): boolean;
7017
7276
  /** Sets automatic line output with optional threshold (default: 3). */
7018
7277
  auto(threshold?: number): this;
7019
7278
  /** Sets single line output. */
7020
7279
  inline(): this;
7021
7280
  /** Sets multi line output. */
7022
7281
  pretty(): this;
7023
- /** Computes whether output should be multiline based on layout setting and element count. */
7024
- protected $multiline(count: number): boolean;
7025
7282
  }
7026
7283
  //#endregion
7027
7284
  //#region src/ts-dsl/expr/array.d.ts
7028
- declare class ArrayTsDsl extends TsDsl<ts.ArrayLiteralExpression> {
7285
+ declare const Mixed$23: MixinCtor<MixinCtor<abstract new () => TsDsl<ts.ArrayLiteralExpression>, LayoutMethods>, AsMethods>;
7286
+ declare class ArrayTsDsl extends Mixed$23 {
7287
+ readonly '~dsl' = "ArrayTsDsl";
7029
7288
  protected _elements: Array<{
7030
7289
  expr: MaybeTsDsl<ts.Expression>;
7031
7290
  kind: 'element';
@@ -7034,185 +7293,50 @@ declare class ArrayTsDsl extends TsDsl<ts.ArrayLiteralExpression> {
7034
7293
  kind: 'spread';
7035
7294
  }>;
7036
7295
  constructor(...exprs: Array<string | number | boolean | MaybeTsDsl<ts.Expression>>);
7296
+ analyze(ctx: AnalysisContext): void;
7037
7297
  /** Adds a single array element. */
7038
7298
  element(expr: string | number | boolean | MaybeTsDsl<ts.Expression>): this;
7039
7299
  /** Adds multiple array elements. */
7040
7300
  elements(...exprs: ReadonlyArray<string | number | boolean | MaybeTsDsl<ts.Expression>>): this;
7041
7301
  /** Adds a spread element (`...expr`). */
7042
7302
  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;
7303
+ toAst(ctx: AstContext): ts.ArrayLiteralExpression;
7160
7304
  }
7161
7305
  //#endregion
7162
7306
  //#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;
7307
+ type Id = Symbol | string | MaybeTsDsl<ts.Expression>;
7308
+ declare const Mixed$22: MixinCtor<MixinCtor<MixinCtor<MixinCtor<abstract new () => TsDsl<ts.Expression>, TypeExprMethods>, OperatorMethods>, ExprMethods>, AsMethods>;
7309
+ declare class ExprTsDsl extends Mixed$22 {
7310
+ readonly '~dsl' = "ExprTsDsl";
7311
+ protected _exprInput: Ref<Id>;
7312
+ constructor(id: Id);
7313
+ analyze(ctx: AnalysisContext): void;
7314
+ toAst(ctx: AstContext): ts.Expression;
7167
7315
  }
7168
- interface ExprTsDsl extends AsMixin, ExprMixin, OperatorMixin, TypeExprMixin {}
7169
7316
  //#endregion
7170
7317
  //#region src/ts-dsl/expr/id.d.ts
7171
- declare class IdTsDsl extends TsDsl<ts.Identifier> {
7318
+ declare const Mixed$21: abstract new () => TsDsl<ts.Identifier>;
7319
+ declare class IdTsDsl extends Mixed$21 {
7320
+ readonly '~dsl' = "IdTsDsl";
7172
7321
  protected name: string;
7173
7322
  constructor(name: string);
7174
- $render(): ts.Identifier;
7323
+ analyze(ctx: AnalysisContext): void;
7324
+ toAst(): ts.Identifier;
7175
7325
  }
7176
7326
  //#endregion
7177
7327
  //#region src/ts-dsl/expr/literal.d.ts
7178
- declare class LiteralTsDsl extends TsDsl<ts.LiteralTypeNode['literal']> {
7328
+ declare const Mixed$20: MixinCtor<abstract new () => TsDsl<ts.LiteralExpression | ts.NullLiteral | ts.BooleanLiteral | ts.PrefixUnaryExpression>, AsMethods>;
7329
+ declare class LiteralTsDsl extends Mixed$20 {
7330
+ readonly '~dsl' = "LiteralTsDsl";
7179
7331
  protected value: string | number | boolean | null;
7180
7332
  constructor(value: string | number | boolean | null);
7181
- $render(): ts.LiteralTypeNode['literal'];
7182
- }
7183
- interface LiteralTsDsl extends AsMixin {}
7184
- //#endregion
7185
- //#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;
7191
- }
7192
- interface NewTsDsl extends ArgsMixin, ExprMixin, TypeArgsMixin {}
7193
- //#endregion
7194
- //#region src/ts-dsl/layout/hint.d.ts
7195
- declare class HintTsDsl extends TsDsl<ts.Node> {
7196
- protected _lines: Array<string>;
7197
- constructor(lines?: MaybeArray$1<string>, fn?: (d: HintTsDsl) => void);
7198
- add(...lines: ReadonlyArray<string>): this;
7199
- apply<T extends ts.Node>(node: T): T;
7200
- $render(): ts.Node;
7333
+ analyze(ctx: AnalysisContext): void;
7334
+ toAst(ctx: AstContext): ts.StringLiteral | ts.NumericLiteral | ts.NullLiteral | ts.TrueLiteral | ts.FalseLiteral | ts.PrefixUnaryExpression;
7201
7335
  }
7202
7336
  //#endregion
7203
- //#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>>;
7212
- //#endregion
7213
7337
  //#region src/ts-dsl/expr/prop.d.ts
7214
- type Expr$1 = string | MaybeTsDsl<ts.Expression>;
7215
- type Stmt$1 = string | MaybeTsDsl<ts.Statement>;
7338
+ type Expr$1 = Symbol | string | MaybeTsDsl<ts.Expression>;
7339
+ type Stmt$1 = Symbol | string | MaybeTsDsl<ts.Statement>;
7216
7340
  type Kind = 'computed' | 'getter' | 'prop' | 'setter' | 'spread';
7217
7341
  type Meta = {
7218
7342
  kind: 'computed';
@@ -7230,30 +7354,35 @@ type Meta = {
7230
7354
  kind: 'spread';
7231
7355
  name?: undefined;
7232
7356
  };
7233
- declare class ObjectPropTsDsl extends TsDsl<ts.ObjectLiteralElementLike> {
7234
- protected _value?: Expr$1 | Stmt$1;
7357
+ declare const Mixed$19: MixinCtor<abstract new () => TsDsl<ts.ObjectLiteralElementLike>, DocMethods>;
7358
+ declare class ObjectPropTsDsl extends Mixed$19 {
7359
+ readonly '~dsl' = "ObjectPropTsDsl";
7360
+ protected _value?: Ref<Expr$1 | Stmt$1>;
7235
7361
  protected meta: Meta;
7236
7362
  constructor(meta: Meta);
7363
+ analyze(ctx: AnalysisContext): void;
7237
7364
  /** Returns true when all required builder calls are present. */
7238
7365
  get isValid(): boolean;
7239
7366
  value(value: Expr$1 | Stmt$1 | ((p: ObjectPropTsDsl) => void)): this;
7240
- $render(): ts.ObjectLiteralElementLike;
7367
+ toAst(ctx: AstContext): ts.GetAccessorDeclaration | ts.SetAccessorDeclaration | ts.PropertyAssignment | ts.ShorthandPropertyAssignment | ts.SpreadAssignment;
7241
7368
  $validate(): asserts this is this & {
7242
7369
  _value: Expr$1 | Stmt$1;
7243
7370
  kind: Kind;
7244
7371
  };
7245
7372
  private missingRequiredCalls;
7246
7373
  }
7247
- interface ObjectPropTsDsl extends DocMixin {}
7248
7374
  //#endregion
7249
7375
  //#region src/ts-dsl/expr/object.d.ts
7250
- type Expr = string | MaybeTsDsl<ts.Expression>;
7251
- type Stmt = string | MaybeTsDsl<ts.Statement>;
7376
+ type Expr = Symbol | string | MaybeTsDsl<ts.Expression>;
7377
+ type Stmt = Symbol | string | MaybeTsDsl<ts.Statement>;
7252
7378
  type ExprFn = Expr | ((p: ObjectPropTsDsl) => void);
7253
7379
  type StmtFn = Stmt | ((p: ObjectPropTsDsl) => void);
7254
- declare class ObjectTsDsl extends TsDsl<ts.ObjectLiteralExpression> {
7380
+ declare const Mixed$18: MixinCtor<MixinCtor<MixinCtor<MixinCtor<abstract new () => TsDsl<ts.ObjectLiteralExpression>, LayoutMethods>, HintMethods>, ExprMethods>, AsMethods>;
7381
+ declare class ObjectTsDsl extends Mixed$18 {
7382
+ readonly '~dsl' = "ObjectTsDsl";
7255
7383
  protected _props: Array<ObjectPropTsDsl>;
7256
7384
  constructor(...props: Array<ObjectPropTsDsl>);
7385
+ analyze(ctx: AnalysisContext): void;
7257
7386
  /** Adds a computed property (e.g. `{ [expr]: value }`). */
7258
7387
  computed(name: string, expr: ExprFn): this;
7259
7388
  /** Adds a getter property (e.g. `{ get foo() { ... } }`). */
@@ -7270,16 +7399,17 @@ declare class ObjectTsDsl extends TsDsl<ts.ObjectLiteralExpression> {
7270
7399
  setter(name: string, stmt: StmtFn): this;
7271
7400
  /** Adds a spread property (e.g. `{ ...options }`). */
7272
7401
  spread(expr: ExprFn): this;
7273
- /** Builds and returns the object literal expression. */
7274
- $render(): ts.ObjectLiteralExpression;
7402
+ toAst(ctx: AstContext): ts.ObjectLiteralExpression;
7275
7403
  }
7276
- interface ObjectTsDsl extends AsMixin, ExprMixin, HintMixin, LayoutMixin {}
7277
7404
  //#endregion
7278
7405
  //#region src/ts-dsl/expr/prefix.d.ts
7279
- declare class PrefixTsDsl extends TsDsl<ts.PrefixUnaryExpression> {
7406
+ declare const Mixed$17: abstract new () => TsDsl<ts.PrefixUnaryExpression>;
7407
+ declare class PrefixTsDsl extends Mixed$17 {
7408
+ readonly '~dsl' = "PrefixTsDsl";
7280
7409
  protected _expr?: string | MaybeTsDsl<ts.Expression>;
7281
7410
  protected _op?: ts.PrefixUnaryOperator;
7282
7411
  constructor(expr?: string | MaybeTsDsl<ts.Expression>, op?: ts.PrefixUnaryOperator);
7412
+ analyze(ctx: AnalysisContext): void;
7283
7413
  /** Sets the operand (the expression being prefixed). */
7284
7414
  expr(expr: string | MaybeTsDsl<ts.Expression>): this;
7285
7415
  /** Sets the operator to MinusToken for negation (`-`). */
@@ -7288,98 +7418,97 @@ declare class PrefixTsDsl extends TsDsl<ts.PrefixUnaryExpression> {
7288
7418
  not(): this;
7289
7419
  /** Sets the operator (e.g. `ts.SyntaxKind.ExclamationToken` for `!`). */
7290
7420
  op(op: ts.PrefixUnaryOperator): this;
7291
- /** Renders the prefix unary expression node. */
7292
- $render(): ts.PrefixUnaryExpression;
7421
+ toAst(ctx: AstContext): ts.PrefixUnaryExpression;
7293
7422
  }
7294
7423
  //#endregion
7295
7424
  //#region src/ts-dsl/expr/regexp.d.ts
7296
7425
  type RegexFlag = 'g' | 'i' | 'm' | 's' | 'u' | 'y';
7297
7426
  type RegexFlags<Avail extends string = RegexFlag> = '' | { [K in Avail]: `${K}${RegexFlags<Exclude<Avail, K>>}` }[Avail];
7298
- declare class RegExpTsDsl extends TsDsl<ts.RegularExpressionLiteral> {
7427
+ declare const Mixed$16: abstract new () => TsDsl<ts.RegularExpressionLiteral>;
7428
+ declare class RegExpTsDsl extends Mixed$16 {
7429
+ readonly '~dsl' = "RegExpTsDsl";
7299
7430
  protected pattern: string;
7300
7431
  protected flags?: RegexFlags;
7301
7432
  constructor(pattern: string, flags?: RegexFlags);
7302
- /** Emits a RegularExpressionLiteral node. */
7303
- $render(): ts.RegularExpressionLiteral;
7304
- }
7305
- //#endregion
7306
- //#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;
7433
+ analyze(ctx: AnalysisContext): void;
7434
+ toAst(): ts.RegularExpressionLiteral;
7312
7435
  }
7313
7436
  //#endregion
7314
7437
  //#region src/ts-dsl/expr/ternary.d.ts
7315
- declare class TernaryTsDsl extends TsDsl<ts.ConditionalExpression> {
7438
+ declare const Mixed$15: abstract new () => TsDsl<ts.ConditionalExpression>;
7439
+ declare class TernaryTsDsl extends Mixed$15 {
7440
+ readonly '~dsl' = "TernaryTsDsl";
7316
7441
  protected _condition?: string | MaybeTsDsl<ts.Expression>;
7317
7442
  protected _then?: string | MaybeTsDsl<ts.Expression>;
7318
7443
  protected _else?: string | MaybeTsDsl<ts.Expression>;
7319
7444
  constructor(condition?: string | MaybeTsDsl<ts.Expression>);
7445
+ analyze(ctx: AnalysisContext): void;
7320
7446
  condition(condition: string | MaybeTsDsl<ts.Expression>): this;
7321
7447
  do(expr: string | MaybeTsDsl<ts.Expression>): this;
7322
7448
  otherwise(expr: string | MaybeTsDsl<ts.Expression>): this;
7323
- $render(): ts.ConditionalExpression;
7449
+ toAst(ctx: AstContext): ts.ConditionalExpression;
7324
7450
  }
7325
7451
  //#endregion
7326
- //#region src/ts-dsl/layout/note.d.ts
7327
- declare class NoteTsDsl extends TsDsl<ts.Node> {
7328
- protected _lines: Array<string>;
7329
- constructor(lines?: MaybeArray$1<string>, fn?: (d: NoteTsDsl) => void);
7330
- add(...lines: ReadonlyArray<string>): this;
7331
- apply<T extends ts.Node>(node: T): T;
7332
- $render(): ts.Node;
7452
+ //#region src/ts-dsl/layout/newline.d.ts
7453
+ declare class NewlineTsDsl extends TsDsl<ts.Identifier> {
7454
+ readonly '~dsl' = "NewlineTsDsl";
7455
+ analyze(ctx: AnalysisContext): void;
7456
+ toAst(ctx: AstContext): ts.Identifier;
7333
7457
  }
7334
7458
  //#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;
7459
+ //#region src/ts-dsl/stmt/block.d.ts
7460
+ declare const Mixed$14: MixinCtor<MixinCtor<abstract new () => TsDsl<ts.Block>, LayoutMethods>, DoMethods>;
7461
+ declare class BlockTsDsl extends Mixed$14 {
7462
+ readonly '~dsl' = "BlockTsDsl";
7463
+ constructor(...items: Array<DoExpr>);
7464
+ analyze(ctx: AnalysisContext): void;
7465
+ toAst(ctx: AstContext): ts.Block;
7343
7466
  }
7344
- interface IfTsDsl extends DoMixin {}
7345
7467
  //#endregion
7346
7468
  //#region src/ts-dsl/stmt/stmt.d.ts
7347
- declare class StmtTsDsl extends TsDsl<ts.Statement> {
7469
+ declare const Mixed$13: abstract new () => TsDsl<ts.Statement>;
7470
+ declare class StmtTsDsl extends Mixed$13 {
7471
+ readonly '~dsl' = "StmtTsDsl";
7348
7472
  protected _inner: ts.Expression | ts.Statement | TsDsl<any>;
7349
7473
  constructor(inner: ts.Expression | ts.Statement | TsDsl<any>);
7350
- $render(): ts.Statement;
7474
+ analyze(ctx: AnalysisContext): void;
7475
+ toAst(ctx: AstContext): ts.Statement;
7351
7476
  }
7352
7477
  //#endregion
7353
7478
  //#region src/ts-dsl/stmt/throw.d.ts
7354
- declare class ThrowTsDsl extends TsDsl<ts.ThrowStatement> {
7479
+ declare const Mixed$12: abstract new () => TsDsl<ts.ThrowStatement>;
7480
+ declare class ThrowTsDsl extends Mixed$12 {
7481
+ readonly '~dsl' = "ThrowTsDsl";
7355
7482
  protected error: string | MaybeTsDsl<ts.Expression>;
7356
7483
  protected msg?: string | MaybeTsDsl<ts.Expression>;
7357
7484
  protected useNew: boolean;
7358
7485
  constructor(error: string | MaybeTsDsl<ts.Expression>, useNew?: boolean);
7486
+ analyze(ctx: AnalysisContext): void;
7359
7487
  message(value: string | MaybeTsDsl<ts.Expression>): this;
7360
- $render(): ts.ThrowStatement;
7361
- }
7362
- //#endregion
7363
- //#region src/ts-dsl/stmt/var.d.ts
7364
- declare class VarTsDsl extends TsDsl<ts.VariableStatement> {
7365
- protected kind: ts.NodeFlags;
7366
- protected modifiers: {
7367
- list: () => ts.Modifier[];
7368
- };
7369
- protected name?: string;
7370
- protected _type?: TypeTsDsl;
7371
- constructor(name?: string);
7372
- const(): this;
7373
- let(): this;
7374
- /** Sets the variable type. */
7375
- type(type: string | TypeTsDsl): this;
7376
- var(): this;
7377
- $render(): ts.VariableStatement;
7488
+ toAst(ctx: AstContext): ts.ThrowStatement;
7489
+ }
7490
+ //#endregion
7491
+ //#region src/ts-dsl/stmt/try.d.ts
7492
+ declare const Mixed$11: abstract new () => TsDsl<ts.TryStatement>;
7493
+ type CatchParam = Symbol | string;
7494
+ declare class TryTsDsl extends Mixed$11 {
7495
+ readonly '~dsl' = "TryTsDsl";
7496
+ protected _catch?: Array<DoExpr>;
7497
+ protected _catchArg?: CatchParam;
7498
+ protected _finally?: Array<DoExpr>;
7499
+ protected _try?: Array<DoExpr>;
7500
+ constructor(...tryBlock: Array<DoExpr>);
7501
+ analyze(ctx: AnalysisContext): void;
7502
+ catch(...items: Array<DoExpr>): this;
7503
+ catchArg(arg: CatchParam): this;
7504
+ finally(...items: Array<DoExpr>): this;
7505
+ try(...items: Array<DoExpr>): this;
7506
+ toAst(ctx: AstContext): ts.TryStatement;
7378
7507
  }
7379
- interface VarTsDsl extends DefaultMixin, DocMixin, ExportMixin, HintMixin, PatternMixin, ValueMixin {}
7380
7508
  //#endregion
7381
7509
  //#region src/ts-dsl/token.d.ts
7382
7510
  declare class TokenTsDsl<K$1 extends ts.SyntaxKind = never> extends TsDsl<ts.Token<K$1>> {
7511
+ readonly '~dsl' = "TokenTsDsl";
7383
7512
  protected _kind?: K$1;
7384
7513
  /** Sets the token kind */
7385
7514
  kind(kind: K$1): this;
@@ -7395,57 +7524,65 @@ declare class TokenTsDsl<K$1 extends ts.SyntaxKind = never> extends TsDsl<ts.Tok
7395
7524
  readonly(): TokenTsDsl<ts.SyntaxKind.ReadonlyKeyword>;
7396
7525
  /** Creates `...` (spread / rest) */
7397
7526
  spread(): TokenTsDsl<ts.SyntaxKind.DotDotDotToken>;
7398
- /** Renders the final token */
7399
- $render(): ts.Token<K$1>;
7527
+ toAst(): ts.Token<K$1>;
7400
7528
  }
7401
7529
  //#endregion
7402
7530
  //#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);
7531
+ type Name = Symbol | string;
7532
+ type Value = MaybeTsDsl<ts.TypeNode>;
7533
+ declare const Mixed$10: MixinCtor<MixinCtor<MixinCtor<abstract new () => TsDsl<ts.TypeAliasDeclaration>, TypeParamsMethods>, ExportMethods>, DocMethods>;
7534
+ declare class TypeAliasTsDsl extends Mixed$10 {
7535
+ readonly '~dsl' = "TypeAliasTsDsl";
7536
+ protected name: Ref<Name>;
7537
+ protected value?: Value;
7538
+ constructor(name: Name, fn?: (t: TypeAliasTsDsl) => void);
7539
+ analyze(ctx: AnalysisContext): void;
7410
7540
  /** 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;
7541
+ type(node: Value): this;
7542
+ toAst(ctx: AstContext): ts.TypeAliasDeclaration;
7414
7543
  }
7415
- interface TypeAliasTsDsl extends DocMixin, ExportMixin, TypeParamsMixin {}
7416
7544
  //#endregion
7417
7545
  //#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;
7546
+ type Type$1 = Symbol | string | ts.TypeNode | TypeTsDsl;
7547
+ declare const Mixed$9: abstract new () => TsDsl<ts.IntersectionTypeNode>;
7548
+ declare class TypeAndTsDsl extends Mixed$9 {
7549
+ readonly '~dsl' = "TypeAndTsDsl";
7550
+ protected _types: Array<Ref<Type$1>>;
7551
+ constructor(...nodes: Array<Type$1>);
7552
+ analyze(ctx: AnalysisContext): void;
7553
+ types(...nodes: Array<Type$1>): this;
7554
+ toAst(ctx: AstContext): ts.IntersectionTypeNode;
7423
7555
  }
7424
7556
  //#endregion
7425
7557
  //#region src/ts-dsl/type/func.d.ts
7426
- declare class TypeFuncTsDsl extends TypeTsDsl<ts.FunctionTypeNode> {
7427
- protected _returns?: TypeTsDsl;
7428
- /** Sets the return type. */
7429
- returns(type: string | TypeTsDsl): this;
7430
- $render(): ts.FunctionTypeNode;
7558
+ declare const Mixed$8: MixinCtor<MixinCtor<MixinCtor<MixinCtor<abstract new () => TsDsl<ts.FunctionTypeNode>, TypeReturnsMethods>, TypeParamsMethods>, ParamMethods>, DocMethods>;
7559
+ declare class TypeFuncTsDsl extends Mixed$8 {
7560
+ readonly '~dsl' = "TypeFuncTsDsl";
7561
+ analyze(ctx: AnalysisContext): void;
7562
+ toAst(ctx: AstContext): ts.FunctionTypeNode;
7431
7563
  }
7432
- interface TypeFuncTsDsl extends DocMixin, ParamMixin, TypeParamsMixin {}
7433
7564
  //#endregion
7434
7565
  //#region src/ts-dsl/type/literal.d.ts
7435
- declare class TypeLiteralTsDsl extends TypeTsDsl<ts.LiteralTypeNode> {
7566
+ declare const Mixed$7: abstract new () => TsDsl<ts.LiteralTypeNode>;
7567
+ declare class TypeLiteralTsDsl extends Mixed$7 {
7568
+ readonly '~dsl' = "TypeLiteralTsDsl";
7436
7569
  protected value: string | number | boolean | null;
7437
7570
  constructor(value: string | number | boolean | null);
7438
- $render(): ts.LiteralTypeNode;
7571
+ analyze(ctx: AnalysisContext): void;
7572
+ toAst(ctx: AstContext): ts.LiteralTypeNode;
7439
7573
  }
7440
7574
  //#endregion
7441
7575
  //#region src/ts-dsl/type/mapped.d.ts
7442
- declare class TypeMappedTsDsl extends TypeTsDsl<ts.MappedTypeNode> {
7576
+ declare const Mixed$6: abstract new () => TsDsl<ts.MappedTypeNode>;
7577
+ declare class TypeMappedTsDsl extends Mixed$6 {
7578
+ readonly '~dsl' = "TypeMappedTsDsl";
7443
7579
  protected questionToken?: TokenTsDsl<ts.SyntaxKind.QuestionToken | ts.SyntaxKind.PlusToken | ts.SyntaxKind.MinusToken>;
7444
7580
  protected readonlyToken?: TokenTsDsl<ts.SyntaxKind.ReadonlyKeyword | ts.SyntaxKind.MinusToken | ts.SyntaxKind.PlusToken>;
7445
7581
  protected _key?: string | MaybeTsDsl<ts.TypeNode>;
7446
7582
  protected _name?: string;
7447
7583
  protected _type?: string | MaybeTsDsl<ts.TypeNode>;
7448
7584
  constructor(name?: string);
7585
+ analyze(ctx: AnalysisContext): void;
7449
7586
  /** Returns true when all required builder calls are present. */
7450
7587
  get isValid(): boolean;
7451
7588
  /** Sets the key constraint: `[K in Constraint]` */
@@ -7462,7 +7599,7 @@ declare class TypeMappedTsDsl extends TypeTsDsl<ts.MappedTypeNode> {
7462
7599
  required(): this;
7463
7600
  /** Sets the mapped value type: `[K in X]: ValueType` */
7464
7601
  type(type: string | MaybeTsDsl<ts.TypeNode>): this;
7465
- $render(): ts.MappedTypeNode;
7602
+ toAst(ctx: AstContext): ts.MappedTypeNode;
7466
7603
  $validate(): asserts this is this & {
7467
7604
  _key: string | MaybeTsDsl<ts.TypeNode>;
7468
7605
  _name: string;
@@ -7472,49 +7609,52 @@ declare class TypeMappedTsDsl extends TypeTsDsl<ts.MappedTypeNode> {
7472
7609
  }
7473
7610
  //#endregion
7474
7611
  //#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);
7612
+ type TypeIdxSigName = string;
7613
+ type TypeIdxSigType = string | MaybeTsDsl<ts.TypeNode>;
7614
+ declare const Mixed$5: MixinCtor<MixinCtor<abstract new () => TsDsl<ts.IndexSignatureDeclaration>, ReadonlyMethods>, DocMethods>;
7615
+ declare class TypeIdxSigTsDsl extends Mixed$5 {
7616
+ readonly '~dsl' = "TypeIdxSigTsDsl";
7617
+ protected _key?: TypeIdxSigType;
7618
+ protected _name: TypeIdxSigName;
7619
+ protected _type?: TypeIdxSigType;
7620
+ constructor(name: TypeIdxSigName, fn?: (i: TypeIdxSigTsDsl) => void);
7621
+ analyze(ctx: AnalysisContext): void;
7484
7622
  /** Returns true when all required builder calls are present. */
7485
7623
  get isValid(): boolean;
7486
7624
  /** Sets the key type: `[name: T]` */
7487
- key(type: Type): this;
7625
+ key(type: TypeIdxSigType): this;
7488
7626
  /** Sets the property type. */
7489
- type(type: Type): this;
7490
- $render(): ts.IndexSignatureDeclaration;
7627
+ type(type: TypeIdxSigType): this;
7628
+ toAst(ctx: AstContext): ts.IndexSignatureDeclaration;
7491
7629
  $validate(): asserts this is this & {
7492
- _key: Type;
7493
- _name: string;
7494
- _type: Type;
7630
+ _key: TypeIdxSigType;
7631
+ _name: TypeIdxSigName;
7632
+ _type: TypeIdxSigType;
7495
7633
  };
7496
7634
  private missingRequiredCalls;
7497
7635
  }
7498
- interface TypeIdxSigTsDsl extends DocMixin, ReadonlyMixin {}
7499
7636
  //#endregion
7500
7637
  //#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);
7638
+ type TypePropName = string;
7639
+ type TypePropType = Symbol | string | MaybeTsDsl<ts.TypeNode>;
7640
+ declare const Mixed$4: MixinCtor<MixinCtor<MixinCtor<abstract new () => TsDsl<ts.TypeElement>, ReadonlyMethods>, OptionalMethods>, DocMethods>;
7641
+ declare class TypePropTsDsl extends Mixed$4 {
7642
+ readonly '~dsl' = "TypePropTsDsl";
7643
+ protected name: TypePropName;
7644
+ protected _type?: Ref<TypePropType>;
7645
+ constructor(name: TypePropName, fn: (p: TypePropTsDsl) => void);
7646
+ analyze(ctx: AnalysisContext): void;
7508
7647
  /** Sets the property type. */
7509
- type(type: string | MaybeTsDsl<ts.TypeNode>): this;
7510
- /** Builds and returns the property signature. */
7511
- $render(): ts.TypeElement;
7648
+ type(type: TypePropType): this;
7649
+ toAst(ctx: AstContext): ts.PropertySignature;
7512
7650
  }
7513
- interface TypePropTsDsl extends DocMixin, OptionalMixin, ReadonlyMixin {}
7514
7651
  //#endregion
7515
7652
  //#region src/ts-dsl/type/object.d.ts
7516
- declare class TypeObjectTsDsl extends TypeTsDsl<ts.TypeNode> {
7653
+ declare const Mixed$3: abstract new () => TsDsl<ts.TypeNode>;
7654
+ declare class TypeObjectTsDsl extends Mixed$3 {
7655
+ readonly '~dsl' = "TypeObjectTsDsl";
7517
7656
  protected props: Array<TypePropTsDsl | TypeIdxSigTsDsl>;
7657
+ analyze(ctx: AnalysisContext): void;
7518
7658
  /** Returns true if object has at least one property or spread. */
7519
7659
  hasProps(): boolean;
7520
7660
  /** Adds an index signature to the object type. */
@@ -7523,67 +7663,171 @@ declare class TypeObjectTsDsl extends TypeTsDsl<ts.TypeNode> {
7523
7663
  get isEmpty(): boolean;
7524
7664
  /** Adds a property signature (returns property builder). */
7525
7665
  prop(name: string, fn: (p: TypePropTsDsl) => void): this;
7526
- $render(): ts.TypeNode;
7666
+ toAst(ctx: AstContext): ts.TypeLiteralNode;
7527
7667
  }
7528
7668
  //#endregion
7529
7669
  //#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;
7670
+ type Type = Symbol | string | ts.TypeNode | TypeTsDsl;
7671
+ declare const Mixed$2: abstract new () => TsDsl<ts.UnionTypeNode>;
7672
+ declare class TypeOrTsDsl extends Mixed$2 {
7673
+ readonly '~dsl' = "TypeOrTsDsl";
7674
+ protected _types: Array<Ref<Type>>;
7675
+ constructor(...nodes: Array<Type>);
7676
+ analyze(ctx: AnalysisContext): void;
7677
+ types(...nodes: Array<Type>): this;
7678
+ toAst(ctx: AstContext): ts.UnionTypeNode;
7535
7679
  }
7536
7680
  //#endregion
7537
7681
  //#region src/ts-dsl/type/template.d.ts
7538
- declare class TypeTemplateTsDsl extends TypeTsDsl<ts.TemplateLiteralTypeNode> {
7682
+ declare const Mixed$1: abstract new () => TsDsl<ts.TemplateLiteralTypeNode>;
7683
+ declare class TypeTemplateTsDsl extends Mixed$1 {
7684
+ readonly '~dsl' = "TypeTemplateTsDsl";
7539
7685
  protected parts: Array<string | MaybeTsDsl<ts.TypeNode>>;
7540
7686
  constructor(value?: string | MaybeTsDsl<ts.TypeNode>);
7687
+ analyze(ctx: AnalysisContext): void;
7541
7688
  /** Adds a raw string segment or embedded type expression. */
7542
7689
  add(part: string | MaybeTsDsl<ts.TypeNode>): this;
7543
- /** Renders a TemplateLiteralTypeNode. */
7544
- $render(): ts.TemplateLiteralTypeNode;
7690
+ toAst(ctx: AstContext): ts.TemplateLiteralTypeNode;
7545
7691
  }
7546
7692
  //#endregion
7547
7693
  //#region src/ts-dsl/type/tuple.d.ts
7548
- declare class TypeTupleTsDsl extends TypeTsDsl<ts.TupleTypeNode> {
7694
+ declare const Mixed: abstract new () => TsDsl<ts.TupleTypeNode>;
7695
+ declare class TypeTupleTsDsl extends Mixed {
7696
+ readonly '~dsl' = "TypeTupleTsDsl";
7549
7697
  protected _elements: Array<string | ts.TypeNode | TypeTsDsl>;
7550
7698
  constructor(...nodes: Array<string | ts.TypeNode | TypeTsDsl>);
7699
+ analyze(ctx: AnalysisContext): void;
7551
7700
  elements(...types: Array<string | ts.TypeNode | TypeTsDsl>): this;
7552
- $render(): ts.TupleTypeNode;
7701
+ toAst(ctx: AstContext): ts.TupleTypeNode;
7702
+ }
7703
+ //#endregion
7704
+ //#region src/ts-dsl/render/typescript.d.ts
7705
+ declare class TypeScriptRenderer implements Renderer {
7706
+ /**
7707
+ * Whether `export * from 'module'` should be used when possible instead of named exports.
7708
+ *
7709
+ * @private
7710
+ */
7711
+ private preferExportAll;
7712
+ /**
7713
+ * Controls whether imports/exports include a file extension (e.g., '.ts' or '.js').
7714
+ *
7715
+ * @private
7716
+ */
7717
+ private preferFileExtension;
7718
+ /**
7719
+ * Optional function to transform module specifiers.
7720
+ *
7721
+ * @private
7722
+ */
7723
+ private resolveModuleName?;
7724
+ constructor(args?: {
7725
+ preferExportAll?: boolean;
7726
+ preferFileExtension?: string;
7727
+ resolveModuleName?: (moduleName: string) => string | undefined;
7728
+ });
7729
+ render(ctx: RenderContext): string;
7730
+ supports(ctx: RenderContext): boolean;
7731
+ private getExports;
7732
+ private getImports;
7733
+ private renderExport;
7734
+ private renderImport;
7735
+ }
7736
+ //#endregion
7737
+ //#region src/ts-dsl/utils/keywords.d.ts
7738
+ declare const keywords: {
7739
+ browserGlobals: string[];
7740
+ javaScriptGlobals: string[];
7741
+ javaScriptKeywords: string[];
7742
+ nodeGlobals: string[];
7743
+ typeScriptKeywords: string[];
7744
+ };
7745
+ //#endregion
7746
+ //#region src/ts-dsl/utils/regexp.d.ts
7747
+ declare const regexp: {
7748
+ /**
7749
+ * Matches characters from the start as long as they're not allowed.
7750
+ */
7751
+ illegalStartCharacters: RegExp;
7752
+ /**
7753
+ * Matches string if it contains only digits and optionally decimal point or
7754
+ * leading minus sign.
7755
+ */
7756
+ number: RegExp;
7757
+ /**
7758
+ * Javascript identifier regexp pattern retrieved from
7759
+ * {@link} https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#identifiers
7760
+ */
7761
+ typeScriptIdentifier: RegExp;
7762
+ };
7763
+ //#endregion
7764
+ //#region src/ts-dsl/utils/reserved.d.ts
7765
+ type List = ReadonlyArray<string>;
7766
+ declare class ReservedList {
7767
+ private _array;
7768
+ private _set;
7769
+ constructor(values: List);
7770
+ get '~values'(): Set<string>;
7771
+ /**
7772
+ * Updates the reserved list with new values.
7773
+ *
7774
+ * @param values New reserved values or a function that receives the previous
7775
+ * reserved values and returns the new ones.
7776
+ */
7777
+ set(values: List | ((prev: List) => List)): void;
7553
7778
  }
7779
+ /**
7780
+ * Reserved names for identifiers. These names will not be used
7781
+ * for variables, functions, classes, or other identifiers in generated code.
7782
+ */
7783
+ declare const reserved: {
7784
+ /**
7785
+ * Reserved names for runtime identifiers. These names will not be used
7786
+ * for variables, functions, classes, or other runtime identifiers in
7787
+ * generated code.
7788
+ */
7789
+ runtime: ReservedList;
7790
+ /**
7791
+ * Reserved names for type identifiers. These names will not be used
7792
+ * for type or interface identifiers in generated code.
7793
+ */
7794
+ type: ReservedList;
7795
+ };
7554
7796
  //#endregion
7555
7797
  //#region src/ts-dsl/index.d.ts
7556
- declare const $: ((id: string | typescript0.Expression | TsDsl<typescript0.Expression>) => ExprTsDsl) & {
7798
+ declare const $: ((id: string | _hey_api_codegen_core0.Symbol | ts.Expression | TsDsl<ts.Expression>) => ExprTsDsl) & {
7557
7799
  /** Creates an array literal expression (e.g. `[1, 2, 3]`). */
7558
7800
  array: (...args: ConstructorParameters<typeof ArrayTsDsl>) => ArrayTsDsl;
7559
7801
  /** 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;
7802
+ as: (expr: AsExpr, type: AsType) => AsTsDsl;
7561
7803
  /** Creates a property access expression (e.g. `obj.foo`). */
7562
- attr: (left: string | typescript0.Expression | TsDsl<typescript0.Expression>, right: string | number | typescript0.MemberName) => AttrTsDsl;
7804
+ attr: (left: AttrLeft, right: AttrRight) => AttrTsDsl;
7563
7805
  /** Creates an await expression (e.g. `await promise`). */
7564
- await: (expr: string | typescript0.Expression | TsDsl<typescript0.Expression>) => AwaitTsDsl;
7806
+ await: (expr: AwaitExpr) => AwaitTsDsl;
7565
7807
  /** 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;
7808
+ binary: (base: string | _hey_api_codegen_core0.Symbol | ts.Expression | TsDsl<ts.Expression>, op?: (("!=" | "!==" | "&&" | "*" | "+" | "-" | "/" | "<" | "<=" | "=" | "==" | "===" | ">" | ">=" | "??" | "??=" | "||") | ts.BinaryOperator) | undefined, expr?: (string | _hey_api_codegen_core0.Symbol | ts.Expression | TsDsl<ts.Expression>) | undefined) => BinaryTsDsl;
7809
+ /** Creates a statement block (`{ ... }`). */
7810
+ block: (...args: ConstructorParameters<typeof BlockTsDsl>) => BlockTsDsl;
7567
7811
  /** 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;
7812
+ call: (callee: CallCallee, ...args: (CallArg | undefined)[]) => CallTsDsl;
7569
7813
  /** Creates a class declaration or expression. */
7570
- class: (name: string) => ClassTsDsl;
7814
+ class: (name: string | _hey_api_codegen_core0.Symbol) => ClassTsDsl;
7571
7815
  /** Creates a constant variable declaration (`const`). */
7572
- const: (name?: string | undefined) => VarTsDsl;
7816
+ const: (name?: VarName | undefined) => VarTsDsl;
7573
7817
  /** Creates a decorator expression (e.g. `@decorator`). */
7574
- decorator: (name: string | typescript0.Expression, ...args: (string | typescript0.Expression | TsDsl<typescript0.Expression>)[]) => DecoratorTsDsl;
7818
+ decorator: (name: DecoratorName, ...args: (string | ts.Expression | TsDsl<ts.Expression>)[]) => DecoratorTsDsl;
7575
7819
  /** Creates a JSDoc documentation block. */
7576
- doc: (lines?: MaybeArray$1<string> | undefined, fn?: ((d: DocTsDsl) => void) | undefined) => DocTsDsl;
7820
+ doc: (lines?: DocLines | undefined, fn?: DocFn | undefined) => DocTsDsl;
7577
7821
  /** Creates an enum declaration. */
7578
- enum: (name: string | typescript0.Identifier, fn?: ((e: EnumTsDsl) => void) | undefined) => EnumTsDsl;
7822
+ enum: (name: EnumName, fn?: ((e: EnumTsDsl) => void) | undefined) => EnumTsDsl;
7579
7823
  /** Creates a general expression node. */
7580
- expr: (id: string | typescript0.Expression | TsDsl<typescript0.Expression>) => ExprTsDsl;
7824
+ expr: (id: string | _hey_api_codegen_core0.Symbol | ts.Expression | TsDsl<ts.Expression>) => ExprTsDsl;
7581
7825
  /** Creates a field declaration in a class or object. */
7582
- field: (name: string, fn?: ((f: FieldTsDsl) => void) | undefined) => FieldTsDsl;
7826
+ field: (name: FieldName, fn?: ((f: FieldTsDsl) => void) | undefined) => FieldTsDsl;
7583
7827
  /** Converts a runtime value into a corresponding expression node. */
7584
7828
  fromValue: (input: unknown, options?: {
7585
7829
  layout?: "pretty";
7586
- } | undefined) => TsDsl<typescript0.Expression>;
7830
+ } | undefined) => TsDsl<ts.Expression>;
7587
7831
  /** Creates a function expression or declaration. */
7588
7832
  func: {
7589
7833
  (): FuncTsDsl<"arrow">;
@@ -7593,41 +7837,43 @@ declare const $: ((id: string | typescript0.Expression | TsDsl<typescript0.Expre
7593
7837
  (name?: string, fn?: (f: FuncTsDsl<"decl">) => void): FuncTsDsl<"arrow"> | FuncTsDsl<"decl">;
7594
7838
  };
7595
7839
  /** Creates a getter method declaration. */
7596
- getter: (name: string | typescript0.PropertyName, fn?: ((g: GetterTsDsl) => void) | undefined) => GetterTsDsl;
7840
+ getter: (name: GetterName, fn?: ((g: GetterTsDsl) => void) | undefined) => GetterTsDsl;
7597
7841
  /** Creates a single-line comment (//). */
7598
- hint: (lines?: MaybeArray$1<string> | undefined, fn?: ((d: HintTsDsl) => void) | undefined) => HintTsDsl;
7842
+ hint: (lines?: HintLines | undefined, fn?: HintFn | undefined) => HintTsDsl;
7599
7843
  /** Creates an identifier (e.g. `foo`). */
7600
7844
  id: (name: string) => IdTsDsl;
7601
7845
  /** Creates an if statement. */
7602
- if: (condition?: string | typescript0.Expression | TsDsl<typescript0.Expression> | undefined) => IfTsDsl;
7846
+ if: (condition?: IfCondition | undefined) => IfTsDsl;
7603
7847
  /** Creates an initialization block or statement. */
7604
7848
  init: (fn?: ((i: InitTsDsl) => void) | undefined) => InitTsDsl;
7849
+ /** Creates a lazy, context-aware node with deferred evaluation. */
7850
+ lazy: <T extends ts.Node>(thunk: LazyThunk<T>) => LazyTsDsl<T>;
7605
7851
  /** Creates a let variable declaration (`let`). */
7606
- let: (name?: string | undefined) => VarTsDsl;
7852
+ let: (name?: VarName | undefined) => VarTsDsl;
7607
7853
  /** Creates a literal value (e.g. string, number, boolean). */
7608
7854
  literal: (value: string | number | boolean | null) => LiteralTsDsl;
7609
7855
  /** Creates an enum member declaration. */
7610
- member: (name: string, value?: ((string | number | typescript0.Expression | TsDsl<typescript0.Expression>) | ((m: EnumMemberTsDsl) => void)) | undefined) => EnumMemberTsDsl;
7856
+ member: (name: string, value?: ((string | number | ts.Expression | TsDsl<ts.Expression>) | ((m: EnumMemberTsDsl) => void)) | undefined) => EnumMemberTsDsl;
7611
7857
  /** Creates a method declaration inside a class or object. */
7612
7858
  method: (name: string, fn?: ((m: MethodTsDsl) => void) | undefined) => MethodTsDsl;
7613
7859
  /** Creates a negation expression (`-x`). */
7614
- neg: (expr?: string | typescript0.Expression | TsDsl<typescript0.Expression> | undefined, op?: typescript0.PrefixUnaryOperator | undefined) => PrefixTsDsl;
7860
+ neg: (expr?: string | ts.Expression | TsDsl<ts.Expression> | undefined, op?: ts.PrefixUnaryOperator | undefined) => PrefixTsDsl;
7615
7861
  /** 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;
7862
+ new: (classExpr: NewExpr, ...args: NewExpr[]) => NewTsDsl;
7617
7863
  /** Creates a newline (for formatting purposes). */
7618
7864
  newline: () => NewlineTsDsl;
7619
7865
  /** Creates a logical NOT expression (`!x`). */
7620
- not: (expr?: string | typescript0.Expression | TsDsl<typescript0.Expression> | undefined, op?: typescript0.PrefixUnaryOperator | undefined) => PrefixTsDsl;
7866
+ not: (expr?: string | ts.Expression | TsDsl<ts.Expression> | undefined, op?: ts.PrefixUnaryOperator | undefined) => PrefixTsDsl;
7621
7867
  /** Creates a block comment (/* ... *\/). */
7622
- note: (lines?: MaybeArray$1<string> | undefined, fn?: ((d: NoteTsDsl) => void) | undefined) => NoteTsDsl;
7868
+ note: (lines?: NoteLines | undefined, fn?: NoteFn | undefined) => NoteTsDsl;
7623
7869
  /** Creates an object literal expression. */
7624
7870
  object: (...args: ConstructorParameters<typeof ObjectTsDsl>) => ObjectTsDsl;
7625
7871
  /** Creates a parameter declaration for functions or methods. */
7626
- param: (name: string | ((p: ParamTsDsl) => void), fn?: ((p: ParamTsDsl) => void) | undefined) => ParamTsDsl;
7872
+ param: (name: ParamName | ((p: ParamTsDsl) => void), fn?: ((p: ParamTsDsl) => void) | undefined) => ParamTsDsl;
7627
7873
  /** Creates a pattern for destructuring or matching. */
7628
7874
  pattern: () => PatternTsDsl;
7629
7875
  /** Creates a prefix unary expression (e.g. `-x`, `!x`, `~x`). */
7630
- prefix: (expr?: string | typescript0.Expression | TsDsl<typescript0.Expression> | undefined, op?: typescript0.PrefixUnaryOperator | undefined) => PrefixTsDsl;
7876
+ prefix: (expr?: string | ts.Expression | TsDsl<ts.Expression> | undefined, op?: ts.PrefixUnaryOperator | undefined) => PrefixTsDsl;
7631
7877
  /** Creates an object literal property (e.g. `{ foo: bar }`). */
7632
7878
  prop: (meta: {
7633
7879
  kind: "computed";
@@ -7648,35 +7894,37 @@ declare const $: ((id: string | typescript0.Expression | TsDsl<typescript0.Expre
7648
7894
  /** Creates a regular expression literal (e.g. `/foo/gi`). */
7649
7895
  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
7896
  /** Creates a return statement. */
7651
- return: (expr?: string | typescript0.Expression | TsDsl<typescript0.Expression> | undefined) => ReturnTsDsl;
7897
+ return: (expr?: ReturnExpr | undefined) => ReturnTsDsl;
7652
7898
  /** Creates a setter method declaration. */
7653
- setter: (name: string | typescript0.PropertyName, fn?: ((s: SetterTsDsl) => void) | undefined) => SetterTsDsl;
7899
+ setter: (name: SetterName, fn?: ((s: SetterTsDsl) => void) | undefined) => SetterTsDsl;
7654
7900
  /** Wraps an expression or statement-like value into a `StmtTsDsl`. */
7655
- stmt: (inner: typescript0.Expression | typescript0.Statement | TsDsl<any>) => StmtTsDsl;
7901
+ stmt: (inner: ts.Expression | ts.Statement | TsDsl<any>) => StmtTsDsl;
7656
7902
  /** Creates a template literal expression. */
7657
- template: (value?: string | typescript0.Expression | TsDsl<typescript0.Expression> | undefined) => TemplateTsDsl;
7903
+ template: (value?: TemplatePart | undefined) => TemplateTsDsl;
7658
7904
  /** Creates a ternary conditional expression (if ? then : else). */
7659
- ternary: (condition?: string | typescript0.Expression | TsDsl<typescript0.Expression> | undefined) => TernaryTsDsl;
7905
+ ternary: (condition?: string | ts.Expression | TsDsl<ts.Expression> | undefined) => TernaryTsDsl;
7660
7906
  /** Creates a throw statement. */
7661
- throw: (error: string | typescript0.Expression | TsDsl<typescript0.Expression>, useNew?: boolean | undefined) => ThrowTsDsl;
7907
+ throw: (error: string | ts.Expression | TsDsl<ts.Expression>, useNew?: boolean | undefined) => ThrowTsDsl;
7662
7908
  /** Creates a syntax token (e.g. `?`, `readonly`, `+`, `-`). */
7663
7909
  token: () => TokenTsDsl<never>;
7910
+ /** Creates a try/catch/finally statement. */
7911
+ try: (...args: ConstructorParameters<typeof TryTsDsl>) => TryTsDsl;
7664
7912
  /** Creates a basic type reference or type expression (e.g. Foo or Foo<T>). */
7665
- type: ((name: string, fn?: ((t: TypeExprTsDsl) => void) | undefined) => TypeExprTsDsl) & {
7913
+ type: ((name: TypeExprName, fn?: TypeExprFn | undefined) => TypeExprTsDsl) & {
7666
7914
  /** Creates a type alias declaration (e.g. `type Foo = Bar`). */
7667
- alias: (name: string, fn?: ((t: TypeAliasTsDsl) => void) | undefined) => TypeAliasTsDsl;
7915
+ alias: (name: string | _hey_api_codegen_core0.Symbol, fn?: ((t: TypeAliasTsDsl) => void) | undefined) => TypeAliasTsDsl;
7668
7916
  /** Creates an intersection type (e.g. `A & B`). */
7669
7917
  and: (...args: ConstructorParameters<typeof TypeAndTsDsl>) => TypeAndTsDsl;
7670
7918
  /** Creates a qualified type reference (e.g. Foo.Bar). */
7671
- attr: (right: string | typescript0.Identifier) => TypeAttrTsDsl;
7919
+ attr: (right: string | _hey_api_codegen_core0.Symbol | ts.Identifier) => TypeAttrTsDsl;
7672
7920
  /** Creates a basic type reference or type expression (e.g. Foo or Foo<T>). */
7673
- expr: (name: string, fn?: ((t: TypeExprTsDsl) => void) | undefined) => TypeExprTsDsl;
7921
+ expr: (name: TypeExprName, fn?: TypeExprFn | undefined) => TypeExprTsDsl;
7674
7922
  /** Converts a runtime value into a corresponding type expression node. */
7675
- fromValue: (input: unknown) => TsDsl<typescript0.TypeNode>;
7923
+ fromValue: (input: unknown) => TsDsl<ts.TypeNode>;
7676
7924
  /** Creates a function type node (e.g. `(a: string) => number`). */
7677
- func: () => TypeFuncTsDsl;
7925
+ func: (...args: ConstructorParameters<typeof TypeFuncTsDsl>) => TypeFuncTsDsl;
7678
7926
  /** Creates an indexed-access type (e.g. `Foo<T>[K]`). */
7679
- idx: (base: string | typescript0.TypeNode | TsDsl<typescript0.TypeNode>, index: string | number | typescript0.TypeNode | TsDsl<typescript0.TypeNode>) => TypeIdxTsDsl;
7927
+ idx: (base: string | ts.TypeNode | TsDsl<ts.TypeNode>, index: string | number | ts.TypeNode | TsDsl<ts.TypeNode>) => TypeIdxTsDsl;
7680
7928
  /** Creates a literal type node (e.g. 'foo', 42, or true). */
7681
7929
  literal: (value: string | number | boolean | null) => TypeLiteralTsDsl;
7682
7930
  /** Creates a mapped type (e.g. `{ [K in keyof T]: U }`). */
@@ -7688,18 +7936,18 @@ declare const $: ((id: string | typescript0.Expression | TsDsl<typescript0.Expre
7688
7936
  /** Represents a union type (e.g. `A | B | C`). */
7689
7937
  or: (...args: ConstructorParameters<typeof TypeOrTsDsl>) => TypeOrTsDsl;
7690
7938
  /** Creates a type parameter (e.g. `<T>`). */
7691
- param: (name?: string | typescript0.Identifier | undefined, fn?: ((name: TypeParamTsDsl) => void) | undefined) => TypeParamTsDsl;
7939
+ param: (name?: TypeParamName | undefined, fn?: ((name: TypeParamTsDsl) => void) | undefined) => TypeParamTsDsl;
7692
7940
  /** Creates a type query node (e.g. `typeof Foo`). */
7693
- query: (expr: string | MaybeTsDsl<typescript0.Expression | TypeTsDsl<typescript0.TypeNode>>) => TypeQueryTsDsl;
7941
+ query: (expr: TypeQueryExpr) => TypeQueryTsDsl;
7694
7942
  /** Builds a TypeScript template literal *type* (e.g. `${Foo}-${Bar}` as a type). */
7695
- template: (value?: string | typescript0.TypeNode | TsDsl<typescript0.TypeNode> | undefined) => TypeTemplateTsDsl;
7943
+ template: (value?: string | ts.TypeNode | TsDsl<ts.TypeNode> | undefined) => TypeTemplateTsDsl;
7696
7944
  /** Creates a tuple type (e.g. [A, B, C]). */
7697
7945
  tuple: (...args: ConstructorParameters<typeof TypeTupleTsDsl>) => TypeTupleTsDsl;
7698
7946
  };
7699
- /** Creates a runtime `typeof` expression (e.g. typeof x). */
7700
- typeofExpr: (expr: string | typescript0.Expression | TsDsl<typescript0.Expression>) => TypeOfExprTsDsl;
7701
- /** Creates a variable declaration (var). */
7702
- var: (name?: string | undefined) => VarTsDsl;
7947
+ /** Creates a `typeof` expression (e.g. `typeof value`). */
7948
+ typeofExpr: (expr: TypeOfExpr) => TypeOfExprTsDsl;
7949
+ /** Creates a variable declaration (`var`). */
7950
+ var: (name?: VarName | undefined) => VarTsDsl;
7703
7951
  };
7704
7952
  type DollarTsDsl = {
7705
7953
  /**
@@ -7716,7 +7964,7 @@ type DollarTsDsl = {
7716
7964
  *
7717
7965
  * Returns:
7718
7966
  * - A new `ExprTsDsl` instance when called directly.
7719
- * - The `base` factory object for constructing more specific nodes.
7967
+ * - The `tsDsl` object for constructing more specific nodes.
7720
7968
  */
7721
7969
  $: typeof $;
7722
7970
  };
@@ -7805,7 +8053,7 @@ type HeyApiTransformersPlugin = DefinePlugin<UserConfig$13, Config$12>;
7805
8053
  //#region src/plugins/@hey-api/typescript/shared/types.d.ts
7806
8054
  type IrSchemaToAstOptions = {
7807
8055
  plugin: HeyApiTypeScriptPlugin['Instance'];
7808
- state: ToRefs<PluginState>;
8056
+ state: Refs<PluginState>;
7809
8057
  };
7810
8058
  type PluginState = Pick<Required<SymbolMeta>, 'path'> & Pick<Partial<SymbolMeta>, 'tags'>;
7811
8059
  //#endregion
@@ -14032,14 +14280,25 @@ declare class PluginInstance<T extends Plugin.Types = Plugin.Types> {
14032
14280
  };
14033
14281
  };
14034
14282
  isSymbolRegistered(identifier: SymbolIdentifier): boolean;
14283
+ /**
14284
+ * Sets or adds a node to the project graph.
14285
+ *
14286
+ * @param node The node to be added or updated in the project graph.
14287
+ * @param index The index at which to update the node. If undefined, the node will be added.
14288
+ * @returns The index of the added node or void if updated.
14289
+ */
14290
+ node<T extends number | undefined = undefined>(node: Node | null, index?: T): T extends number ? void : number;
14035
14291
  querySymbol(filter: SymbolMeta): Symbol | undefined;
14036
14292
  referenceSymbol(meta: SymbolMeta): Symbol;
14293
+ /**
14294
+ * @deprecated use `plugin.symbol()` instead
14295
+ */
14037
14296
  registerSymbol(symbol: SymbolIn): Symbol;
14038
14297
  /**
14039
14298
  * Executes plugin's handler function.
14040
14299
  */
14041
14300
  run(): Promise<void>;
14042
- setSymbolValue(symbol: Symbol, value: unknown): void;
14301
+ symbol(name: SymbolIn['name'], symbol?: Omit<SymbolIn, 'name'>): Symbol;
14043
14302
  private buildEventHooks;
14044
14303
  private forEachError;
14045
14304
  private getSymbolFilePath;
@@ -14052,6 +14311,34 @@ type Hooks = {
14052
14311
  * Event hooks.
14053
14312
  */
14054
14313
  events?: {
14314
+ /**
14315
+ * Triggered after adding or updating a node.
14316
+ *
14317
+ * You can use this to perform actions after a node is added or updated.
14318
+ *
14319
+ * @param args Arguments object.
14320
+ * @returns void
14321
+ */
14322
+ 'node:set:after'?: (args: {
14323
+ /** The node added or updated. */
14324
+ node: Node | null;
14325
+ /** Plugin that added or updated the node. */
14326
+ plugin: PluginInstance;
14327
+ }) => void;
14328
+ /**
14329
+ * Triggered before adding or updating a node.
14330
+ *
14331
+ * You can use this to modify the node before it's added or updated.
14332
+ *
14333
+ * @param args Arguments object.
14334
+ * @returns void
14335
+ */
14336
+ 'node:set:before'?: (args: {
14337
+ /** The node to be added or updated. */
14338
+ node: Node | null;
14339
+ /** Plugin adding or updating the node. */
14340
+ plugin: PluginInstance;
14341
+ }) => void;
14055
14342
  /**
14056
14343
  * Triggered after executing a plugin handler.
14057
14344
  *
@@ -14100,38 +14387,6 @@ type Hooks = {
14100
14387
  /** Symbol to register. */
14101
14388
  symbol: SymbolIn;
14102
14389
  }) => 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
14390
  };
14136
14391
  /**
14137
14392
  * Hooks specifically for overriding operations behavior.
@@ -14293,8 +14548,8 @@ declare namespace Plugin {
14293
14548
  * Generic wrapper for plugin hooks.
14294
14549
  */
14295
14550
  export type Hooks = Pick<BaseConfig, '~hooks'>;
14296
- export interface Name<Name extends PluginNames> {
14297
- name: Name;
14551
+ export interface Name<Name$2 extends PluginNames> {
14552
+ name: Name$2;
14298
14553
  }
14299
14554
 
14300
14555
  /**
@@ -14611,8 +14866,8 @@ type UserOutput = {
14611
14866
  /**
14612
14867
  * If specified, this will be the file extension used when importing
14613
14868
  * other modules. By default, we don't add a file extension and let the
14614
- * runtime resolve it. If you're using moduleResolution `nodenext`, we
14615
- * default to `.js`.
14869
+ * runtime resolve it. If you're using moduleResolution `nodenext` or
14870
+ * `node16`, we default to `.js`.
14616
14871
  *
14617
14872
  * @default undefined
14618
14873
  */
@@ -14631,10 +14886,28 @@ type UserOutput = {
14631
14886
  * @default null
14632
14887
  */
14633
14888
  lint?: Linters | null;
14889
+ /**
14890
+ * Optional name conflict resolver to customize how naming conflicts
14891
+ * are handled.
14892
+ */
14893
+ nameConflictResolver?: NameConflictResolver;
14634
14894
  /**
14635
14895
  * The absolute path to the output folder.
14636
14896
  */
14637
14897
  path: string;
14898
+ /**
14899
+ * Whether `export * from 'module'` should be used when possible
14900
+ * instead of named exports.
14901
+ *
14902
+ * @default false
14903
+ */
14904
+ preferExportAll?: boolean;
14905
+ /**
14906
+ * Optional function to transform module specifiers.
14907
+ *
14908
+ * @default undefined
14909
+ */
14910
+ resolveModuleName?: (moduleName: string) => string | undefined;
14638
14911
  /**
14639
14912
  * Relative or absolute path to the tsconfig file we should use to
14640
14913
  * generate the output. If a path to tsconfig file is not provided, we
@@ -14649,17 +14922,13 @@ type Output = {
14649
14922
  /**
14650
14923
  * Defines casing of the output fields. By default, we preserve `input`
14651
14924
  * values as data transforms incur a performance penalty at runtime.
14652
- *
14653
- * @default undefined
14654
14925
  */
14655
- case?: StringCase;
14926
+ case: StringCase | undefined;
14656
14927
  /**
14657
14928
  * Clean the `output` folder on every run? If disabled, this folder may
14658
14929
  * be used to store additional files. The default option is `true` to
14659
14930
  * reduce the risk of keeping outdated files around when configuration,
14660
14931
  * input, or package version changes.
14661
- *
14662
- * @default true
14663
14932
  */
14664
14933
  clean: boolean;
14665
14934
  /**
@@ -14671,21 +14940,16 @@ type Output = {
14671
14940
  fileName: {
14672
14941
  /**
14673
14942
  * The casing convention to use for generated file names.
14674
- *
14675
- * @default 'preserve'
14676
14943
  */
14677
14944
  case: StringCase;
14678
14945
  /**
14679
14946
  * Custom naming pattern for generated file names.
14680
- *
14681
- * @default '{{name}}'
14682
14947
  */
14683
14948
  name: StringName;
14684
14949
  /**
14685
14950
  * Suffix to append to file names (before the extension). For example,
14686
14951
  * with a suffix of `.gen`, `example.ts` becomes `example.gen.ts`.
14687
14952
  *
14688
- * @default '.gen'
14689
14953
  * @example
14690
14954
  * // Given a suffix of `.gen`
14691
14955
  * 'index.ts' -> 'index.ts' (index files are not renamed)
@@ -14696,37 +14960,43 @@ type Output = {
14696
14960
  };
14697
14961
  /**
14698
14962
  * Which formatter to use to process output folder?
14699
- *
14700
- * @default null
14701
14963
  */
14702
14964
  format: Formatters | null;
14703
14965
  /**
14704
14966
  * If specified, this will be the file extension used when importing
14705
14967
  * other modules. By default, we don't add a file extension and let the
14706
- * runtime resolve it. If you're using moduleResolution `nodenext`, we
14707
- * default to `.js`.
14708
- *
14709
- * @default undefined
14968
+ * runtime resolve it. If you're using moduleResolution `nodenext` or
14969
+ * `node16`, we default to `.js`.
14710
14970
  */
14711
14971
  importFileExtension: ImportFileExtensions | (string & {}) | null | undefined;
14712
14972
  /**
14713
14973
  * Should the exports from plugin files be re-exported in the index
14714
14974
  * barrel file? By default, this is enabled and only default plugins
14715
14975
  * are re-exported.
14716
- *
14717
- * @default true
14718
14976
  */
14719
14977
  indexFile: boolean;
14720
14978
  /**
14721
14979
  * Which linter to use to process output folder?
14722
- *
14723
- * @default null
14724
14980
  */
14725
14981
  lint: Linters | null;
14982
+ /**
14983
+ * Optional name conflict resolver to customize how naming conflicts
14984
+ * are handled.
14985
+ */
14986
+ nameConflictResolver: NameConflictResolver | undefined;
14726
14987
  /**
14727
14988
  * The absolute path to the output folder.
14728
14989
  */
14729
14990
  path: string;
14991
+ /**
14992
+ * Whether `export * from 'module'` should be used when possible
14993
+ * instead of named exports.
14994
+ */
14995
+ preferExportAll: boolean;
14996
+ /**
14997
+ * Optional function to transform module specifiers.
14998
+ */
14999
+ resolveModuleName: ((moduleName: string) => string | undefined) | undefined;
14730
15000
  /**
14731
15001
  * The parsed TypeScript configuration used to generate the output.
14732
15002
  * If no `tsconfig` file path was provided or found, this will be `null`.
@@ -14737,8 +15007,6 @@ type Output = {
14737
15007
  * generate the output. If a path to tsconfig file is not provided, we
14738
15008
  * attempt to find one starting from the location of the
14739
15009
  * `@hey-api/openapi-ts` configuration file and traversing up.
14740
- *
14741
- * @default undefined
14742
15010
  */
14743
15011
  tsConfigPath: (string & {}) | null | undefined;
14744
15012
  };
@@ -15384,5 +15652,5 @@ type Config = Omit<Required<UserConfig>, 'input' | 'logs' | 'output' | 'parser'
15384
15652
  plugins: { [K in PluginNames]?: Plugin.Config<PluginConfigMap[K]> };
15385
15653
  };
15386
15654
  //#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
15655
+ 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 };
15656
+ //# sourceMappingURL=config-Duuay7XM.d.cts.map