@hey-api/openapi-ts 0.78.3 → 0.79.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.
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { C as Comments, I as ImportExportItemObject, t as tsNodeToString, s as stringToTsNodes, P as PluginHandler, a as Plugin, S as StringCase, U as UserConfig, b as Client, c as IR } from './types.d-CaH9PF-K.cjs';
2
- export { j as Client, D as DefinePlugin, E as ExpressionTransformer, L as LegacyIR, O as OpenApi, d as OpenApiMetaObject, e as OpenApiOperationObject, f as OpenApiParameterObject, g as OpenApiRequestBodyObject, h as OpenApiResponseObject, i as OpenApiSchemaObject } from './types.d-CaH9PF-K.cjs';
1
+ import { C as Comments, I as ImportExportItemObject, t as tsNodeToString, s as stringToTsNodes, P as PluginHandler, a as Plugin, S as StringCase, U as UserConfig, b as Client, c as IR } from './types.d-BRYhp7DX.cjs';
2
+ export { j as Client, D as DefinePlugin, E as ExpressionTransformer, L as LegacyIR, O as OpenApi, d as OpenApiMetaObject, e as OpenApiOperationObject, f as OpenApiParameterObject, g as OpenApiRequestBodyObject, h as OpenApiResponseObject, i as OpenApiSchemaObject } from './types.d-BRYhp7DX.cjs';
3
3
  import * as ts from 'typescript';
4
4
  import ts__default from 'typescript';
5
5
  import 'node:fs';
@@ -51,7 +51,7 @@ declare const compiler: {
51
51
  multiLine?: boolean;
52
52
  parameters?: FunctionParameter[];
53
53
  returnType?: string | ts.TypeNode;
54
- statements?: ts.Statement[];
54
+ statements?: ReadonlyArray<ts.Statement>;
55
55
  types?: FunctionTypeParameter[];
56
56
  }) => ts.FunctionExpression;
