@hey-api/openapi-ts 0.86.3 → 0.86.5
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/bin/run.cmd +3 -0
- package/bin/run.js +18 -0
- package/dist/clients/angular/utils.ts +9 -8
- package/dist/clients/axios/utils.ts +9 -8
- package/dist/clients/core/bodySerializer.ts +12 -4
- package/dist/clients/fetch/utils.ts +9 -8
- package/dist/clients/next/utils.ts +9 -8
- package/dist/clients/nuxt/utils.ts +9 -8
- package/dist/clients/ofetch/utils.ts +9 -8
- package/dist/getSpec-CdBgV-sm.js +24 -0
- package/dist/getSpec-CdBgV-sm.js.map +1 -0
- package/dist/getSpec-y1q2Fa6c.cjs +24 -0
- package/dist/getSpec-y1q2Fa6c.cjs.map +1 -0
- package/dist/index.cjs +1 -1318
- package/dist/index.d.cts +1217 -11
- package/dist/index.d.ts +1219 -11
- package/dist/index.js +1 -1310
- package/dist/internal.cjs +1 -1
- package/dist/internal.d.cts +1 -1
- package/dist/internal.d.ts +1 -1
- package/dist/internal.js +1 -1
- package/dist/run.cjs +3 -0
- package/dist/run.cjs.map +1 -0
- package/dist/run.d.cts +1 -0
- package/dist/run.d.ts +1 -0
- package/dist/run.js +3 -0
- package/dist/run.js.map +1 -0
- package/dist/src-DxujYdu0.cjs +1318 -0
- package/dist/src-DxujYdu0.cjs.map +1 -0
- package/dist/src-SnUobB4f.js +1310 -0
- package/dist/src-SnUobB4f.js.map +1 -0
- package/dist/{types-TTJZ61ck.d.ts → types-7_tn_FD9.d.ts} +7674 -8802
- package/dist/{types-CBGf9bNY.d.cts → types-ComCm5zo.d.cts} +7674 -8802
- package/package.json +3 -3
- package/bin/index.cjs +0 -148
- package/dist/getSpec-DhkA7wWv.cjs +0 -24
- package/dist/getSpec-DhkA7wWv.cjs.map +0 -1
- package/dist/getSpec-DzntayfV.js +0 -24
- package/dist/getSpec-DzntayfV.js.map +0 -1
- package/dist/index.cjs.map +0 -1
- package/dist/index.js.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { C as
|
|
1
|
+
import { A as FunctionParameter, C as StringCase, D as ImportExportItemObject, E as Comments, F as __export, M as ObjectValue, N as SyntaxKindKeyword, O as tsNodeToString, P as types_d_exports, S as PluginHandler, T as MaybeArray, _ as OpenApiResponseObject, b as Logger, c as ExpressionTransformer, d as Client$7, f as OpenApi, g as OpenApiRequestBodyObject, h as OpenApiParameterObject, i as UserConfig, j as FunctionTypeParameter, k as AccessLevel, l as DefinePlugin, m as OpenApiOperationObject, o as IR, p as OpenApiMetaObject, s as TypeTransformer, t as LegacyIR, u as Plugin, v as OpenApiSchemaObject, w as LazyOrAsync, x as Client$2 } from "./types-ComCm5zo.cjs";
|
|
2
|
+
import * as typescript0 from "typescript";
|
|
3
|
+
import ts from "typescript";
|
|
2
4
|
import { HttpClient, HttpErrorResponse, HttpHeaders, HttpRequest, HttpResponse } from "@angular/common/http";
|
|
3
5
|
import { Injector } from "@angular/core";
|
|
4
6
|
import { AxiosError, AxiosInstance, AxiosRequestHeaders, AxiosResponse, AxiosStatic, CreateAxiosDefaults } from "axios";
|
|
@@ -39,11 +41,18 @@ type ObjectStyle = 'form' | 'deepObject';
|
|
|
39
41
|
//#region src/plugins/@hey-api/client-core/bundle/bodySerializer.d.ts
|
|
40
42
|
type QuerySerializer$1 = (query: Record<string, unknown>) => string;
|
|
41
43
|
type BodySerializer = (body: any) => any;
|
|
42
|
-
|
|
44
|
+
type QuerySerializerOptionsObject = {
|
|
43
45
|
allowReserved?: boolean;
|
|
44
|
-
array?: SerializerOptions<ArrayStyle
|
|
45
|
-
object?: SerializerOptions<ObjectStyle
|
|
46
|
-
}
|
|
46
|
+
array?: Partial<SerializerOptions<ArrayStyle>>;
|
|
47
|
+
object?: Partial<SerializerOptions<ObjectStyle>>;
|
|
48
|
+
};
|
|
49
|
+
type QuerySerializerOptions = QuerySerializerOptionsObject & {
|
|
50
|
+
/**
|
|
51
|
+
* Per-parameter serialization overrides. When provided, these settings
|
|
52
|
+
* override the global array/object settings for specific parameter names.
|
|
53
|
+
*/
|
|
54
|
+
parameters?: Record<string, QuerySerializerOptionsObject>;
|
|
55
|
+
};
|
|
47
56
|
//#endregion
|
|
48
57
|
//#region src/plugins/@hey-api/client-core/bundle/types.d.ts
|
|
49
58
|
type HttpMethod = 'connect' | 'delete' | 'get' | 'head' | 'options' | 'patch' | 'post' | 'put' | 'trace';
|
|
@@ -865,6 +874,14 @@ interface TDataShape {
|
|
|
865
874
|
type OmitKeys<T$1, K$1> = Pick<T$1, Exclude<keyof T$1, K$1>>;
|
|
866
875
|
type Options$1<TData$1 extends TDataShape = TDataShape, ThrowOnError$1 extends boolean = boolean, TResponse = unknown, TResponseStyle$1 extends ResponseStyle = 'fields'> = OmitKeys<RequestOptions<TResponse, TResponseStyle$1, ThrowOnError$1>, 'body' | 'path' | 'query' | 'url'> & Omit<TData$1, 'url'>;
|
|
867
876
|
//#endregion
|
|
877
|
+
//#region src/generate.d.ts
|
|
878
|
+
/**
|
|
879
|
+
* Generate a client from the provided configuration.
|
|
880
|
+
*
|
|
881
|
+
* @param userConfig User provided {@link UserConfig} configuration(s).
|
|
882
|
+
*/
|
|
883
|
+
declare const createClient: (userConfig?: LazyOrAsync<MaybeArray<UserConfig>>, logger?: Logger) => Promise<ReadonlyArray<Client$7 | IR.Context>>;
|
|
884
|
+
//#endregion
|
|
868
885
|
//#region src/config/parser.d.ts
|
|
869
886
|
declare const defaultPaginationKeywords: readonly ["after", "before", "cursor", "offset", "page", "start"];
|
|
870
887
|
//#endregion
|
|
@@ -900,6 +917,1175 @@ declare const definePluginConfig: <T extends Plugin.Types>(defaultConfig: Plugin
|
|
|
900
917
|
*/
|
|
901
918
|
name: any;
|
|
902
919
|
};
|
|
920
|
+
declare namespace module_d_exports {
|
|
921
|
+
export { ImportExportItem, createCallExpression, createConstVariable, createExportAllDeclaration, createNamedExportDeclarations, createNamedImportDeclarations };
|
|
922
|
+
}
|
|
923
|
+
/**
|
|
924
|
+
* Create export all declaration. Example: `export * from './y'`.
|
|
925
|
+
* @param module - module containing exports
|
|
926
|
+
* @returns ts.ExportDeclaration
|
|
927
|
+
*/
|
|
928
|
+
declare const createExportAllDeclaration: ({
|
|
929
|
+
module,
|
|
930
|
+
shouldAppendJs
|
|
931
|
+
}: {
|
|
932
|
+
module: string;
|
|
933
|
+
shouldAppendJs?: boolean;
|
|
934
|
+
}) => ts.ExportDeclaration;
|
|
935
|
+
type ImportExportItem = ImportExportItemObject | string;
|
|
936
|
+
declare const createCallExpression: ({
|
|
937
|
+
functionName,
|
|
938
|
+
parameters,
|
|
939
|
+
types
|
|
940
|
+
}: {
|
|
941
|
+
functionName: string | ts.PropertyAccessExpression | ts.PropertyAccessChain | ts.ElementAccessExpression | ts.Expression;
|
|
942
|
+
parameters?: Array<string | ts.Expression | undefined>;
|
|
943
|
+
types?: ReadonlyArray<ts.TypeNode>;
|
|
944
|
+
}) => ts.CallExpression;
|
|
945
|
+
/**
|
|
946
|
+
* Create a named export declaration. Example: `export { X } from './y'`.
|
|
947
|
+
* @param exports - named imports to export
|
|
948
|
+
* @param module - module containing exports
|
|
949
|
+
* @returns ts.ExportDeclaration
|
|
950
|
+
*/
|
|
951
|
+
declare const createNamedExportDeclarations: ({
|
|
952
|
+
exports,
|
|
953
|
+
module
|
|
954
|
+
}: {
|
|
955
|
+
exports: Array<ImportExportItem> | ImportExportItem;
|
|
956
|
+
module: string;
|
|
957
|
+
}) => ts.ExportDeclaration;
|
|
958
|
+
/**
|
|
959
|
+
* Create a const variable. Optionally, it can use const assertion or export
|
|
960
|
+
* statement. Example: `export x = {} as const`.
|
|
961
|
+
* @param assertion use const assertion?
|
|
962
|
+
* @param exportConst export created variable?
|
|
963
|
+
* @param expression expression for the variable.
|
|
964
|
+
* @param name name of the variable.
|
|
965
|
+
* @returns ts.VariableStatement
|
|
966
|
+
*/
|
|
967
|
+
declare const createConstVariable: ({
|
|
968
|
+
assertion,
|
|
969
|
+
comment,
|
|
970
|
+
destructure,
|
|
971
|
+
exportConst,
|
|
972
|
+
expression,
|
|
973
|
+
name,
|
|
974
|
+
typeName
|
|
975
|
+
}: {
|
|
976
|
+
assertion?: "const" | ts.TypeNode;
|
|
977
|
+
comment?: Comments;
|
|
978
|
+
destructure?: boolean;
|
|
979
|
+
exportConst?: boolean;
|
|
980
|
+
expression: ts.Expression;
|
|
981
|
+
name: string | ts.TypeReferenceNode;
|
|
982
|
+
typeName?: string | ts.IndexedAccessTypeNode | ts.TypeNode;
|
|
983
|
+
}) => ts.VariableStatement;
|
|
984
|
+
/**
|
|
985
|
+
* Create a named import declaration. Example: `import { X } from './y'`.
|
|
986
|
+
* @param imports - named exports to import
|
|
987
|
+
* @param module - module containing imports
|
|
988
|
+
* @returns ts.ImportDeclaration
|
|
989
|
+
*/
|
|
990
|
+
declare const createNamedImportDeclarations: ({
|
|
991
|
+
imports,
|
|
992
|
+
module
|
|
993
|
+
}: {
|
|
994
|
+
imports: Array<ImportExportItem> | ImportExportItem;
|
|
995
|
+
module: string;
|
|
996
|
+
}) => ts.ImportDeclaration;
|
|
997
|
+
//#endregion
|
|
998
|
+
//#region src/tsc/typedef.d.ts
|
|
999
|
+
type Property = {
|
|
1000
|
+
comment?: Comments;
|
|
1001
|
+
isReadOnly?: boolean;
|
|
1002
|
+
isRequired?: boolean;
|
|
1003
|
+
name: string | ts.PropertyName;
|
|
1004
|
+
type: any | ts.TypeNode;
|
|
1005
|
+
};
|
|
1006
|
+
//#endregion
|
|
1007
|
+
//#region src/tsc/index.d.ts
|
|
1008
|
+
declare const tsc: {
|
|
1009
|
+
anonymousFunction: ({
|
|
1010
|
+
async,
|
|
1011
|
+
comment,
|
|
1012
|
+
multiLine,
|
|
1013
|
+
parameters,
|
|
1014
|
+
returnType,
|
|
1015
|
+
statements,
|
|
1016
|
+
types: types_d_exports
|
|
1017
|
+
}: {
|
|
1018
|
+
async?: boolean;
|
|
1019
|
+
comment?: Comments;
|
|
1020
|
+
multiLine?: boolean;
|
|
1021
|
+
parameters?: FunctionParameter[];
|
|
1022
|
+
returnType?: string | typescript0.TypeNode;
|
|
1023
|
+
statements?: ReadonlyArray<typescript0.Statement>;
|
|
1024
|
+
types?: FunctionTypeParameter[];
|
|
1025
|
+
}) => typescript0.FunctionExpression;
|
|
1026
|
+
arrayLiteralExpression: <T>({
|
|
1027
|
+
elements,
|
|
1028
|
+
multiLine
|
|
1029
|
+
}: {
|
|
1030
|
+
elements: T[];
|
|
1031
|
+
multiLine?: boolean;
|
|
1032
|
+
}) => typescript0.ArrayLiteralExpression;
|
|
1033
|
+
arrowFunction: ({
|
|
1034
|
+
async,
|
|
1035
|
+
comment,
|
|
1036
|
+
multiLine,
|
|
1037
|
+
parameters,
|
|
1038
|
+
returnType,
|
|
1039
|
+
statements,
|
|
1040
|
+
types: types_d_exports
|
|
1041
|
+
}: {
|
|
1042
|
+
async?: boolean;
|
|
1043
|
+
comment?: Comments;
|
|
1044
|
+
multiLine?: boolean;
|
|
1045
|
+
parameters?: ReadonlyArray<FunctionParameter>;
|
|
1046
|
+
returnType?: string | typescript0.TypeNode;
|
|
1047
|
+
statements?: typescript0.Statement[] | typescript0.Expression;
|
|
1048
|
+
types?: FunctionTypeParameter[];
|
|
1049
|
+
}) => typescript0.ArrowFunction;
|
|
1050
|
+
asExpression: ({
|
|
1051
|
+
expression,
|
|
1052
|
+
type
|
|
1053
|
+
}: {
|
|
1054
|
+
expression: typescript0.Expression;
|
|
1055
|
+
type: typescript0.TypeNode;
|
|
1056
|
+
}) => typescript0.AsExpression;
|
|
1057
|
+
assignment: ({
|
|
1058
|
+
left,
|
|
1059
|
+
right
|
|
1060
|
+
}: {
|
|
1061
|
+
left: typescript0.Expression;
|
|
1062
|
+
right: typescript0.Expression;
|
|
1063
|
+
}) => typescript0.AssignmentExpression<typescript0.EqualsToken>;
|
|
1064
|
+
awaitExpression: ({
|
|
1065
|
+
expression
|
|
1066
|
+
}: {
|
|
1067
|
+
expression: typescript0.Expression;
|
|
1068
|
+
}) => typescript0.AwaitExpression;
|
|
1069
|
+
binaryExpression: ({
|
|
1070
|
+
left,
|
|
1071
|
+
operator,
|
|
1072
|
+
right
|
|
1073
|
+
}: {
|
|
1074
|
+
left: typescript0.Expression;
|
|
1075
|
+
operator?: "=" | "===" | "!==" | "in" | "??";
|
|
1076
|
+
right: typescript0.Expression | string;
|
|
1077
|
+
}) => typescript0.BinaryExpression;
|
|
1078
|
+
block: ({
|
|
1079
|
+
multiLine,
|
|
1080
|
+
statements
|
|
1081
|
+
}: {
|
|
1082
|
+
multiLine?: boolean;
|
|
1083
|
+
statements: ReadonlyArray<typescript0.Statement>;
|
|
1084
|
+
}) => typescript0.Block;
|
|
1085
|
+
callExpression: ({
|
|
1086
|
+
functionName,
|
|
1087
|
+
parameters,
|
|
1088
|
+
types: types_d_exports
|
|
1089
|
+
}: {
|
|
1090
|
+
functionName: string | typescript0.PropertyAccessExpression | typescript0.PropertyAccessChain | typescript0.ElementAccessExpression | typescript0.Expression;
|
|
1091
|
+
parameters?: Array<string | typescript0.Expression | undefined>;
|
|
1092
|
+
types?: ReadonlyArray<typescript0.TypeNode>;
|
|
1093
|
+
}) => typescript0.CallExpression;
|
|
1094
|
+
classDeclaration: ({
|
|
1095
|
+
decorator,
|
|
1096
|
+
exportClass,
|
|
1097
|
+
extendedClasses,
|
|
1098
|
+
name,
|
|
1099
|
+
nodes
|
|
1100
|
+
}: {
|
|
1101
|
+
decorator?: {
|
|
1102
|
+
args: any[];
|
|
1103
|
+
name: string;
|
|
1104
|
+
};
|
|
1105
|
+
exportClass?: boolean;
|
|
1106
|
+
extendedClasses?: ReadonlyArray<string>;
|
|
1107
|
+
name: string;
|
|
1108
|
+
nodes: ReadonlyArray<typescript0.ClassElement>;
|
|
1109
|
+
}) => typescript0.ClassDeclaration;
|
|
1110
|
+
conditionalExpression: ({
|
|
1111
|
+
condition,
|
|
1112
|
+
whenFalse,
|
|
1113
|
+
whenTrue
|
|
1114
|
+
}: {
|
|
1115
|
+
condition: typescript0.Expression;
|
|
1116
|
+
whenFalse: typescript0.Expression;
|
|
1117
|
+
whenTrue: typescript0.Expression;
|
|
1118
|
+
}) => typescript0.ConditionalExpression;
|
|
1119
|
+
constVariable: ({
|
|
1120
|
+
assertion,
|
|
1121
|
+
comment,
|
|
1122
|
+
destructure,
|
|
1123
|
+
exportConst,
|
|
1124
|
+
expression,
|
|
1125
|
+
name,
|
|
1126
|
+
typeName
|
|
1127
|
+
}: {
|
|
1128
|
+
assertion?: "const" | typescript0.TypeNode;
|
|
1129
|
+
comment?: Comments;
|
|
1130
|
+
destructure?: boolean;
|
|
1131
|
+
exportConst?: boolean;
|
|
1132
|
+
expression: typescript0.Expression;
|
|
1133
|
+
name: string | typescript0.TypeReferenceNode;
|
|
1134
|
+
typeName?: string | typescript0.IndexedAccessTypeNode | typescript0.TypeNode;
|
|
1135
|
+
}) => typescript0.VariableStatement;
|
|
1136
|
+
constructorDeclaration: ({
|
|
1137
|
+
accessLevel,
|
|
1138
|
+
comment,
|
|
1139
|
+
multiLine,
|
|
1140
|
+
parameters,
|
|
1141
|
+
statements
|
|
1142
|
+
}: {
|
|
1143
|
+
accessLevel?: AccessLevel;
|
|
1144
|
+
comment?: Comments;
|
|
1145
|
+
multiLine?: boolean;
|
|
1146
|
+
parameters?: FunctionParameter[];
|
|
1147
|
+
statements?: typescript0.Statement[];
|
|
1148
|
+
}) => typescript0.ConstructorDeclaration;
|
|
1149
|
+
enumDeclaration: <T extends Record<string, any> | Array<ObjectValue>>({
|
|
1150
|
+
asConst,
|
|
1151
|
+
comments: enumMemberComments,
|
|
1152
|
+
leadingComment: comments,
|
|
1153
|
+
name,
|
|
1154
|
+
obj
|
|
1155
|
+
}: {
|
|
1156
|
+
asConst: boolean;
|
|
1157
|
+
comments?: Record<string | number, Comments>;
|
|
1158
|
+
leadingComment?: Comments;
|
|
1159
|
+
name: string | typescript0.TypeReferenceNode;
|
|
1160
|
+
obj: T;
|
|
1161
|
+
}) => typescript0.EnumDeclaration;
|
|
1162
|
+
exportAllDeclaration: ({
|
|
1163
|
+
module: module_d_exports,
|
|
1164
|
+
shouldAppendJs
|
|
1165
|
+
}: {
|
|
1166
|
+
module: string;
|
|
1167
|
+
shouldAppendJs?: boolean;
|
|
1168
|
+
}) => typescript0.ExportDeclaration;
|
|
1169
|
+
exportNamedDeclaration: ({
|
|
1170
|
+
exports,
|
|
1171
|
+
module: module_d_exports
|
|
1172
|
+
}: {
|
|
1173
|
+
exports: Array<ImportExportItem> | ImportExportItem;
|
|
1174
|
+
module: string;
|
|
1175
|
+
}) => typescript0.ExportDeclaration;
|
|
1176
|
+
expressionToStatement: ({
|
|
1177
|
+
expression
|
|
1178
|
+
}: {
|
|
1179
|
+
expression: typescript0.Expression;
|
|
1180
|
+
}) => typescript0.ExpressionStatement;
|
|
1181
|
+
forOfStatement: ({
|
|
1182
|
+
awaitModifier,
|
|
1183
|
+
expression,
|
|
1184
|
+
initializer,
|
|
1185
|
+
statement
|
|
1186
|
+
}: {
|
|
1187
|
+
awaitModifier?: typescript0.AwaitKeyword;
|
|
1188
|
+
expression: typescript0.Expression;
|
|
1189
|
+
initializer: typescript0.ForInitializer;
|
|
1190
|
+
statement: typescript0.Statement;
|
|
1191
|
+
}) => typescript0.ForOfStatement;
|
|
1192
|
+
functionTypeNode: ({
|
|
1193
|
+
parameters,
|
|
1194
|
+
returnType,
|
|
1195
|
+
typeParameters
|
|
1196
|
+
}: {
|
|
1197
|
+
parameters?: typescript0.ParameterDeclaration[];
|
|
1198
|
+
returnType: typescript0.TypeNode;
|
|
1199
|
+
typeParameters?: typescript0.TypeParameterDeclaration[];
|
|
1200
|
+
}) => typescript0.FunctionTypeNode;
|
|
1201
|
+
getAccessorDeclaration: ({
|
|
1202
|
+
name,
|
|
1203
|
+
returnType,
|
|
1204
|
+
statements
|
|
1205
|
+
}: {
|
|
1206
|
+
name: string | typescript0.PropertyName;
|
|
1207
|
+
returnType?: string | typescript0.Identifier;
|
|
1208
|
+
statements: ReadonlyArray<typescript0.Statement>;
|
|
1209
|
+
}) => typescript0.GetAccessorDeclaration;
|
|
1210
|
+
identifier: ({
|
|
1211
|
+
text
|
|
1212
|
+
}: {
|
|
1213
|
+
text: string;
|
|
1214
|
+
}) => typescript0.Identifier;
|
|
1215
|
+
ifStatement: ({
|
|
1216
|
+
elseStatement,
|
|
1217
|
+
expression,
|
|
1218
|
+
thenStatement
|
|
1219
|
+
}: {
|
|
1220
|
+
elseStatement?: typescript0.Statement;
|
|
1221
|
+
expression: typescript0.Expression;
|
|
1222
|
+
thenStatement: typescript0.Statement;
|
|
1223
|
+
}) => typescript0.IfStatement;
|
|
1224
|
+
indexedAccessTypeNode: ({
|
|
1225
|
+
indexType,
|
|
1226
|
+
objectType
|
|
1227
|
+
}: {
|
|
1228
|
+
indexType: typescript0.TypeNode;
|
|
1229
|
+
objectType: typescript0.TypeNode;
|
|
1230
|
+
}) => typescript0.IndexedAccessTypeNode;
|
|
1231
|
+
isTsNode: (node: any) => node is typescript0.Expression;
|
|
1232
|
+
keywordTypeNode: ({
|
|
1233
|
+
keyword
|
|
1234
|
+
}: {
|
|
1235
|
+
keyword: Extract<SyntaxKindKeyword, "any" | "boolean" | "never" | "number" | "string" | "undefined" | "unknown" | "void">;
|
|
1236
|
+
}) => typescript0.KeywordTypeNode<typescript0.SyntaxKind.VoidKeyword | typescript0.SyntaxKind.AnyKeyword | typescript0.SyntaxKind.BooleanKeyword | typescript0.SyntaxKind.NeverKeyword | typescript0.SyntaxKind.NumberKeyword | typescript0.SyntaxKind.StringKeyword | typescript0.SyntaxKind.UndefinedKeyword | typescript0.SyntaxKind.UnknownKeyword>;
|
|
1237
|
+
literalTypeNode: ({
|
|
1238
|
+
literal
|
|
1239
|
+
}: {
|
|
1240
|
+
literal: typescript0.LiteralTypeNode["literal"];
|
|
1241
|
+
}) => typescript0.LiteralTypeNode;
|
|
1242
|
+
mappedTypeNode: ({
|
|
1243
|
+
members,
|
|
1244
|
+
nameType,
|
|
1245
|
+
questionToken,
|
|
1246
|
+
readonlyToken,
|
|
1247
|
+
type,
|
|
1248
|
+
typeParameter
|
|
1249
|
+
}: {
|
|
1250
|
+
members?: typescript0.NodeArray<typescript0.TypeElement>;
|
|
1251
|
+
nameType?: typescript0.TypeNode;
|
|
1252
|
+
questionToken?: typescript0.QuestionToken | typescript0.PlusToken | typescript0.MinusToken;
|
|
1253
|
+
readonlyToken?: typescript0.ReadonlyKeyword | typescript0.PlusToken | typescript0.MinusToken;
|
|
1254
|
+
type?: typescript0.TypeNode;
|
|
1255
|
+
typeParameter: typescript0.TypeParameterDeclaration;
|
|
1256
|
+
}) => typescript0.MappedTypeNode;
|
|
1257
|
+
methodDeclaration: ({
|
|
1258
|
+
accessLevel,
|
|
1259
|
+
comment,
|
|
1260
|
+
isStatic,
|
|
1261
|
+
multiLine,
|
|
1262
|
+
name,
|
|
1263
|
+
parameters,
|
|
1264
|
+
returnType,
|
|
1265
|
+
statements,
|
|
1266
|
+
types: types_d_exports
|
|
1267
|
+
}: {
|
|
1268
|
+
accessLevel?: AccessLevel;
|
|
1269
|
+
comment?: Comments;
|
|
1270
|
+
isStatic?: boolean;
|
|
1271
|
+
multiLine?: boolean;
|
|
1272
|
+
name: string;
|
|
1273
|
+
parameters?: ReadonlyArray<FunctionParameter>;
|
|
1274
|
+
returnType?: string | typescript0.TypeNode;
|
|
1275
|
+
statements?: typescript0.Statement[];
|
|
1276
|
+
types?: FunctionTypeParameter[];
|
|
1277
|
+
}) => typescript0.MethodDeclaration;
|
|
1278
|
+
namedImportDeclarations: ({
|
|
1279
|
+
imports,
|
|
1280
|
+
module: module_d_exports
|
|
1281
|
+
}: {
|
|
1282
|
+
imports: Array<ImportExportItem> | ImportExportItem;
|
|
1283
|
+
module: string;
|
|
1284
|
+
}) => typescript0.ImportDeclaration;
|
|
1285
|
+
namespaceDeclaration: ({
|
|
1286
|
+
name,
|
|
1287
|
+
statements
|
|
1288
|
+
}: {
|
|
1289
|
+
name: string;
|
|
1290
|
+
statements: Array<typescript0.Statement>;
|
|
1291
|
+
}) => typescript0.ModuleDeclaration;
|
|
1292
|
+
newExpression: ({
|
|
1293
|
+
argumentsArray,
|
|
1294
|
+
expression,
|
|
1295
|
+
typeArguments
|
|
1296
|
+
}: {
|
|
1297
|
+
argumentsArray?: Array<typescript0.Expression>;
|
|
1298
|
+
expression: typescript0.Expression;
|
|
1299
|
+
typeArguments?: Array<typescript0.TypeNode>;
|
|
1300
|
+
}) => typescript0.NewExpression;
|
|
1301
|
+
nodeToString: typeof tsNodeToString;
|
|
1302
|
+
null: () => typescript0.NullLiteral;
|
|
1303
|
+
objectExpression: <T extends Record<string, any> | Array<ObjectValue>>({
|
|
1304
|
+
comments,
|
|
1305
|
+
identifiers,
|
|
1306
|
+
multiLine,
|
|
1307
|
+
obj,
|
|
1308
|
+
shorthand,
|
|
1309
|
+
unescape
|
|
1310
|
+
}: {
|
|
1311
|
+
comments?: Comments;
|
|
1312
|
+
identifiers?: string[];
|
|
1313
|
+
multiLine?: boolean;
|
|
1314
|
+
obj: T;
|
|
1315
|
+
shorthand?: boolean;
|
|
1316
|
+
unescape?: boolean;
|
|
1317
|
+
}) => typescript0.ObjectLiteralExpression;
|
|
1318
|
+
ots: {
|
|
1319
|
+
boolean: (value: boolean) => typescript0.TrueLiteral | typescript0.FalseLiteral;
|
|
1320
|
+
export: ({
|
|
1321
|
+
alias,
|
|
1322
|
+
asType,
|
|
1323
|
+
name
|
|
1324
|
+
}: ImportExportItemObject) => typescript0.ExportSpecifier;
|
|
1325
|
+
import: ({
|
|
1326
|
+
alias,
|
|
1327
|
+
asType,
|
|
1328
|
+
name
|
|
1329
|
+
}: ImportExportItemObject) => typescript0.ImportSpecifier;
|
|
1330
|
+
number: (value: number) => typescript0.NumericLiteral | typescript0.PrefixUnaryExpression;
|
|
1331
|
+
string: (value: string, unescape?: boolean) => typescript0.Identifier | typescript0.StringLiteral;
|
|
1332
|
+
};
|
|
1333
|
+
parameterDeclaration: ({
|
|
1334
|
+
initializer,
|
|
1335
|
+
modifiers,
|
|
1336
|
+
name,
|
|
1337
|
+
required,
|
|
1338
|
+
type
|
|
1339
|
+
}: {
|
|
1340
|
+
initializer?: typescript0.Expression;
|
|
1341
|
+
modifiers?: ReadonlyArray<typescript0.ModifierLike>;
|
|
1342
|
+
name: string | typescript0.BindingName;
|
|
1343
|
+
required?: boolean;
|
|
1344
|
+
type?: typescript0.TypeNode;
|
|
1345
|
+
}) => typescript0.ParameterDeclaration;
|
|
1346
|
+
propertyAccessExpression: ({
|
|
1347
|
+
expression,
|
|
1348
|
+
isOptional,
|
|
1349
|
+
name
|
|
1350
|
+
}: {
|
|
1351
|
+
expression: string | typescript0.Expression;
|
|
1352
|
+
isOptional?: boolean;
|
|
1353
|
+
name: string | number | typescript0.MemberName;
|
|
1354
|
+
}) => typescript0.PropertyAccessChain | typescript0.PropertyAccessExpression | typescript0.ElementAccessExpression;
|
|
1355
|
+
propertyAccessExpressions: ({
|
|
1356
|
+
expressions
|
|
1357
|
+
}: {
|
|
1358
|
+
expressions: Array<string | typescript0.Expression | typescript0.MemberName>;
|
|
1359
|
+
}) => typescript0.PropertyAccessExpression;
|
|
1360
|
+
propertyAssignment: ({
|
|
1361
|
+
initializer,
|
|
1362
|
+
name
|
|
1363
|
+
}: {
|
|
1364
|
+
initializer: typescript0.Expression;
|
|
1365
|
+
name: string | typescript0.PropertyName;
|
|
1366
|
+
}) => typescript0.PropertyAssignment;
|
|
1367
|
+
propertyDeclaration: ({
|
|
1368
|
+
initializer,
|
|
1369
|
+
modifier,
|
|
1370
|
+
name,
|
|
1371
|
+
type
|
|
1372
|
+
}: {
|
|
1373
|
+
initializer?: typescript0.Expression;
|
|
1374
|
+
modifier?: "async" | AccessLevel | "export" | "readonly" | "static";
|
|
1375
|
+
name: string | typescript0.PropertyName;
|
|
1376
|
+
type?: typescript0.TypeNode;
|
|
1377
|
+
}) => typescript0.PropertyDeclaration;
|
|
1378
|
+
regularExpressionLiteral: ({
|
|
1379
|
+
flags,
|
|
1380
|
+
text
|
|
1381
|
+
}: {
|
|
1382
|
+
flags?: ReadonlyArray<"g" | "i" | "m" | "s" | "u" | "y">;
|
|
1383
|
+
text: string;
|
|
1384
|
+
}) => typescript0.RegularExpressionLiteral;
|
|
1385
|
+
returnFunctionCall: ({
|
|
1386
|
+
args,
|
|
1387
|
+
name,
|
|
1388
|
+
types: types_d_exports
|
|
1389
|
+
}: {
|
|
1390
|
+
args: any[];
|
|
1391
|
+
name: string | typescript0.Expression;
|
|
1392
|
+
types?: ReadonlyArray<string | typescript0.StringLiteral>;
|
|
1393
|
+
}) => typescript0.ReturnStatement;
|
|
1394
|
+
returnStatement: ({
|
|
1395
|
+
expression
|
|
1396
|
+
}: {
|
|
1397
|
+
expression?: typescript0.Expression;
|
|
1398
|
+
}) => typescript0.ReturnStatement;
|
|
1399
|
+
returnVariable: ({
|
|
1400
|
+
expression
|
|
1401
|
+
}: {
|
|
1402
|
+
expression: string | typescript0.Expression;
|
|
1403
|
+
}) => typescript0.ReturnStatement;
|
|
1404
|
+
safeAccessExpression: (path: string[]) => typescript0.Expression;
|
|
1405
|
+
stringLiteral: ({
|
|
1406
|
+
isSingleQuote,
|
|
1407
|
+
text
|
|
1408
|
+
}: {
|
|
1409
|
+
isSingleQuote?: boolean;
|
|
1410
|
+
text: string;
|
|
1411
|
+
}) => typescript0.StringLiteral;
|
|
1412
|
+
templateLiteralType: ({
|
|
1413
|
+
value
|
|
1414
|
+
}: {
|
|
1415
|
+
value: ReadonlyArray<string | typescript0.TypeNode>;
|
|
1416
|
+
}) => typescript0.TemplateLiteralTypeNode;
|
|
1417
|
+
this: () => typescript0.ThisExpression;
|
|
1418
|
+
transformArrayMap: ({
|
|
1419
|
+
path,
|
|
1420
|
+
transformExpression
|
|
1421
|
+
}: {
|
|
1422
|
+
path: string[];
|
|
1423
|
+
transformExpression: typescript0.Expression;
|
|
1424
|
+
}) => typescript0.IfStatement;
|
|
1425
|
+
transformArrayMutation: ({
|
|
1426
|
+
path,
|
|
1427
|
+
transformerName
|
|
1428
|
+
}: {
|
|
1429
|
+
path: string[];
|
|
1430
|
+
transformerName: string;
|
|
1431
|
+
}) => typescript0.Statement;
|
|
1432
|
+
transformDateMutation: ({
|
|
1433
|
+
path
|
|
1434
|
+
}: {
|
|
1435
|
+
path: string[];
|
|
1436
|
+
}) => typescript0.Statement;
|
|
1437
|
+
transformFunctionMutation: ({
|
|
1438
|
+
path,
|
|
1439
|
+
transformerName
|
|
1440
|
+
}: {
|
|
1441
|
+
path: string[];
|
|
1442
|
+
transformerName: string;
|
|
1443
|
+
}) => typescript0.IfStatement[];
|
|
1444
|
+
transformNewDate: ({
|
|
1445
|
+
parameterName
|
|
1446
|
+
}: {
|
|
1447
|
+
parameterName: string;
|
|
1448
|
+
}) => typescript0.NewExpression;
|
|
1449
|
+
typeAliasDeclaration: ({
|
|
1450
|
+
comment,
|
|
1451
|
+
exportType,
|
|
1452
|
+
name,
|
|
1453
|
+
type,
|
|
1454
|
+
typeParameters
|
|
1455
|
+
}: {
|
|
1456
|
+
comment?: Comments;
|
|
1457
|
+
exportType?: boolean;
|
|
1458
|
+
name: string | typescript0.TypeReferenceNode;
|
|
1459
|
+
type: string | typescript0.TypeNode | typescript0.Identifier;
|
|
1460
|
+
typeParameters?: FunctionTypeParameter[];
|
|
1461
|
+
}) => typescript0.TypeAliasDeclaration;
|
|
1462
|
+
typeArrayNode: (types: ReadonlyArray<any | typescript0.TypeNode> | typescript0.TypeNode | typescript0.Identifier | string, isNullable?: boolean) => typescript0.TypeNode;
|
|
1463
|
+
typeInterfaceNode: ({
|
|
1464
|
+
indexKey,
|
|
1465
|
+
indexProperty,
|
|
1466
|
+
isNullable,
|
|
1467
|
+
properties,
|
|
1468
|
+
useLegacyResolution
|
|
1469
|
+
}: {
|
|
1470
|
+
indexKey?: typescript0.TypeReferenceNode;
|
|
1471
|
+
indexProperty?: Property;
|
|
1472
|
+
isNullable?: boolean;
|
|
1473
|
+
properties: Property[];
|
|
1474
|
+
useLegacyResolution: boolean;
|
|
1475
|
+
}) => typescript0.TypeNode;
|
|
1476
|
+
typeIntersectionNode: ({
|
|
1477
|
+
isNullable,
|
|
1478
|
+
types: types_d_exports
|
|
1479
|
+
}: {
|
|
1480
|
+
isNullable?: boolean;
|
|
1481
|
+
types: (any | typescript0.TypeNode)[];
|
|
1482
|
+
}) => typescript0.TypeNode;
|
|
1483
|
+
typeNode: (base: any | typescript0.TypeNode, args?: (any | typescript0.TypeNode)[]) => typescript0.TypeNode;
|
|
1484
|
+
typeOfExpression: ({
|
|
1485
|
+
text
|
|
1486
|
+
}: {
|
|
1487
|
+
text: string | typescript0.Identifier;
|
|
1488
|
+
}) => typescript0.TypeOfExpression;
|
|
1489
|
+
typeOperatorNode: ({
|
|
1490
|
+
operator,
|
|
1491
|
+
type
|
|
1492
|
+
}: {
|
|
1493
|
+
operator: "keyof" | "readonly" | "unique";
|
|
1494
|
+
type: typescript0.TypeNode;
|
|
1495
|
+
}) => typescript0.TypeOperatorNode;
|
|
1496
|
+
typeParameterDeclaration: ({
|
|
1497
|
+
constraint,
|
|
1498
|
+
defaultType,
|
|
1499
|
+
modifiers,
|
|
1500
|
+
name
|
|
1501
|
+
}: {
|
|
1502
|
+
constraint?: typescript0.TypeNode;
|
|
1503
|
+
defaultType?: typescript0.TypeNode;
|
|
1504
|
+
modifiers?: Array<typescript0.Modifier>;
|
|
1505
|
+
name: string | typescript0.Identifier;
|
|
1506
|
+
}) => typescript0.TypeParameterDeclaration;
|
|
1507
|
+
typeParenthesizedNode: ({
|
|
1508
|
+
type
|
|
1509
|
+
}: {
|
|
1510
|
+
type: typescript0.TypeNode;
|
|
1511
|
+
}) => typescript0.ParenthesizedTypeNode;
|
|
1512
|
+
typeRecordNode: (keys: (any | typescript0.TypeNode)[], values: (any | typescript0.TypeNode)[], isNullable?: boolean, useLegacyResolution?: boolean) => typescript0.TypeNode;
|
|
1513
|
+
typeReferenceNode: ({
|
|
1514
|
+
typeArguments,
|
|
1515
|
+
typeName
|
|
1516
|
+
}: {
|
|
1517
|
+
typeArguments?: typescript0.TypeNode[];
|
|
1518
|
+
typeName: string | typescript0.EntityName;
|
|
1519
|
+
}) => typescript0.TypeReferenceNode;
|
|
1520
|
+
typeTupleNode: ({
|
|
1521
|
+
isNullable,
|
|
1522
|
+
types: types_d_exports
|
|
1523
|
+
}: {
|
|
1524
|
+
isNullable?: boolean;
|
|
1525
|
+
types: Array<any | typescript0.TypeNode>;
|
|
1526
|
+
}) => typescript0.TypeNode;
|
|
1527
|
+
typeUnionNode: ({
|
|
1528
|
+
isNullable,
|
|
1529
|
+
types: types_d_exports
|
|
1530
|
+
}: {
|
|
1531
|
+
isNullable?: boolean;
|
|
1532
|
+
types: ReadonlyArray<any | typescript0.TypeNode>;
|
|
1533
|
+
}) => typescript0.TypeNode;
|
|
1534
|
+
valueToExpression: <T = unknown>({
|
|
1535
|
+
identifiers,
|
|
1536
|
+
isValueAccess,
|
|
1537
|
+
shorthand,
|
|
1538
|
+
unescape,
|
|
1539
|
+
value
|
|
1540
|
+
}: {
|
|
1541
|
+
identifiers?: string[];
|
|
1542
|
+
isValueAccess?: boolean;
|
|
1543
|
+
shorthand?: boolean;
|
|
1544
|
+
unescape?: boolean;
|
|
1545
|
+
value: T;
|
|
1546
|
+
}) => typescript0.Expression | undefined;
|
|
1547
|
+
};
|
|
1548
|
+
/** @deprecated use tsc */
|
|
1549
|
+
declare const compiler: {
|
|
1550
|
+
anonymousFunction: ({
|
|
1551
|
+
async,
|
|
1552
|
+
comment,
|
|
1553
|
+
multiLine,
|
|
1554
|
+
parameters,
|
|
1555
|
+
returnType,
|
|
1556
|
+
statements,
|
|
1557
|
+
types: types_d_exports
|
|
1558
|
+
}: {
|
|
1559
|
+
async?: boolean;
|
|
1560
|
+
comment?: Comments;
|
|
1561
|
+
multiLine?: boolean;
|
|
1562
|
+
parameters?: FunctionParameter[];
|
|
1563
|
+
returnType?: string | typescript0.TypeNode;
|
|
1564
|
+
statements?: ReadonlyArray<typescript0.Statement>;
|
|
1565
|
+
types?: FunctionTypeParameter[];
|
|
1566
|
+
}) => typescript0.FunctionExpression;
|
|
1567
|
+
arrayLiteralExpression: <T>({
|
|
1568
|
+
elements,
|
|
1569
|
+
multiLine
|
|
1570
|
+
}: {
|
|
1571
|
+
elements: T[];
|
|
1572
|
+
multiLine?: boolean;
|
|
1573
|
+
}) => typescript0.ArrayLiteralExpression;
|
|
1574
|
+
arrowFunction: ({
|
|
1575
|
+
async,
|
|
1576
|
+
comment,
|
|
1577
|
+
multiLine,
|
|
1578
|
+
parameters,
|
|
1579
|
+
returnType,
|
|
1580
|
+
statements,
|
|
1581
|
+
types: types_d_exports
|
|
1582
|
+
}: {
|
|
1583
|
+
async?: boolean;
|
|
1584
|
+
comment?: Comments;
|
|
1585
|
+
multiLine?: boolean;
|
|
1586
|
+
parameters?: ReadonlyArray<FunctionParameter>;
|
|
1587
|
+
returnType?: string | typescript0.TypeNode;
|
|
1588
|
+
statements?: typescript0.Statement[] | typescript0.Expression;
|
|
1589
|
+
types?: FunctionTypeParameter[];
|
|
1590
|
+
}) => typescript0.ArrowFunction;
|
|
1591
|
+
asExpression: ({
|
|
1592
|
+
expression,
|
|
1593
|
+
type
|
|
1594
|
+
}: {
|
|
1595
|
+
expression: typescript0.Expression;
|
|
1596
|
+
type: typescript0.TypeNode;
|
|
1597
|
+
}) => typescript0.AsExpression;
|
|
1598
|
+
assignment: ({
|
|
1599
|
+
left,
|
|
1600
|
+
right
|
|
1601
|
+
}: {
|
|
1602
|
+
left: typescript0.Expression;
|
|
1603
|
+
right: typescript0.Expression;
|
|
1604
|
+
}) => typescript0.AssignmentExpression<typescript0.EqualsToken>;
|
|
1605
|
+
awaitExpression: ({
|
|
1606
|
+
expression
|
|
1607
|
+
}: {
|
|
1608
|
+
expression: typescript0.Expression;
|
|
1609
|
+
}) => typescript0.AwaitExpression;
|
|
1610
|
+
binaryExpression: ({
|
|
1611
|
+
left,
|
|
1612
|
+
operator,
|
|
1613
|
+
right
|
|
1614
|
+
}: {
|
|
1615
|
+
left: typescript0.Expression;
|
|
1616
|
+
operator?: "=" | "===" | "!==" | "in" | "??";
|
|
1617
|
+
right: typescript0.Expression | string;
|
|
1618
|
+
}) => typescript0.BinaryExpression;
|
|
1619
|
+
block: ({
|
|
1620
|
+
multiLine,
|
|
1621
|
+
statements
|
|
1622
|
+
}: {
|
|
1623
|
+
multiLine?: boolean;
|
|
1624
|
+
statements: ReadonlyArray<typescript0.Statement>;
|
|
1625
|
+
}) => typescript0.Block;
|
|
1626
|
+
callExpression: ({
|
|
1627
|
+
functionName,
|
|
1628
|
+
parameters,
|
|
1629
|
+
types: types_d_exports
|
|
1630
|
+
}: {
|
|
1631
|
+
functionName: string | typescript0.PropertyAccessExpression | typescript0.PropertyAccessChain | typescript0.ElementAccessExpression | typescript0.Expression;
|
|
1632
|
+
parameters?: Array<string | typescript0.Expression | undefined>;
|
|
1633
|
+
types?: ReadonlyArray<typescript0.TypeNode>;
|
|
1634
|
+
}) => typescript0.CallExpression;
|
|
1635
|
+
classDeclaration: ({
|
|
1636
|
+
decorator,
|
|
1637
|
+
exportClass,
|
|
1638
|
+
extendedClasses,
|
|
1639
|
+
name,
|
|
1640
|
+
nodes
|
|
1641
|
+
}: {
|
|
1642
|
+
decorator?: {
|
|
1643
|
+
args: any[];
|
|
1644
|
+
name: string;
|
|
1645
|
+
};
|
|
1646
|
+
exportClass?: boolean;
|
|
1647
|
+
extendedClasses?: ReadonlyArray<string>;
|
|
1648
|
+
name: string;
|
|
1649
|
+
nodes: ReadonlyArray<typescript0.ClassElement>;
|
|
1650
|
+
}) => typescript0.ClassDeclaration;
|
|
1651
|
+
conditionalExpression: ({
|
|
1652
|
+
condition,
|
|
1653
|
+
whenFalse,
|
|
1654
|
+
whenTrue
|
|
1655
|
+
}: {
|
|
1656
|
+
condition: typescript0.Expression;
|
|
1657
|
+
whenFalse: typescript0.Expression;
|
|
1658
|
+
whenTrue: typescript0.Expression;
|
|
1659
|
+
}) => typescript0.ConditionalExpression;
|
|
1660
|
+
constVariable: ({
|
|
1661
|
+
assertion,
|
|
1662
|
+
comment,
|
|
1663
|
+
destructure,
|
|
1664
|
+
exportConst,
|
|
1665
|
+
expression,
|
|
1666
|
+
name,
|
|
1667
|
+
typeName
|
|
1668
|
+
}: {
|
|
1669
|
+
assertion?: "const" | typescript0.TypeNode;
|
|
1670
|
+
comment?: Comments;
|
|
1671
|
+
destructure?: boolean;
|
|
1672
|
+
exportConst?: boolean;
|
|
1673
|
+
expression: typescript0.Expression;
|
|
1674
|
+
name: string | typescript0.TypeReferenceNode;
|
|
1675
|
+
typeName?: string | typescript0.IndexedAccessTypeNode | typescript0.TypeNode;
|
|
1676
|
+
}) => typescript0.VariableStatement;
|
|
1677
|
+
constructorDeclaration: ({
|
|
1678
|
+
accessLevel,
|
|
1679
|
+
comment,
|
|
1680
|
+
multiLine,
|
|
1681
|
+
parameters,
|
|
1682
|
+
statements
|
|
1683
|
+
}: {
|
|
1684
|
+
accessLevel?: AccessLevel;
|
|
1685
|
+
comment?: Comments;
|
|
1686
|
+
multiLine?: boolean;
|
|
1687
|
+
parameters?: FunctionParameter[];
|
|
1688
|
+
statements?: typescript0.Statement[];
|
|
1689
|
+
}) => typescript0.ConstructorDeclaration;
|
|
1690
|
+
enumDeclaration: <T extends Record<string, any> | Array<ObjectValue>>({
|
|
1691
|
+
asConst,
|
|
1692
|
+
comments: enumMemberComments,
|
|
1693
|
+
leadingComment: comments,
|
|
1694
|
+
name,
|
|
1695
|
+
obj
|
|
1696
|
+
}: {
|
|
1697
|
+
asConst: boolean;
|
|
1698
|
+
comments?: Record<string | number, Comments>;
|
|
1699
|
+
leadingComment?: Comments;
|
|
1700
|
+
name: string | typescript0.TypeReferenceNode;
|
|
1701
|
+
obj: T;
|
|
1702
|
+
}) => typescript0.EnumDeclaration;
|
|
1703
|
+
exportAllDeclaration: ({
|
|
1704
|
+
module: module_d_exports,
|
|
1705
|
+
shouldAppendJs
|
|
1706
|
+
}: {
|
|
1707
|
+
module: string;
|
|
1708
|
+
shouldAppendJs?: boolean;
|
|
1709
|
+
}) => typescript0.ExportDeclaration;
|
|
1710
|
+
exportNamedDeclaration: ({
|
|
1711
|
+
exports,
|
|
1712
|
+
module: module_d_exports
|
|
1713
|
+
}: {
|
|
1714
|
+
exports: Array<ImportExportItem> | ImportExportItem;
|
|
1715
|
+
module: string;
|
|
1716
|
+
}) => typescript0.ExportDeclaration;
|
|
1717
|
+
expressionToStatement: ({
|
|
1718
|
+
expression
|
|
1719
|
+
}: {
|
|
1720
|
+
expression: typescript0.Expression;
|
|
1721
|
+
}) => typescript0.ExpressionStatement;
|
|
1722
|
+
forOfStatement: ({
|
|
1723
|
+
awaitModifier,
|
|
1724
|
+
expression,
|
|
1725
|
+
initializer,
|
|
1726
|
+
statement
|
|
1727
|
+
}: {
|
|
1728
|
+
awaitModifier?: typescript0.AwaitKeyword;
|
|
1729
|
+
expression: typescript0.Expression;
|
|
1730
|
+
initializer: typescript0.ForInitializer;
|
|
1731
|
+
statement: typescript0.Statement;
|
|
1732
|
+
}) => typescript0.ForOfStatement;
|
|
1733
|
+
functionTypeNode: ({
|
|
1734
|
+
parameters,
|
|
1735
|
+
returnType,
|
|
1736
|
+
typeParameters
|
|
1737
|
+
}: {
|
|
1738
|
+
parameters?: typescript0.ParameterDeclaration[];
|
|
1739
|
+
returnType: typescript0.TypeNode;
|
|
1740
|
+
typeParameters?: typescript0.TypeParameterDeclaration[];
|
|
1741
|
+
}) => typescript0.FunctionTypeNode;
|
|
1742
|
+
getAccessorDeclaration: ({
|
|
1743
|
+
name,
|
|
1744
|
+
returnType,
|
|
1745
|
+
statements
|
|
1746
|
+
}: {
|
|
1747
|
+
name: string | typescript0.PropertyName;
|
|
1748
|
+
returnType?: string | typescript0.Identifier;
|
|
1749
|
+
statements: ReadonlyArray<typescript0.Statement>;
|
|
1750
|
+
}) => typescript0.GetAccessorDeclaration;
|
|
1751
|
+
identifier: ({
|
|
1752
|
+
text
|
|
1753
|
+
}: {
|
|
1754
|
+
text: string;
|
|
1755
|
+
}) => typescript0.Identifier;
|
|
1756
|
+
ifStatement: ({
|
|
1757
|
+
elseStatement,
|
|
1758
|
+
expression,
|
|
1759
|
+
thenStatement
|
|
1760
|
+
}: {
|
|
1761
|
+
elseStatement?: typescript0.Statement;
|
|
1762
|
+
expression: typescript0.Expression;
|
|
1763
|
+
thenStatement: typescript0.Statement;
|
|
1764
|
+
}) => typescript0.IfStatement;
|
|
1765
|
+
indexedAccessTypeNode: ({
|
|
1766
|
+
indexType,
|
|
1767
|
+
objectType
|
|
1768
|
+
}: {
|
|
1769
|
+
indexType: typescript0.TypeNode;
|
|
1770
|
+
objectType: typescript0.TypeNode;
|
|
1771
|
+
}) => typescript0.IndexedAccessTypeNode;
|
|
1772
|
+
isTsNode: (node: any) => node is typescript0.Expression;
|
|
1773
|
+
keywordTypeNode: ({
|
|
1774
|
+
keyword
|
|
1775
|
+
}: {
|
|
1776
|
+
keyword: Extract<SyntaxKindKeyword, "any" | "boolean" | "never" | "number" | "string" | "undefined" | "unknown" | "void">;
|
|
1777
|
+
}) => typescript0.KeywordTypeNode<typescript0.SyntaxKind.VoidKeyword | typescript0.SyntaxKind.AnyKeyword | typescript0.SyntaxKind.BooleanKeyword | typescript0.SyntaxKind.NeverKeyword | typescript0.SyntaxKind.NumberKeyword | typescript0.SyntaxKind.StringKeyword | typescript0.SyntaxKind.UndefinedKeyword | typescript0.SyntaxKind.UnknownKeyword>;
|
|
1778
|
+
literalTypeNode: ({
|
|
1779
|
+
literal
|
|
1780
|
+
}: {
|
|
1781
|
+
literal: typescript0.LiteralTypeNode["literal"];
|
|
1782
|
+
}) => typescript0.LiteralTypeNode;
|
|
1783
|
+
mappedTypeNode: ({
|
|
1784
|
+
members,
|
|
1785
|
+
nameType,
|
|
1786
|
+
questionToken,
|
|
1787
|
+
readonlyToken,
|
|
1788
|
+
type,
|
|
1789
|
+
typeParameter
|
|
1790
|
+
}: {
|
|
1791
|
+
members?: typescript0.NodeArray<typescript0.TypeElement>;
|
|
1792
|
+
nameType?: typescript0.TypeNode;
|
|
1793
|
+
questionToken?: typescript0.QuestionToken | typescript0.PlusToken | typescript0.MinusToken;
|
|
1794
|
+
readonlyToken?: typescript0.ReadonlyKeyword | typescript0.PlusToken | typescript0.MinusToken;
|
|
1795
|
+
type?: typescript0.TypeNode;
|
|
1796
|
+
typeParameter: typescript0.TypeParameterDeclaration;
|
|
1797
|
+
}) => typescript0.MappedTypeNode;
|
|
1798
|
+
methodDeclaration: ({
|
|
1799
|
+
accessLevel,
|
|
1800
|
+
comment,
|
|
1801
|
+
isStatic,
|
|
1802
|
+
multiLine,
|
|
1803
|
+
name,
|
|
1804
|
+
parameters,
|
|
1805
|
+
returnType,
|
|
1806
|
+
statements,
|
|
1807
|
+
types: types_d_exports
|
|
1808
|
+
}: {
|
|
1809
|
+
accessLevel?: AccessLevel;
|
|
1810
|
+
comment?: Comments;
|
|
1811
|
+
isStatic?: boolean;
|
|
1812
|
+
multiLine?: boolean;
|
|
1813
|
+
name: string;
|
|
1814
|
+
parameters?: ReadonlyArray<FunctionParameter>;
|
|
1815
|
+
returnType?: string | typescript0.TypeNode;
|
|
1816
|
+
statements?: typescript0.Statement[];
|
|
1817
|
+
types?: FunctionTypeParameter[];
|
|
1818
|
+
}) => typescript0.MethodDeclaration;
|
|
1819
|
+
namedImportDeclarations: ({
|
|
1820
|
+
imports,
|
|
1821
|
+
module: module_d_exports
|
|
1822
|
+
}: {
|
|
1823
|
+
imports: Array<ImportExportItem> | ImportExportItem;
|
|
1824
|
+
module: string;
|
|
1825
|
+
}) => typescript0.ImportDeclaration;
|
|
1826
|
+
namespaceDeclaration: ({
|
|
1827
|
+
name,
|
|
1828
|
+
statements
|
|
1829
|
+
}: {
|
|
1830
|
+
name: string;
|
|
1831
|
+
statements: Array<typescript0.Statement>;
|
|
1832
|
+
}) => typescript0.ModuleDeclaration;
|
|
1833
|
+
newExpression: ({
|
|
1834
|
+
argumentsArray,
|
|
1835
|
+
expression,
|
|
1836
|
+
typeArguments
|
|
1837
|
+
}: {
|
|
1838
|
+
argumentsArray?: Array<typescript0.Expression>;
|
|
1839
|
+
expression: typescript0.Expression;
|
|
1840
|
+
typeArguments?: Array<typescript0.TypeNode>;
|
|
1841
|
+
}) => typescript0.NewExpression;
|
|
1842
|
+
nodeToString: typeof tsNodeToString;
|
|
1843
|
+
null: () => typescript0.NullLiteral;
|
|
1844
|
+
objectExpression: <T extends Record<string, any> | Array<ObjectValue>>({
|
|
1845
|
+
comments,
|
|
1846
|
+
identifiers,
|
|
1847
|
+
multiLine,
|
|
1848
|
+
obj,
|
|
1849
|
+
shorthand,
|
|
1850
|
+
unescape
|
|
1851
|
+
}: {
|
|
1852
|
+
comments?: Comments;
|
|
1853
|
+
identifiers?: string[];
|
|
1854
|
+
multiLine?: boolean;
|
|
1855
|
+
obj: T;
|
|
1856
|
+
shorthand?: boolean;
|
|
1857
|
+
unescape?: boolean;
|
|
1858
|
+
}) => typescript0.ObjectLiteralExpression;
|
|
1859
|
+
ots: {
|
|
1860
|
+
boolean: (value: boolean) => typescript0.TrueLiteral | typescript0.FalseLiteral;
|
|
1861
|
+
export: ({
|
|
1862
|
+
alias,
|
|
1863
|
+
asType,
|
|
1864
|
+
name
|
|
1865
|
+
}: ImportExportItemObject) => typescript0.ExportSpecifier;
|
|
1866
|
+
import: ({
|
|
1867
|
+
alias,
|
|
1868
|
+
asType,
|
|
1869
|
+
name
|
|
1870
|
+
}: ImportExportItemObject) => typescript0.ImportSpecifier;
|
|
1871
|
+
number: (value: number) => typescript0.NumericLiteral | typescript0.PrefixUnaryExpression;
|
|
1872
|
+
string: (value: string, unescape?: boolean) => typescript0.Identifier | typescript0.StringLiteral;
|
|
1873
|
+
};
|
|
1874
|
+
parameterDeclaration: ({
|
|
1875
|
+
initializer,
|
|
1876
|
+
modifiers,
|
|
1877
|
+
name,
|
|
1878
|
+
required,
|
|
1879
|
+
type
|
|
1880
|
+
}: {
|
|
1881
|
+
initializer?: typescript0.Expression;
|
|
1882
|
+
modifiers?: ReadonlyArray<typescript0.ModifierLike>;
|
|
1883
|
+
name: string | typescript0.BindingName;
|
|
1884
|
+
required?: boolean;
|
|
1885
|
+
type?: typescript0.TypeNode;
|
|
1886
|
+
}) => typescript0.ParameterDeclaration;
|
|
1887
|
+
propertyAccessExpression: ({
|
|
1888
|
+
expression,
|
|
1889
|
+
isOptional,
|
|
1890
|
+
name
|
|
1891
|
+
}: {
|
|
1892
|
+
expression: string | typescript0.Expression;
|
|
1893
|
+
isOptional?: boolean;
|
|
1894
|
+
name: string | number | typescript0.MemberName;
|
|
1895
|
+
}) => typescript0.PropertyAccessChain | typescript0.PropertyAccessExpression | typescript0.ElementAccessExpression;
|
|
1896
|
+
propertyAccessExpressions: ({
|
|
1897
|
+
expressions
|
|
1898
|
+
}: {
|
|
1899
|
+
expressions: Array<string | typescript0.Expression | typescript0.MemberName>;
|
|
1900
|
+
}) => typescript0.PropertyAccessExpression;
|
|
1901
|
+
propertyAssignment: ({
|
|
1902
|
+
initializer,
|
|
1903
|
+
name
|
|
1904
|
+
}: {
|
|
1905
|
+
initializer: typescript0.Expression;
|
|
1906
|
+
name: string | typescript0.PropertyName;
|
|
1907
|
+
}) => typescript0.PropertyAssignment;
|
|
1908
|
+
propertyDeclaration: ({
|
|
1909
|
+
initializer,
|
|
1910
|
+
modifier,
|
|
1911
|
+
name,
|
|
1912
|
+
type
|
|
1913
|
+
}: {
|
|
1914
|
+
initializer?: typescript0.Expression;
|
|
1915
|
+
modifier?: "async" | AccessLevel | "export" | "readonly" | "static";
|
|
1916
|
+
name: string | typescript0.PropertyName;
|
|
1917
|
+
type?: typescript0.TypeNode;
|
|
1918
|
+
}) => typescript0.PropertyDeclaration;
|
|
1919
|
+
regularExpressionLiteral: ({
|
|
1920
|
+
flags,
|
|
1921
|
+
text
|
|
1922
|
+
}: {
|
|
1923
|
+
flags?: ReadonlyArray<"g" | "i" | "m" | "s" | "u" | "y">;
|
|
1924
|
+
text: string;
|
|
1925
|
+
}) => typescript0.RegularExpressionLiteral;
|
|
1926
|
+
returnFunctionCall: ({
|
|
1927
|
+
args,
|
|
1928
|
+
name,
|
|
1929
|
+
types: types_d_exports
|
|
1930
|
+
}: {
|
|
1931
|
+
args: any[];
|
|
1932
|
+
name: string | typescript0.Expression;
|
|
1933
|
+
types?: ReadonlyArray<string | typescript0.StringLiteral>;
|
|
1934
|
+
}) => typescript0.ReturnStatement;
|
|
1935
|
+
returnStatement: ({
|
|
1936
|
+
expression
|
|
1937
|
+
}: {
|
|
1938
|
+
expression?: typescript0.Expression;
|
|
1939
|
+
}) => typescript0.ReturnStatement;
|
|
1940
|
+
returnVariable: ({
|
|
1941
|
+
expression
|
|
1942
|
+
}: {
|
|
1943
|
+
expression: string | typescript0.Expression;
|
|
1944
|
+
}) => typescript0.ReturnStatement;
|
|
1945
|
+
safeAccessExpression: (path: string[]) => typescript0.Expression;
|
|
1946
|
+
stringLiteral: ({
|
|
1947
|
+
isSingleQuote,
|
|
1948
|
+
text
|
|
1949
|
+
}: {
|
|
1950
|
+
isSingleQuote?: boolean;
|
|
1951
|
+
text: string;
|
|
1952
|
+
}) => typescript0.StringLiteral;
|
|
1953
|
+
templateLiteralType: ({
|
|
1954
|
+
value
|
|
1955
|
+
}: {
|
|
1956
|
+
value: ReadonlyArray<string | typescript0.TypeNode>;
|
|
1957
|
+
}) => typescript0.TemplateLiteralTypeNode;
|
|
1958
|
+
this: () => typescript0.ThisExpression;
|
|
1959
|
+
transformArrayMap: ({
|
|
1960
|
+
path,
|
|
1961
|
+
transformExpression
|
|
1962
|
+
}: {
|
|
1963
|
+
path: string[];
|
|
1964
|
+
transformExpression: typescript0.Expression;
|
|
1965
|
+
}) => typescript0.IfStatement;
|
|
1966
|
+
transformArrayMutation: ({
|
|
1967
|
+
path,
|
|
1968
|
+
transformerName
|
|
1969
|
+
}: {
|
|
1970
|
+
path: string[];
|
|
1971
|
+
transformerName: string;
|
|
1972
|
+
}) => typescript0.Statement;
|
|
1973
|
+
transformDateMutation: ({
|
|
1974
|
+
path
|
|
1975
|
+
}: {
|
|
1976
|
+
path: string[];
|
|
1977
|
+
}) => typescript0.Statement;
|
|
1978
|
+
transformFunctionMutation: ({
|
|
1979
|
+
path,
|
|
1980
|
+
transformerName
|
|
1981
|
+
}: {
|
|
1982
|
+
path: string[];
|
|
1983
|
+
transformerName: string;
|
|
1984
|
+
}) => typescript0.IfStatement[];
|
|
1985
|
+
transformNewDate: ({
|
|
1986
|
+
parameterName
|
|
1987
|
+
}: {
|
|
1988
|
+
parameterName: string;
|
|
1989
|
+
}) => typescript0.NewExpression;
|
|
1990
|
+
typeAliasDeclaration: ({
|
|
1991
|
+
comment,
|
|
1992
|
+
exportType,
|
|
1993
|
+
name,
|
|
1994
|
+
type,
|
|
1995
|
+
typeParameters
|
|
1996
|
+
}: {
|
|
1997
|
+
comment?: Comments;
|
|
1998
|
+
exportType?: boolean;
|
|
1999
|
+
name: string | typescript0.TypeReferenceNode;
|
|
2000
|
+
type: string | typescript0.TypeNode | typescript0.Identifier;
|
|
2001
|
+
typeParameters?: FunctionTypeParameter[];
|
|
2002
|
+
}) => typescript0.TypeAliasDeclaration;
|
|
2003
|
+
typeArrayNode: (types: ReadonlyArray<any | typescript0.TypeNode> | typescript0.TypeNode | typescript0.Identifier | string, isNullable?: boolean) => typescript0.TypeNode;
|
|
2004
|
+
typeInterfaceNode: ({
|
|
2005
|
+
indexKey,
|
|
2006
|
+
indexProperty,
|
|
2007
|
+
isNullable,
|
|
2008
|
+
properties,
|
|
2009
|
+
useLegacyResolution
|
|
2010
|
+
}: {
|
|
2011
|
+
indexKey?: typescript0.TypeReferenceNode;
|
|
2012
|
+
indexProperty?: Property;
|
|
2013
|
+
isNullable?: boolean;
|
|
2014
|
+
properties: Property[];
|
|
2015
|
+
useLegacyResolution: boolean;
|
|
2016
|
+
}) => typescript0.TypeNode;
|
|
2017
|
+
typeIntersectionNode: ({
|
|
2018
|
+
isNullable,
|
|
2019
|
+
types: types_d_exports
|
|
2020
|
+
}: {
|
|
2021
|
+
isNullable?: boolean;
|
|
2022
|
+
types: (any | typescript0.TypeNode)[];
|
|
2023
|
+
}) => typescript0.TypeNode;
|
|
2024
|
+
typeNode: (base: any | typescript0.TypeNode, args?: (any | typescript0.TypeNode)[]) => typescript0.TypeNode;
|
|
2025
|
+
typeOfExpression: ({
|
|
2026
|
+
text
|
|
2027
|
+
}: {
|
|
2028
|
+
text: string | typescript0.Identifier;
|
|
2029
|
+
}) => typescript0.TypeOfExpression;
|
|
2030
|
+
typeOperatorNode: ({
|
|
2031
|
+
operator,
|
|
2032
|
+
type
|
|
2033
|
+
}: {
|
|
2034
|
+
operator: "keyof" | "readonly" | "unique";
|
|
2035
|
+
type: typescript0.TypeNode;
|
|
2036
|
+
}) => typescript0.TypeOperatorNode;
|
|
2037
|
+
typeParameterDeclaration: ({
|
|
2038
|
+
constraint,
|
|
2039
|
+
defaultType,
|
|
2040
|
+
modifiers,
|
|
2041
|
+
name
|
|
2042
|
+
}: {
|
|
2043
|
+
constraint?: typescript0.TypeNode;
|
|
2044
|
+
defaultType?: typescript0.TypeNode;
|
|
2045
|
+
modifiers?: Array<typescript0.Modifier>;
|
|
2046
|
+
name: string | typescript0.Identifier;
|
|
2047
|
+
}) => typescript0.TypeParameterDeclaration;
|
|
2048
|
+
typeParenthesizedNode: ({
|
|
2049
|
+
type
|
|
2050
|
+
}: {
|
|
2051
|
+
type: typescript0.TypeNode;
|
|
2052
|
+
}) => typescript0.ParenthesizedTypeNode;
|
|
2053
|
+
typeRecordNode: (keys: (any | typescript0.TypeNode)[], values: (any | typescript0.TypeNode)[], isNullable?: boolean, useLegacyResolution?: boolean) => typescript0.TypeNode;
|
|
2054
|
+
typeReferenceNode: ({
|
|
2055
|
+
typeArguments,
|
|
2056
|
+
typeName
|
|
2057
|
+
}: {
|
|
2058
|
+
typeArguments?: typescript0.TypeNode[];
|
|
2059
|
+
typeName: string | typescript0.EntityName;
|
|
2060
|
+
}) => typescript0.TypeReferenceNode;
|
|
2061
|
+
typeTupleNode: ({
|
|
2062
|
+
isNullable,
|
|
2063
|
+
types: types_d_exports
|
|
2064
|
+
}: {
|
|
2065
|
+
isNullable?: boolean;
|
|
2066
|
+
types: Array<any | typescript0.TypeNode>;
|
|
2067
|
+
}) => typescript0.TypeNode;
|
|
2068
|
+
typeUnionNode: ({
|
|
2069
|
+
isNullable,
|
|
2070
|
+
types: types_d_exports
|
|
2071
|
+
}: {
|
|
2072
|
+
isNullable?: boolean;
|
|
2073
|
+
types: ReadonlyArray<any | typescript0.TypeNode>;
|
|
2074
|
+
}) => typescript0.TypeNode;
|
|
2075
|
+
valueToExpression: <T = unknown>({
|
|
2076
|
+
identifiers,
|
|
2077
|
+
isValueAccess,
|
|
2078
|
+
shorthand,
|
|
2079
|
+
unescape,
|
|
2080
|
+
value
|
|
2081
|
+
}: {
|
|
2082
|
+
identifiers?: string[];
|
|
2083
|
+
isValueAccess?: boolean;
|
|
2084
|
+
shorthand?: boolean;
|
|
2085
|
+
unescape?: boolean;
|
|
2086
|
+
value: T;
|
|
2087
|
+
}) => typescript0.Expression | undefined;
|
|
2088
|
+
};
|
|
903
2089
|
//#endregion
|
|
904
2090
|
//#region src/utils/exports.d.ts
|
|
905
2091
|
declare const utils: {
|
|
@@ -915,12 +2101,32 @@ declare const utils: {
|
|
|
915
2101
|
};
|
|
916
2102
|
//#endregion
|
|
917
2103
|
//#region src/index.d.ts
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
2104
|
+
declare module '@hey-api/codegen-core' {
|
|
2105
|
+
interface ProjectRenderMeta {
|
|
2106
|
+
/**
|
|
2107
|
+
* If specified, this will be the file extension used when importing
|
|
2108
|
+
* other modules. By default, we don't add a file extension and let the
|
|
2109
|
+
* runtime resolve it.
|
|
2110
|
+
*
|
|
2111
|
+
* @default null
|
|
2112
|
+
*/
|
|
2113
|
+
importFileExtension?: (string & {}) | null;
|
|
2114
|
+
}
|
|
2115
|
+
interface SymbolMeta {
|
|
2116
|
+
/**
|
|
2117
|
+
* Path to the resource this symbol represents.
|
|
2118
|
+
*/
|
|
2119
|
+
path?: ReadonlyArray<string | number>;
|
|
2120
|
+
/**
|
|
2121
|
+
* Name of the plugin that registered this symbol.
|
|
2122
|
+
*/
|
|
2123
|
+
pluginName?: string;
|
|
2124
|
+
/**
|
|
2125
|
+
* Tags associated with this symbol.
|
|
2126
|
+
*/
|
|
2127
|
+
tags?: Set<string>;
|
|
2128
|
+
}
|
|
2129
|
+
}
|
|
924
2130
|
/**
|
|
925
2131
|
* Type helper for openapi-ts.config.ts, returns {@link MaybeArray<UserConfig>} object(s)
|
|
926
2132
|
*/
|