@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,51 +1,14 @@
1
- import { IProject, Project, Symbol, SymbolIdentifier, SymbolIn, SymbolMeta } from "@hey-api/codegen-core";
2
- import * as typescript0 from "typescript";
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";
3
3
  import ts from "typescript";
4
4
  import { RangeOptions, SemVer } from "semver";
5
5
  import { HttpClient, HttpErrorResponse, HttpHeaders, HttpRequest, HttpResponse } from "@angular/common/http";
6
6
  import { Injector } from "@angular/core";
7
7
  import { AxiosError, AxiosInstance, AxiosRequestHeaders, AxiosResponse, AxiosStatic, CreateAxiosDefaults } from "axios";
8
8
  import { AsyncDataOptions, UseFetchOptions, useAsyncData, useFetch, useLazyAsyncData, useLazyFetch } from "nuxt/app";
9
- import { Ref } from "vue";
9
+ import { Ref as Ref$1 } from "vue";
10
10
  import { FetchOptions, ResponseType, ofetch } from "ofetch";
11
11
 
12
- //#region src/plugins/shared/types/refs.d.ts
13
- /**
14
- * Ref wrapper which ensures a stable reference for a value.
15
- *
16
- * @example
17
- * ```ts
18
- * type NumRef = Ref<number>; // { value: number }
19
- * const num: NumRef = { value: 42 };
20
- * console.log(num.value); // 42
21
- * ```
22
- */
23
- type Ref$1<T> = {
24
- value: T;
25
- };
26
-
27
- /**
28
- * Utility type: wraps a value in a Ref.
29
- *
30
- * @example
31
- * ```ts
32
- * type R = ToRef<number>; // { value: number }
33
- * ```
34
- */
35
-
36
- /**
37
- * Maps every property of `T` to a `Ref` of that property.
38
- *
39
- * @example
40
- * ```ts
41
- * type Foo = { a: number; b: string };
42
- * type Refs = ToRefs<Foo>; // { a: Ref<number>; b: Ref<string> }
43
- * const refs: Refs = { a: { value: 1 }, b: { value: 'x' } };
44
- * console.log(refs.a.value, refs.b.value); // 1 'x'
45
- * ```
46
- */
47
- type ToRefs<T> = { [K in keyof T]: Ref$1<T[K]> };
48
- //#endregion
49
12
  //#region src/openApi/shared/types/openapi-spec-extensions.d.ts