57
57
  arrayLiteralExpression: <T>({ elements, multiLine, }: {
@@ -85,7 +85,7 @@ declare const compiler: {
85
85
  }) => ts.BinaryExpression;
86
86
  block: ({ multiLine, statements, }: {
87
87
  multiLine?: boolean;
88
- statements: Array<ts.Statement>;
88
+ statements: ReadonlyArray<ts.Statement>;
89
89
  }) => ts.Block;
90
90
  callExpression: ({ functionName, parameters, types, }: {
91
91
  functionName: string | ts.PropertyAccessExpression | ts.PropertyAccessChain | ts.ElementAccessExpression | ts.Expression;
@@ -113,7 +113,7 @@ declare const compiler: {
113
113
  destructure?: boolean;
114
114
  exportConst?: boolean;
115
115
  expression: ts.Expression;
116
- name: string;
116
+ name: string | ts.TypeReferenceNode;
117
117
  typeName?: string | ts.IndexedAccessTypeNode | ts.TypeNode;
118
118
  }) => ts.VariableStatement;
119
119
  constructorDeclaration: ({ accessLevel, comment, multiLine, parameters, statements, }: {
@@ -126,7 +126,7 @@ declare const compiler: {
126
126
  enumDeclaration: <T extends Record<string, any> | Array<ObjectValue>>({ comments: enumMemberComments, leadingComment: comments, name, obj, }: {
127
127
  comments?: Record<string | number, Comments>;
128
128
  leadingComment?: Comments;
129
- name: string;
129
+ name: string | ts.TypeReferenceNode;
130
130
  obj: T;
131
131
  }) => ts.EnumDeclaration;
132
132
  exportAllDeclaration: ({ module, }: {
@@ -289,13 +289,13 @@ declare const compiler: {
289
289
  typeAliasDeclaration: ({ comment, exportType, name, type, typeParameters, }: {
290
290
  comment?: Comments;
291
291
  exportType?: boolean;
292
- name: string;
293
- type: string | ts.TypeNode;
292
+ name: string | ts.TypeReferenceNode;
293
+ type: string | ts.TypeNode | ts.Identifier;
294
294
  typeParameters?: FunctionTypeParameter[];
295
295
  }) => ts.TypeAliasDeclaration;
296
- typeArrayNode: (types: (any | ts.TypeNode)[] | ts.TypeNode | string, isNullable?: boolean) => ts.TypeNode;
296
+ typeArrayNode: (types: ReadonlyArray<any | ts.TypeNode> | ts.TypeNode | ts.Identifier | string, isNullable?: boolean) => ts.TypeNode;
297
297
  typeInterfaceNode: ({ indexKey, indexProperty, isNullable, properties, useLegacyResolution, }: {
298
- indexKey?: string;
298
+ indexKey?: ts.TypeReferenceNode;
299
299
  indexProperty?: Property;
300
300
  isNullable?: boolean;
301
301
  properties: Property[];
@@ -306,8 +306,8 @@ declare const compiler: {
306
306
  types: (any | ts.TypeNode)[];
307
307
  }) => ts.TypeNode;
308
308
  typeNode: (base: any | ts.TypeNode, args?: (any | ts.TypeNode)[]) => ts.TypeNode;
309
- typeOfExpression: ({ text }: {
310
- text: string;
309
+ typeOfExpression: ({ text, }: {
310
+ text: string | ts.Identifier;
311
311
  }) => ts.TypeOfExpression;
312
312
  typeOperatorNode: ({ operator, type, }: {
313
313
  operator: "keyof" | "readonly" | "unique";
@@ -333,7 +333,7 @@ declare const compiler: {
333
333
  }) => ts.TypeNode;
334
334
  typeUnionNode: ({ isNullable, types, }: {
335
335
  isNullable?: boolean;
336
- types: (any | ts.TypeNode)[];
336
+ types: ReadonlyArray<any | ts.TypeNode>;
337
337
  }) => ts.TypeNode;
338
338
  valueToExpression: <T = unknown>({ identifiers, isValueAccess, shorthand, unescape, value, }: {
339
339
  identifiers?: string[];
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { C as Comments, I as ImportExportItemObject, t as tsNodeToString, s as stringToTsNodes, P as PluginHandler, a as Plugin, S as StringCase, U as UserConfig, b as Client, c as IR } from './types.d-CaH9PF-K.js';
2
- export { j as Client, D as DefinePlugin, E as ExpressionTransformer, L as LegacyIR, O as OpenApi, d as OpenApiMetaObject, e as OpenApiOperationObject, f as OpenApiParameterObject, g as OpenApiRequestBodyObject, h as OpenApiResponseObject, i as OpenApiSchemaObject } from './types.d-CaH9PF-K.js';
1
+ import { C as Comments, I as ImportExportItemObject, t as tsNodeToString, s as stringToTsNodes, P as PluginHandler, a as Plugin, S as StringCase, U as UserConfig, b as Client, c as IR } from './types.d-BRYhp7DX.js';
2
+ export { j as Client, D as DefinePlugin, E as ExpressionTransformer, L as LegacyIR, O as OpenApi, d as OpenApiMetaObject, e as OpenApiOperationObject, f as OpenApiParameterObject, g as OpenApiRequestBodyObject, h as OpenApiResponseObject, i as OpenApiSchemaObject } from './types.d-BRYhp7DX.js';
3
3
  import * as ts from 'typescript';
4
4
  import ts__default from 'typescript';
5
5
  import 'node:fs';
@@ -51,7 +51,7 @@ declare const compiler: {
51
51
  multiLine?: boolean;
52
52
  parameters?: FunctionParameter[];
53
53
  returnType?: string | ts.TypeNode;
54
- statements?: ts.Statement[];
54
+ statements?: ReadonlyArray<ts.Statement>;
55
55
  types?: FunctionTypeParameter[];
56
56
  }) => ts.FunctionExpression;
57
57
  arrayLiteralExpression: <T>({ elements, multiLine, }: {
@@ -85,7 +85,7 @@ declare const compiler: {
85
85
  }) => ts.BinaryExpression;
86
86
  block: ({ multiLine, statements, }: {
87
87
  multiLine?: boolean;
88
- statements: Array<ts.Statement>;
88
+ statements: ReadonlyArray<ts.Statement>;
89
89
  }) => ts.Block;
90
90
  callExpression: ({ functionName, parameters, types, }: {
91
91
  functionName: string | ts.PropertyAccessExpression | ts.PropertyAccessChain | ts.ElementAccessExpression | ts.Expression;
@@ -113,7 +113,7 @@ declare const compiler: {
113
113
  destructure?: boolean;
114
114
  exportConst?: boolean;
115
115
  expression: ts.Expression;
116
- name: string;
116
+ name: string | ts.TypeReferenceNode;
117
117
  typeName?: string | ts.IndexedAccessTypeNode | ts.TypeNode;
118
118
  }) => ts.VariableStatement;
119
119
  constructorDeclaration: ({ accessLevel, comment, multiLine, parameters, statements, }: {
@@ -126,7 +126,7 @@ declare const compiler: {
126
126
  enumDeclaration: <T extends Record<string, any> | Array<ObjectValue>>({ comments: enumMemberComments, leadingComment: comments, name, obj, }: {
127
127
  comments?: Record<string | number, Comments>;
128
128
  leadingComment?: Comments;
129
- name: string;
129
+ name: string | ts.TypeReferenceNode;
130
130
  obj: T;
131
131
  }) => ts.EnumDeclaration;
132
132
  exportAllDeclaration: ({ module, }: {
@@ -289,13 +289,13 @@ declare const compiler: {
289
289
  typeAliasDeclaration: ({ comment, exportType, name, type, typeParameters, }: {
290
290
  comment?: Comments;
291
291
  exportType?: boolean;
292
- name: string;
293
- type: string | ts.TypeNode;
292
+ name: string | ts.TypeReferenceNode;
293
+ type: string | ts.TypeNode | ts.Identifier;
294
294
  typeParameters?: FunctionTypeParameter[];
295
295
  }) => ts.TypeAliasDeclaration;
296
- typeArrayNode: (types: (any | ts.TypeNode)[] | ts.TypeNode | string, isNullable?: boolean) => ts.TypeNode;
296
+ typeArrayNode: (types: ReadonlyArray<any | ts.TypeNode> | ts.TypeNode | ts.Identifier | string, isNullable?: boolean) => ts.TypeNode;
297
297
  typeInterfaceNode: ({ indexKey, indexProperty, isNullable, properties, useLegacyResolution, }: {
298
- indexKey?: string;
298
+ indexKey?: ts.TypeReferenceNode;
299
299
  indexProperty?: Property;
300
300
  isNullable?: boolean;
301
301
  properties: Property[];
@@ -306,8 +306,8 @@ declare const compiler: {
306
306
  types: (any | ts.TypeNode)[];
307
307
  }) => ts.TypeNode;
308
308
  typeNode: (base: any | ts.TypeNode, args?: (any | ts.TypeNode)[]) => ts.TypeNode;
309
- typeOfExpression: ({ text }: {
310
- text: string;
309
+ typeOfExpression: ({ text, }: {
310
+ text: string | ts.Identifier;
311
311
  }) => ts.TypeOfExpression;
312
312
  typeOperatorNode: ({ operator, type, }: {
313
313
  operator: "keyof" | "readonly" | "unique";
@@ -333,7 +333,7 @@ declare const compiler: {
333
333
  }) => ts.TypeNode;
334
334
  typeUnionNode: ({ isNullable, types, }: {
335
335
  isNullable?: boolean;
336
- types: (any | ts.TypeNode)[];
336
+ types: ReadonlyArray<any | ts.TypeNode>;
337
337
  }) => ts.TypeNode;
338
338
  valueToExpression: <T = unknown>({ identifiers, isValueAccess, shorthand, unescape, value, }: {
339
339
  identifiers?: string[];