50
13
  interface EnumExtensions {
51
14
  /**
@@ -73,12 +36,20 @@ type LazyOrAsync<T> = T | (() => T) | (() => Promise<T>);
73
36
  type MaybeArray<T> = T | ReadonlyArray<T>;
74
37
  //#endregion
75
38
  //#region src/openApi/3.1.x/types/spec.d.ts
39
+ /**
40
+ * OpenAPI Specification Extensions.
41
+ *
42
+ * See {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specification-extensions Specification Extensions}.
43
+ */
44
+ interface SpecificationExtensions$2 {
45
+ [extension: `x-${string}`]: unknown;
46
+ }
76
47
  /**
77
48
  * 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}.
78
49
  *
79
50
  * This object MAY be extended with {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specification-extensions Specification Extensions}.
80
51
  */
81
- interface OpenApiV3_1_X {
52
+ interface OpenApiV3_1_X extends SpecificationExtensions$2 {
82
53
  /**
83
54
  * An element to hold various schemas for the document.
84
55
  */
@@ -201,11 +172,11 @@ interface OpenApiV3_1_X {
201
172
  * description: callback successfully processed
202
173
  * ```
203
174
  */
204
- interface CallbackObject$1 {
175
+ interface CallbackObject$1 extends SpecificationExtensions$2 {
205
176
  /**
206
177
  * 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.
207
178
  */
208
- [expression: string]: PathItemObject$2 | ReferenceObject$1;
179
+ [expression: string]: PathItemObject$2 | ReferenceObject$1 | unknown;
209
180
  }
210
181
  /**
211
182
  * 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.
@@ -296,7 +267,7 @@ interface CallbackObject$1 {
296
267
  * read:pets: read your pets
297
268
  * ```
298
269
  */
299
- interface ComponentsObject$1 {
270
+ interface ComponentsObject$1 extends SpecificationExtensions$2 {
300
271
  /**
301
272
  * An object to hold reusable {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#callback-object Callback Objects}.
302
273
  */
@@ -350,7 +321,7 @@ interface ComponentsObject$1 {
350
321
  * email: support@example.com
351
322
  * ```
352
323
  */
353
- interface ContactObject$2 {
324
+ interface ContactObject$2 extends SpecificationExtensions$2 {
354
325
  /**
355
326
  * The email address of the contact person/organization. This MUST be in the form of an email address.
356
327
  */
@@ -490,7 +461,7 @@ interface ContactObject$2 {
490
461
  *
491
462
  * will map to `Dog` because of the definition in the `mapping` element.
492
463
  */
493
- interface DiscriminatorObject$1 {
464
+ interface DiscriminatorObject$1 extends SpecificationExtensions$2 {
494
465
  /**
495
466
  * An object to hold mappings between payload values and schema names or references.
496
467
  */
@@ -541,7 +512,7 @@ interface DiscriminatorObject$1 {
541
512
  * type: integer
542
513
  * ```
543
514
  */
544
- interface EncodingObject$1 {
515
+ interface EncodingObject$1 extends SpecificationExtensions$2 {
545
516
  /**
546
517
  * 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.
547
518
  */
@@ -629,7 +600,7 @@ interface EncodingObject$1 {
629
600
  * $ref: '#/components/examples/confirmation-success'
630
601
  * ```
631
602
  */
632
- interface ExampleObject$2 {
603
+ interface ExampleObject$2 extends SpecificationExtensions$2 {
633
604
  /**
634
605
  * Long description for the example. {@link https://spec.commonmark.org/ CommonMark syntax} MAY be used for rich text representation.
635
606
  */
@@ -658,7 +629,7 @@ interface ExampleObject$2 {
658
629
  * url: https://example.com
659
630
  * ```
660
631
  */
661
- interface ExternalDocumentationObject$2 {
632
+ interface ExternalDocumentationObject$2 extends SpecificationExtensions$2 {
662
633
  /**
663
634
  * A description of the target documentation. {@link https://spec.commonmark.org/ CommonMark syntax} MAY be used for rich text representation.
664
635
  */
@@ -704,7 +675,7 @@ type HeaderObject$2 = Omit<ParameterObject, 'in' | 'name'>;
704
675
  * version: 1.0.1
705
676
  * ```
706
677
  */
707
- interface InfoObject {
678
+ interface InfoObject extends SpecificationExtensions$2 {
708
679
  /**
709
680
  * The contact information for the exposed API.
710
681
  */
@@ -745,7 +716,7 @@ interface InfoObject {
745
716
  * identifier: Apache-2.0
746
717
  * ```
747
718
  */
748
- interface LicenseObject$2 {
719
+ interface LicenseObject$2 extends SpecificationExtensions$2 {
749
720
  /**
750
721
  * An {@link https://spdx.org/licenses/ SPDX} license expression for the API. The `identifier` field is mutually exclusive of the `url` field.
751
722
  */
@@ -906,7 +877,7 @@ interface LicenseObject$2 {
906
877
  *
907
878
  * Runtime expressions preserve the type of the referenced value. Expressions can be embedded into string values by surrounding the expression with `{}` curly braces.
908
879
  */
909
- interface LinkObject$1 {
880
+ interface LinkObject$1 extends SpecificationExtensions$2 {
910
881
  /**
911
882
  * A description of the link. {@link https://spec.commonmark.org/ CommonMark syntax} MAY be used for rich text representation.
912
883
  */
@@ -965,7 +936,7 @@ interface LinkObject$1 {
965
936
  * $ref: "#/components/examples/frog-example"
966
937
  * ```
967
938
  */
968
- interface MediaTypeObject$1 {
939
+ interface MediaTypeObject$1 extends SpecificationExtensions$2 {
969
940
  /**
970
941
  * 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`.
971
942
  */
@@ -1006,7 +977,7 @@ interface MediaTypeObject$1 {
1006
977
  * read:pets: read your pets
1007
978
  * ```
1008
979
  */
1009
- interface OAuthFlowObject$1 {
980
+ interface OAuthFlowObject$1 extends SpecificationExtensions$2 {
1010
981
  /**
1011
982
  * **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.
1012
983
  */
@@ -1029,7 +1000,7 @@ interface OAuthFlowObject$1 {
1029
1000
  *
1030
1001
  * This object MAY be extended with {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specification-extensions Specification Extensions}.
1031
1002
  */
1032
- interface OAuthFlowsObject$1 {
1003
+ interface OAuthFlowsObject$1 extends SpecificationExtensions$2 {
1033
1004
  /**
1034
1005
  * Configuration for the OAuth Authorization Code flow. Previously called `accessCode` in OpenAPI 2.0.
1035
1006
  */
@@ -1096,7 +1067,7 @@ interface OAuthFlowsObject$1 {
1096
1067
  * - read:pets
1097
1068
  * ```
1098
1069
  */
1099
- interface OperationObject {
1070
+ interface OperationObject extends SpecificationExtensions$2 {
1100
1071
  /**
1101
1072
  * 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.
1102
1073
  */
@@ -1243,7 +1214,7 @@ interface OperationObject {
1243
1214
  * type: number
1244
1215
  * ```
1245
1216
  */
1246
- interface ParameterObject {
1217
+ interface ParameterObject extends SpecificationExtensions$2 {
1247
1218
  /**
1248
1219
  * 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.
1249
1220
  */
@@ -1338,7 +1309,7 @@ interface ParameterObject {
1338
1309
  * style: simple
1339
1310
  * ```
1340
1311
  */
1341
- interface PathItemObject$2 {
1312
+ interface PathItemObject$2 extends SpecificationExtensions$2 {
1342
1313
  /**
1343
1314
  * 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}.
1344
1315
  */
@@ -1437,7 +1408,7 @@ interface PathItemObject$2 {
1437
1408
  * $ref: '#/components/schemas/pet'
1438
1409
  * ```
1439
1410
  */
1440
- interface PathsObject$2 {
1411
+ interface PathsObject$2 extends SpecificationExtensions$2 {
1441
1412
  /**
1442
1413
  * 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.
1443
1414
  */
@@ -1540,7 +1511,7 @@ interface ReferenceObject$1 {
1540
1511
  * type: string
1541
1512
  * ```
1542
1513
  */
1543
- interface RequestBodyObject {
1514
+ interface RequestBodyObject extends SpecificationExtensions$2 {
1544
1515
  /**
1545
1516
  * **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/*
1546
1517
  */
@@ -1615,7 +1586,7 @@ interface RequestBodyObject {
1615
1586
  * description: object created
1616
1587
  * ```
1617
1588
  */
1618
- interface ResponseObject {
1589
+ interface ResponseObject extends SpecificationExtensions$2 {
1619
1590
  /**
1620
1591
  * 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/*
1621
1592
  */
@@ -1662,11 +1633,11 @@ interface ResponseObject {
1662
1633
  * $ref: '#/components/schemas/ErrorModel'
1663
1634
  * ```
1664
1635
  */
1665
- interface ResponsesObject$2 {
1636
+ interface ResponsesObject$2 extends SpecificationExtensions$2 {
1666
1637
  /**
1667
1638
  * 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.
1668
1639
  */
1669
- [httpStatusCode: string]: ResponseObject | ReferenceObject$1 | undefined;
1640
+ [httpStatusCode: string]: ResponseObject | ReferenceObject$1 | undefined | unknown;
1670
1641
  /**
1671
1642
  * The documentation of responses other than the ones declared for specific HTTP response codes. Use this field to cover undeclared responses.
1672
1643
  */
@@ -1696,7 +1667,7 @@ interface ResponsesObject$2 {
1696
1667
  *
1697
1668
  * 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.
1698
1669
  */
1699
- type SchemaObject = JsonSchemaDraft2020_12;
1670
+ type SchemaObject = JsonSchemaDraft2020_12 & SpecificationExtensions$2;
1700
1671
  /**
1701
1672
  * 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}.
1702
1673
  *
@@ -1781,7 +1752,7 @@ interface SecurityRequirementObject$2 {
1781
1752
  * read:pets: read your pets
1782
1753
  * ```
1783
1754
  */
1784
- type SecuritySchemeObject$2 = {
1755
+ type SecuritySchemeObject$2 = SpecificationExtensions$2 & {
1785
1756
  /**
1786
1757
  * A description for security scheme. {@link https://spec.commonmark.org/ CommonMark syntax} MAY be used for rich text representation.
1787
1758
  */
@@ -1847,7 +1818,7 @@ type SecuritySchemeObject$2 = {
1847
1818
  * description: Development server
1848
1819
  * ```
1849
1820
  */
1850
- interface ServerObject$1 {
1821
+ interface ServerObject$1 extends SpecificationExtensions$2 {
1851
1822
  /**
1852
1823
  * An optional string describing the host designated by the URL. {@link https://spec.commonmark.org/ CommonMark syntax} MAY be used for rich text representation.
1853
1824
  */
@@ -1866,7 +1837,7 @@ interface ServerObject$1 {
1866
1837
  *
1867
1838
  * This object MAY be extended with {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specification-extensions Specification Extensions}.
1868
1839
  */
1869
- interface ServerVariableObject$1 {
1840
+ interface ServerVariableObject$1 extends SpecificationExtensions$2 {
1870
1841
  /**
1871
1842
  * **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.
1872
1843
  */
@@ -1891,7 +1862,7 @@ interface ServerVariableObject$1 {
1891
1862
  * description: Pets operations
1892
1863
  * ```
1893
1864
  */
1894
- interface TagObject$2 {
1865
+ interface TagObject$2 extends SpecificationExtensions$2 {
1895
1866
  /**
1896
1867
  * A description for the tag. {@link https://spec.commonmark.org/ CommonMark syntax} MAY be used for rich text representation.
1897
1868
  */
@@ -2097,7 +2068,7 @@ interface TagObject$2 {
2097
2068
  * </aliens>
2098
2069
  * ```
2099
2070
  */
2100
- interface XMLObject$2 {
2071
+ interface XMLObject$2 extends SpecificationExtensions$2 {
2101
2072
  /**
2102
2073
  * Declares whether the property definition translates to an attribute instead of an element. Default value is `false`.
2103
2074
  */
@@ -2144,7 +2115,7 @@ interface OpenApiSchemaExtensions {
2144
2115
  //#endregion
2145
2116
  //#region src/openApi/3.1.x/types/json-schema-draft-2020-12.d.ts
2146
2117
  // TODO: left out some keywords related to structuring a complex schema and declaring a dialect
2147
- interface JsonSchemaDraft2020_12 extends ArrayKeywords, NumberKeywords, ObjectKeywords, StringKeywords, EnumExtensions, OpenApiSchemaExtensions {
2118
+ interface JsonSchemaDraft2020_12 extends ArrayKeywords, NumberKeywords, ObjectKeywords, StringKeywords, EnumExtensions, OpenApiSchemaExtensions, SpecificationExtensions$2 {
2148
2119
  /**
2149
2120
  * 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.
2150
2121
  */
@@ -2469,6 +2440,14 @@ type JsonSchemaTypes$1 = 'array' | 'boolean' | 'integer' | 'null' | 'number' | '
2469
2440
  type IRMediaType = 'form-data' | 'json' | 'text' | 'url-search-params' | 'octet-stream';
2470
2441
  //#endregion
2471
2442
  //#region src/ir/types.d.ts
2443
+ /**
2444
+ * OpenAPI Specification Extensions.
2445
+ *
2446
+ * See {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specification-extensions Specification Extensions}.
2447
+ */
2448
+ interface SpecificationExtensions$1 {
2449
+ [extension: `x-${string}`]: unknown;
2450
+ }
2472
2451
  interface IRBodyObject {
2473
2452
  mediaType: string;
2474
2453
  /**
@@ -2485,7 +2464,7 @@ interface IRComponentsObject {
2485
2464
  requestBodies?: Record<string, IRRequestBodyObject>;
2486
2465
  schemas?: Record<string, IRSchemaObject>;
2487
2466
  }
2488
- interface IROperationObject {
2467
+ interface IROperationObject extends SpecificationExtensions$1 {
2489
2468
  body?: IRBodyObject;
2490
2469
  deprecated?: boolean;
2491
2470
  description?: string;
@@ -2506,7 +2485,7 @@ interface IRParametersObject {
2506
2485
  path?: Record<string, IRParameterObject>;
2507
2486
  query?: Record<string, IRParameterObject>;
2508
2487
  }
2509
- interface IRParameterObject extends Pick<JsonSchemaDraft2020_12, 'deprecated' | 'description'> {
2488
+ interface IRParameterObject extends Pick<JsonSchemaDraft2020_12, 'deprecated' | 'description'>, SpecificationExtensions$1 {
2510
2489
  /**
2511
2490
  * 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.
2512
2491
  */
@@ -2564,7 +2543,7 @@ interface IRResponseObject {
2564
2543
  mediaType?: string;
2565
2544
  schema: IRSchemaObject;
2566
2545
  }
2567
- interface IRSchemaObject extends Pick<JsonSchemaDraft2020_12, '$ref' | 'const' | 'default' | 'deprecated' | 'description' | 'exclusiveMaximum' | 'exclusiveMinimum' | 'maximum' | 'maxItems' | 'maxLength' | 'minimum' | 'minItems' | 'minLength' | 'pattern' | 'required' | 'title' | 'example'> {
2546
+ 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 {
2568
2547
  /**
2569
2548
  * If the schema is intended to be used as an object property, it can be
2570
2549
  * marked as read-only or write-only. This value controls whether the schema
@@ -2609,6 +2588,10 @@ interface IRSchemaObject extends Pick<JsonSchemaDraft2020_12, '$ref' | 'const' |
2609
2588
  * follow a specific convention.
2610
2589
  */
2611
2590
  propertyNames?: IRSchemaObject;
2591
+ /**
2592
+ * Reference to symbol instead of `$ref` string.
2593
+ */
2594
+ symbolRef?: Symbol;
2612
2595
  /**
2613
2596
  * Each schema eventually resolves into `type`.
2614
2597
  */
@@ -3583,7 +3566,7 @@ type HeyApiClientNextPlugin = DefinePlugin<UserConfig$20, UserConfig$20>;
3583
3566
  //#endregion
3584
3567
  //#region src/plugins/@hey-api/client-nuxt/bundle/types.d.ts
3585
3568
  type QuerySerializer = (query: Parameters<Client$3['buildUrl']>[0]['query']) => string;
3586
- type WithRefs<TData> = { [K in keyof TData]: NonNullable<TData[K]> extends object ? WithRefs<NonNullable<TData[K]>> | Ref<NonNullable<TData[K]>> : NonNullable<TData[K]> | Ref<NonNullable<TData[K]>> };
3569
+ type WithRefs<TData> = { [K in keyof TData]: NonNullable<TData[K]> extends object ? WithRefs<NonNullable<TData[K]>> | Ref$1<NonNullable<TData[K]>> : NonNullable<TData[K]> | Ref$1<NonNullable<TData[K]>> };
3587
3570
  type KeysOf<T> = Array<T extends T ? (keyof T extends string ? keyof T : never) : never>;
3588
3571
  interface Config$16<T extends ClientOptions$1 = ClientOptions$1> extends Omit<FetchOptions$1<unknown>, 'baseURL' | 'body' | 'headers' | 'method' | 'query'>, WithRefs<Pick<FetchOptions$1<unknown>, 'query'>>, Omit<Config$14, 'querySerializer'> {
3589
3572
  /**
@@ -5650,12 +5633,20 @@ interface OpenApiV2_0_XTypes {
5650
5633
  }
5651
5634
  //#endregion
5652
5635
  //#region src/openApi/3.0.x/types/spec.d.ts
5636
+ /**
5637
+ * OpenAPI Specification Extensions.
5638
+ *
5639
+ * See {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#specification-extensions Specification Extensions}.
5640
+ */
5641
+ interface SpecificationExtensions {
5642
+ [extension: `x-${string}`]: unknown;
5643
+ }
5653
5644
  /**
5654
5645
  * 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}.
5655
5646
  *
5656
5647
  * This object MAY be extended with {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#specification-extensions Specification Extensions}.
5657
5648
  */
5658
- interface OpenApiV3_0_X {
5649
+ interface OpenApiV3_0_X extends SpecificationExtensions {
5659
5650
  /**
5660
5651
  * An element to hold various Objects for the OpenAPI Description.
5661
5652
  */
@@ -5696,11 +5687,11 @@ interface OpenApiV3_0_X {
5696
5687
  *
5697
5688
  * TODO: examples
5698
5689
  */
5699
- interface CallbackObject {
5690
+ interface CallbackObject extends SpecificationExtensions {
5700
5691
  /**
5701
5692
  * 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.
5702
5693
  */
5703
- [expression: string]: PathItemObject | ReferenceObject$2;
5694
+ [expression: string]: PathItemObject | ReferenceObject$2 | unknown;
5704
5695
  }
5705
5696
  /**
5706
5697
  * 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.
@@ -5711,7 +5702,7 @@ interface CallbackObject {
5711
5702
  *
5712
5703
  * TODO: examples
5713
5704
  */
5714
- interface ComponentsObject {
5705
+ interface ComponentsObject extends SpecificationExtensions {
5715
5706
  /**
5716
5707
  * An object to hold reusable {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#callback-object Callback Objects}.
5717
5708
  */
@@ -5760,7 +5751,7 @@ interface ComponentsObject {
5760
5751
  * email: support@example.com
5761
5752
  * ```
5762
5753
  */
5763
- interface ContactObject {
5754
+ interface ContactObject extends SpecificationExtensions {
5764
5755
  /**
5765
5756
  * The email address of the contact person/organization. This MUST be in the form of an email address.
5766
5757
  */
@@ -5805,7 +5796,7 @@ interface DiscriminatorObject {
5805
5796
  * TODO: default values examples
5806
5797
  * TODO: examples
5807
5798
  */
5808
- interface EncodingObject {
5799
+ interface EncodingObject extends SpecificationExtensions {
5809
5800
  /**
5810
5801
  * 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`.
5811
5802
  */
@@ -5838,7 +5829,7 @@ interface EncodingObject {
5838
5829
  *
5839
5830
  * TODO: examples
5840
5831
  */
5841
- interface ExampleObject {
5832
+ interface ExampleObject extends SpecificationExtensions {
5842
5833
  /**
5843
5834
  * Long description for the example. {@link https://spec.commonmark.org/ CommonMark syntax} MAY be used for rich text representation.
5844
5835
  */
@@ -5868,7 +5859,7 @@ interface ExampleObject {
5868
5859
  * url: https://example.com
5869
5860
  * ```
5870
5861
  */
5871
- interface ExternalDocumentationObject {
5862
+ interface ExternalDocumentationObject extends SpecificationExtensions {
5872
5863
  /**
5873
5864
  * A description of the target documentation. {@link https://spec.commonmark.org/ CommonMark syntax} MAY be used for rich text representation.
5874
5865
  */
@@ -5910,7 +5901,7 @@ type HeaderObject = Omit<ParameterObject$1, 'in' | 'name'>;
5910
5901
  * version: 1.0.1
5911
5902
  * ```
5912
5903
  */
5913
- interface InfoObject$1 {
5904
+ interface InfoObject$1 extends SpecificationExtensions {
5914
5905
  /**
5915
5906
  * The contact information for the exposed API.
5916
5907
  */
@@ -5946,7 +5937,7 @@ interface InfoObject$1 {
5946
5937
  * url: https://www.apache.org/licenses/LICENSE-2.0.html
5947
5938
  * ```
5948
5939
  */
5949
- interface LicenseObject {
5940
+ interface LicenseObject extends SpecificationExtensions {
5950
5941
  /**
5951
5942
  * **REQUIRED**. The license name used for the API.
5952
5943
  */
@@ -5971,7 +5962,7 @@ interface LicenseObject {
5971
5962
  *
5972
5963
  * TODO: examples
5973
5964
  */
5974
- interface LinkObject {
5965
+ interface LinkObject extends SpecificationExtensions {
5975
5966
  /**
5976
5967
  * A description of the link. {@link https://spec.commonmark.org/ CommonMark syntax} MAY be used for rich text representation.
5977
5968
  */
@@ -6006,7 +5997,7 @@ interface LinkObject {
6006
5997
  *
6007
5998
  * TODO: examples
6008
5999
  */
6009
- interface MediaTypeObject {
6000
+ interface MediaTypeObject extends SpecificationExtensions {
6010
6001
  /**
6011
6002
  * 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.
6012
6003
  */
@@ -6031,7 +6022,7 @@ interface MediaTypeObject {
6031
6022
  *
6032
6023
  * TODO: examples
6033
6024
  */
6034
- interface OAuthFlowObject {
6025
+ interface OAuthFlowObject extends SpecificationExtensions {
6035
6026
  /**
6036
6027
  * **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.
6037
6028
  */
@@ -6054,7 +6045,7 @@ interface OAuthFlowObject {
6054
6045
  *
6055
6046
  * This object MAY be extended with {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#specification-extensions Specification Extensions}.
6056
6047
  */
6057
- interface OAuthFlowsObject {
6048
+ interface OAuthFlowsObject extends SpecificationExtensions {
6058
6049
  /**
6059
6050
  * Configuration for the OAuth Authorization Code flow. Previously called `accessCode` in OpenAPI 2.0.
6060
6051
  */
@@ -6079,7 +6070,7 @@ interface OAuthFlowsObject {
6079
6070
  *
6080
6071
  * TODO: examples
6081
6072
  */
6082
- interface OperationObject$1 {
6073
+ interface OperationObject$1 extends SpecificationExtensions {
6083
6074
  /**
6084
6075
  * 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.
6085
6076
  */
@@ -6173,7 +6164,7 @@ interface OperationObject$1 {
6173
6164
  *
6174
6165
  * TODO: examples
6175
6166
  */
6176
- interface ParameterObject$1 {
6167
+ interface ParameterObject$1 extends SpecificationExtensions {
6177
6168
  /**
6178
6169
  * 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.
6179
6170
  */
@@ -6237,7 +6228,7 @@ interface ParameterObject$1 {
6237
6228
  *
6238
6229
  * TODO: examples
6239
6230
  */
6240
- interface PathItemObject {
6231
+ interface PathItemObject extends SpecificationExtensions {
6241
6232
  /**
6242
6233
  * 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}.
6243
6234
  */
@@ -6298,7 +6289,7 @@ interface PathItemObject {
6298
6289
  *
6299
6290
  * TODO: examples
6300
6291
  */
6301
- interface PathsObject {
6292
+ interface PathsObject extends SpecificationExtensions {
6302
6293
  /**
6303
6294
  * 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.
6304
6295
  */
@@ -6344,7 +6335,7 @@ interface ReferenceObject$2 {
6344
6335
  *
6345
6336
  * TODO: examples
6346
6337
  */
6347
- interface RequestBodyObject$1 {
6338
+ interface RequestBodyObject$1 extends SpecificationExtensions {
6348
6339
  /**
6349
6340
  * **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/*"`
6350
6341
  */
@@ -6365,7 +6356,7 @@ interface RequestBodyObject$1 {
6365
6356
  *
6366
6357
  * TODO: examples
6367
6358
  */
6368
- interface ResponseObject$1 {
6359
+ interface ResponseObject$1 extends SpecificationExtensions {
6369
6360
  /**
6370
6361
  * 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/*"`
6371
6362
  */
@@ -6396,11 +6387,11 @@ interface ResponseObject$1 {
6396
6387
  *
6397
6388
  * TODO: examples
6398
6389
  */
6399
- interface ResponsesObject {
6390
+ interface ResponsesObject extends SpecificationExtensions {
6400
6391
  /**
6401
6392
  * 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.
6402
6393
  */
6403
- [httpStatusCode: string]: ResponseObject$1 | ReferenceObject$2 | undefined;
6394
+ [httpStatusCode: string]: ResponseObject$1 | ReferenceObject$2 | undefined | unknown;
6404
6395
  /**
6405
6396
  * 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.
6406
6397
  */
@@ -6457,7 +6448,7 @@ interface ResponsesObject {
6457
6448
  *
6458
6449
  * TODO: content, examples
6459
6450
  */
6460
- interface SchemaObject$1 extends EnumExtensions {
6451
+ interface SchemaObject$1 extends EnumExtensions, SpecificationExtensions {
6461
6452
  /**
6462
6453
  * The value of "additionalProperties" MUST be a boolean or a schema.
6463
6454
  *
@@ -6708,7 +6699,7 @@ interface SecurityRequirementObject {
6708
6699
  *
6709
6700
  * TODO: examples
6710
6701
  */
6711
- type SecuritySchemeObject = {
6702
+ type SecuritySchemeObject = SpecificationExtensions & {
6712
6703
  /**
6713
6704
  * A description for security scheme. {@link https://spec.commonmark.org/ CommonMark syntax} MAY be used for rich text representation.
6714
6705
  */
@@ -6765,7 +6756,7 @@ type SecuritySchemeObject = {
6765
6756
  *
6766
6757
  * TODO: examples
6767
6758
  */
6768
- interface ServerObject {
6759
+ interface ServerObject extends SpecificationExtensions {
6769
6760
  /**
6770
6761
  * An optional string describing the host designated by the URL. {@link https://spec.commonmark.org/ CommonMark syntax} MAY be used for rich text representation.
6771
6762
  */
@@ -6784,7 +6775,7 @@ interface ServerObject {
6784
6775
  *
6785
6776
  * This object MAY be extended with {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md#specification-extensions Specification Extensions}.
6786
6777
  */
6787
- interface ServerVariableObject {
6778
+ interface ServerVariableObject extends SpecificationExtensions {
6788
6779
  /**
6789
6780
  * **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.
6790
6781
  */
@@ -6810,7 +6801,7 @@ interface ServerVariableObject {
6810
6801
  * description: Pets operations
6811
6802
  * ```
6812
6803
  */
6813
- interface TagObject {
6804
+ interface TagObject extends SpecificationExtensions {
6814
6805
  /**
6815
6806
  * A description for the tag. {@link https://spec.commonmark.org/ CommonMark syntax} MAY be used for rich text representation.
6816
6807
  */
@@ -6838,7 +6829,7 @@ interface TagObject {
6838
6829
  *
6839
6830
  * TODO: examples
6840
6831
  */
6841
- interface XMLObject {
6832
+ interface XMLObject extends SpecificationExtensions {
6842
6833
  /**
6843
6834
  * Declares whether the property definition translates to an attribute instead of an element. Default value is `false`.
6844
6835
  */
@@ -7154,10 +7145,8 @@ type Config$13 = Plugin.Name<'@hey-api/sdk'> & Plugin.Hooks & {
7154
7145
  * Set `instance` to create an instantiable SDK. Using `true` will use the
7155
7146
  * default instance name; in practice, you want to define your own by passing
7156
7147
  * a string value.
7157
- *
7158
- * @default false
7159
7148
  */
7160
- instance: string | boolean;
7149
+ instance: string;
7161
7150
  /**
7162
7151
  * Customise the name of methods within the service. By default,
7163
7152
  * {@link IR.OperationObject.id} is used.
@@ -7249,608 +7238,874 @@ type HeyApiSdkPlugin = DefinePlugin<UserConfig$14, Config$13>;
7249
7238
  //#endregion
7250
7239
  //#region src/ts-dsl/base.d.ts
7251
7240
  type MaybeArray$1<T> = T | ReadonlyArray<T>;
7252
- interface ITsDsl<T extends ts.Node = ts.Node> {
7253
- $render(): T;
7254
- }
7255
- declare abstract class TsDsl<T extends ts.Node = ts.Node> implements ITsDsl<T> {
7256
- abstract $render(): T;
7241
+ declare abstract class TsDsl<T extends ts.Node = ts.Node> implements Node<T> {
7242
+ analyze(_: AnalysisContext): void;
7243
+ exported?: boolean;
7244
+ file?: File;
7245
+ language: Language;
7246
+ parent?: Node;
7247
+ root?: Node;
7248
+ symbol?: Symbol;
7249
+ toAst(_: AstContext): T;
7250
+ readonly '~brand' = "heyapi.node";
7251
+ /** Branding property to identify the DSL class at runtime. */
7252
+ abstract readonly '~dsl': string;
7257
7253
  /** Conditionally applies a callback to this builder. */
7258
- $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;
7259
- $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;
7260
- $if<T extends TsDsl, V$1, R extends TsDsl = T>(this: T, value: V$1, ifTrue: () => R | void, ifFalse?: () => R | void): R | T;
7254
+ $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;
7255
+ $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;
7256
+ $if<T extends TsDsl, V, R extends TsDsl = T>(this: T, value: V, ifTrue: () => R | void, ifFalse?: () => R | void): R | T;
7261
7257
  protected $maybeId<T extends string | ts.Expression>(expr: T): T extends string ? ts.Identifier : T;
7262
- protected $node<I>(value: I): NodeOfMaybe<I>;
7263
- protected $type<I>(value: I, args?: ReadonlyArray<ts.TypeNode>): TypeOfMaybe<I>;
7264
- protected unwrap<I>(value: I): I extends TsDsl<infer N> ? N : I;
7258
+ protected $node<I>(ctx: AstContext, value: I): NodeOfMaybe<I>;
7259
+ protected $type<I>(ctx: AstContext, value: I, args?: ReadonlyArray<ts.TypeNode>): TypeOfMaybe<I>;
7260
+ /** Unwraps nested nodes into raw TypeScript AST. */
7261
+ private unwrap;
7265
7262
  }
7266
- type NodeOfMaybe<I> = undefined extends I ? NodeOf<NonNullable<I>> | undefined : NodeOf<I>;
7263
+ type NodeOfMaybe<I> = undefined extends I ? NodeOf<NonNullable<FromRef<I>>> | undefined : NodeOf<FromRef<I>>;
7267
7264
  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;
7268
7265
  type MaybeTsDsl<T> = T extends TsDsl<infer U> ? U | TsDsl<U> : T extends ts.Node ? T | TsDsl<T> : never;
7269
7266
  declare abstract class TypeTsDsl<T extends ts.LiteralTypeNode | ts.QualifiedName | ts.TypeElement | ts.TypeNode | ts.TypeParameterDeclaration = ts.TypeNode> extends TsDsl<T> {}
7270
- type TypeOfMaybe<I> = undefined extends I ? TypeOf<NonNullable<I>> | undefined : TypeOf<I>;
7267
+ type TypeOfMaybe<I> = undefined extends I ? TypeOf<NonNullable<FromRef<I>>> | undefined : TypeOf<FromRef<I>>;
7271
7268
  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;
7272
7269
  //#endregion
7273
- //#region src/ts-dsl/layout/newline.d.ts
7274
- declare class NewlineTsDsl extends TsDsl<ts.Identifier> {
7275
- $render(): ts.Identifier;
7270
+ //#region src/ts-dsl/mixins/types.d.ts
7271
+ type BaseCtor<T> = abstract new (...args: Array<any>) => TsDsl<T>;
7272
+ type DropFirst<T extends Array<any>> = T extends [any, ...infer Rest] ? Rest : never;
7273
+ type MixinCtor<T extends BaseCtor<any>, K$1> = abstract new (...args: Array<any>) => InstanceType<T> & K$1;
7274
+ //#endregion
7275
+ //#region src/ts-dsl/mixins/optional.d.ts
7276
+ interface OptionalMethods extends Node {
7277
+ _optional?: boolean;
7278
+ /** Marks the node as optional when the condition is true. */
7279
+ optional(condition?: boolean): this;
7280
+ /** Marks the node as required when the condition is true. */
7281
+ required(condition?: boolean): this;
7282
+ }
7283
+ //#endregion
7284
+ //#region src/ts-dsl/mixins/as.d.ts
7285
+ interface AsMethods extends Node {
7286
+ /** Creates an `as` type assertion expression (e.g. `value as Type`). */
7287
+ as(...args: DropFirst<Parameters<typeof f.as>>): ReturnType<typeof f.as>;
7288
+ }
7289
+ //#endregion
7290
+ //#region src/ts-dsl/expr/binary.d.ts
7291
+ type Expr$3 = Symbol | string | MaybeTsDsl<ts.Expression>;
7292
+ type Op$1 = Operator | ts.BinaryOperator;
7293
+ type Operator = '!=' | '!==' | '&&' | '*' | '+' | '-' | '/' | '<' | '<=' | '=' | '==' | '===' | '>' | '>=' | '??' | '??=' | '||';
7294
+ declare const Mixed$52: MixinCtor<MixinCtor<abstract new () => TsDsl<ts.BinaryExpression>, ExprMethods>, AsMethods>;
7295
+ declare class BinaryTsDsl extends Mixed$52 {
7296
+ readonly '~dsl' = "BinaryTsDsl";
7297
+ protected _base: Ref<Expr$3>;
7298
+ protected _expr?: Ref<Expr$3>;
7299
+ protected _op?: Op$1;
7300
+ constructor(base: Expr$3, op?: Op$1, expr?: Expr$3);
7301
+ analyze(ctx: AnalysisContext): void;
7302
+ /** Logical AND — `this && expr` */
7303
+ and(expr: Expr$3): this;
7304
+ /** Creates an assignment expression (e.g. `this = expr`). */
7305
+ assign(expr: Expr$3): this;
7306
+ /** Nullish coalescing — `this ?? expr` */
7307
+ coalesce(expr: Expr$3): this;
7308
+ /** Division — `this / expr` */
7309
+ div(expr: Expr$3): this;
7310
+ /** Strict equality — `this === expr` */
7311
+ eq(expr: Expr$3): this;
7312
+ /** Greater than — `this > expr` */
7313
+ gt(expr: Expr$3): this;
7314
+ /** Greater than or equal — `this >= expr` */
7315
+ gte(expr: Expr$3): this;
7316
+ /** Loose equality — `this == expr` */
7317
+ looseEq(expr: Expr$3): this;
7318
+ /** Loose inequality — `this != expr` */
7319
+ looseNeq(expr: Expr$3): this;
7320
+ /** Less than — `this < expr` */
7321
+ lt(expr: Expr$3): this;
7322
+ /** Less than or equal — `this <= expr` */
7323
+ lte(expr: Expr$3): this;
7324
+ /** Subtraction — `this - expr` */
7325
+ minus(expr: Expr$3): this;
7326
+ /** Strict inequality — `this !== expr` */
7327
+ neq(expr: Expr$3): this;
7328
+ /** Nullish assignment — `this ??= expr` */
7329
+ nullishAssign(expr: Expr$3): this;
7330
+ /** Logical OR — `this || expr` */
7331
+ or(expr: Expr$3): this;
7332
+ /** Addition — `this + expr` */
7333
+ plus(expr: Expr$3): this;
7334
+ /** Multiplication — `this * expr` */
7335
+ times(expr: Expr$3): this;
7336
+ toAst(ctx: AstContext): ts.BinaryExpression;
7337
+ /** Sets the binary operator and right-hand operand for this expression. */
7338
+ private opAndExpr;
7339
+ private opToToken;
7340
+ }
7341
+ //#endregion
7342
+ //#region src/ts-dsl/mixins/operator.d.ts
7343
+ type Expr$2 = Symbol | string | MaybeTsDsl<ts.Expression>;
7344
+ interface OperatorMethods extends Node {
7345
+ /** Logical AND — `this && expr` */
7346
+ and(expr: Expr$2): BinaryTsDsl;
7347
+ /** Creates an assignment expression (e.g. `this = expr`). */
7348
+ assign(expr: Expr$2): BinaryTsDsl;
7349
+ /** Nullish coalescing — `this ?? expr` */
7350
+ coalesce(expr: Expr$2): BinaryTsDsl;
7351
+ /** Division — `this / expr` */
7352
+ div(expr: Expr$2): BinaryTsDsl;
7353
+ /** Strict equality — `this === expr` */
7354
+ eq(expr: Expr$2): BinaryTsDsl;
7355
+ /** Greater than — `this > expr` */
7356
+ gt(expr: Expr$2): BinaryTsDsl;
7357
+ /** Greater than or equal — `this >= expr` */
7358
+ gte(expr: Expr$2): BinaryTsDsl;
7359
+ /** Loose equality — `this == expr` */
7360
+ looseEq(expr: Expr$2): BinaryTsDsl;
7361
+ /** Loose inequality — `this != expr` */
7362
+ looseNeq(expr: Expr$2): BinaryTsDsl;
7363
+ /** Less than — `this < expr` */
7364
+ lt(expr: Expr$2): BinaryTsDsl;
7365
+ /** Less than or equal — `this <= expr` */
7366
+ lte(expr: Expr$2): BinaryTsDsl;
7367
+ /** Subtraction — `this - expr` */
7368
+ minus(expr: Expr$2): BinaryTsDsl;
7369
+ /** Strict inequality — `this !== expr` */
7370
+ neq(expr: Expr$2): BinaryTsDsl;
7371
+ /** Nullish assignment — `this ??= expr` */
7372
+ nullishAssign(expr: Expr$2): BinaryTsDsl;
7373
+ /** Logical OR — `this || expr` */
7374
+ or(expr: Expr$2): BinaryTsDsl;
7375
+ /** Addition — `this + expr` */
7376
+ plus(expr: Expr$2): BinaryTsDsl;
7377
+ /** Multiplication — `this * expr` */
7378
+ times(expr: Expr$2): BinaryTsDsl;
7379
+ }
7380
+ //#endregion
7381
+ //#region src/ts-dsl/expr/attr.d.ts
7382
+ type AttrLeft = Symbol | string | MaybeTsDsl<ts.Expression>;
7383
+ type AttrRight = Symbol | string | ts.MemberName | number;
7384
+ type AttrCtor = (left: AttrLeft, right: AttrRight) => AttrTsDsl;
7385
+ declare const Mixed$51: MixinCtor<MixinCtor<MixinCtor<MixinCtor<abstract new () => TsDsl<ts.PropertyAccessExpression | ts.ElementAccessExpression>, OptionalMethods>, OperatorMethods>, ExprMethods>, AsMethods>;
7386
+ declare class AttrTsDsl extends Mixed$51 {
7387
+ readonly '~dsl' = "AttrTsDsl";
7388
+ protected left: Ref<AttrLeft>;
7389
+ protected right: Ref<AttrRight>;
7390
+ constructor(left: AttrLeft, right: AttrRight);
7391
+ analyze(ctx: AnalysisContext): void;
7392
+ toAst(ctx: AstContext): ts.PropertyAccessExpression | ts.ElementAccessExpression;
7393
+ }
7394
+ //#endregion
7395
+ //#region src/ts-dsl/expr/await.d.ts
7396
+ type AwaitExpr = Symbol | string | MaybeTsDsl<ts.Expression>;
7397
+ type AwaitCtor = (expr: AwaitExpr) => AwaitTsDsl;
7398
+ declare const Mixed$50: MixinCtor<abstract new () => TsDsl<ts.AwaitExpression>, ExprMethods>;
7399
+ declare class AwaitTsDsl extends Mixed$50 {
7400
+ readonly '~dsl' = "AwaitTsDsl";
7401
+ protected _awaitExpr: Ref<AwaitExpr>;
7402
+ constructor(expr: AwaitExpr);
7403
+ analyze(ctx: AnalysisContext): void;
7404
+ toAst(ctx: AstContext): ts.AwaitExpression;
7405
+ }
7406
+ //#endregion
7407
+ //#region src/ts-dsl/mixins/type-args.d.ts
7408
+ type Arg$1 = Symbol | string | MaybeTsDsl<TypeTsDsl>;
7409
+ interface TypeArgsMethods extends Node {
7410
+ /** Returns the type arguments as an array of ts.TypeNode nodes. */
7411
+ $generics(ctx: AstContext): ReadonlyArray<ts.TypeNode> | undefined;
7412
+ /** Adds a single type argument (e.g. `string` in `Foo<string>`). */
7413
+ generic(arg: Arg$1): this;
7414
+ /** Adds type arguments (e.g. `Map<string, number>`). */
7415
+ generics(...args: ReadonlyArray<Arg$1>): this;
7276
7416
  }
7277
7417
  //#endregion
7278
7418
  //#region src/ts-dsl/mixins/args.d.ts
7279
- /**
7280
- * Adds `.arg()` and `.args()` for managing expression arguments in call-like nodes.
7281
- */
7282
- declare class ArgsMixin extends TsDsl {
7283
- protected _args?: Array<string | MaybeTsDsl<ts.Expression>>;
7419
+ type Arg = Symbol | string | MaybeTsDsl<ts.Expression>;
7420
+ interface ArgsMethods extends Node {
7421
+ /** Renders the arguments into an array of `Expression`s. */
7422
+ $args(ctx: AstContext): ReadonlyArray<ts.Expression>;
7284
7423
  /** Adds a single expression argument. */
7285
- arg(arg: string | MaybeTsDsl<ts.Expression>): this;
7424
+ arg(arg: Arg | undefined): this;
7286
7425
  /** Adds one or more expression arguments. */
7287
- args(...args: ReadonlyArray<string | MaybeTsDsl<ts.Expression>>): this;
7288
- /** Renders the arguments into an array of `Expression`s. */
7289
- protected $args(): ReadonlyArray<ts.Expression>;
7290
- $render(): ts.Node;
7426
+ args(...args: ReadonlyArray<Arg | undefined>): this;
7291
7427
  }
7292
7428
  //#endregion
7293
- //#region src/ts-dsl/decl/decorator.d.ts
7294
- declare class DecoratorTsDsl extends TsDsl<ts.Decorator> {
7295
- protected name: string | ts.Expression;
7296
- constructor(name: string | ts.Expression, ...args: ReadonlyArray<string | MaybeTsDsl<ts.Expression>>);
7297
- $render(): ts.Decorator;
7429
+ //#region src/ts-dsl/expr/call.d.ts
7430
+ type CallCallee = string | MaybeTsDsl<ts.Expression>;
7431
+ type CallArg = Symbol | string | MaybeTsDsl<ts.Expression>;
7432
+ type CallArgs = ReadonlyArray<CallArg | undefined>;
7433
+ type CallCtor = (callee: CallCallee, ...args: CallArgs) => CallTsDsl;
7434
+ declare const Mixed$49: MixinCtor<MixinCtor<MixinCtor<MixinCtor<abstract new () => TsDsl<ts.CallExpression>, TypeArgsMethods>, ExprMethods>, AsMethods>, ArgsMethods>;
7435
+ declare class CallTsDsl extends Mixed$49 {
7436
+ readonly '~dsl' = "CallTsDsl";
7437
+ protected _callee: CallCallee;
7438
+ constructor(callee: CallCallee, ...args: CallArgs);
7439
+ analyze(ctx: AnalysisContext): void;
7440
+ toAst(ctx: AstContext): ts.CallExpression;
7298
7441
  }
7299
- interface DecoratorTsDsl extends ArgsMixin {}
7300
7442
  //#endregion
7301
- //#region src/ts-dsl/mixins/decorator.d.ts
7302
- declare class DecoratorMixin extends TsDsl {
7303
- protected decorators?: Array<DecoratorTsDsl>;
7304
- /** Adds a decorator (e.g. `@sealed({ in: 'root' })`). */
7305
- decorator(name: string | ts.Expression, ...args: ReadonlyArray<string | MaybeTsDsl<ts.Expression>>): this;
7306
- /** Renders the decorators into an array of `ts.Decorator`s. */
7307
- protected $decorators(): ReadonlyArray<ts.Decorator>;
7308
- $render(): ts.Node;
7443
+ //#region src/ts-dsl/expr/typeof.d.ts
7444
+ type TypeOfExpr = string | MaybeTsDsl<ts.Expression>;
7445
+ type TypeOfExprCtor = (expr: TypeOfExpr) => TypeOfExprTsDsl;
7446
+ declare const Mixed$48: MixinCtor<abstract new () => TsDsl<ts.TypeOfExpression>, OperatorMethods>;
7447
+ declare class TypeOfExprTsDsl extends Mixed$48 {
7448
+ readonly '~dsl' = "TypeOfExprTsDsl";
7449
+ protected _expr: TypeOfExpr;
7450
+ constructor(expr: TypeOfExpr);
7451
+ analyze(ctx: AnalysisContext): void;
7452
+ toAst(ctx: AstContext): ts.TypeOfExpression;
7309
7453
  }
7310
7454
  //#endregion
7311
- //#region src/ts-dsl/layout/doc.d.ts
7312
- declare class DocTsDsl extends TsDsl<ts.Node> {
7313
- protected _lines: Array<string>;
7314
- constructor(lines?: MaybeArray$1<string>, fn?: (d: DocTsDsl) => void);
7315
- add(...lines: ReadonlyArray<string>): this;
7316
- apply<T extends ts.Node>(node: T): T;
7317
- $render(): ts.Node;
7455
+ //#region src/ts-dsl/stmt/return.d.ts
7456
+ type ReturnExpr = Symbol | string | MaybeTsDsl<ts.Expression>;
7457
+ type ReturnCtor = (expr?: ReturnExpr) => ReturnTsDsl;
7458
+ declare const Mixed$47: abstract new () => TsDsl<ts.ReturnStatement>;
7459
+ declare class ReturnTsDsl extends Mixed$47 {
7460
+ readonly '~dsl' = "ReturnTsDsl";
7461
+ protected _returnExpr?: Ref<ReturnExpr>;
7462
+ constructor(expr?: ReturnExpr);
7463
+ analyze(ctx: AnalysisContext): void;
7464
+ toAst(ctx: AstContext): ts.ReturnStatement;
7318
7465
  }
7319
7466
  //#endregion
7320
- //#region src/ts-dsl/mixins/doc.d.ts
7321
- declare function DocMixin<TBase extends new (...args: ReadonlyArray<any>) => ITsDsl>(Base: TBase): {
7322
- new (...args: ReadonlyArray<any>): {
7323
- _doc?: DocTsDsl;
7324
- doc(lines?: MaybeArray$1<string>, fn?: (d: DocTsDsl) => void): /*elided*/any;
7325
- $render(): any;
7467
+ //#region src/ts-dsl/mixins/type-expr.d.ts
7468
+ interface TypeExprMethods extends Node {
7469
+ /** Creates an indexed-access type (e.g. `Foo<T>[K]`). */
7470
+ idx(this: Parameters<typeof f.type.idx>[0], ...args: DropFirst<Parameters<typeof f.type.idx>>): ReturnType<typeof f.type.idx>;
7471
+ /** Shorthand: builds `keyof T`. */
7472
+ keyof(this: MaybeTsDsl<TypeTsDsl>): ReturnType<typeof f.type.operator>;
7473
+ /** Shorthand: builds `readonly T`. */
7474
+ readonly(this: MaybeTsDsl<TypeTsDsl>): ReturnType<typeof f.type.operator>;
7475
+ /** Create a TypeExpr node representing ReturnType<this>. */
7476
+ returnType(this: Parameters<typeof f.type.query>[0], ...args: DropFirst<Parameters<typeof f.type.query>>): ReturnType<typeof f.type.expr>;
7477
+ /** Create a TypeOfExpr node representing typeof this. */
7478
+ typeofExpr(this: Parameters<typeof f.typeofExpr>[0], ...args: DropFirst<Parameters<typeof f.typeofExpr>>): ReturnType<typeof f.typeofExpr>;
7479
+ /** Create a TypeQuery node representing typeof this. */
7480
+ typeofType(this: Parameters<typeof f.type.query>[0], ...args: DropFirst<Parameters<typeof f.type.query>>): ReturnType<typeof f.type.query>;
7481
+ /** Shorthand: builds `unique T`. */
7482
+ unique(this: MaybeTsDsl<TypeTsDsl>): ReturnType<typeof f.type.operator>;
7483
+ }
7484
+ //#endregion
7485
+ //#region src/ts-dsl/type/attr.d.ts
7486
+ type Base$2 = Symbol | string | MaybeTsDsl<ts.EntityName>;
7487
+ type Right = Symbol | string | ts.Identifier;
7488
+ declare const Mixed$46: MixinCtor<abstract new () => TsDsl<ts.QualifiedName>, TypeExprMethods>;
7489
+ declare class TypeAttrTsDsl extends Mixed$46 {
7490
+ readonly '~dsl' = "TypeAttrTsDsl";
7491
+ protected _base?: Ref<Base$2>;
7492
+ protected _right: Ref<Right>;
7493
+ constructor(base: Base$2 | Ref<Base$2>, right: string | ts.Identifier);
7494
+ constructor(right: Right);
7495
+ analyze(ctx: AnalysisContext): void;
7496
+ base(base?: Base$2 | Ref<Base$2>): this;
7497
+ right(right: Right): this;
7498
+ toAst(ctx: AstContext): ts.QualifiedName;
7499
+ }
7500
+ //#endregion
7501
+ //#region src/ts-dsl/type/expr.d.ts
7502
+ type TypeExprName = Symbol | string;
7503
+ type TypeExprExpr = TypeExprName | TypeAttrTsDsl;
7504
+ type TypeExprFn = (t: TypeExprTsDsl) => void;
7505
+ type TypeExprCtor = (nameOrFn?: TypeExprName | TypeExprFn, fn?: TypeExprFn) => TypeExprTsDsl;
7506
+ declare const Mixed$45: MixinCtor<MixinCtor<abstract new () => TsDsl<ts.TypeReferenceNode>, TypeExprMethods>, TypeArgsMethods>;
7507
+ declare class TypeExprTsDsl extends Mixed$45 {
7508
+ readonly '~dsl' = "TypeExprTsDsl";
7509
+ protected _exprInput?: Ref<TypeExprExpr>;
7510
+ constructor();
7511
+ constructor(fn: TypeExprFn);
7512
+ constructor(name: TypeExprName);
7513
+ constructor(name: TypeExprName, fn?: TypeExprFn);
7514
+ analyze(ctx: AnalysisContext): void;
7515
+ /** Accesses a nested type (e.g. `Foo.Bar`). */
7516
+ attr(right: string | ts.Identifier | TypeAttrTsDsl): this;
7517
+ toAst(ctx: AstContext): ts.TypeReferenceNode;
7518
+ }
7519
+ //#endregion
7520
+ //#region src/ts-dsl/type/idx.d.ts
7521
+ type Base$1 = string | MaybeTsDsl<ts.TypeNode>;
7522
+ type Index = string | number | MaybeTsDsl<ts.TypeNode>;
7523
+ type TypeIdxCtor = (base: Base$1, index: Index) => TypeIdxTsDsl;
7524
+ declare const Mixed$44: MixinCtor<abstract new () => TsDsl<ts.IndexedAccessTypeNode>, TypeExprMethods>;
7525
+ declare class TypeIdxTsDsl extends Mixed$44 {
7526
+ readonly '~dsl' = "TypeIdxTsDsl";
7527
+ protected _base: Base$1;
7528
+ protected _index: Index;
7529
+ constructor(base: Base$1, index: Index);
7530
+ analyze(ctx: AnalysisContext): void;
7531
+ base(base: Base$1): this;
7532
+ index(index: Index): this;
7533
+ toAst(ctx: AstContext): ts.IndexedAccessTypeNode;
7534
+ }
7535
+ //#endregion
7536
+ //#region src/ts-dsl/type/operator.d.ts
7537
+ type Op = ts.SyntaxKind.KeyOfKeyword | ts.SyntaxKind.ReadonlyKeyword | ts.SyntaxKind.UniqueKeyword;
7538
+ type Type$2 = string | MaybeTsDsl<ts.TypeNode>;
7539
+ type TypeOperatorCtor = () => TypeOperatorTsDsl;
7540
+ declare const Mixed$43: abstract new () => TsDsl<ts.TypeOperatorNode>;
7541
+ /**
7542
+ * Builds a TypeScript `TypeOperatorNode`, such as:
7543
+ *
7544
+ * - `keyof T`
7545
+ * - `readonly U`
7546
+ * - `unique V`
7547
+ *
7548
+ * This DSL provides both a generic `.operator()` API and convenient
7549
+ * shorthand methods (`.keyof()`, `.readonly()`, `.unique()`).
7550
+ *
7551
+ * The node will throw during render if required fields are missing.
7552
+ */
7553
+ declare class TypeOperatorTsDsl extends Mixed$43 {
7554
+ readonly '~dsl' = "TypeOperatorTsDsl";
7555
+ protected _op?: Op;
7556
+ protected _type?: Type$2;
7557
+ analyze(ctx: AnalysisContext): void;
7558
+ /** Shorthand: builds `keyof T`. */
7559
+ keyof(type: Type$2): this;
7560
+ /** Sets the operator explicitly. */
7561
+ operator(op: Op): this;
7562
+ /** Shorthand: builds `readonly T`. */
7563
+ readonly(type: Type$2): this;
7564
+ /** Sets the target type of the operator. */
7565
+ type(type: Type$2): this;
7566
+ /** Shorthand: builds `unique T`. */
7567
+ unique(type: Type$2): this;
7568
+ toAst(ctx: AstContext): ts.TypeOperatorNode;
7569
+ /** Throws if required fields are not set. */
7570
+ $validate(): asserts this is this & {
7571
+ _op: Op;
7572
+ _type: Type$2;
7573
+ };
7574
+ private missingRequiredCalls;
7575
+ }
7576
+ //#endregion
7577
+ //#region src/ts-dsl/type/query.d.ts
7578
+ type TypeQueryExpr = string | MaybeTsDsl<TypeTsDsl | ts.Expression>;
7579
+ type TypeQueryCtor = (expr: TypeQueryExpr) => TypeQueryTsDsl;
7580
+ declare const Mixed$42: MixinCtor<abstract new () => TsDsl<ts.TypeQueryNode>, TypeExprMethods>;
7581
+ declare class TypeQueryTsDsl extends Mixed$42 {
7582
+ readonly '~dsl' = "TypeQueryTsDsl";
7583
+ protected _expr: TypeQueryExpr;
7584
+ constructor(expr: TypeQueryExpr);
7585
+ analyze(ctx: AnalysisContext): void;
7586
+ toAst(ctx: AstContext): ts.TypeQueryNode;
7587
+ }
7588
+ //#endregion
7589
+ //#region src/ts-dsl/utils/factories.d.ts
7590
+ type Ctor = (...args: Array<any>) => any;
7591
+ type Factory<T extends Ctor> = {
7592
+ (...args: Parameters<T>): ReturnType<T>;
7593
+ /** Sets the implementation of this factory. */
7594
+ set(fn: T): void;
7595
+ };
7596
+ declare const f: {
7597
+ /** Factory for creating `as` type assertion expressions (e.g. `value as Type`). */
7598
+ as: Factory<AsCtor>;
7599
+ /** Factory for creating property access expressions (e.g. `obj.foo`). */
7600
+ attr: Factory<AttrCtor>;
7601
+ /** Factory for creating await expressions (e.g. `await promise`). */
7602
+ await: Factory<AwaitCtor>;
7603
+ /** Factory for creating function or method call expressions (e.g. `fn(arg)`). */
7604
+ call: Factory<CallCtor>;
7605
+ /** Factory for creating return statements. */
7606
+ return: Factory<ReturnCtor>;
7607
+ /** Factories for creating type nodes. */
7608
+ type: {
7609
+ /** Factory for creating basic type references or type expressions (e.g. Foo or Foo<T>). */
7610
+ expr: Factory<TypeExprCtor>;
7611
+ /** Factory for creating indexed-access types (e.g. `Foo<T>[K]`). */
7612
+ idx: Factory<TypeIdxCtor>;
7613
+ /** Factory for creating type operator nodes (e.g. `readonly T`, `keyof T`, `unique T`). */
7614
+ operator: Factory<TypeOperatorCtor>;
7615
+ /** Factory for creating type query nodes (e.g. `typeof Foo`). */
7616
+ query: Factory<TypeQueryCtor>;
7326
7617
  };
7327
- } & TBase;
7328
- type DocMixin = InstanceType<ReturnType<typeof DocMixin>>;
7618
+ /** Factory for creating `typeof` expressions (e.g. `typeof value`). */
7619
+ typeofExpr: Factory<TypeOfExprCtor>;
7620
+ };
7621
+ //#endregion
7622
+ //#region src/ts-dsl/mixins/expr.d.ts
7623
+ interface ExprMethods extends Node {
7624
+ /** Accesses a property on the current expression (e.g. `this.foo`). */
7625
+ attr(...args: DropFirst<Parameters<typeof f.attr>>): ReturnType<typeof f.attr>;
7626
+ /** Awaits the current expression (e.g. `await expr`). */
7627
+ await(): ReturnType<typeof f.await>;
7628
+ /** Calls the current expression (e.g. `fn(arg1, arg2)`). */
7629
+ call(...args: DropFirst<Parameters<typeof f.call>>): ReturnType<typeof f.call>;
7630
+ /** Produces a `return` statement returning the current expression. */
7631
+ return(): ReturnType<typeof f.return>;
7632
+ }
7633
+ //#endregion
7634
+ //#region src/ts-dsl/expr/as.d.ts
7635
+ type AsExpr = Symbol | string | MaybeTsDsl<ts.Expression>;
7636
+ type AsType = Symbol | string | TypeTsDsl;
7637
+ type AsCtor = (expr: AsExpr, type: AsType) => AsTsDsl;
7638
+ declare const Mixed$41: MixinCtor<MixinCtor<abstract new () => TsDsl<ts.AsExpression>, ExprMethods>, AsMethods>;
7639
+ declare class AsTsDsl extends Mixed$41 {
7640
+ readonly '~dsl' = "AsTsDsl";
7641
+ protected expr: Ref<AsExpr>;
7642
+ protected type: Ref<AsType>;
7643
+ constructor(expr: AsExpr, type: AsType);
7644
+ analyze(ctx: AnalysisContext): void;
7645
+ toAst(ctx: AstContext): ts.AsExpression;
7646
+ }
7647
+ //#endregion
7648
+ //#region src/ts-dsl/mixins/value.d.ts
7649
+ type ValueExpr = string | MaybeTsDsl<ts.Expression>;
7650
+ interface ValueMethods extends Node {
7651
+ $value(ctx: AstContext): ts.Expression | undefined;
7652
+ /** Sets the initializer expression (e.g. `= expr`). */
7653
+ assign(expr: ValueExpr): this;
7654
+ }
7655
+ //#endregion
7656
+ //#region src/ts-dsl/mixins/pattern.d.ts
7657
+ interface PatternMethods extends Node {
7658
+ /** Renders the pattern into a `BindingName`. */
7659
+ $pattern(ctx: AstContext): ts.BindingName | undefined;
7660
+ /** Defines an array binding pattern. */
7661
+ array(...props: ReadonlyArray<string> | [ReadonlyArray<string>]): this;
7662
+ /** Defines an object binding pattern. */
7663
+ object(...props: ReadonlyArray<MaybeArray$1<string> | Record<string, string>>): this;
7664
+ /** Adds a spread element (e.g. `...args`, `...options`) to the pattern. */
7665
+ spread(name: string): this;
7666
+ }
7667
+ //#endregion
7668
+ //#region src/ts-dsl/layout/hint.d.ts
7669
+ type HintMaybeLazy<T> = ((ctx: AstContext) => T) | T;
7670
+ type HintFn = (d: HintTsDsl) => void;
7671
+ type HintLines = HintMaybeLazy<MaybeArray$1<string>>;
7672
+ declare class HintTsDsl extends TsDsl<ts.Node> {
7673
+ readonly '~dsl' = "HintTsDsl";
7674
+ protected _lines: Array<HintLines>;
7675
+ constructor(lines?: HintLines, fn?: HintFn);
7676
+ analyze(ctx: AnalysisContext): void;
7677
+ add(lines: HintLines): this;
7678
+ apply<T extends ts.Node>(ctx: AstContext, node: T): T;
7679
+ toAst(ctx: AstContext): ts.Node;
7680
+ }
7681
+ //#endregion
7682
+ //#region src/ts-dsl/mixins/hint.d.ts
7683
+ interface HintMethods extends Node {
7684
+ $hint<T extends ts.Node>(ctx: AstContext, node: T): T;
7685
+ hint(lines?: HintLines, fn?: HintFn): this;
7686
+ }
7329
7687
  //#endregion
7330
7688
  //#region src/ts-dsl/mixins/modifiers.d.ts
7331
- type Target = object & {
7332
- _m?(kind: ts.ModifierSyntaxKind, condition?: boolean): unknown;
7689
+ type Modifiers = {
7690
+ modifiers: Array<ts.Modifier>;
7333
7691
  };
7334
- /**
7335
- * Mixin that adds an `abstract` modifier to a node.
7336
- */
7337
- declare class AbstractMixin {
7692
+ interface AbstractMethods extends Modifiers {
7338
7693
  /**
7339
7694
  * Adds the `abstract` keyword modifier if the condition is true.
7340
7695
  *
7341
7696
  * @param condition - Whether to add the modifier (default: true).
7342
7697
  * @returns The target object for chaining.
7343
7698
  */
7344
- abstract<T extends Target>(this: T, condition?: boolean): T;
7699
+ abstract(condition?: boolean): this;
7345
7700
  }
7346
- /**
7347
- * Mixin that adds an `async` modifier to a node.
7348
- */
7349
- declare class AsyncMixin {
7701
+ interface AsyncMethods extends Modifiers {
7350
7702
  /**
7351
7703
  * Adds the `async` keyword modifier if the condition is true.
7352
7704
  *
7353
7705
  * @param condition - Whether to add the modifier (default: true).
7354
7706
  * @returns The target object for chaining.
7355
7707
  */
7356
- async<T extends Target>(this: T, condition?: boolean): T;
7708
+ async(condition?: boolean): this;
7357
7709
  }
7358
- /**
7359
- * Mixin that adds a `const` modifier to a node.
7360
- */
7361
- declare class ConstMixin {
7710
+ interface ConstMethods extends Modifiers {
7362
7711
  /**
7363
7712
  * Adds the `const` keyword modifier if the condition is true.
7364
7713
  *
7365
7714
  * @param condition - Whether to add the modifier (default: true).
7366
7715
  * @returns The target object for chaining.
7367
7716
  */
7368
- const<T extends Target>(this: T, condition?: boolean): T;
7717
+ const(condition?: boolean): this;
7369
7718
  }
7370
- /**
7371
- * Mixin that adds a `default` modifier to a node.
7372
- */
7373
- declare class DefaultMixin {
7719
+ interface DefaultMethods extends Modifiers {
7374
7720
  /**
7375
7721
  * Adds the `default` keyword modifier if the condition is true.
7376
7722
  *
7377
7723
  * @param condition - Whether to add the modifier (default: true).
7378
7724
  * @returns The target object for chaining.
7379
7725
  */
7380
- default<T extends Target>(this: T, condition?: boolean): T;
7726
+ default(condition?: boolean): this;
7381
7727
  }
7382
- /**
7383
- * Mixin that adds an `export` modifier to a node.
7384
- */
7385
- declare class ExportMixin {
7728
+ interface ExportMethods extends Modifiers {
7386
7729
  /**
7387
7730
  * Adds the `export` keyword modifier if the condition is true.
7388
7731
  *
7389
7732
  * @param condition - Whether to add the modifier (default: true).
7390
7733
  * @returns The target object for chaining.
7391
7734
  */
7392
- export<T extends Target>(this: T, condition?: boolean): T;
7735
+ export(condition?: boolean): this;
7393
7736
  }
7394
- /**
7395
- * Mixin that adds a `private` modifier to a node.
7396
- */
7397
- declare class PrivateMixin {
7737
+ interface PrivateMethods extends Modifiers {
7398
7738
  /**
7399
7739
  * Adds the `private` keyword modifier if the condition is true.
7400
7740
  *
7401
7741
  * @param condition - Whether to add the modifier (default: true).
7402
7742
  * @returns The target object for chaining.
7403
7743
  */
7404
- private<T extends Target>(this: T, condition?: boolean): T;
7744
+ private(condition?: boolean): this;
7405
7745
  }
7406
- /**
7407
- * Mixin that adds a `protected` modifier to a node.
7408
- */
7409
- declare class ProtectedMixin {
7746
+ interface ProtectedMethods extends Modifiers {
7410
7747
  /**
7411
7748
  * Adds the `protected` keyword modifier if the condition is true.
7412
7749
  *
7413
7750
  * @param condition - Whether to add the modifier (default: true).
7414
7751
  * @returns The target object for chaining.
7415
7752
  */
7416
- protected<T extends Target>(this: T, condition?: boolean): T;
7753
+ protected(condition?: boolean): this;
7417
7754
  }
7418
- /**
7419
- * Mixin that adds a `public` modifier to a node.
7420
- */
7421
- declare class PublicMixin {
7755
+ interface PublicMethods extends Modifiers {
7422
7756
  /**
7423
7757
  * Adds the `public` keyword modifier if the condition is true.
7424
7758
  *
7425
7759
  * @param condition - Whether to add the modifier (default: true).
7426
7760
  * @returns The target object for chaining.
7427
7761
  */
7428
- public<T extends Target>(this: T, condition?: boolean): T;
7762
+ public(condition?: boolean): this;
7429
7763
  }
7430
- /**
7431
- * Mixin that adds a `readonly` modifier to a node.
7432
- */
7433
- declare class ReadonlyMixin {
7764
+ interface ReadonlyMethods extends Modifiers {
7434
7765
  /**
7435
7766
  * Adds the `readonly` keyword modifier if the condition is true.
7436
7767
  *
7437
7768
  * @param condition - Whether to add the modifier (default: true).
7438
7769
  * @returns The target object for chaining.
7439
7770
  */
7440
- readonly<T extends Target>(this: T, condition?: boolean): T;
7771
+ readonly(condition?: boolean): this;
7441
7772
  }
7442
- /**
7443
- * Mixin that adds a `static` modifier to a node.
7444
- */
7445
- declare class StaticMixin {
7773
+ interface StaticMethods extends Modifiers {
7446
7774
  /**
7447
7775
  * Adds the `static` keyword modifier if the condition is true.
7448
7776
  *
7449
7777
  * @param condition - Whether to add the modifier (default: true).
7450
7778
  * @returns The target object for chaining.
7451
7779
  */
7452
- static<T extends Target>(this: T, condition?: boolean): T;
7780
+ static(condition?: boolean): this;
7453
7781
  }
7454
7782
  //#endregion
7455
- //#region src/ts-dsl/type/param.d.ts
7456
- declare class TypeParamTsDsl extends TypeTsDsl<ts.TypeParameterDeclaration> {
7457
- protected name?: string | ts.Identifier;
7458
- protected constraint?: string | MaybeTsDsl<TypeTsDsl> | boolean;
7459
- protected defaultValue?: string | MaybeTsDsl<TypeTsDsl> | boolean;
7460
- constructor(name?: string | ts.Identifier, fn?: (name: TypeParamTsDsl) => void);
7461
- default(value: string | MaybeTsDsl<TypeTsDsl> | boolean): this;
7462
- extends(constraint: string | MaybeTsDsl<TypeTsDsl> | boolean): this;
7463
- $render(): ts.TypeParameterDeclaration;
7464
- }
7465
- //#endregion
7466
- //#region src/ts-dsl/mixins/type-params.d.ts
7467
- declare class TypeParamsMixin extends TsDsl {
7468
- protected _generics?: Array<string | MaybeTsDsl<TypeParamTsDsl>>;
7469
- /** Adds a single type parameter (e.g. `T` in `Array<T>`). */
7470
- generic(...args: ConstructorParameters<typeof TypeParamTsDsl>): this;
7471
- /** Adds type parameters (e.g. `Map<string, T>`). */
7472
- generics(...args: ReadonlyArray<string | MaybeTsDsl<TypeParamTsDsl>>): this;
7473
- /** Returns the type parameters as an array of ts.TypeParameterDeclaration nodes. */
7474
- protected $generics(): ReadonlyArray<ts.TypeParameterDeclaration> | undefined;
7475
- $render(): ts.Node;
7783
+ //#region src/ts-dsl/layout/doc.d.ts
7784
+ type DocMaybeLazy<T> = ((ctx: AstContext) => T) | T;
7785
+ type DocFn = (d: DocTsDsl) => void;
7786
+ type DocLines = DocMaybeLazy<MaybeArray$1<string>>;
7787
+ declare class DocTsDsl extends TsDsl<ts.Node> {
7788
+ readonly '~dsl' = "DocTsDsl";
7789
+ protected _lines: Array<DocLines>;
7790
+ constructor(lines?: DocLines, fn?: DocFn);
7791
+ analyze(ctx: AnalysisContext): void;
7792
+ add(lines: DocLines): this;
7793
+ apply<T extends ts.Node>(ctx: AstContext, node: T): T;
7794
+ toAst(ctx: AstContext): ts.Node;
7476
7795
  }
7477
7796
  //#endregion
7478
- //#region src/ts-dsl/mixins/value.d.ts
7479
- declare class ValueMixin extends TsDsl {
7480
- protected value?: string | MaybeTsDsl<ts.Expression>;
7481
- /** Sets the initializer expression (e.g. `= expr`). */
7482
- assign<T extends this>(this: T, expr: string | MaybeTsDsl<ts.Expression>): T;
7483
- protected $value(): ts.Expression | undefined;
7484
- $render(): ts.Node;
7797
+ //#region src/ts-dsl/mixins/doc.d.ts
7798
+ interface DocMethods extends Node {
7799
+ $docs<T extends ts.Node>(ctx: AstContext, node: T): T;
7800
+ doc(lines?: DocLines, fn?: DocFn): this;
7485
7801
  }
7486
7802
  //#endregion
7487
- //#region src/ts-dsl/decl/field.d.ts
7488
- declare class FieldTsDsl extends TsDsl<ts.PropertyDeclaration> {
7489
- protected modifiers: {
7490
- list: () => ts.Modifier[];
7491
- };
7492
- protected name: string;
7803
+ //#region src/ts-dsl/stmt/var.d.ts
7804
+ type VarName = Symbol | string;
7805
+ declare const Mixed$40: MixinCtor<MixinCtor<MixinCtor<MixinCtor<MixinCtor<MixinCtor<abstract new () => TsDsl<ts.VariableStatement>, ValueMethods>, PatternMethods>, HintMethods>, ExportMethods>, DocMethods>, DefaultMethods>;
7806
+ declare class VarTsDsl extends Mixed$40 {
7807
+ readonly '~dsl' = "VarTsDsl";
7808
+ protected kind: ts.NodeFlags;
7809
+ protected name?: Ref<VarName>;
7493
7810
  protected _type?: TypeTsDsl;
7494
- constructor(name: string, fn?: (f: FieldTsDsl) => void);
7495
- /** Sets the field type. */
7811
+ constructor(name?: VarName);
7812
+ analyze(ctx: AnalysisContext): void;
7813
+ const(): this;
7814
+ let(): this;
7815
+ /** Sets the variable type. */
7496
7816
  type(type: string | TypeTsDsl): this;
7497
- /** Builds the `PropertyDeclaration` node. */
7498
- $render(): ts.PropertyDeclaration;
7817
+ var(): this;
7818
+ toAst(ctx: AstContext): ts.VariableStatement;
7499
7819
  }
7500
- interface FieldTsDsl extends DecoratorMixin, DocMixin, PrivateMixin, ProtectedMixin, PublicMixin, ReadonlyMixin, StaticMixin, ValueMixin {}
7501
7820
  //#endregion
7502
- //#region src/ts-dsl/mixins/do.d.ts
7503
- /**
7504
- * Adds `.do()` for appending statements or expressions to a body.
7505
- */
7506
- declare class DoMixin extends TsDsl {
7507
- protected _do?: Array<MaybeTsDsl<ts.Expression | ts.Statement>>;
7508
- /** Adds one or more expressions/statements to the body. */
7509
- do(...items: ReadonlyArray<MaybeTsDsl<ts.Expression | ts.Statement>>): this;
7510
- /** Renders the collected `.do()` calls into an array of `Statement` nodes. */
7511
- protected $do(): ReadonlyArray<ts.Statement>;
7512
- $render(): ts.Node;
7821
+ //#region src/ts-dsl/decl/decorator.d.ts
7822
+ type DecoratorName = Symbol | string | MaybeTsDsl<ts.Expression>;
7823
+ declare const Mixed$39: MixinCtor<abstract new () => TsDsl<ts.Decorator>, ArgsMethods>;
7824
+ declare class DecoratorTsDsl extends Mixed$39 {
7825
+ readonly '~dsl' = "DecoratorTsDsl";
7826
+ protected name: Ref<DecoratorName>;
7827
+ constructor(name: DecoratorName, ...args: ReadonlyArray<string | MaybeTsDsl<ts.Expression>>);
7828
+ analyze(ctx: AnalysisContext): void;
7829
+ toAst(ctx: AstContext): ts.Decorator;
7513
7830
  }
7514
7831
  //#endregion
7515
- //#region src/ts-dsl/mixins/optional.d.ts
7516
- declare class OptionalMixin {
7517
- protected _optional?: boolean;
7518
- /** Marks the node as optional when the condition is true. */
7519
- optional<T extends this>(this: T, condition?: boolean): T;
7520
- /** Marks the node as required when the condition is true. */
7521
- required<T extends this>(this: T, condition?: boolean): T;
7832
+ //#region src/ts-dsl/decl/member.d.ts
7833
+ type Value$2 = string | number | MaybeTsDsl<ts.Expression>;
7834
+ type ValueFn$1 = Value$2 | ((m: EnumMemberTsDsl) => void);
7835
+ declare const Mixed$38: MixinCtor<abstract new () => TsDsl<ts.EnumMember>, DocMethods>;
7836
+ declare class EnumMemberTsDsl extends Mixed$38 {
7837
+ readonly '~dsl' = "EnumMemberTsDsl";
7838
+ private _name;
7839
+ private _value?;
7840
+ constructor(name: string, value?: ValueFn$1);
7841
+ analyze(ctx: AnalysisContext): void;
7842
+ /** Sets the enum member value. */
7843
+ value(value?: Value$2): this;
7844
+ toAst(ctx: AstContext): ts.EnumMember;
7522
7845
  }
7523
7846
  //#endregion
7524
- //#region src/ts-dsl/decl/pattern.d.ts
7525
- /**
7526
- * Builds binding patterns (e.g. `{ foo, bar }`, `[a, b, ...rest]`).
7527
- */
7528
- declare class PatternTsDsl extends TsDsl<ts.BindingName> {
7529
- protected pattern?: {
7530
- kind: 'array';
7531
- values: ReadonlyArray<string>;
7532
- } | {
7533
- kind: 'object';
7534
- values: Record<string, string>;
7535
- };
7536
- protected _spread?: string;
7537
- /** Defines an array pattern (e.g. `[a, b, c]`). */
7538
- array(...props: ReadonlyArray<string> | [ReadonlyArray<string>]): this;
7539
- /** Defines an object pattern (e.g. `{ a, b: alias }`). */
7540
- object(...props: ReadonlyArray<MaybeArray$1<string> | Record<string, string>>): this;
7541
- /** Adds a spread element (e.g. `...rest`, `...options`, `...args`). */
7542
- spread(name: string): this;
7543
- /** Builds and returns a BindingName (ObjectBindingPattern, ArrayBindingPattern, or Identifier). */
7544
- $render(): ts.BindingName;
7545
- private createSpread;
7847
+ //#region src/ts-dsl/decl/enum.d.ts
7848
+ type EnumName = Symbol | string;
7849
+ type Value$1 = string | number | MaybeTsDsl<ts.Expression>;
7850
+ type ValueFn = Value$1 | ((m: EnumMemberTsDsl) => void);
7851
+ declare const Mixed$37: MixinCtor<MixinCtor<MixinCtor<abstract new () => TsDsl<ts.EnumDeclaration>, ExportMethods>, DocMethods>, ConstMethods>;
7852
+ declare class EnumTsDsl extends Mixed$37 {
7853
+ readonly '~dsl' = "EnumTsDsl";
7854
+ private _members;
7855
+ private _name;
7856
+ constructor(name: EnumName, fn?: (e: EnumTsDsl) => void);
7857
+ analyze(ctx: AnalysisContext): void;
7858
+ /** Adds an enum member. */
7859
+ member(name: string, value?: ValueFn): this;
7860
+ /** Adds multiple enum members. */
7861
+ members(...members: ReadonlyArray<EnumMemberTsDsl>): this;
7862
+ toAst(ctx: AstContext): ts.EnumDeclaration;
7546
7863
  }
7547
7864
  //#endregion
7548
- //#region src/ts-dsl/mixins/pattern.d.ts
7549
- /**
7550
- * Mixin providing `.array()`, `.object()`, and `.spread()` methods for defining destructuring patterns.
7551
- */
7552
- declare class PatternMixin extends TsDsl {
7553
- protected pattern?: PatternTsDsl;
7554
- /** Defines an array binding pattern. */
7555
- array(...props: ReadonlyArray<string> | [ReadonlyArray<string>]): this;
7556
- /** Defines an object binding pattern. */
7557
- object(...props: ReadonlyArray<MaybeArray$1<string> | Record<string, string>>): this;
7558
- /** Adds a spread element (e.g. `...args`, `...options`) to the pattern. */
7559
- spread(name: string): this;
7560
- /** Renders the pattern into a `BindingName`. */
7561
- protected $pattern(): ts.BindingName | undefined;
7562
- $render(): ts.Node;
7865
+ //#region src/ts-dsl/mixins/decorator.d.ts
7866
+ interface DecoratorMethods extends Node {
7867
+ /** Renders the decorators into an array of `ts.Decorator`s. */
7868
+ $decorators(ctx: AstContext): ReadonlyArray<ts.Decorator>;
7869
+ /** Adds a decorator (e.g. `@sealed({ in: 'root' })`). */
7870
+ decorator(name: Symbol | string | MaybeTsDsl<ts.Expression>, ...args: ReadonlyArray<string | MaybeTsDsl<ts.Expression>>): this;
7871
+ }
7872
+ //#endregion
7873
+ //#region src/ts-dsl/decl/field.d.ts
7874
+ type FieldName = Symbol | string;
7875
+ type FieldType = TypeExprName | TypeTsDsl;
7876
+ 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>;
7877
+ declare class FieldTsDsl extends Mixed$36 {
7878
+ readonly '~dsl' = "FieldTsDsl";
7879
+ protected name: FieldName;
7880
+ protected _type?: TypeTsDsl;
7881
+ constructor(name: FieldName, fn?: (f: FieldTsDsl) => void);
7882
+ analyze(ctx: AnalysisContext): void;
7883
+ /** Sets the field type. */
7884
+ type(type: FieldType): this;
7885
+ toAst(ctx: AstContext): ts.PropertyDeclaration;
7886
+ }
7887
+ //#endregion
7888
+ //#region src/ts-dsl/mixins/type-returns.d.ts
7889
+ interface TypeReturnsMethods extends Node {
7890
+ /** Returns the return type node. */
7891
+ $returns(ctx: AstContext): ts.TypeNode | undefined;
7892
+ /** Sets the return type. */
7893
+ returns(type: TypeExprName | TypeTsDsl): this;
7563
7894
  }
7564
7895
  //#endregion
7565
7896
  //#region src/ts-dsl/decl/param.d.ts
7566
- declare class ParamTsDsl extends TsDsl<ts.ParameterDeclaration> {
7567
- protected name?: string;
7897
+ type ParamName = Symbol | string;
7898
+ type ParamCtor = (name: ParamName | ((p: ParamTsDsl) => void), fn?: (p: ParamTsDsl) => void) => ParamTsDsl;
7899
+ declare const Mixed$35: MixinCtor<MixinCtor<MixinCtor<MixinCtor<abstract new () => TsDsl<ts.ParameterDeclaration>, ValueMethods>, PatternMethods>, OptionalMethods>, DecoratorMethods>;
7900
+ declare class ParamTsDsl extends Mixed$35 {
7901
+ readonly '~dsl' = "ParamTsDsl";
7902
+ protected name?: Ref<ParamName>;
7568
7903
  protected _type?: TypeTsDsl;
7569
- constructor(name: string | ((p: ParamTsDsl) => void), fn?: (p: ParamTsDsl) => void);
7904
+ constructor(name: ParamName | ((p: ParamTsDsl) => void), fn?: (p: ParamTsDsl) => void);
7905
+ analyze(ctx: AnalysisContext): void;
7570
7906
  /** Sets the parameter type. */
7571
7907
  type(type: string | TypeTsDsl): this;
7572
- $render(): ts.ParameterDeclaration;
7908
+ toAst(ctx: AstContext): ts.ParameterDeclaration;
7573
7909
  }
7574
- interface ParamTsDsl extends DecoratorMixin, OptionalMixin, PatternMixin, ValueMixin {}
7575
7910
  //#endregion
7576
7911
  //#region src/ts-dsl/mixins/param.d.ts
7577
- declare class ParamMixin extends TsDsl {
7578
- protected _params?: Array<MaybeTsDsl<ts.ParameterDeclaration>>;
7912
+ interface ParamMethods extends Node {
7913
+ /** Renders the parameters into an array of `ParameterDeclaration`s. */
7914
+ $params(ast: AstContext): ReadonlyArray<ts.ParameterDeclaration>;
7579
7915
  /** Adds a parameter. */
7580
- param(name: string | ((p: ParamTsDsl) => void), fn?: (p: ParamTsDsl) => void): this;
7916
+ param(...args: Parameters<ParamCtor>): this;
7581
7917
  /** Adds multiple parameters. */
7582
7918
  params(...params: ReadonlyArray<MaybeTsDsl<ts.ParameterDeclaration>>): this;
7583
- /** Renders the parameters into an array of `ParameterDeclaration`s. */
7584
- protected $params(): ReadonlyArray<ts.ParameterDeclaration>;
7585
- $render(): ts.Node;
7586
7919
  }
7587
7920
  //#endregion
7588
- //#region src/ts-dsl/decl/init.d.ts
7589
- declare class InitTsDsl extends TsDsl<ts.ConstructorDeclaration> {
7590
- protected modifiers: {
7591
- list: () => ts.Modifier[];
7592
- };
7593
- constructor(fn?: (i: InitTsDsl) => void);
7594
- /** Builds the `ConstructorDeclaration` node. */
7595
- $render(): ts.ConstructorDeclaration;
7596
- }
7597
- interface InitTsDsl extends DecoratorMixin, DoMixin, DocMixin, ParamMixin, PrivateMixin, ProtectedMixin, PublicMixin {}
7598
- //#endregion
7599
- //#region src/ts-dsl/decl/method.d.ts
7600
- declare class MethodTsDsl extends TsDsl<ts.MethodDeclaration> {
7601
- protected modifiers: {
7602
- list: () => ts.Modifier[];
7603
- };
7604
- protected name: string;
7605
- protected _returns?: TypeTsDsl;
7606
- constructor(name: string, fn?: (m: MethodTsDsl) => void);
7607
- /** Sets the return type. */
7608
- returns(type: string | TypeTsDsl): this;
7609
- /** Builds the `MethodDeclaration` node. */
7610
- $render(): ts.MethodDeclaration;
7921
+ //#region src/ts-dsl/mixins/do.d.ts
7922
+ type DoExpr = MaybeTsDsl<ts.Expression | ts.Statement>;
7923
+ interface DoMethods extends Node {
7924
+ /** Renders the collected `.do()` calls into an array of `Statement` nodes. */
7925
+ $do(ctx: AstContext): ReadonlyArray<ts.Statement>;
7926
+ _do: Array<DoExpr>;
7927
+ /** Adds one or more expressions/statements to the body. */
7928
+ do(...items: ReadonlyArray<DoExpr>): this;
7611
7929
  }
7612
- interface MethodTsDsl extends AbstractMixin, AsyncMixin, DecoratorMixin, DoMixin, DocMixin, OptionalMixin, ParamMixin, PrivateMixin, ProtectedMixin, PublicMixin, StaticMixin, TypeParamsMixin {}
7613
7930
  //#endregion
7614
- //#region src/ts-dsl/decl/class.d.ts
7615
- declare class ClassTsDsl extends TsDsl<ts.ClassDeclaration> {
7616
- protected heritageClauses: Array<ts.HeritageClause>;
7617
- protected body: Array<MaybeTsDsl<ts.ClassElement | NewlineTsDsl>>;
7618
- protected modifiers: {
7619
- list: () => ts.Modifier[];
7620
- };
7621
- protected name: string;
7622
- constructor(name: string);
7623
- /** Adds one or more class members (fields, methods, etc.). */
7624
- do(...items: ReadonlyArray<MaybeTsDsl<ts.ClassElement | ts.Node>>): this;
7625
- /** Adds a base class to extend from. */
7626
- extends(base?: string | ts.Expression | false | null): this;
7627
- /** Adds a class field. */
7628
- field(name: string, fn?: (f: FieldTsDsl) => void): this;
7629
- /** Adds a class constructor. */
7630
- init(fn?: (i: InitTsDsl) => void): this;
7631
- /** Adds a class method. */
7632
- method(name: string, fn?: (m: MethodTsDsl) => void): this;
7633
- /** Inserts an empty line between members for formatting. */
7634
- newline(): this;
7635
- /** Builds the `ClassDeclaration` node. */
7636
- $render(): ts.ClassDeclaration;
7931
+ //#region src/ts-dsl/decl/getter.d.ts
7932
+ type GetterName = string | ts.PropertyName;
7933
+ 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>;
7934
+ declare class GetterTsDsl extends Mixed$34 {
7935
+ readonly '~dsl' = "GetterTsDsl";
7936
+ protected name: GetterName;
7937
+ constructor(name: GetterName, fn?: (g: GetterTsDsl) => void);
7938
+ analyze(ctx: AnalysisContext): void;
7939
+ toAst(ctx: AstContext): ts.GetAccessorDeclaration;
7637
7940
  }
7638
- interface ClassTsDsl extends AbstractMixin, DecoratorMixin, DefaultMixin, DocMixin, ExportMixin, TypeParamsMixin {}
7639
7941
  //#endregion
7640
- //#region src/ts-dsl/decl/member.d.ts
7641
- type Value$1 = string | number | MaybeTsDsl<ts.Expression>;
7642
- type ValueFn$1 = Value$1 | ((m: EnumMemberTsDsl) => void);
7643
- declare class EnumMemberTsDsl extends TsDsl<ts.EnumMember> {
7644
- private _name;
7645
- private _value?;
7646
- constructor(name: string, value?: ValueFn$1);
7647
- /** Sets the enum member value. */
7648
- value(value?: Value$1): this;
7649
- $render(): ts.EnumMember;
7942
+ //#region src/ts-dsl/stmt/if.d.ts
7943
+ type IfCondition = string | MaybeTsDsl<ts.Expression>;
7944
+ declare const Mixed$33: MixinCtor<abstract new () => TsDsl<ts.IfStatement>, DoMethods>;
7945
+ declare class IfTsDsl extends Mixed$33 {
7946
+ readonly '~dsl' = "IfTsDsl";
7947
+ protected _condition?: IfCondition;
7948
+ protected _else?: Array<DoExpr>;
7949
+ constructor(condition?: IfCondition);
7950
+ analyze(ctx: AnalysisContext): void;
7951
+ condition(condition: IfCondition): this;
7952
+ otherwise(...items: Array<DoExpr>): this;
7953
+ toAst(ctx: AstContext): ts.IfStatement;
7650
7954
  }
7651
- interface EnumMemberTsDsl extends DocMixin {}
7652
7955
  //#endregion
7653
- //#region src/ts-dsl/decl/enum.d.ts
7654
- type Value = string | number | MaybeTsDsl<ts.Expression>;
7655
- type ValueFn = Value | ((m: EnumMemberTsDsl) => void);
7656
- declare class EnumTsDsl extends TsDsl<ts.EnumDeclaration> {
7657
- private _members;
7658
- private _name;
7659
- protected modifiers: {
7660
- list: () => ts.Modifier[];
7661
- };
7662
- constructor(name: string | ts.Identifier, fn?: (e: EnumTsDsl) => void);
7663
- /** Adds an enum member. */
7664
- member(name: string, value?: ValueFn): this;
7665
- /** Adds multiple enum members. */
7666
- members(...members: ReadonlyArray<EnumMemberTsDsl>): this;
7667
- /** Renders the enum declaration. */
7668
- $render(): ts.EnumDeclaration;
7956
+ //#region src/ts-dsl/utils/lazy.d.ts
7957
+ type LazyThunk<T extends ts.Node> = (ctx: AstContext) => TsDsl<T>;
7958
+ declare class LazyTsDsl<T extends ts.Node = ts.Node> extends TsDsl<T> {
7959
+ readonly '~dsl' = "LazyTsDsl";
7960
+ private _thunk;
7961
+ constructor(thunk: LazyThunk<T>);
7962
+ analyze(ctx: AnalysisContext): void;
7963
+ toAst(ctx: AstContext): T;
7669
7964
  }
7670
- interface EnumTsDsl extends ConstMixin, DocMixin, ExportMixin {}
7671
7965
  //#endregion
7672
- //#region src/ts-dsl/expr/binary.d.ts
7673
- type Expr$3 = string | MaybeTsDsl<ts.Expression>;
7674
- type Op$1 = Operator | ts.BinaryOperator;
7675
- type Operator = '!=' | '!==' | '&&' | '*' | '+' | '-' | '/' | '<' | '<=' | '=' | '==' | '===' | '>' | '>=' | '??' | '||';
7676
- declare class BinaryTsDsl extends TsDsl<ts.BinaryExpression> {
7677
- protected _base: Expr$3;
7678
- protected _expr?: Expr$3;
7679
- protected _op?: Op$1;
7680
- constructor(base: Expr$3, op?: Op$1, expr?: Expr$3);
7681
- /** Logical AND — `this && expr` */
7682
- and(expr: Expr$3): this;
7683
- /** Creates an assignment expression (e.g. `this = expr`). */
7684
- assign(expr: Expr$3): this;
7685
- /** Nullish coalescing — `this ?? expr` */
7686
- coalesce(expr: Expr$3): this;
7687
- /** Division — `this / expr` */
7688
- div(expr: Expr$3): this;
7689
- /** Strict equality — `this === expr` */
7690
- eq(expr: Expr$3): this;
7691
- /** Greater than — `this > expr` */
7692
- gt(expr: Expr$3): this;
7693
- /** Greater than or equal — `this >= expr` */
7694
- gte(expr: Expr$3): this;
7695
- /** Loose equality — `this == expr` */
7696
- looseEq(expr: Expr$3): this;
7697
- /** Loose inequality — `this != expr` */
7698
- looseNeq(expr: Expr$3): this;
7699
- /** Less than — `this < expr` */
7700
- lt(expr: Expr$3): this;
7701
- /** Less than or equal — `this <= expr` */
7702
- lte(expr: Expr$3): this;
7703
- /** Subtraction — `this - expr` */
7704
- minus(expr: Expr$3): this;
7705
- /** Strict inequality — `this !== expr` */
7706
- neq(expr: Expr$3): this;
7707
- /** Logical OR — `this || expr` */
7708
- or(expr: Expr$3): this;
7709
- /** Addition — `this + expr` */
7710
- plus(expr: Expr$3): this;
7711
- /** Multiplication — `this * expr` */
7712
- times(expr: Expr$3): this;
7713
- $render(): ts.BinaryExpression;
7714
- /** Sets the binary operator and right-hand operand for this expression. */
7715
- private opAndExpr;
7716
- private opToToken;
7717
- }
7718
- interface BinaryTsDsl extends AsMixin, ExprMixin {}
7719
- //#endregion
7720
- //#region src/ts-dsl/mixins/operator.d.ts
7721
- type This = string | MaybeTsDsl<ts.Expression>;
7722
- type Expr$2 = string | MaybeTsDsl<ts.Expression>;
7723
- declare class OperatorMixin {
7724
- /** Logical AND — `this && expr` */
7725
- and(this: This, expr: Expr$2): BinaryTsDsl;
7726
- /** Creates an assignment expression (e.g. `this = expr`). */
7727
- assign(this: This, expr: Expr$2): BinaryTsDsl;
7728
- /** Nullish coalescing — `this ?? expr` */
7729
- coalesce(this: This, expr: Expr$2): BinaryTsDsl;
7730
- /** Division — `this / expr` */
7731
- div(this: This, expr: Expr$2): BinaryTsDsl;
7732
- /** Strict equality — `this === expr` */
7733
- eq(this: This, expr: Expr$2): BinaryTsDsl;
7734
- /** Greater than — `this > expr` */
7735
- gt(this: This, expr: Expr$2): BinaryTsDsl;
7736
- /** Greater than or equal — `this >= expr` */
7737
- gte(this: This, expr: Expr$2): BinaryTsDsl;
7738
- /** Loose equality — `this == expr` */
7739
- looseEq(this: This, expr: Expr$2): BinaryTsDsl;
7740
- /** Loose inequality — `this != expr` */
7741
- looseNeq(this: This, expr: Expr$2): BinaryTsDsl;
7742
- /** Less than — `this < expr` */
7743
- lt(this: This, expr: Expr$2): BinaryTsDsl;
7744
- /** Less than or equal — `this <= expr` */
7745
- lte(this: This, expr: Expr$2): BinaryTsDsl;
7746
- /** Subtraction — `this - expr` */
7747
- minus(this: This, expr: Expr$2): BinaryTsDsl;
7748
- /** Strict inequality — `this !== expr` */
7749
- neq(this: This, expr: Expr$2): BinaryTsDsl;
7750
- /** Logical OR — `this || expr` */
7751
- or(this: This, expr: Expr$2): BinaryTsDsl;
7752
- /** Addition — `this + expr` */
7753
- plus(this: This, expr: Expr$2): BinaryTsDsl;
7754
- /** Multiplication — `this * expr` */
7755
- times(this: This, expr: Expr$2): BinaryTsDsl;
7966
+ //#region src/ts-dsl/expr/new.d.ts
7967
+ type NewExpr = Symbol | string | MaybeTsDsl<ts.Expression>;
7968
+ declare const Mixed$32: MixinCtor<MixinCtor<MixinCtor<abstract new () => TsDsl<ts.NewExpression>, TypeArgsMethods>, ExprMethods>, ArgsMethods>;
7969
+ declare class NewTsDsl extends Mixed$32 {
7970
+ readonly '~dsl' = "NewTsDsl";
7971
+ protected classExpr: Ref<NewExpr>;
7972
+ constructor(classExpr: NewExpr, ...args: ReadonlyArray<NewExpr>);
7973
+ analyze(ctx: AnalysisContext): void;
7974
+ toAst(ctx: AstContext): ts.NewExpression;
7756
7975
  }
7757
7976
  //#endregion
7758
- //#region src/ts-dsl/expr/attr.d.ts
7759
- declare class AttrTsDsl extends TsDsl<ts.PropertyAccessExpression | ts.ElementAccessExpression> {
7760
- protected left: string | MaybeTsDsl<ts.Expression>;
7761
- protected right: string | ts.MemberName | number;
7762
- constructor(left: string | MaybeTsDsl<ts.Expression>, right: string | ts.MemberName | number);
7763
- $render(): ts.PropertyAccessExpression | ts.ElementAccessExpression;
7977
+ //#region src/ts-dsl/layout/note.d.ts
7978
+ type NoteMaybeLazy<T> = ((ctx: AstContext) => T) | T;
7979
+ type NoteFn = (d: NoteTsDsl) => void;
7980
+ type NoteLines = NoteMaybeLazy<MaybeArray$1<string>>;
7981
+ declare class NoteTsDsl extends TsDsl<ts.Node> {
7982
+ readonly '~dsl' = "NoteTsDsl";
7983
+ protected _lines: Array<NoteLines>;
7984
+ constructor(lines?: NoteLines, fn?: NoteFn);
7985
+ analyze(ctx: AnalysisContext): void;
7986
+ add(lines: NoteLines): this;
7987
+ apply<T extends ts.Node>(ctx: AstContext, node: T): T;
7988
+ toAst(ctx: AstContext): ts.Node;
7764
7989
  }
7765
- interface AttrTsDsl extends AsMixin, ExprMixin, OperatorMixin, OptionalMixin {}
7766
7990
  //#endregion
7767
- //#region src/ts-dsl/expr/await.d.ts
7768
- declare class AwaitTsDsl extends TsDsl<ts.AwaitExpression> {
7769
- protected _awaitExpr: string | MaybeTsDsl<ts.Expression>;
7770
- constructor(expr: string | MaybeTsDsl<ts.Expression>);
7771
- $render(): ts.AwaitExpression;
7991
+ //#region src/ts-dsl/decl/setter.d.ts
7992
+ type SetterName = string | ts.PropertyName;
7993
+ 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>;
7994
+ declare class SetterTsDsl extends Mixed$31 {
7995
+ readonly '~dsl' = "SetterTsDsl";
7996
+ protected name: SetterName;
7997
+ constructor(name: SetterName, fn?: (s: SetterTsDsl) => void);
7998
+ analyze(ctx: AnalysisContext): void;
7999
+ toAst(ctx: AstContext): ts.SetAccessorDeclaration;
7772
8000
  }
7773
- interface AwaitTsDsl extends ExprMixin {}
7774
8001
  //#endregion
7775
- //#region src/ts-dsl/mixins/type-args.d.ts
7776
- declare class TypeArgsMixin extends TsDsl {
7777
- protected _generics?: Array<string | MaybeTsDsl<TypeTsDsl>>;
7778
- /** Adds a single type argument (e.g. `string` in `Foo<string>`). */
7779
- generic(arg: string | MaybeTsDsl<TypeTsDsl>): this;
7780
- /** Adds type arguments (e.g. `Map<string, number>`). */
7781
- generics(...args: ReadonlyArray<string | MaybeTsDsl<TypeTsDsl>>): this;
7782
- /** Returns the type arguments as an array of ts.TypeNode nodes. */
7783
- protected $generics(): ReadonlyArray<ts.TypeNode> | undefined;
7784
- $render(): ts.Node;
8002
+ //#region src/ts-dsl/expr/template.d.ts
8003
+ type TemplatePart = Symbol | string | MaybeTsDsl<ts.Expression>;
8004
+ declare const Mixed$30: abstract new () => TsDsl<ts.NoSubstitutionTemplateLiteral | ts.TemplateExpression>;
8005
+ declare class TemplateTsDsl extends Mixed$30 {
8006
+ readonly '~dsl' = "TemplateTsDsl";
8007
+ protected parts: Array<Ref<TemplatePart>>;
8008
+ constructor(value?: TemplatePart);
8009
+ analyze(ctx: AnalysisContext): void;
8010
+ add(value: TemplatePart): this;
8011
+ toAst(ctx: AstContext): ts.NoSubstitutionTemplateLiteral | ts.TemplateExpression;
7785
8012
  }
7786
8013
  //#endregion
7787
- //#region src/ts-dsl/expr/call.d.ts
7788
- declare class CallTsDsl extends TsDsl<ts.CallExpression> {
7789
- protected _callee: string | MaybeTsDsl<ts.Expression>;
7790
- constructor(callee: string | MaybeTsDsl<ts.Expression>, ...args: ReadonlyArray<string | MaybeTsDsl<ts.Expression> | undefined>);
7791
- $render(): ts.CallExpression;
8014
+ //#region src/ts-dsl/type/param.d.ts
8015
+ type TypeParamName = Symbol | string;
8016
+ type TypeParamExpr = Symbol | string | boolean | MaybeTsDsl<TypeTsDsl>;
8017
+ declare const Mixed$29: abstract new () => TsDsl<ts.TypeParameterDeclaration>;
8018
+ declare class TypeParamTsDsl extends Mixed$29 {
8019
+ readonly '~dsl' = "TypeParamTsDsl";
8020
+ protected constraint?: Ref<TypeParamExpr>;
8021
+ protected defaultValue?: Ref<TypeParamExpr>;
8022
+ protected name?: Ref<TypeParamName>;
8023
+ constructor(name?: TypeParamName, fn?: (name: TypeParamTsDsl) => void);
8024
+ analyze(ctx: AnalysisContext): void;
8025
+ default(value: TypeParamExpr): this;
8026
+ extends(constraint: TypeParamExpr): this;
8027
+ toAst(ctx: AstContext): ts.TypeParameterDeclaration;
7792
8028
  }
7793
- interface CallTsDsl extends ArgsMixin, AsMixin, ExprMixin, TypeArgsMixin {}
7794
8029
  //#endregion
7795
- //#region src/ts-dsl/stmt/return.d.ts
7796
- declare class ReturnTsDsl extends TsDsl<ts.ReturnStatement> {
7797
- protected _returnExpr?: string | MaybeTsDsl<ts.Expression>;
7798
- constructor(expr?: string | MaybeTsDsl<ts.Expression>);
7799
- $render(): ts.ReturnStatement;
8030
+ //#region src/ts-dsl/mixins/type-params.d.ts
8031
+ interface TypeParamsMethods extends Node {
8032
+ /** Returns the type parameters as an array of ts.TypeParameterDeclaration nodes. */
8033
+ $generics(ast: AstContext): ReadonlyArray<ts.TypeParameterDeclaration> | undefined;
8034
+ /** Adds a single type parameter (e.g. `T` in `Array<T>`). */
8035
+ generic(...args: ConstructorParameters<typeof TypeParamTsDsl>): this;
8036
+ /** Adds type parameters (e.g. `Map<string, T>`). */
8037
+ generics(...args: ReadonlyArray<Symbol | string | MaybeTsDsl<TypeParamTsDsl>>): this;
7800
8038
  }
7801
- interface ReturnTsDsl extends ExprMixin {}
7802
8039
  //#endregion
7803
- //#region src/ts-dsl/mixins/expr.d.ts
7804
- declare class ExprMixin {
7805
- /** Accesses a property on the current expression (e.g. `this.foo`). */
7806
- attr(this: string | MaybeTsDsl<ts.Expression>, name: string | ts.MemberName | number): AttrTsDsl;
7807
- /** Awaits the current expression (e.g. `await expr`). */
7808
- await(this: string | MaybeTsDsl<ts.Expression>): AwaitTsDsl;
7809
- /** Calls the current expression (e.g. `fn(arg1, arg2)`). */
7810
- call(this: string | MaybeTsDsl<ts.Expression>, ...args: ReadonlyArray<string | MaybeTsDsl<ts.Expression> | undefined>): CallTsDsl;
7811
- /** Produces a `return` statement returning the current expression. */
7812
- return(this: string | MaybeTsDsl<ts.Expression>): ReturnTsDsl;
8040
+ //#region src/ts-dsl/decl/init.d.ts
8041
+ declare const Mixed$28: MixinCtor<MixinCtor<MixinCtor<MixinCtor<MixinCtor<MixinCtor<MixinCtor<abstract new () => TsDsl<ts.ConstructorDeclaration>, PublicMethods>, ProtectedMethods>, PrivateMethods>, ParamMethods>, DocMethods>, DoMethods>, DecoratorMethods>;
8042
+ declare class InitTsDsl extends Mixed$28 {
8043
+ readonly '~dsl' = "InitTsDsl";
8044
+ constructor(fn?: (i: InitTsDsl) => void);
8045
+ analyze(ctx: AnalysisContext): void;
8046
+ toAst(ctx: AstContext): ts.ConstructorDeclaration;
7813
8047
  }
7814
8048
  //#endregion
7815
- //#region src/ts-dsl/expr/as.d.ts
7816
- declare class AsTsDsl extends TsDsl<ts.AsExpression> {
7817
- protected expr: string | MaybeTsDsl<ts.Expression>;
7818
- protected type: string | TypeTsDsl;
7819
- constructor(expr: string | MaybeTsDsl<ts.Expression>, type: string | TypeTsDsl);
7820
- $render(): ts.AsExpression;
8049
+ //#region src/ts-dsl/decl/method.d.ts
8050
+ 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>;
8051
+ declare class MethodTsDsl extends Mixed$27 {
8052
+ readonly '~dsl' = "MethodTsDsl";
8053
+ protected name: string;
8054
+ constructor(name: string, fn?: (m: MethodTsDsl) => void);
8055
+ analyze(ctx: AnalysisContext): void;
8056
+ toAst(ctx: AstContext): ts.MethodDeclaration;
7821
8057
  }
7822
- interface AsTsDsl extends AsMixin, ExprMixin {}
7823
8058
  //#endregion
7824
- //#region src/ts-dsl/mixins/as.d.ts
7825
- declare class AsMixin {
7826
- /** Creates an `as` type assertion expression (e.g. `value as Type`). */
7827
- as(this: string | MaybeTsDsl<ts.Expression>, type: string | TypeTsDsl): AsTsDsl;
8059
+ //#region src/ts-dsl/decl/class.d.ts
8060
+ type Base = Symbol | string;
8061
+ type Name$1 = Symbol | string;
8062
+ type Body = Array<MaybeTsDsl<ts.ClassElement | ts.Node>>;
8063
+ declare const Mixed$26: MixinCtor<MixinCtor<MixinCtor<MixinCtor<MixinCtor<MixinCtor<abstract new () => TsDsl<ts.ClassDeclaration>, TypeParamsMethods>, ExportMethods>, DocMethods>, DefaultMethods>, DecoratorMethods>, AbstractMethods>;
8064
+ declare class ClassTsDsl extends Mixed$26 {
8065
+ readonly '~dsl' = "ClassTsDsl";
8066
+ protected baseClass?: Ref<Base>;
8067
+ protected body: Body;
8068
+ protected name: Ref<Name$1>;
8069
+ constructor(name: Name$1);
8070
+ analyze(ctx: AnalysisContext): void;
8071
+ /** Adds one or more class members (fields, methods, etc.). */
8072
+ do(...items: Body): this;
8073
+ /** Records a base class to extend from. */
8074
+ extends(base?: Base): this;
8075
+ /** Adds a class field. */
8076
+ field(name: FieldName, fn?: (f: FieldTsDsl) => void): this;
8077
+ /** Adds a class constructor. */
8078
+ init(fn?: (i: InitTsDsl) => void): this;
8079
+ /** Adds a class method. */
8080
+ method(name: string, fn?: (m: MethodTsDsl) => void): this;
8081
+ /** Inserts an empty line between members for formatting. */
8082
+ newline(): this;
8083
+ toAst(ctx: AstContext): ts.ClassDeclaration;
8084
+ /** Builds heritage clauses (extends). */
8085
+ private _heritage;
7828
8086
  }
7829
8087
  //#endregion
7830
8088
  //#region src/ts-dsl/decl/func.d.ts
7831
8089
  type FuncMode = 'arrow' | 'decl' | 'expr';
7832
- declare class ImplFuncTsDsl<M extends FuncMode = 'arrow'> extends TsDsl<M extends 'decl' ? ts.FunctionDeclaration : M extends 'expr' ? ts.FunctionExpression : ts.ArrowFunction> {
7833
- protected mode: FuncMode;
7834
- protected modifiers: {
7835
- list: () => ts.Modifier[];
7836
- };
7837
- protected name?: string;
7838
- protected _returns?: TypeTsDsl;
8090
+ type FuncName = Symbol | string;
8091
+ 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>;
8092
+ declare class ImplFuncTsDsl<M extends FuncMode = 'arrow'> extends Mixed$25 {
8093
+ readonly '~dsl' = "FuncTsDsl";
8094
+ protected mode?: FuncMode;
8095
+ protected name?: Ref<FuncName>;
7839
8096
  constructor();
7840
8097
  constructor(fn: (f: ImplFuncTsDsl<'arrow'>) => void);
7841
- constructor(name: string);
7842
- constructor(name: string, fn: (f: ImplFuncTsDsl<'decl'>) => void);
8098
+ constructor(name: FuncName);
8099
+ constructor(name: FuncName, fn: (f: ImplFuncTsDsl<'decl'>) => void);
8100
+ analyze(ctx: AnalysisContext): void;
7843
8101
  /** Switches the function to an arrow function form. */
7844
8102
  arrow(): FuncTsDsl<'arrow'>;
7845
8103
  /** Switches the function to a function declaration form. */
7846
8104
  decl(): FuncTsDsl<'decl'>;
7847
8105
  /** Switches the function to a function expression form. */
7848
8106
  expr(): FuncTsDsl<'expr'>;
7849
- /** Sets the return type. */
7850
- returns(type: string | TypeTsDsl): this;
7851
- $render(): M extends 'decl' ? ts.FunctionDeclaration : M extends 'expr' ? ts.FunctionExpression : ts.ArrowFunction;
8107
+ toAst(ctx: AstContext): M extends 'decl' ? ts.FunctionDeclaration : M extends 'expr' ? ts.FunctionExpression : ts.ArrowFunction;
7852
8108
  }
7853
- interface ImplFuncTsDsl extends AbstractMixin, AsMixin, AsyncMixin, DecoratorMixin, DoMixin, DocMixin, ParamMixin, PrivateMixin, ProtectedMixin, PublicMixin, StaticMixin, TypeParamsMixin {}
7854
8109
  declare const FuncTsDsl: {
7855
8110
  new (): FuncTsDsl<"arrow">;
7856
8111
  new (fn: (f: FuncTsDsl<"arrow">) => void): FuncTsDsl<"arrow">;
@@ -7859,44 +8114,48 @@ declare const FuncTsDsl: {
7859
8114
  } & typeof ImplFuncTsDsl;
7860
8115
  type FuncTsDsl<M extends FuncMode = 'arrow'> = ImplFuncTsDsl<M>;
7861
8116
  //#endregion
7862
- //#region src/ts-dsl/decl/getter.d.ts
7863
- declare class GetterTsDsl extends TsDsl<ts.GetAccessorDeclaration> {
7864
- protected modifiers: {
7865
- list: () => ts.Modifier[];
7866
- };
7867
- protected name: string | ts.PropertyName;
7868
- constructor(name: string | ts.PropertyName, fn?: (g: GetterTsDsl) => void);
7869
- $render(): ts.GetAccessorDeclaration;
7870
- }
7871
- interface GetterTsDsl extends AbstractMixin, AsyncMixin, DecoratorMixin, DoMixin, DocMixin, ParamMixin, PrivateMixin, ProtectedMixin, PublicMixin, StaticMixin {}
7872
- //#endregion
7873
- //#region src/ts-dsl/decl/setter.d.ts
7874
- declare class SetterTsDsl extends TsDsl<ts.SetAccessorDeclaration> {
7875
- protected modifiers: {
7876
- list: () => ts.Modifier[];
8117
+ //#region src/ts-dsl/decl/pattern.d.ts
8118
+ declare const Mixed$24: abstract new () => TsDsl<ts.BindingName>;
8119
+ /**
8120
+ * Builds binding patterns (e.g. `{ foo, bar }`, `[a, b, ...rest]`).
8121
+ */
8122
+ declare class PatternTsDsl extends Mixed$24 {
8123
+ readonly '~dsl' = "PatternTsDsl";
8124
+ protected pattern?: {
8125
+ kind: 'array';
8126
+ values: ReadonlyArray<string>;
8127
+ } | {
8128
+ kind: 'object';
8129
+ values: Record<string, string>;
7877
8130
  };
7878
- protected name: string | ts.PropertyName;
7879
- constructor(name: string | ts.PropertyName, fn?: (s: SetterTsDsl) => void);
7880
- $render(): ts.SetAccessorDeclaration;
8131
+ protected _spread?: string;
8132
+ analyze(ctx: AnalysisContext): void;
8133
+ /** Defines an array pattern (e.g. `[a, b, c]`). */
8134
+ array(...props: ReadonlyArray<string> | [ReadonlyArray<string>]): this;
8135
+ /** Defines an object pattern (e.g. `{ a, b: alias }`). */
8136
+ object(...props: ReadonlyArray<MaybeArray$1<string> | Record<string, string>>): this;
8137
+ /** Adds a spread element (e.g. `...rest`, `...options`, `...args`). */
8138
+ spread(name: string): this;
8139
+ toAst(ctx: AstContext): ts.ObjectBindingPattern | ts.ArrayBindingPattern;
8140
+ private createSpread;
7881
8141
  }
7882
- interface SetterTsDsl extends AbstractMixin, AsyncMixin, DecoratorMixin, DoMixin, DocMixin, ParamMixin, PrivateMixin, ProtectedMixin, PublicMixin, StaticMixin {}
7883
8142
  //#endregion
7884
8143
  //#region src/ts-dsl/mixins/layout.d.ts
7885
- declare class LayoutMixin {
7886
- protected static readonly DEFAULT_THRESHOLD = 3;
7887
- protected layout: boolean | number | undefined;
8144
+ interface LayoutMethods extends Node {
8145
+ /** Computes whether output should be multiline based on layout setting and element count. */
8146
+ $multiline(count: number): boolean;
7888
8147
  /** Sets automatic line output with optional threshold (default: 3). */
7889
8148
  auto(threshold?: number): this;
7890
8149
  /** Sets single line output. */
7891
8150
  inline(): this;
7892
8151
  /** Sets multi line output. */
7893
8152
  pretty(): this;
7894
- /** Computes whether output should be multiline based on layout setting and element count. */
7895
- protected $multiline(count: number): boolean;
7896
8153
  }
7897
8154
  //#endregion
7898
8155
  //#region src/ts-dsl/expr/array.d.ts
7899
- declare class ArrayTsDsl extends TsDsl<ts.ArrayLiteralExpression> {
8156
+ declare const Mixed$23: MixinCtor<MixinCtor<abstract new () => TsDsl<ts.ArrayLiteralExpression>, LayoutMethods>, AsMethods>;
8157
+ declare class ArrayTsDsl extends Mixed$23 {
8158
+ readonly '~dsl' = "ArrayTsDsl";
7900
8159
  protected _elements: Array<{
7901
8160
  expr: MaybeTsDsl<ts.Expression>;
7902
8161
  kind: 'element';
@@ -7905,185 +8164,50 @@ declare class ArrayTsDsl extends TsDsl<ts.ArrayLiteralExpression> {
7905
8164
  kind: 'spread';
7906
8165
  }>;
7907
8166
  constructor(...exprs: Array<string | number | boolean | MaybeTsDsl<ts.Expression>>);
8167
+ analyze(ctx: AnalysisContext): void;
7908
8168
  /** Adds a single array element. */
7909
8169
  element(expr: string | number | boolean | MaybeTsDsl<ts.Expression>): this;
7910
8170
  /** Adds multiple array elements. */
7911
8171
  elements(...exprs: ReadonlyArray<string | number | boolean | MaybeTsDsl<ts.Expression>>): this;
7912
8172
  /** Adds a spread element (`...expr`). */
7913
8173
  spread(expr: MaybeTsDsl<ts.Expression>): this;
7914
- $render(): ts.ArrayLiteralExpression;
7915
- }
7916
- interface ArrayTsDsl extends AsMixin, LayoutMixin {}
7917
- //#endregion
7918
- //#region src/ts-dsl/expr/typeof.d.ts
7919
- declare class TypeOfExprTsDsl extends TsDsl<ts.TypeOfExpression> {
7920
- protected _expr: string | MaybeTsDsl<ts.Expression>;
7921
- constructor(expr: string | MaybeTsDsl<ts.Expression>);
7922
- $render(): ts.TypeOfExpression;
7923
- }
7924
- interface TypeOfExprTsDsl extends OperatorMixin {}
7925
- //#endregion
7926
- //#region src/ts-dsl/type/attr.d.ts
7927
- declare class TypeAttrTsDsl extends TypeTsDsl<ts.QualifiedName> {
7928
- protected _base?: string | MaybeTsDsl<ts.EntityName>;
7929
- protected right: string | ts.Identifier;
7930
- constructor(base: string | MaybeTsDsl<ts.EntityName>, right: string | ts.Identifier);
7931
- constructor(right: string | ts.Identifier);
7932
- base(base?: string | MaybeTsDsl<ts.EntityName>): this;
7933
- $render(): ts.QualifiedName;
7934
- }
7935
- interface TypeAttrTsDsl extends TypeExprMixin {}
7936
- //#endregion
7937
- //#region src/ts-dsl/type/expr.d.ts
7938
- declare class TypeExprTsDsl extends TypeTsDsl<ts.TypeReferenceNode> {
7939
- protected _exprInput?: string | ts.Identifier | TypeAttrTsDsl;
7940
- constructor();
7941
- constructor(fn: (t: TypeExprTsDsl) => void);
7942
- constructor(name: string);
7943
- constructor(name: string, fn?: (t: TypeExprTsDsl) => void);
7944
- /** Accesses a nested type (e.g. `Foo.Bar`). */
7945
- attr(right: string | ts.Identifier | TypeAttrTsDsl): this;
7946
- $render(): ts.TypeReferenceNode;
7947
- }
7948
- interface TypeExprTsDsl extends TypeArgsMixin, TypeExprMixin {}
7949
- //#endregion
7950
- //#region src/ts-dsl/type/idx.d.ts
7951
- declare class TypeIdxTsDsl extends TypeTsDsl<ts.IndexedAccessTypeNode> {
7952
- protected _base: string | MaybeTsDsl<ts.TypeNode>;
7953
- protected _index: string | MaybeTsDsl<ts.TypeNode> | number;
7954
- constructor(base: string | MaybeTsDsl<ts.TypeNode>, index: string | MaybeTsDsl<ts.TypeNode> | number);
7955
- base(base: string | MaybeTsDsl<ts.TypeNode>): this;
7956
- index(index: string | MaybeTsDsl<ts.TypeNode> | number): this;
7957
- $render(): ts.IndexedAccessTypeNode;
7958
- }
7959
- interface TypeIdxTsDsl extends TypeExprMixin {}
7960
- //#endregion
7961
- //#region src/ts-dsl/type/operator.d.ts
7962
- type Op = ts.SyntaxKind.KeyOfKeyword | ts.SyntaxKind.ReadonlyKeyword | ts.SyntaxKind.UniqueKeyword;
7963
- type Type$1 = string | MaybeTsDsl<ts.TypeNode>;
7964
- /**
7965
- * Builds a TypeScript `TypeOperatorNode`, such as:
7966
- *
7967
- * - `keyof T`
7968
- * - `readonly U`
7969
- * - `unique V`
7970
- *
7971
- * This DSL provides both a generic `.operator()` API and convenient
7972
- * shorthand methods (`.keyof()`, `.readonly()`, `.unique()`).
7973
- *
7974
- * The node will throw during render if required fields are missing.
7975
- */
7976
- declare class TypeOperatorTsDsl extends TypeTsDsl<ts.TypeOperatorNode> {
7977
- protected _op?: Op;
7978
- protected _type?: Type$1;
7979
- /** Shorthand: builds `keyof T`. */
7980
- keyof(type: Type$1): this;
7981
- /** Sets the operator explicitly. */
7982
- operator(op: Op): this;
7983
- /** Shorthand: builds `readonly T`. */
7984
- readonly(type: Type$1): this;
7985
- /** Sets the target type of the operator. */
7986
- type(type: Type$1): this;
7987
- /** Shorthand: builds `unique T`. */
7988
- unique(type: Type$1): this;
7989
- $render(): ts.TypeOperatorNode;
7990
- /** Throws if required fields are not set. */
7991
- $validate(): asserts this is this & {
7992
- _op: Op;
7993
- _type: Type$1;
7994
- };
7995
- private missingRequiredCalls;
7996
- }
7997
- //#endregion
7998
- //#region src/ts-dsl/type/query.d.ts
7999
- declare class TypeQueryTsDsl extends TypeTsDsl<ts.TypeQueryNode> {
8000
- protected _expr: string | MaybeTsDsl<TypeTsDsl | ts.Expression>;
8001
- constructor(expr: string | MaybeTsDsl<TypeTsDsl | ts.Expression>);
8002
- $render(): ts.TypeQueryNode;
8003
- }
8004
- interface TypeQueryTsDsl extends TypeExprMixin {}
8005
- //#endregion
8006
- //#region src/ts-dsl/mixins/type-expr.d.ts
8007
- declare class TypeExprMixin {
8008
- /** Creates an indexed-access type (e.g. `Foo<T>[K]`). */
8009
- idx(this: MaybeTsDsl<TypeTsDsl>, index: string | number | MaybeTsDsl<ts.TypeNode>): TypeIdxTsDsl;
8010
- /** Shorthand: builds `keyof T`. */
8011
- keyof(this: MaybeTsDsl<TypeTsDsl>): TypeOperatorTsDsl;
8012
- /** Shorthand: builds `readonly T`. */
8013
- readonly(this: MaybeTsDsl<TypeTsDsl>): TypeOperatorTsDsl;
8014
- /** Create a TypeExpr DSL node representing ReturnType<this>. */
8015
- returnType(this: MaybeTsDsl<ts.Expression>): TypeExprTsDsl;
8016
- /** Create a TypeOfExpr DSL node representing typeof this. */
8017
- typeofExpr(this: MaybeTsDsl<ts.Expression>): TypeOfExprTsDsl;
8018
- /** Create a TypeQuery DSL node representing typeof this. */
8019
- typeofType(this: MaybeTsDsl<TypeTsDsl | ts.Expression>): TypeQueryTsDsl;
8020
- /**
8021
- * Create a `typeof` operator that narrows its return type based on the receiver.
8022
- *
8023
- * - If `this` is a `TsDsl<ts.Expression>` → returns TypeOfExprTsDsl
8024
- * - If `this` is a `TsDsl<TypeTsDsl>` → returns TypeQueryTsDsl
8025
- * - If `this` is a raw ts.Expression → returns TypeOfExprTsDsl
8026
- * - Otherwise → returns TypeQueryTsDsl
8027
- */
8028
- typeof<T extends MaybeTsDsl<TypeTsDsl | ts.Expression>>(this: T): T extends MaybeTsDsl<ts.Expression> ? TypeOfExprTsDsl : T extends MaybeTsDsl<TypeTsDsl> ? TypeQueryTsDsl : TypeQueryTsDsl | TypeOfExprTsDsl;
8029
- /** Shorthand: builds `unique T`. */
8030
- unique(this: MaybeTsDsl<TypeTsDsl>): TypeOperatorTsDsl;
8174
+ toAst(ctx: AstContext): ts.ArrayLiteralExpression;
8031
8175
  }
8032
8176
  //#endregion
8033
8177
  //#region src/ts-dsl/expr/expr.d.ts
8034
- declare class ExprTsDsl extends TsDsl<ts.Expression> {
8035
- protected _exprInput: string | MaybeTsDsl<ts.Expression>;
8036
- constructor(id: string | MaybeTsDsl<ts.Expression>);
8037
- $render(): ts.Expression;
8178
+ type Id = Symbol | string | MaybeTsDsl<ts.Expression>;
8179
+ declare const Mixed$22: MixinCtor<MixinCtor<MixinCtor<MixinCtor<abstract new () => TsDsl<ts.Expression>, TypeExprMethods>, OperatorMethods>, ExprMethods>, AsMethods>;
8180
+ declare class ExprTsDsl extends Mixed$22 {
8181
+ readonly '~dsl' = "ExprTsDsl";
8182
+ protected _exprInput: Ref<Id>;
8183
+ constructor(id: Id);
8184
+ analyze(ctx: AnalysisContext): void;
8185
+ toAst(ctx: AstContext): ts.Expression;
8038
8186
  }
8039
- interface ExprTsDsl extends AsMixin, ExprMixin, OperatorMixin, TypeExprMixin {}
8040
8187
  //#endregion
8041
8188
  //#region src/ts-dsl/expr/id.d.ts
8042
- declare class IdTsDsl extends TsDsl<ts.Identifier> {
8189
+ declare const Mixed$21: abstract new () => TsDsl<ts.Identifier>;
8190
+ declare class IdTsDsl extends Mixed$21 {
8191
+ readonly '~dsl' = "IdTsDsl";
8043
8192
  protected name: string;
8044
8193
  constructor(name: string);
8045
- $render(): ts.Identifier;
8194
+ analyze(ctx: AnalysisContext): void;
8195
+ toAst(): ts.Identifier;
8046
8196
  }
8047
8197
  //#endregion
8048
8198
  //#region src/ts-dsl/expr/literal.d.ts
8049
- declare class LiteralTsDsl extends TsDsl<ts.LiteralTypeNode['literal']> {
8199
+ declare const Mixed$20: MixinCtor<abstract new () => TsDsl<ts.LiteralExpression | ts.NullLiteral | ts.BooleanLiteral | ts.PrefixUnaryExpression>, AsMethods>;
8200
+ declare class LiteralTsDsl extends Mixed$20 {
8201
+ readonly '~dsl' = "LiteralTsDsl";
8050
8202
  protected value: string | number | boolean | null;
8051
8203
  constructor(value: string | number | boolean | null);
8052
- $render(): ts.LiteralTypeNode['literal'];
8053
- }
8054
- interface LiteralTsDsl extends AsMixin {}
8055
- //#endregion
8056
- //#region src/ts-dsl/expr/new.d.ts
8057
- declare class NewTsDsl extends TsDsl<ts.NewExpression> {
8058
- protected classExpr: string | MaybeTsDsl<ts.Expression>;
8059
- constructor(classExpr: string | MaybeTsDsl<ts.Expression>, ...args: ReadonlyArray<string | MaybeTsDsl<ts.Expression>>);
8060
- /** Builds the `NewExpression` node. */
8061
- $render(): ts.NewExpression;
8062
- }
8063
- interface NewTsDsl extends ArgsMixin, ExprMixin, TypeArgsMixin {}
8064
- //#endregion
8065
- //#region src/ts-dsl/layout/hint.d.ts
8066
- declare class HintTsDsl extends TsDsl<ts.Node> {
8067
- protected _lines: Array<string>;
8068
- constructor(lines?: MaybeArray$1<string>, fn?: (d: HintTsDsl) => void);
8069
- add(...lines: ReadonlyArray<string>): this;
8070
- apply<T extends ts.Node>(node: T): T;
8071
- $render(): ts.Node;
8204
+ analyze(ctx: AnalysisContext): void;
8205
+ toAst(ctx: AstContext): ts.StringLiteral | ts.NumericLiteral | ts.NullLiteral | ts.TrueLiteral | ts.FalseLiteral | ts.PrefixUnaryExpression;
8072
8206
  }
8073
8207
  //#endregion
8074
- //#region src/ts-dsl/mixins/hint.d.ts
8075
- declare function HintMixin<TBase extends new (...args: ReadonlyArray<any>) => ITsDsl>(Base: TBase): {
8076
- new (...args: ReadonlyArray<any>): {
8077
- _hint?: HintTsDsl;
8078
- hint(lines?: MaybeArray$1<string>, fn?: (h: HintTsDsl) => void): /*elided*/any;
8079
- $render(): any;
8080
- };
8081
- } & TBase;
8082
- type HintMixin = InstanceType<ReturnType<typeof HintMixin>>;
8083
- //#endregion
8084
8208
  //#region src/ts-dsl/expr/prop.d.ts
8085
- type Expr$1 = string | MaybeTsDsl<ts.Expression>;
8086
- type Stmt$1 = string | MaybeTsDsl<ts.Statement>;
8209
+ type Expr$1 = Symbol | string | MaybeTsDsl<ts.Expression>;
8210
+ type Stmt$1 = Symbol | string | MaybeTsDsl<ts.Statement>;
8087
8211
  type Kind = 'computed' | 'getter' | 'prop' | 'setter' | 'spread';
8088
8212
  type Meta = {
8089
8213
  kind: 'computed';
@@ -8101,30 +8225,35 @@ type Meta = {
8101
8225
  kind: 'spread';
8102
8226
  name?: undefined;
8103
8227
  };
8104
- declare class ObjectPropTsDsl extends TsDsl<ts.ObjectLiteralElementLike> {
8105
- protected _value?: Expr$1 | Stmt$1;
8228
+ declare const Mixed$19: MixinCtor<abstract new () => TsDsl<ts.ObjectLiteralElementLike>, DocMethods>;
8229
+ declare class ObjectPropTsDsl extends Mixed$19 {
8230
+ readonly '~dsl' = "ObjectPropTsDsl";
8231
+ protected _value?: Ref<Expr$1 | Stmt$1>;
8106
8232
  protected meta: Meta;
8107
8233
  constructor(meta: Meta);
8234
+ analyze(ctx: AnalysisContext): void;
8108
8235
  /** Returns true when all required builder calls are present. */
8109
8236
  get isValid(): boolean;
8110
8237
  value(value: Expr$1 | Stmt$1 | ((p: ObjectPropTsDsl) => void)): this;
8111
- $render(): ts.ObjectLiteralElementLike;
8238
+ toAst(ctx: AstContext): ts.GetAccessorDeclaration | ts.SetAccessorDeclaration | ts.PropertyAssignment | ts.ShorthandPropertyAssignment | ts.SpreadAssignment;
8112
8239
  $validate(): asserts this is this & {
8113
8240
  _value: Expr$1 | Stmt$1;
8114
8241
  kind: Kind;
8115
8242
  };
8116
8243
  private missingRequiredCalls;
8117
8244
  }
8118
- interface ObjectPropTsDsl extends DocMixin {}
8119
8245
  //#endregion
8120
8246
  //#region src/ts-dsl/expr/object.d.ts
8121
- type Expr = string | MaybeTsDsl<ts.Expression>;
8122
- type Stmt = string | MaybeTsDsl<ts.Statement>;
8247
+ type Expr = Symbol | string | MaybeTsDsl<ts.Expression>;
8248
+ type Stmt = Symbol | string | MaybeTsDsl<ts.Statement>;
8123
8249
  type ExprFn = Expr | ((p: ObjectPropTsDsl) => void);
8124
8250
  type StmtFn = Stmt | ((p: ObjectPropTsDsl) => void);
8125
- declare class ObjectTsDsl extends TsDsl<ts.ObjectLiteralExpression> {
8251
+ declare const Mixed$18: MixinCtor<MixinCtor<MixinCtor<MixinCtor<abstract new () => TsDsl<ts.ObjectLiteralExpression>, LayoutMethods>, HintMethods>, ExprMethods>, AsMethods>;
8252
+ declare class ObjectTsDsl extends Mixed$18 {
8253
+ readonly '~dsl' = "ObjectTsDsl";
8126
8254
  protected _props: Array<ObjectPropTsDsl>;
8127
8255
  constructor(...props: Array<ObjectPropTsDsl>);
8256
+ analyze(ctx: AnalysisContext): void;
8128
8257
  /** Adds a computed property (e.g. `{ [expr]: value }`). */
8129
8258
  computed(name: string, expr: ExprFn): this;
8130
8259
  /** Adds a getter property (e.g. `{ get foo() { ... } }`). */
@@ -8141,16 +8270,17 @@ declare class ObjectTsDsl extends TsDsl<ts.ObjectLiteralExpression> {
8141
8270
  setter(name: string, stmt: StmtFn): this;
8142
8271
  /** Adds a spread property (e.g. `{ ...options }`). */
8143
8272
  spread(expr: ExprFn): this;
8144
- /** Builds and returns the object literal expression. */
8145
- $render(): ts.ObjectLiteralExpression;
8273
+ toAst(ctx: AstContext): ts.ObjectLiteralExpression;
8146
8274
  }
8147
- interface ObjectTsDsl extends AsMixin, ExprMixin, HintMixin, LayoutMixin {}
8148
8275
  //#endregion
8149
8276
  //#region src/ts-dsl/expr/prefix.d.ts
8150
- declare class PrefixTsDsl extends TsDsl<ts.PrefixUnaryExpression> {
8277
+ declare const Mixed$17: abstract new () => TsDsl<ts.PrefixUnaryExpression>;
8278
+ declare class PrefixTsDsl extends Mixed$17 {
8279
+ readonly '~dsl' = "PrefixTsDsl";
8151
8280
  protected _expr?: string | MaybeTsDsl<ts.Expression>;
8152
8281
  protected _op?: ts.PrefixUnaryOperator;
8153
8282
  constructor(expr?: string | MaybeTsDsl<ts.Expression>, op?: ts.PrefixUnaryOperator);
8283
+ analyze(ctx: AnalysisContext): void;
8154
8284
  /** Sets the operand (the expression being prefixed). */
8155
8285
  expr(expr: string | MaybeTsDsl<ts.Expression>): this;
8156
8286
  /** Sets the operator to MinusToken for negation (`-`). */
@@ -8159,98 +8289,97 @@ declare class PrefixTsDsl extends TsDsl<ts.PrefixUnaryExpression> {
8159
8289
  not(): this;
8160
8290
  /** Sets the operator (e.g. `ts.SyntaxKind.ExclamationToken` for `!`). */
8161
8291
  op(op: ts.PrefixUnaryOperator): this;
8162
- /** Renders the prefix unary expression node. */
8163
- $render(): ts.PrefixUnaryExpression;
8292
+ toAst(ctx: AstContext): ts.PrefixUnaryExpression;
8164
8293
  }
8165
8294
  //#endregion
8166
8295
  //#region src/ts-dsl/expr/regexp.d.ts
8167
8296
  type RegexFlag = 'g' | 'i' | 'm' | 's' | 'u' | 'y';
8168
8297
  type RegexFlags<Avail extends string = RegexFlag> = '' | { [K in Avail]: `${K}${RegexFlags<Exclude<Avail, K>>}` }[Avail];
8169
- declare class RegExpTsDsl extends TsDsl<ts.RegularExpressionLiteral> {
8298
+ declare const Mixed$16: abstract new () => TsDsl<ts.RegularExpressionLiteral>;
8299
+ declare class RegExpTsDsl extends Mixed$16 {
8300
+ readonly '~dsl' = "RegExpTsDsl";
8170
8301
  protected pattern: string;
8171
8302
  protected flags?: RegexFlags;
8172
8303
  constructor(pattern: string, flags?: RegexFlags);
8173
- /** Emits a RegularExpressionLiteral node. */
8174
- $render(): ts.RegularExpressionLiteral;
8175
- }
8176
- //#endregion
8177
- //#region src/ts-dsl/expr/template.d.ts
8178
- declare class TemplateTsDsl extends TsDsl<ts.TemplateExpression | ts.NoSubstitutionTemplateLiteral> {
8179
- protected parts: Array<string | MaybeTsDsl<ts.Expression>>;
8180
- constructor(value?: string | MaybeTsDsl<ts.Expression>);
8181
- add(value: string | MaybeTsDsl<ts.Expression>): this;
8182
- $render(): ts.TemplateExpression | ts.NoSubstitutionTemplateLiteral;
8304
+ analyze(ctx: AnalysisContext): void;
8305
+ toAst(): ts.RegularExpressionLiteral;
8183
8306
  }
8184
8307
  //#endregion
8185
8308
  //#region src/ts-dsl/expr/ternary.d.ts
8186
- declare class TernaryTsDsl extends TsDsl<ts.ConditionalExpression> {
8309
+ declare const Mixed$15: abstract new () => TsDsl<ts.ConditionalExpression>;
8310
+ declare class TernaryTsDsl extends Mixed$15 {
8311
+ readonly '~dsl' = "TernaryTsDsl";
8187
8312
  protected _condition?: string | MaybeTsDsl<ts.Expression>;
8188
8313
  protected _then?: string | MaybeTsDsl<ts.Expression>;
8189
8314
  protected _else?: string | MaybeTsDsl<ts.Expression>;
8190
8315
  constructor(condition?: string | MaybeTsDsl<ts.Expression>);
8316
+ analyze(ctx: AnalysisContext): void;
8191
8317
  condition(condition: string | MaybeTsDsl<ts.Expression>): this;
8192
8318
  do(expr: string | MaybeTsDsl<ts.Expression>): this;
8193
8319
  otherwise(expr: string | MaybeTsDsl<ts.Expression>): this;
8194
- $render(): ts.ConditionalExpression;
8320
+ toAst(ctx: AstContext): ts.ConditionalExpression;
8195
8321
  }
8196
8322
  //#endregion
8197
- //#region src/ts-dsl/layout/note.d.ts
8198
- declare class NoteTsDsl extends TsDsl<ts.Node> {
8199
- protected _lines: Array<string>;
8200
- constructor(lines?: MaybeArray$1<string>, fn?: (d: NoteTsDsl) => void);
8201
- add(...lines: ReadonlyArray<string>): this;
8202
- apply<T extends ts.Node>(node: T): T;
8203
- $render(): ts.Node;
8323
+ //#region src/ts-dsl/layout/newline.d.ts
8324
+ declare class NewlineTsDsl extends TsDsl<ts.Identifier> {
8325
+ readonly '~dsl' = "NewlineTsDsl";
8326
+ analyze(ctx: AnalysisContext): void;
8327
+ toAst(ctx: AstContext): ts.Identifier;
8204
8328
  }
8205
8329
  //#endregion
8206
- //#region src/ts-dsl/stmt/if.d.ts
8207
- declare class IfTsDsl extends TsDsl<ts.IfStatement> {
8208
- protected _condition?: string | MaybeTsDsl<ts.Expression>;
8209
- protected _else?: ReadonlyArray<MaybeTsDsl<ts.Statement>>;
8210
- constructor(condition?: string | MaybeTsDsl<ts.Expression>);
8211
- condition(condition: string | MaybeTsDsl<ts.Expression>): this;
8212
- otherwise(...statements: ReadonlyArray<MaybeTsDsl<ts.Statement>>): this;
8213
- $render(): ts.IfStatement;
8330
+ //#region src/ts-dsl/stmt/block.d.ts
8331
+ declare const Mixed$14: MixinCtor<MixinCtor<abstract new () => TsDsl<ts.Block>, LayoutMethods>, DoMethods>;
8332
+ declare class BlockTsDsl extends Mixed$14 {
8333
+ readonly '~dsl' = "BlockTsDsl";
8334
+ constructor(...items: Array<DoExpr>);
8335
+ analyze(ctx: AnalysisContext): void;
8336
+ toAst(ctx: AstContext): ts.Block;
8214
8337
  }
8215
- interface IfTsDsl extends DoMixin {}
8216
8338
  //#endregion
8217
8339
  //#region src/ts-dsl/stmt/stmt.d.ts
8218
- declare class StmtTsDsl extends TsDsl<ts.Statement> {
8340
+ declare const Mixed$13: abstract new () => TsDsl<ts.Statement>;
8341
+ declare class StmtTsDsl extends Mixed$13 {
8342
+ readonly '~dsl' = "StmtTsDsl";
8219
8343
  protected _inner: ts.Expression | ts.Statement | TsDsl<any>;
8220
8344
  constructor(inner: ts.Expression | ts.Statement | TsDsl<any>);
8221
- $render(): ts.Statement;
8345
+ analyze(ctx: AnalysisContext): void;
8346
+ toAst(ctx: AstContext): ts.Statement;
8222
8347
  }
8223
8348
  //#endregion
8224
8349
  //#region src/ts-dsl/stmt/throw.d.ts
8225
- declare class ThrowTsDsl extends TsDsl<ts.ThrowStatement> {
8350
+ declare const Mixed$12: abstract new () => TsDsl<ts.ThrowStatement>;
8351
+ declare class ThrowTsDsl extends Mixed$12 {
8352
+ readonly '~dsl' = "ThrowTsDsl";
8226
8353
  protected error: string | MaybeTsDsl<ts.Expression>;
8227
8354
  protected msg?: string | MaybeTsDsl<ts.Expression>;
8228
8355
  protected useNew: boolean;
8229
8356
  constructor(error: string | MaybeTsDsl<ts.Expression>, useNew?: boolean);
8357
+ analyze(ctx: AnalysisContext): void;
8230
8358
  message(value: string | MaybeTsDsl<ts.Expression>): this;
8231
- $render(): ts.ThrowStatement;
8359
+ toAst(ctx: AstContext): ts.ThrowStatement;
8232
8360
  }
8233
8361
  //#endregion
8234
- //#region src/ts-dsl/stmt/var.d.ts
8235
- declare class VarTsDsl extends TsDsl<ts.VariableStatement> {
8236
- protected kind: ts.NodeFlags;
8237
- protected modifiers: {
8238
- list: () => ts.Modifier[];
8239
- };
8240
- protected name?: string;
8241
- protected _type?: TypeTsDsl;
8242
- constructor(name?: string);
8243
- const(): this;
8244
- let(): this;
8245
- /** Sets the variable type. */
8246
- type(type: string | TypeTsDsl): this;
8247
- var(): this;
8248
- $render(): ts.VariableStatement;
8362
+ //#region src/ts-dsl/stmt/try.d.ts
8363
+ declare const Mixed$11: abstract new () => TsDsl<ts.TryStatement>;
8364
+ type CatchParam = Symbol | string;
8365
+ declare class TryTsDsl extends Mixed$11 {
8366
+ readonly '~dsl' = "TryTsDsl";
8367
+ protected _catch?: Array<DoExpr>;
8368
+ protected _catchArg?: CatchParam;
8369
+ protected _finally?: Array<DoExpr>;
8370
+ protected _try?: Array<DoExpr>;
8371
+ constructor(...tryBlock: Array<DoExpr>);
8372
+ analyze(ctx: AnalysisContext): void;
8373
+ catch(...items: Array<DoExpr>): this;
8374
+ catchArg(arg: CatchParam): this;
8375
+ finally(...items: Array<DoExpr>): this;
8376
+ try(...items: Array<DoExpr>): this;
8377
+ toAst(ctx: AstContext): ts.TryStatement;
8249
8378
  }
8250
- interface VarTsDsl extends DefaultMixin, DocMixin, ExportMixin, HintMixin, PatternMixin, ValueMixin {}
8251
8379
  //#endregion
8252
8380
  //#region src/ts-dsl/token.d.ts
8253
8381
  declare class TokenTsDsl<K$1 extends ts.SyntaxKind = never> extends TsDsl<ts.Token<K$1>> {
8382
+ readonly '~dsl' = "TokenTsDsl";
8254
8383
  protected _kind?: K$1;
8255
8384
  /** Sets the token kind */
8256
8385
  kind(kind: K$1): this;
@@ -8266,57 +8395,65 @@ declare class TokenTsDsl<K$1 extends ts.SyntaxKind = never> extends TsDsl<ts.Tok
8266
8395
  readonly(): TokenTsDsl<ts.SyntaxKind.ReadonlyKeyword>;
8267
8396
  /** Creates `...` (spread / rest) */
8268
8397
  spread(): TokenTsDsl<ts.SyntaxKind.DotDotDotToken>;
8269
- /** Renders the final token */
8270
- $render(): ts.Token<K$1>;
8398
+ toAst(): ts.Token<K$1>;
8271
8399
  }
8272
8400
  //#endregion
8273
8401
  //#region src/ts-dsl/type/alias.d.ts
8274
- declare class TypeAliasTsDsl extends TsDsl<ts.TypeAliasDeclaration> {
8275
- protected value?: MaybeTsDsl<ts.TypeNode>;
8276
- protected modifiers: {
8277
- list: () => ts.Modifier[];
8278
- };
8279
- protected name: string;
8280
- constructor(name: string, fn?: (t: TypeAliasTsDsl) => void);
8402
+ type Name = Symbol | string;
8403
+ type Value = MaybeTsDsl<ts.TypeNode>;
8404
+ declare const Mixed$10: MixinCtor<MixinCtor<MixinCtor<abstract new () => TsDsl<ts.TypeAliasDeclaration>, TypeParamsMethods>, ExportMethods>, DocMethods>;
8405
+ declare class TypeAliasTsDsl extends Mixed$10 {
8406
+ readonly '~dsl' = "TypeAliasTsDsl";
8407
+ protected name: Ref<Name>;
8408
+ protected value?: Value;
8409
+ constructor(name: Name, fn?: (t: TypeAliasTsDsl) => void);
8410
+ analyze(ctx: AnalysisContext): void;
8281
8411
  /** Sets the type expression on the right-hand side of `= ...`. */
8282
- type(node: MaybeTsDsl<ts.TypeNode>): this;
8283
- /** Renders a `TypeAliasDeclaration` node. */
8284
- $render(): ts.TypeAliasDeclaration;
8412
+ type(node: Value): this;
8413
+ toAst(ctx: AstContext): ts.TypeAliasDeclaration;
8285
8414
  }
8286
- interface TypeAliasTsDsl extends DocMixin, ExportMixin, TypeParamsMixin {}
8287
8415
  //#endregion
8288
8416
  //#region src/ts-dsl/type/and.d.ts
8289
- declare class TypeAndTsDsl extends TypeTsDsl<ts.IntersectionTypeNode> {
8290
- protected _types: Array<string | ts.TypeNode | TypeTsDsl>;
8291
- constructor(...nodes: Array<string | ts.TypeNode | TypeTsDsl>);
8292
- types(...nodes: Array<string | ts.TypeNode | TypeTsDsl>): this;
8293
- $render(): ts.IntersectionTypeNode;
8417
+ type Type$1 = Symbol | string | ts.TypeNode | TypeTsDsl;
8418
+ declare const Mixed$9: abstract new () => TsDsl<ts.IntersectionTypeNode>;
8419
+ declare class TypeAndTsDsl extends Mixed$9 {
8420
+ readonly '~dsl' = "TypeAndTsDsl";
8421
+ protected _types: Array<Ref<Type$1>>;
8422
+ constructor(...nodes: Array<Type$1>);
8423
+ analyze(ctx: AnalysisContext): void;
8424
+ types(...nodes: Array<Type$1>): this;
8425
+ toAst(ctx: AstContext): ts.IntersectionTypeNode;
8294
8426
  }
8295
8427
  //#endregion
8296
8428
  //#region src/ts-dsl/type/func.d.ts
8297
- declare class TypeFuncTsDsl extends TypeTsDsl<ts.FunctionTypeNode> {
8298
- protected _returns?: TypeTsDsl;
8299
- /** Sets the return type. */
8300
- returns(type: string | TypeTsDsl): this;
8301
- $render(): ts.FunctionTypeNode;
8429
+ declare const Mixed$8: MixinCtor<MixinCtor<MixinCtor<MixinCtor<abstract new () => TsDsl<ts.FunctionTypeNode>, TypeReturnsMethods>, TypeParamsMethods>, ParamMethods>, DocMethods>;
8430
+ declare class TypeFuncTsDsl extends Mixed$8 {
8431
+ readonly '~dsl' = "TypeFuncTsDsl";
8432
+ analyze(ctx: AnalysisContext): void;
8433
+ toAst(ctx: AstContext): ts.FunctionTypeNode;
8302
8434
  }
8303
- interface TypeFuncTsDsl extends DocMixin, ParamMixin, TypeParamsMixin {}
8304
8435
  //#endregion
8305
8436
  //#region src/ts-dsl/type/literal.d.ts
8306
- declare class TypeLiteralTsDsl extends TypeTsDsl<ts.LiteralTypeNode> {
8437
+ declare const Mixed$7: abstract new () => TsDsl<ts.LiteralTypeNode>;
8438
+ declare class TypeLiteralTsDsl extends Mixed$7 {
8439
+ readonly '~dsl' = "TypeLiteralTsDsl";
8307
8440
  protected value: string | number | boolean | null;
8308
8441
  constructor(value: string | number | boolean | null);
8309
- $render(): ts.LiteralTypeNode;
8442
+ analyze(ctx: AnalysisContext): void;
8443
+ toAst(ctx: AstContext): ts.LiteralTypeNode;
8310
8444
  }
8311
8445
  //#endregion
8312
8446
  //#region src/ts-dsl/type/mapped.d.ts
8313
- declare class TypeMappedTsDsl extends TypeTsDsl<ts.MappedTypeNode> {
8447
+ declare const Mixed$6: abstract new () => TsDsl<ts.MappedTypeNode>;
8448
+ declare class TypeMappedTsDsl extends Mixed$6 {
8449
+ readonly '~dsl' = "TypeMappedTsDsl";
8314
8450
  protected questionToken?: TokenTsDsl<ts.SyntaxKind.QuestionToken | ts.SyntaxKind.PlusToken | ts.SyntaxKind.MinusToken>;
8315
8451
  protected readonlyToken?: TokenTsDsl<ts.SyntaxKind.ReadonlyKeyword | ts.SyntaxKind.MinusToken | ts.SyntaxKind.PlusToken>;
8316
8452
  protected _key?: string | MaybeTsDsl<ts.TypeNode>;
8317
8453
  protected _name?: string;
8318
8454
  protected _type?: string | MaybeTsDsl<ts.TypeNode>;
8319
8455
  constructor(name?: string);
8456
+ analyze(ctx: AnalysisContext): void;
8320
8457
  /** Returns true when all required builder calls are present. */
8321
8458
  get isValid(): boolean;
8322
8459
  /** Sets the key constraint: `[K in Constraint]` */
@@ -8333,7 +8470,7 @@ declare class TypeMappedTsDsl extends TypeTsDsl<ts.MappedTypeNode> {
8333
8470
  required(): this;
8334
8471
  /** Sets the mapped value type: `[K in X]: ValueType` */
8335
8472
  type(type: string | MaybeTsDsl<ts.TypeNode>): this;
8336
- $render(): ts.MappedTypeNode;
8473
+ toAst(ctx: AstContext): ts.MappedTypeNode;
8337
8474
  $validate(): asserts this is this & {
8338
8475
  _key: string | MaybeTsDsl<ts.TypeNode>;
8339
8476
  _name: string;
@@ -8343,49 +8480,52 @@ declare class TypeMappedTsDsl extends TypeTsDsl<ts.MappedTypeNode> {
8343
8480
  }
8344
8481
  //#endregion
8345
8482
  //#region src/ts-dsl/type/idx-sig.d.ts
8346
- type Type = string | MaybeTsDsl<ts.TypeNode>;
8347
- declare class TypeIdxSigTsDsl extends TypeTsDsl<ts.IndexSignatureDeclaration> {
8348
- protected modifiers: {
8349
- list: () => ts.Modifier[];
8350
- };
8351
- protected _key?: Type;
8352
- protected _name: string;
8353
- protected _type?: Type;
8354
- constructor(name: string, fn?: (i: TypeIdxSigTsDsl) => void);
8483
+ type TypeIdxSigName = string;
8484
+ type TypeIdxSigType = string | MaybeTsDsl<ts.TypeNode>;
8485
+ declare const Mixed$5: MixinCtor<MixinCtor<abstract new () => TsDsl<ts.IndexSignatureDeclaration>, ReadonlyMethods>, DocMethods>;
8486
+ declare class TypeIdxSigTsDsl extends Mixed$5 {
8487
+ readonly '~dsl' = "TypeIdxSigTsDsl";
8488
+ protected _key?: TypeIdxSigType;
8489
+ protected _name: TypeIdxSigName;
8490
+ protected _type?: TypeIdxSigType;
8491
+ constructor(name: TypeIdxSigName, fn?: (i: TypeIdxSigTsDsl) => void);
8492
+ analyze(ctx: AnalysisContext): void;
8355
8493
  /** Returns true when all required builder calls are present. */
8356
8494
  get isValid(): boolean;
8357
8495
  /** Sets the key type: `[name: T]` */
8358
- key(type: Type): this;
8496
+ key(type: TypeIdxSigType): this;
8359
8497
  /** Sets the property type. */
8360
- type(type: Type): this;
8361
- $render(): ts.IndexSignatureDeclaration;
8498
+ type(type: TypeIdxSigType): this;
8499
+ toAst(ctx: AstContext): ts.IndexSignatureDeclaration;
8362
8500
  $validate(): asserts this is this & {
8363
- _key: Type;
8364
- _name: string;
8365
- _type: Type;
8501
+ _key: TypeIdxSigType;
8502
+ _name: TypeIdxSigName;
8503
+ _type: TypeIdxSigType;
8366
8504
  };
8367
8505
  private missingRequiredCalls;
8368
8506
  }
8369
- interface TypeIdxSigTsDsl extends DocMixin, ReadonlyMixin {}
8370
8507
  //#endregion
8371
8508
  //#region src/ts-dsl/type/prop.d.ts
8372
- declare class TypePropTsDsl extends TypeTsDsl<ts.TypeElement> {
8373
- protected modifiers: {
8374
- list: () => ts.Modifier[];
8375
- };
8376
- protected name: string;
8377
- protected _type?: string | MaybeTsDsl<ts.TypeNode>;
8378
- constructor(name: string, fn: (p: TypePropTsDsl) => void);
8509
+ type TypePropName = string;
8510
+ type TypePropType = Symbol | string | MaybeTsDsl<ts.TypeNode>;
8511
+ declare const Mixed$4: MixinCtor<MixinCtor<MixinCtor<abstract new () => TsDsl<ts.TypeElement>, ReadonlyMethods>, OptionalMethods>, DocMethods>;
8512
+ declare class TypePropTsDsl extends Mixed$4 {
8513
+ readonly '~dsl' = "TypePropTsDsl";
8514
+ protected name: TypePropName;
8515
+ protected _type?: Ref<TypePropType>;
8516
+ constructor(name: TypePropName, fn: (p: TypePropTsDsl) => void);
8517
+ analyze(ctx: AnalysisContext): void;
8379
8518
  /** Sets the property type. */
8380
- type(type: string | MaybeTsDsl<ts.TypeNode>): this;
8381
- /** Builds and returns the property signature. */
8382
- $render(): ts.TypeElement;
8519
+ type(type: TypePropType): this;
8520
+ toAst(ctx: AstContext): ts.PropertySignature;
8383
8521
  }
8384
- interface TypePropTsDsl extends DocMixin, OptionalMixin, ReadonlyMixin {}
8385
8522
  //#endregion
8386
8523
  //#region src/ts-dsl/type/object.d.ts
8387
- declare class TypeObjectTsDsl extends TypeTsDsl<ts.TypeNode> {
8524
+ declare const Mixed$3: abstract new () => TsDsl<ts.TypeNode>;
8525
+ declare class TypeObjectTsDsl extends Mixed$3 {
8526
+ readonly '~dsl' = "TypeObjectTsDsl";
8388
8527
  protected props: Array<TypePropTsDsl | TypeIdxSigTsDsl>;
8528
+ analyze(ctx: AnalysisContext): void;
8389
8529
  /** Returns true if object has at least one property or spread. */
8390
8530
  hasProps(): boolean;
8391
8531
  /** Adds an index signature to the object type. */
@@ -8394,67 +8534,171 @@ declare class TypeObjectTsDsl extends TypeTsDsl<ts.TypeNode> {
8394
8534
  get isEmpty(): boolean;
8395
8535
  /** Adds a property signature (returns property builder). */
8396
8536
  prop(name: string, fn: (p: TypePropTsDsl) => void): this;
8397
- $render(): ts.TypeNode;
8537
+ toAst(ctx: AstContext): ts.TypeLiteralNode;
8398
8538
  }
8399
8539
  //#endregion
8400
8540
  //#region src/ts-dsl/type/or.d.ts
8401
- declare class TypeOrTsDsl extends TypeTsDsl<ts.UnionTypeNode> {
8402
- protected _types: Array<string | ts.TypeNode | TypeTsDsl>;
8403
- constructor(...nodes: Array<string | ts.TypeNode | TypeTsDsl>);
8404
- types(...nodes: Array<string | ts.TypeNode | TypeTsDsl>): this;
8405
- $render(): ts.UnionTypeNode;
8541
+ type Type = Symbol | string | ts.TypeNode | TypeTsDsl;
8542
+ declare const Mixed$2: abstract new () => TsDsl<ts.UnionTypeNode>;
8543
+ declare class TypeOrTsDsl extends Mixed$2 {
8544
+ readonly '~dsl' = "TypeOrTsDsl";
8545
+ protected _types: Array<Ref<Type>>;
8546
+ constructor(...nodes: Array<Type>);
8547
+ analyze(ctx: AnalysisContext): void;
8548
+ types(...nodes: Array<Type>): this;
8549
+ toAst(ctx: AstContext): ts.UnionTypeNode;
8406
8550
  }
8407
8551
  //#endregion
8408
8552
  //#region src/ts-dsl/type/template.d.ts
8409
- declare class TypeTemplateTsDsl extends TypeTsDsl<ts.TemplateLiteralTypeNode> {
8553
+ declare const Mixed$1: abstract new () => TsDsl<ts.TemplateLiteralTypeNode>;
8554
+ declare class TypeTemplateTsDsl extends Mixed$1 {
8555
+ readonly '~dsl' = "TypeTemplateTsDsl";
8410
8556
  protected parts: Array<string | MaybeTsDsl<ts.TypeNode>>;
8411
8557
  constructor(value?: string | MaybeTsDsl<ts.TypeNode>);
8558
+ analyze(ctx: AnalysisContext): void;
8412
8559
  /** Adds a raw string segment or embedded type expression. */
8413
8560
  add(part: string | MaybeTsDsl<ts.TypeNode>): this;
8414
- /** Renders a TemplateLiteralTypeNode. */
8415
- $render(): ts.TemplateLiteralTypeNode;
8561
+ toAst(ctx: AstContext): ts.TemplateLiteralTypeNode;
8416
8562
  }
8417
8563
  //#endregion
8418
8564
  //#region src/ts-dsl/type/tuple.d.ts
8419
- declare class TypeTupleTsDsl extends TypeTsDsl<ts.TupleTypeNode> {
8565
+ declare const Mixed: abstract new () => TsDsl<ts.TupleTypeNode>;
8566
+ declare class TypeTupleTsDsl extends Mixed {
8567
+ readonly '~dsl' = "TypeTupleTsDsl";
8420
8568
  protected _elements: Array<string | ts.TypeNode | TypeTsDsl>;
8421
8569
  constructor(...nodes: Array<string | ts.TypeNode | TypeTsDsl>);
8570
+ analyze(ctx: AnalysisContext): void;
8422
8571
  elements(...types: Array<string | ts.TypeNode | TypeTsDsl>): this;
8423
- $render(): ts.TupleTypeNode;
8572
+ toAst(ctx: AstContext): ts.TupleTypeNode;
8573
+ }
8574
+ //#endregion
8575
+ //#region src/ts-dsl/render/typescript.d.ts
8576
+ declare class TypeScriptRenderer implements Renderer {
8577
+ /**
8578
+ * Whether `export * from 'module'` should be used when possible instead of named exports.
8579
+ *
8580
+ * @private
8581
+ */
8582
+ private preferExportAll;
8583
+ /**
8584
+ * Controls whether imports/exports include a file extension (e.g., '.ts' or '.js').
8585
+ *
8586
+ * @private
8587
+ */
8588
+ private preferFileExtension;
8589
+ /**
8590
+ * Optional function to transform module specifiers.
8591
+ *
8592
+ * @private
8593
+ */
8594
+ private resolveModuleName?;
8595
+ constructor(args?: {
8596
+ preferExportAll?: boolean;
8597
+ preferFileExtension?: string;
8598
+ resolveModuleName?: (moduleName: string) => string | undefined;
8599
+ });
8600
+ render(ctx: RenderContext): string;
8601
+ supports(ctx: RenderContext): boolean;
8602
+ private getExports;
8603
+ private getImports;
8604
+ private renderExport;
8605
+ private renderImport;
8606
+ }
8607
+ //#endregion
8608
+ //#region src/ts-dsl/utils/keywords.d.ts
8609
+ declare const keywords: {
8610
+ browserGlobals: string[];
8611
+ javaScriptGlobals: string[];
8612
+ javaScriptKeywords: string[];
8613
+ nodeGlobals: string[];
8614
+ typeScriptKeywords: string[];
8615
+ };
8616
+ //#endregion
8617
+ //#region src/ts-dsl/utils/regexp.d.ts
8618
+ declare const regexp: {
8619
+ /**
8620
+ * Matches characters from the start as long as they're not allowed.
8621
+ */
8622
+ illegalStartCharacters: RegExp;
8623
+ /**
8624
+ * Matches string if it contains only digits and optionally decimal point or
8625
+ * leading minus sign.
8626
+ */
8627
+ number: RegExp;
8628
+ /**
8629
+ * Javascript identifier regexp pattern retrieved from
8630
+ * {@link} https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#identifiers
8631
+ */
8632
+ typeScriptIdentifier: RegExp;
8633
+ };
8634
+ //#endregion
8635
+ //#region src/ts-dsl/utils/reserved.d.ts
8636
+ type List = ReadonlyArray<string>;
8637
+ declare class ReservedList {
8638
+ private _array;
8639
+ private _set;
8640
+ constructor(values: List);
8641
+ get '~values'(): Set<string>;
8642
+ /**
8643
+ * Updates the reserved list with new values.
8644
+ *
8645
+ * @param values New reserved values or a function that receives the previous
8646
+ * reserved values and returns the new ones.
8647
+ */
8648
+ set(values: List | ((prev: List) => List)): void;
8424
8649
  }
8650
+ /**
8651
+ * Reserved names for identifiers. These names will not be used
8652
+ * for variables, functions, classes, or other identifiers in generated code.
8653
+ */
8654
+ declare const reserved: {
8655
+ /**
8656
+ * Reserved names for runtime identifiers. These names will not be used
8657
+ * for variables, functions, classes, or other runtime identifiers in
8658
+ * generated code.
8659
+ */
8660
+ runtime: ReservedList;
8661
+ /**
8662
+ * Reserved names for type identifiers. These names will not be used
8663
+ * for type or interface identifiers in generated code.
8664
+ */
8665
+ type: ReservedList;
8666
+ };
8425
8667
  //#endregion
8426
8668
  //#region src/ts-dsl/index.d.ts
8427
- declare const $: ((id: string | typescript0.Expression | TsDsl<typescript0.Expression>) => ExprTsDsl) & {
8669
+ declare const $: ((id: string | _hey_api_codegen_core0.Symbol | ts.Expression | TsDsl<ts.Expression>) => ExprTsDsl) & {
8428
8670
  /** Creates an array literal expression (e.g. `[1, 2, 3]`). */
8429
8671
  array: (...args: ConstructorParameters<typeof ArrayTsDsl>) => ArrayTsDsl;
8430
8672
  /** Creates an `as` type assertion expression (e.g. `value as Type`). */
8431
- as: (expr: string | typescript0.Expression | TsDsl<typescript0.Expression>, type: string | TypeTsDsl<typescript0.TypeNode>) => AsTsDsl;
8673
+ as: (expr: AsExpr, type: AsType) => AsTsDsl;
8432
8674
  /** Creates a property access expression (e.g. `obj.foo`). */
8433
- attr: (left: string | typescript0.Expression | TsDsl<typescript0.Expression>, right: string | number | typescript0.MemberName) => AttrTsDsl;
8675
+ attr: (left: AttrLeft, right: AttrRight) => AttrTsDsl;
8434
8676
  /** Creates an await expression (e.g. `await promise`). */
8435
- await: (expr: string | typescript0.Expression | TsDsl<typescript0.Expression>) => AwaitTsDsl;
8677
+ await: (expr: AwaitExpr) => AwaitTsDsl;
8436
8678
  /** Creates a binary expression (e.g. `a + b`). */
8437
- binary: (base: string | typescript0.Expression | TsDsl<typescript0.Expression>, op?: (("!=" | "!==" | "&&" | "*" | "+" | "-" | "/" | "<" | "<=" | "=" | "==" | "===" | ">" | ">=" | "??" | "||") | typescript0.BinaryOperator) | undefined, expr?: (string | typescript0.Expression | TsDsl<typescript0.Expression>) | undefined) => BinaryTsDsl;
8679
+ 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;
8680
+ /** Creates a statement block (`{ ... }`). */
8681
+ block: (...args: ConstructorParameters<typeof BlockTsDsl>) => BlockTsDsl;
8438
8682
  /** Creates a function or method call expression (e.g. `fn(arg)`). */
8439
- call: (callee: string | typescript0.Expression | TsDsl<typescript0.Expression>, ...args: (string | typescript0.Expression | TsDsl<typescript0.Expression> | undefined)[]) => CallTsDsl;
8683
+ call: (callee: CallCallee, ...args: (CallArg | undefined)[]) => CallTsDsl;
8440
8684
  /** Creates a class declaration or expression. */
8441
- class: (name: string) => ClassTsDsl;
8685
+ class: (name: string | _hey_api_codegen_core0.Symbol) => ClassTsDsl;
8442
8686
  /** Creates a constant variable declaration (`const`). */
8443
- const: (name?: string | undefined) => VarTsDsl;
8687
+ const: (name?: VarName | undefined) => VarTsDsl;
8444
8688
  /** Creates a decorator expression (e.g. `@decorator`). */
8445
- decorator: (name: string | typescript0.Expression, ...args: (string | typescript0.Expression | TsDsl<typescript0.Expression>)[]) => DecoratorTsDsl;
8689
+ decorator: (name: DecoratorName, ...args: (string | ts.Expression | TsDsl<ts.Expression>)[]) => DecoratorTsDsl;
8446
8690
  /** Creates a JSDoc documentation block. */
8447
- doc: (lines?: MaybeArray$1<string> | undefined, fn?: ((d: DocTsDsl) => void) | undefined) => DocTsDsl;
8691
+ doc: (lines?: DocLines | undefined, fn?: DocFn | undefined) => DocTsDsl;
8448
8692
  /** Creates an enum declaration. */
8449
- enum: (name: string | typescript0.Identifier, fn?: ((e: EnumTsDsl) => void) | undefined) => EnumTsDsl;
8693
+ enum: (name: EnumName, fn?: ((e: EnumTsDsl) => void) | undefined) => EnumTsDsl;
8450
8694
  /** Creates a general expression node. */
8451
- expr: (id: string | typescript0.Expression | TsDsl<typescript0.Expression>) => ExprTsDsl;
8695
+ expr: (id: string | _hey_api_codegen_core0.Symbol | ts.Expression | TsDsl<ts.Expression>) => ExprTsDsl;
8452
8696
  /** Creates a field declaration in a class or object. */
8453
- field: (name: string, fn?: ((f: FieldTsDsl) => void) | undefined) => FieldTsDsl;
8697
+ field: (name: FieldName, fn?: ((f: FieldTsDsl) => void) | undefined) => FieldTsDsl;
8454
8698
  /** Converts a runtime value into a corresponding expression node. */
8455
8699
  fromValue: (input: unknown, options?: {
8456
8700
  layout?: "pretty";
8457
- } | undefined) => TsDsl<typescript0.Expression>;
8701
+ } | undefined) => TsDsl<ts.Expression>;
8458
8702
  /** Creates a function expression or declaration. */
8459
8703
  func: {
8460
8704
  (): FuncTsDsl<"arrow">;
@@ -8464,41 +8708,43 @@ declare const $: ((id: string | typescript0.Expression | TsDsl<typescript0.Expre
8464
8708
  (name?: string, fn?: (f: FuncTsDsl<"decl">) => void): FuncTsDsl<"arrow"> | FuncTsDsl<"decl">;
8465
8709
  };
8466
8710
  /** Creates a getter method declaration. */
8467
- getter: (name: string | typescript0.PropertyName, fn?: ((g: GetterTsDsl) => void) | undefined) => GetterTsDsl;
8711
+ getter: (name: GetterName, fn?: ((g: GetterTsDsl) => void) | undefined) => GetterTsDsl;
8468
8712
  /** Creates a single-line comment (//). */
8469
- hint: (lines?: MaybeArray$1<string> | undefined, fn?: ((d: HintTsDsl) => void) | undefined) => HintTsDsl;
8713
+ hint: (lines?: HintLines | undefined, fn?: HintFn | undefined) => HintTsDsl;
8470
8714
  /** Creates an identifier (e.g. `foo`). */
8471
8715
  id: (name: string) => IdTsDsl;
8472
8716
  /** Creates an if statement. */
8473
- if: (condition?: string | typescript0.Expression | TsDsl<typescript0.Expression> | undefined) => IfTsDsl;
8717
+ if: (condition?: IfCondition | undefined) => IfTsDsl;
8474
8718
  /** Creates an initialization block or statement. */
8475
8719
  init: (fn?: ((i: InitTsDsl) => void) | undefined) => InitTsDsl;
8720
+ /** Creates a lazy, context-aware node with deferred evaluation. */
8721
+ lazy: <T extends ts.Node>(thunk: LazyThunk<T>) => LazyTsDsl<T>;
8476
8722
  /** Creates a let variable declaration (`let`). */
8477
- let: (name?: string | undefined) => VarTsDsl;
8723
+ let: (name?: VarName | undefined) => VarTsDsl;
8478
8724
  /** Creates a literal value (e.g. string, number, boolean). */
8479
8725
  literal: (value: string | number | boolean | null) => LiteralTsDsl;
8480
8726
  /** Creates an enum member declaration. */
8481
- member: (name: string, value?: ((string | number | typescript0.Expression | TsDsl<typescript0.Expression>) | ((m: EnumMemberTsDsl) => void)) | undefined) => EnumMemberTsDsl;
8727
+ member: (name: string, value?: ((string | number | ts.Expression | TsDsl<ts.Expression>) | ((m: EnumMemberTsDsl) => void)) | undefined) => EnumMemberTsDsl;
8482
8728
  /** Creates a method declaration inside a class or object. */
8483
8729
  method: (name: string, fn?: ((m: MethodTsDsl) => void) | undefined) => MethodTsDsl;
8484
8730
  /** Creates a negation expression (`-x`). */
8485
- neg: (expr?: string | typescript0.Expression | TsDsl<typescript0.Expression> | undefined, op?: typescript0.PrefixUnaryOperator | undefined) => PrefixTsDsl;
8731
+ neg: (expr?: string | ts.Expression | TsDsl<ts.Expression> | undefined, op?: ts.PrefixUnaryOperator | undefined) => PrefixTsDsl;
8486
8732
  /** Creates a new expression (e.g. `new ClassName()`). */
8487
- new: (classExpr: string | typescript0.Expression | TsDsl<typescript0.Expression>, ...args: (string | typescript0.Expression | TsDsl<typescript0.Expression>)[]) => NewTsDsl;
8733
+ new: (classExpr: NewExpr, ...args: NewExpr[]) => NewTsDsl;
8488
8734
  /** Creates a newline (for formatting purposes). */
8489
8735
  newline: () => NewlineTsDsl;
8490
8736
  /** Creates a logical NOT expression (`!x`). */
8491
- not: (expr?: string | typescript0.Expression | TsDsl<typescript0.Expression> | undefined, op?: typescript0.PrefixUnaryOperator | undefined) => PrefixTsDsl;
8737
+ not: (expr?: string | ts.Expression | TsDsl<ts.Expression> | undefined, op?: ts.PrefixUnaryOperator | undefined) => PrefixTsDsl;
8492
8738
  /** Creates a block comment (/* ... *\/). */
8493
- note: (lines?: MaybeArray$1<string> | undefined, fn?: ((d: NoteTsDsl) => void) | undefined) => NoteTsDsl;
8739
+ note: (lines?: NoteLines | undefined, fn?: NoteFn | undefined) => NoteTsDsl;
8494
8740
  /** Creates an object literal expression. */
8495
8741
  object: (...args: ConstructorParameters<typeof ObjectTsDsl>) => ObjectTsDsl;
8496
8742
  /** Creates a parameter declaration for functions or methods. */
8497
- param: (name: string | ((p: ParamTsDsl) => void), fn?: ((p: ParamTsDsl) => void) | undefined) => ParamTsDsl;
8743
+ param: (name: ParamName | ((p: ParamTsDsl) => void), fn?: ((p: ParamTsDsl) => void) | undefined) => ParamTsDsl;
8498
8744
  /** Creates a pattern for destructuring or matching. */
8499
8745
  pattern: () => PatternTsDsl;
8500
8746
  /** Creates a prefix unary expression (e.g. `-x`, `!x`, `~x`). */
8501
- prefix: (expr?: string | typescript0.Expression | TsDsl<typescript0.Expression> | undefined, op?: typescript0.PrefixUnaryOperator | undefined) => PrefixTsDsl;
8747
+ prefix: (expr?: string | ts.Expression | TsDsl<ts.Expression> | undefined, op?: ts.PrefixUnaryOperator | undefined) => PrefixTsDsl;
8502
8748
  /** Creates an object literal property (e.g. `{ foo: bar }`). */
8503
8749
  prop: (meta: {
8504
8750
  kind: "computed";
@@ -8519,35 +8765,37 @@ declare const $: ((id: string | typescript0.Expression | TsDsl<typescript0.Expre
8519
8765
  /** Creates a regular expression literal (e.g. `/foo/gi`). */
8520
8766
  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;
8521
8767
  /** Creates a return statement. */
8522
- return: (expr?: string | typescript0.Expression | TsDsl<typescript0.Expression> | undefined) => ReturnTsDsl;
8768
+ return: (expr?: ReturnExpr | undefined) => ReturnTsDsl;
8523
8769
  /** Creates a setter method declaration. */
8524
- setter: (name: string | typescript0.PropertyName, fn?: ((s: SetterTsDsl) => void) | undefined) => SetterTsDsl;
8770
+ setter: (name: SetterName, fn?: ((s: SetterTsDsl) => void) | undefined) => SetterTsDsl;
8525
8771
  /** Wraps an expression or statement-like value into a `StmtTsDsl`. */
8526
- stmt: (inner: typescript0.Expression | typescript0.Statement | TsDsl<any>) => StmtTsDsl;
8772
+ stmt: (inner: ts.Expression | ts.Statement | TsDsl<any>) => StmtTsDsl;
8527
8773
  /** Creates a template literal expression. */
8528
- template: (value?: string | typescript0.Expression | TsDsl<typescript0.Expression> | undefined) => TemplateTsDsl;
8774
+ template: (value?: TemplatePart | undefined) => TemplateTsDsl;
8529
8775
  /** Creates a ternary conditional expression (if ? then : else). */
8530
- ternary: (condition?: string | typescript0.Expression | TsDsl<typescript0.Expression> | undefined) => TernaryTsDsl;
8776
+ ternary: (condition?: string | ts.Expression | TsDsl<ts.Expression> | undefined) => TernaryTsDsl;
8531
8777
  /** Creates a throw statement. */
8532
- throw: (error: string | typescript0.Expression | TsDsl<typescript0.Expression>, useNew?: boolean | undefined) => ThrowTsDsl;
8778
+ throw: (error: string | ts.Expression | TsDsl<ts.Expression>, useNew?: boolean | undefined) => ThrowTsDsl;
8533
8779
  /** Creates a syntax token (e.g. `?`, `readonly`, `+`, `-`). */
8534
8780
  token: () => TokenTsDsl<never>;
8781
+ /** Creates a try/catch/finally statement. */
8782
+ try: (...args: ConstructorParameters<typeof TryTsDsl>) => TryTsDsl;
8535
8783
  /** Creates a basic type reference or type expression (e.g. Foo or Foo<T>). */
8536
- type: ((name: string, fn?: ((t: TypeExprTsDsl) => void) | undefined) => TypeExprTsDsl) & {
8784
+ type: ((name: TypeExprName, fn?: TypeExprFn | undefined) => TypeExprTsDsl) & {
8537
8785
  /** Creates a type alias declaration (e.g. `type Foo = Bar`). */
8538
- alias: (name: string, fn?: ((t: TypeAliasTsDsl) => void) | undefined) => TypeAliasTsDsl;
8786
+ alias: (name: string | _hey_api_codegen_core0.Symbol, fn?: ((t: TypeAliasTsDsl) => void) | undefined) => TypeAliasTsDsl;
8539
8787
  /** Creates an intersection type (e.g. `A & B`). */
8540
8788
  and: (...args: ConstructorParameters<typeof TypeAndTsDsl>) => TypeAndTsDsl;
8541
8789
  /** Creates a qualified type reference (e.g. Foo.Bar). */
8542
- attr: (right: string | typescript0.Identifier) => TypeAttrTsDsl;
8790
+ attr: (right: string | _hey_api_codegen_core0.Symbol | ts.Identifier) => TypeAttrTsDsl;
8543
8791
  /** Creates a basic type reference or type expression (e.g. Foo or Foo<T>). */
8544
- expr: (name: string, fn?: ((t: TypeExprTsDsl) => void) | undefined) => TypeExprTsDsl;
8792
+ expr: (name: TypeExprName, fn?: TypeExprFn | undefined) => TypeExprTsDsl;
8545
8793
  /** Converts a runtime value into a corresponding type expression node. */
8546
- fromValue: (input: unknown) => TsDsl<typescript0.TypeNode>;
8794
+ fromValue: (input: unknown) => TsDsl<ts.TypeNode>;
8547
8795
  /** Creates a function type node (e.g. `(a: string) => number`). */
8548
- func: () => TypeFuncTsDsl;
8796
+ func: (...args: ConstructorParameters<typeof TypeFuncTsDsl>) => TypeFuncTsDsl;
8549
8797
  /** Creates an indexed-access type (e.g. `Foo<T>[K]`). */
8550
- idx: (base: string | typescript0.TypeNode | TsDsl<typescript0.TypeNode>, index: string | number | typescript0.TypeNode | TsDsl<typescript0.TypeNode>) => TypeIdxTsDsl;
8798
+ idx: (base: string | ts.TypeNode | TsDsl<ts.TypeNode>, index: string | number | ts.TypeNode | TsDsl<ts.TypeNode>) => TypeIdxTsDsl;
8551
8799
  /** Creates a literal type node (e.g. 'foo', 42, or true). */
8552
8800
  literal: (value: string | number | boolean | null) => TypeLiteralTsDsl;
8553
8801
  /** Creates a mapped type (e.g. `{ [K in keyof T]: U }`). */
@@ -8559,18 +8807,18 @@ declare const $: ((id: string | typescript0.Expression | TsDsl<typescript0.Expre
8559
8807
  /** Represents a union type (e.g. `A | B | C`). */
8560
8808
  or: (...args: ConstructorParameters<typeof TypeOrTsDsl>) => TypeOrTsDsl;
8561
8809
  /** Creates a type parameter (e.g. `<T>`). */
8562
- param: (name?: string | typescript0.Identifier | undefined, fn?: ((name: TypeParamTsDsl) => void) | undefined) => TypeParamTsDsl;
8810
+ param: (name?: TypeParamName | undefined, fn?: ((name: TypeParamTsDsl) => void) | undefined) => TypeParamTsDsl;
8563
8811
  /** Creates a type query node (e.g. `typeof Foo`). */
8564
- query: (expr: string | MaybeTsDsl<typescript0.Expression | TypeTsDsl<typescript0.TypeNode>>) => TypeQueryTsDsl;
8812
+ query: (expr: TypeQueryExpr) => TypeQueryTsDsl;
8565
8813
  /** Builds a TypeScript template literal *type* (e.g. `${Foo}-${Bar}` as a type). */
8566
- template: (value?: string | typescript0.TypeNode | TsDsl<typescript0.TypeNode> | undefined) => TypeTemplateTsDsl;
8814
+ template: (value?: string | ts.TypeNode | TsDsl<ts.TypeNode> | undefined) => TypeTemplateTsDsl;
8567
8815
  /** Creates a tuple type (e.g. [A, B, C]). */
8568
8816
  tuple: (...args: ConstructorParameters<typeof TypeTupleTsDsl>) => TypeTupleTsDsl;
8569
8817
  };
8570
- /** Creates a runtime `typeof` expression (e.g. typeof x). */
8571
- typeofExpr: (expr: string | typescript0.Expression | TsDsl<typescript0.Expression>) => TypeOfExprTsDsl;
8572
- /** Creates a variable declaration (var). */
8573
- var: (name?: string | undefined) => VarTsDsl;
8818
+ /** Creates a `typeof` expression (e.g. `typeof value`). */
8819
+ typeofExpr: (expr: TypeOfExpr) => TypeOfExprTsDsl;
8820
+ /** Creates a variable declaration (`var`). */
8821
+ var: (name?: VarName | undefined) => VarTsDsl;
8574
8822
  };
8575
8823
  type DollarTsDsl = {
8576
8824
  /**
@@ -8587,7 +8835,7 @@ type DollarTsDsl = {
8587
8835
  *
8588
8836
  * Returns:
8589
8837
  * - A new `ExprTsDsl` instance when called directly.
8590
- * - The `base` factory object for constructing more specific nodes.
8838
+ * - The `tsDsl` object for constructing more specific nodes.
8591
8839
  */
8592
8840
  $: typeof $;
8593
8841
  };
@@ -8676,7 +8924,7 @@ type HeyApiTransformersPlugin = DefinePlugin<UserConfig$13, Config$12>;
8676
8924
  //#region src/plugins/@hey-api/typescript/shared/types.d.ts
8677
8925
  type IrSchemaToAstOptions = {
8678
8926
  plugin: HeyApiTypeScriptPlugin['Instance'];
8679
- state: ToRefs<PluginState>;
8927
+ state: Refs<PluginState>;
8680
8928
  };
8681
8929
  type PluginState = Pick<Required<SymbolMeta>, 'path'> & Pick<Partial<SymbolMeta>, 'tags'>;
8682
8930
  //#endregion
@@ -14903,14 +15151,25 @@ declare class PluginInstance<T extends Plugin.Types = Plugin.Types> {
14903
15151
  };
14904
15152
  };
14905
15153
  isSymbolRegistered(identifier: SymbolIdentifier): boolean;
15154
+ /**
15155
+ * Sets or adds a node to the project graph.
15156
+ *
15157
+ * @param node The node to be added or updated in the project graph.
15158
+ * @param index The index at which to update the node. If undefined, the node will be added.
15159
+ * @returns The index of the added node or void if updated.
15160
+ */
15161
+ node<T extends number | undefined = undefined>(node: Node | null, index?: T): T extends number ? void : number;
14906
15162
  querySymbol(filter: SymbolMeta): Symbol | undefined;
14907
15163
  referenceSymbol(meta: SymbolMeta): Symbol;
15164
+ /**
15165
+ * @deprecated use `plugin.symbol()` instead
15166
+ */
14908
15167
  registerSymbol(symbol: SymbolIn): Symbol;
14909
15168
  /**
14910
15169
  * Executes plugin's handler function.
14911
15170
  */
14912
15171
  run(): Promise<void>;
14913
- setSymbolValue(symbol: Symbol, value: unknown): void;
15172
+ symbol(name: SymbolIn['name'], symbol?: Omit<SymbolIn, 'name'>): Symbol;
14914
15173
  private buildEventHooks;
14915
15174
  private forEachError;
14916
15175
  private getSymbolFilePath;
@@ -14923,6 +15182,34 @@ type Hooks = {
14923
15182
  * Event hooks.
14924
15183
  */
14925
15184
  events?: {
15185
+ /**
15186
+ * Triggered after adding or updating a node.
15187
+ *
15188
+ * You can use this to perform actions after a node is added or updated.
15189
+ *
15190
+ * @param args Arguments object.
15191
+ * @returns void
15192
+ */
15193
+ 'node:set:after'?: (args: {
15194
+ /** The node added or updated. */
15195
+ node: Node | null;
15196
+ /** Plugin that added or updated the node. */
15197
+ plugin: PluginInstance;
15198
+ }) => void;
15199
+ /**
15200
+ * Triggered before adding or updating a node.
15201
+ *
15202
+ * You can use this to modify the node before it's added or updated.
15203
+ *
15204
+ * @param args Arguments object.
15205
+ * @returns void
15206
+ */
15207
+ 'node:set:before'?: (args: {
15208
+ /** The node to be added or updated. */
15209
+ node: Node | null;
15210
+ /** Plugin adding or updating the node. */
15211
+ plugin: PluginInstance;
15212
+ }) => void;
14926
15213
  /**
14927
15214
  * Triggered after executing a plugin handler.
14928
15215
  *
@@ -14971,38 +15258,6 @@ type Hooks = {
14971
15258
  /** Symbol to register. */
14972
15259
  symbol: SymbolIn;
14973
15260
  }) => void;
14974
- /**
14975
- * Triggered after setting a symbol value.
14976
- *
14977
- * You can use this to perform actions after a symbol's value is set.
14978
- *
14979
- * @param args Arguments object.
14980
- * @returns void
14981
- */
14982
- 'symbol:setValue:after'?: (args: {
14983
- /** Plugin that set the symbol value. */
14984
- plugin: PluginInstance;
14985
- /** The symbol. */
14986
- symbol: Symbol;
14987
- /** The value that was set. */
14988
- value: unknown;
14989
- }) => void;
14990
- /**
14991
- * Triggered before setting a symbol value.
14992
- *
14993
- * You can use this to modify the value before it's set.
14994
- *
14995
- * @param args Arguments object.
14996
- * @returns void
14997
- */
14998
- 'symbol:setValue:before'?: (args: {
14999
- /** Plugin setting the symbol value. */
15000
- plugin: PluginInstance;
15001
- /** The symbol. */
15002
- symbol: Symbol;
15003
- /** The value to set. */
15004
- value: unknown;
15005
- }) => void;
15006
15261
  };
15007
15262
  /**
15008
15263
  * Hooks specifically for overriding operations behavior.
@@ -15164,8 +15419,8 @@ declare namespace Plugin {
15164
15419
  * Generic wrapper for plugin hooks.
15165
15420
  */
15166
15421
  export type Hooks = Pick<BaseConfig, '~hooks'>;
15167
- export interface Name<Name extends PluginNames> {
15168
- name: Name;
15422
+ export interface Name<Name$2 extends PluginNames> {
15423
+ name: Name$2;
15169
15424
  }
15170
15425
 
15171
15426
  /**
@@ -15482,8 +15737,8 @@ type UserOutput = {
15482
15737
  /**
15483
15738
  * If specified, this will be the file extension used when importing
15484
15739
  * other modules. By default, we don't add a file extension and let the
15485
- * runtime resolve it. If you're using moduleResolution `nodenext`, we
15486
- * default to `.js`.
15740
+ * runtime resolve it. If you're using moduleResolution `nodenext` or
15741
+ * `node16`, we default to `.js`.
15487
15742
  *
15488
15743
  * @default undefined
15489
15744
  */
@@ -15502,10 +15757,28 @@ type UserOutput = {
15502
15757
  * @default null
15503
15758
  */
15504
15759
  lint?: Linters | null;
15760
+ /**
15761
+ * Optional name conflict resolver to customize how naming conflicts
15762
+ * are handled.
15763
+ */
15764
+ nameConflictResolver?: NameConflictResolver;
15505
15765
  /**
15506
15766
  * The absolute path to the output folder.
15507
15767
  */
15508
15768
  path: string;
15769
+ /**
15770
+ * Whether `export * from 'module'` should be used when possible
15771
+ * instead of named exports.
15772
+ *
15773
+ * @default false
15774
+ */
15775
+ preferExportAll?: boolean;
15776
+ /**
15777
+ * Optional function to transform module specifiers.
15778
+ *
15779
+ * @default undefined
15780
+ */
15781
+ resolveModuleName?: (moduleName: string) => string | undefined;
15509
15782
  /**
15510
15783
  * Relative or absolute path to the tsconfig file we should use to
15511
15784
  * generate the output. If a path to tsconfig file is not provided, we
@@ -15520,17 +15793,13 @@ type Output = {
15520
15793
  /**
15521
15794
  * Defines casing of the output fields. By default, we preserve `input`
15522
15795
  * values as data transforms incur a performance penalty at runtime.
15523
- *
15524
- * @default undefined
15525
15796
  */
15526
- case?: StringCase;
15797
+ case: StringCase | undefined;
15527
15798
  /**
15528
15799
  * Clean the `output` folder on every run? If disabled, this folder may
15529
15800
  * be used to store additional files. The default option is `true` to
15530
15801
  * reduce the risk of keeping outdated files around when configuration,
15531
15802
  * input, or package version changes.
15532
- *
15533
- * @default true
15534
15803
  */
15535
15804
  clean: boolean;
15536
15805
  /**
@@ -15542,21 +15811,16 @@ type Output = {
15542
15811
  fileName: {
15543
15812
  /**
15544
15813
  * The casing convention to use for generated file names.
15545
- *
15546
- * @default 'preserve'
15547
15814
  */
15548
15815
  case: StringCase;
15549
15816
  /**
15550
15817
  * Custom naming pattern for generated file names.
15551
- *
15552
- * @default '{{name}}'
15553
15818
  */
15554
15819
  name: StringName;
15555
15820
  /**
15556
15821
  * Suffix to append to file names (before the extension). For example,
15557
15822
  * with a suffix of `.gen`, `example.ts` becomes `example.gen.ts`.
15558
15823
  *
15559
- * @default '.gen'
15560
15824
  * @example
15561
15825
  * // Given a suffix of `.gen`
15562
15826
  * 'index.ts' -> 'index.ts' (index files are not renamed)
@@ -15567,37 +15831,43 @@ type Output = {
15567
15831
  };
15568
15832
  /**
15569
15833
  * Which formatter to use to process output folder?
15570
- *
15571
- * @default null
15572
15834
  */
15573
15835
  format: Formatters | null;
15574
15836
  /**
15575
15837
  * If specified, this will be the file extension used when importing
15576
15838
  * other modules. By default, we don't add a file extension and let the
15577
- * runtime resolve it. If you're using moduleResolution `nodenext`, we
15578
- * default to `.js`.
15579
- *
15580
- * @default undefined
15839
+ * runtime resolve it. If you're using moduleResolution `nodenext` or
15840
+ * `node16`, we default to `.js`.
15581
15841
  */
15582
15842
  importFileExtension: ImportFileExtensions | (string & {}) | null | undefined;
15583
15843
  /**
15584
15844
  * Should the exports from plugin files be re-exported in the index
15585
15845
  * barrel file? By default, this is enabled and only default plugins
15586
15846
  * are re-exported.
15587
- *
15588
- * @default true
15589
15847
  */
15590
15848
  indexFile: boolean;
15591
15849
  /**
15592
15850
  * Which linter to use to process output folder?
15593
- *
15594
- * @default null
15595
15851
  */
15596
15852
  lint: Linters | null;
15853
+ /**
15854
+ * Optional name conflict resolver to customize how naming conflicts
15855
+ * are handled.
15856
+ */
15857
+ nameConflictResolver: NameConflictResolver | undefined;
15597
15858
  /**
15598
15859
  * The absolute path to the output folder.
15599
15860
  */
15600
15861
  path: string;
15862
+ /**
15863
+ * Whether `export * from 'module'` should be used when possible
15864
+ * instead of named exports.
15865
+ */
15866
+ preferExportAll: boolean;
15867
+ /**
15868
+ * Optional function to transform module specifiers.
15869
+ */
15870
+ resolveModuleName: ((moduleName: string) => string | undefined) | undefined;
15601
15871
  /**
15602
15872
  * The parsed TypeScript configuration used to generate the output.
15603
15873
  * If no `tsconfig` file path was provided or found, this will be `null`.
@@ -15608,8 +15878,6 @@ type Output = {
15608
15878
  * generate the output. If a path to tsconfig file is not provided, we
15609
15879
  * attempt to find one starting from the location of the
15610
15880
  * `@hey-api/openapi-ts` configuration file and traversing up.
15611
- *
15612
- * @default undefined
15613
15881
  */
15614
15882
  tsConfigPath: (string & {}) | null | undefined;
15615
15883
  };
@@ -16255,5 +16523,5 @@ type Config = Omit<Required<UserConfig>, 'input' | 'logs' | 'output' | 'parser'
16255
16523
  plugins: { [K in PluginNames]?: Plugin.Config<PluginConfigMap[K]> };
16256
16524
  };
16257
16525
  //#endregion
16258
- export { StringCase as A, PluginHandler as C, Client$5 as D, Client$4 as E, LazyOrAsync as M, MaybeArray as N, Client$6 as O, Client as S, Client$3 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, IR$1 as j, Client$7 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, Client$2 as w, TypeTsDsl as x, MaybeTsDsl as y };
16259
- //# sourceMappingURL=config-eqVtXEeO.d.mts.map
16526
+ export { Client$4 as A, MaybeTsDsl as C, PluginHandler as D, Client as E, IR$1 as F, LazyOrAsync as I, MaybeArray as L, Client$6 as M, Client$7 as N, Client$2 as O, StringCase as P, 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, Client$5 as j, Client$3 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 };
16527
+ //# sourceMappingURL=config-DsA-xawl.d.mts.map