@hey-api/openapi-ts 0.86.12 → 0.87.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/README.md +8 -14
- package/dist/clients/angular/index.ts +0 -1
- package/dist/clients/angular/types.ts +0 -27
- package/dist/clients/axios/index.ts +0 -1
- package/dist/clients/axios/types.ts +0 -19
- package/dist/clients/fetch/index.ts +0 -1
- package/dist/clients/fetch/types.ts +0 -27
- package/dist/clients/next/index.ts +0 -1
- package/dist/clients/next/types.ts +0 -19
- package/dist/clients/nuxt/index.ts +0 -1
- package/dist/clients/nuxt/types.ts +0 -12
- package/dist/clients/ofetch/index.ts +0 -1
- package/dist/clients/ofetch/types.ts +0 -27
- package/dist/{types-BRmx9r9T.d.ts → config-CNi83ZTD.d.ts} +1395 -2417
- package/dist/{types-Dh80P1tV.d.cts → config-PWeoedFF.d.cts} +1447 -2471
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +470 -25
- package/dist/index.d.ts +459 -16
- package/dist/index.js +1 -1
- package/dist/internal.cjs +1 -1
- package/dist/internal.d.cts +38 -1
- package/dist/internal.d.ts +38 -1
- package/dist/internal.js +1 -1
- package/dist/openApi-CCTdD3hW.cjs +19 -0
- package/dist/openApi-CCTdD3hW.cjs.map +1 -0
- package/dist/openApi-D7xrG_wR.js +19 -0
- package/dist/openApi-D7xrG_wR.js.map +1 -0
- package/dist/run.cjs +1 -1
- package/dist/run.cjs.map +1 -1
- package/dist/run.js +1 -1
- package/dist/run.js.map +1 -1
- package/dist/src-CZCpIWy7.js +11 -0
- package/dist/src-CZCpIWy7.js.map +1 -0
- package/dist/src-Cvd6zAsc.cjs +19 -0
- package/dist/src-Cvd6zAsc.cjs.map +1 -0
- package/package.json +1 -4
- package/dist/getSpec-1BMHZkPH.js +0 -25
- package/dist/getSpec-1BMHZkPH.js.map +0 -1
- package/dist/getSpec-xn4as4li.cjs +0 -25
- package/dist/getSpec-xn4as4li.cjs.map +0 -1
- package/dist/src-CQ_69Vcm.js +0 -1310
- package/dist/src-CQ_69Vcm.js.map +0 -1
- package/dist/src-DptUs1Ky.cjs +0 -1318
- package/dist/src-DptUs1Ky.cjs.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`./
|
|
1
|
+
const e=require(`./openApi-CCTdD3hW.cjs`),t=require(`./src-Cvd6zAsc.cjs`);exports.Logger=t.i,exports.clientDefaultConfig=e.c,exports.clientDefaultMeta=e.l,exports.clientPluginHandler=e.o,exports.compiler=e.u,exports.createClient=t.r,exports.defaultPaginationKeywords=e.h,exports.defaultPlugins=e.a,exports.defineConfig=t.t,exports.definePluginConfig=e.m,exports.tsc=e.d,exports.utils=t.n;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import * as typescript0 from "typescript";
|
|
3
|
-
import ts from "typescript";
|
|
1
|
+
import { S as MaybeArray, _ as Client$2, a as Plugin, b as IR, c as OpenApiOperationObject, d as OpenApiResponseObject, f as OpenApiSchemaObject, g as ExpressionTransformer, h as TypeTransformer, i as DefinePlugin, l as OpenApiParameterObject, m as Logger, n as UserConfig, o as OpenApi, p as Context, s as OpenApiMetaObject, u as OpenApiRequestBodyObject, v as PluginHandler, x as LazyOrAsync, y as StringCase } from "./config-PWeoedFF.cjs";
|
|
4
2
|
import { HttpClient, HttpErrorResponse, HttpHeaders, HttpRequest, HttpResponse } from "@angular/common/http";
|
|
5
3
|
import { Injector } from "@angular/core";
|
|
6
4
|
import { AxiosError, AxiosInstance, AxiosRequestHeaders, AxiosResponse, AxiosStatic, CreateAxiosDefaults } from "axios";
|
|
7
5
|
import { AsyncDataOptions, UseFetchOptions, useAsyncData, useFetch, useLazyAsyncData, useLazyFetch } from "nuxt/app";
|
|
8
6
|
import { Ref } from "vue";
|
|
9
7
|
import { FetchOptions, ResponseType, ofetch } from "ofetch";
|
|
8
|
+
import * as typescript0 from "typescript";
|
|
9
|
+
import ts from "typescript";
|
|
10
10
|
|
|
11
|
+
//#region rolldown:runtime
|
|
12
|
+
//#endregion
|
|
11
13
|
//#region src/plugins/@hey-api/client-core/bundle/auth.d.ts
|
|
12
14
|
type AuthToken = string | undefined;
|
|
13
15
|
interface Auth {
|
|
@@ -56,7 +58,7 @@ type QuerySerializerOptions = QuerySerializerOptionsObject & {
|
|
|
56
58
|
//#endregion
|
|
57
59
|
//#region src/plugins/@hey-api/client-core/bundle/types.d.ts
|
|
58
60
|
type HttpMethod = 'connect' | 'delete' | 'get' | 'head' | 'options' | 'patch' | 'post' | 'put' | 'trace';
|
|
59
|
-
type Client$
|
|
61
|
+
type Client$7<RequestFn$6 = never, Config$7 = unknown, MethodFn$6 = never, BuildUrlFn$6 = never, SseFn$6 = never> = {
|
|
60
62
|
/**
|
|
61
63
|
* Returns the final request URL.
|
|
62
64
|
*/
|
|
@@ -301,7 +303,7 @@ type BuildUrlFn$5 = <TData extends {
|
|
|
301
303
|
query?: Record<string, unknown>;
|
|
302
304
|
url: string;
|
|
303
305
|
}>(options: TData & Options$5<TData>) => string;
|
|
304
|
-
type Client = Client$
|
|
306
|
+
type Client = Client$7<RequestFn$5, Config$6, MethodFn$5, BuildUrlFn$5, SseFn$5> & {
|
|
305
307
|
interceptors: Middleware$3<HttpRequest<unknown>, HttpResponse<unknown>, unknown, ResolvedRequestOptions$3>;
|
|
306
308
|
requestOptions: RequestOptionsFn;
|
|
307
309
|
};
|
|
@@ -378,7 +380,7 @@ type BuildUrlFn$4 = <TData extends {
|
|
|
378
380
|
query?: Record<string, unknown>;
|
|
379
381
|
url: string;
|
|
380
382
|
}>(options: TData & Options$4<TData>) => string;
|
|
381
|
-
type Client$1 = Client$
|
|
383
|
+
type Client$1 = Client$7<RequestFn$4, Config$5, MethodFn$4, BuildUrlFn$4, SseFn$4> & {
|
|
382
384
|
instance: AxiosInstance;
|
|
383
385
|
};
|
|
384
386
|
interface TDataShape$4 {
|
|
@@ -502,7 +504,7 @@ type BuildUrlFn$3 = <TData extends {
|
|
|
502
504
|
query?: Record<string, unknown>;
|
|
503
505
|
url: string;
|
|
504
506
|
}>(options: TData & Options$3<TData>) => string;
|
|
505
|
-
type Client$3 = Client$
|
|
507
|
+
type Client$3 = Client$7<RequestFn$3, Config$4, MethodFn$3, BuildUrlFn$3, SseFn$3> & {
|
|
506
508
|
interceptors: Middleware$2<Request, Response, unknown, ResolvedRequestOptions$2>;
|
|
507
509
|
};
|
|
508
510
|
interface TDataShape$3 {
|
|
@@ -608,7 +610,7 @@ type BuildUrlFn$2 = <TData extends {
|
|
|
608
610
|
query?: Record<string, unknown>;
|
|
609
611
|
url: string;
|
|
610
612
|
}>(options: TData & Options$2<TData>) => string;
|
|
611
|
-
type Client$4 = Client$
|
|
613
|
+
type Client$4 = Client$7<RequestFn$2, Config$3, MethodFn$2, BuildUrlFn$2, SseFn$2> & {
|
|
612
614
|
interceptors: Middleware$1<Response, unknown, ResolvedRequestOptions$1>;
|
|
613
615
|
};
|
|
614
616
|
interface TDataShape$2 {
|
|
@@ -684,7 +686,7 @@ interface TDataShape$1 {
|
|
|
684
686
|
}
|
|
685
687
|
type BuildUrlOptions<TData extends Omit<TDataShape$1, 'headers'> = Omit<TDataShape$1, 'headers'>> = Pick<WithRefs<TData>, 'path' | 'query'> & Pick<TData, 'url'> & Pick<Options$1<'$fetch', TData>, 'baseURL' | 'querySerializer'>;
|
|
686
688
|
type BuildUrlFn$1 = <TData extends Omit<TDataShape$1, 'headers'>>(options: BuildUrlOptions<TData>) => string;
|
|
687
|
-
type Client$5 = Client$
|
|
689
|
+
type Client$5 = Client$7<RequestFn$1, Config$2, MethodFn$1, BuildUrlFn$1, SseFn$1>;
|
|
688
690
|
type OmitKeys$1<T, K$1> = Pick<T, Exclude<keyof T, K$1>>;
|
|
689
691
|
type Options$1<TComposable extends Composable = '$fetch', TData extends TDataShape$1 = TDataShape$1, ResT = unknown, DefaultT = undefined> = OmitKeys$1<RequestOptions$1<TComposable, ResT, DefaultT>, 'body' | 'path' | 'query' | 'url'> & ([TData] extends [never] ? unknown : WithRefs<Omit<TData, 'url'>>);
|
|
690
692
|
type FetchOptions$1<TData> = Omit<UseFetchOptions<TData, TData>, keyof AsyncDataOptions<TData>>;
|
|
@@ -861,7 +863,7 @@ type BuildUrlFn = <TData extends {
|
|
|
861
863
|
query?: Record<string, unknown>;
|
|
862
864
|
url: string;
|
|
863
865
|
}>(options: TData & Options<TData>) => string;
|
|
864
|
-
type Client$6 = Client$
|
|
866
|
+
type Client$6 = Client$7<RequestFn, Config$1, MethodFn, BuildUrlFn, SseFn> & {
|
|
865
867
|
interceptors: Middleware<Request, Response, unknown, ResolvedRequestOptions>;
|
|
866
868
|
};
|
|
867
869
|
interface TDataShape {
|
|
@@ -880,7 +882,7 @@ type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean
|
|
|
880
882
|
*
|
|
881
883
|
* @param userConfig User provided {@link UserConfig} configuration(s).
|
|
882
884
|
*/
|
|
883
|
-
declare const createClient: (userConfig?: LazyOrAsync<MaybeArray<UserConfig>>, logger?: Logger) => Promise<ReadonlyArray<
|
|
885
|
+
declare const createClient: (userConfig?: LazyOrAsync<MaybeArray<UserConfig>>, logger?: Logger) => Promise<ReadonlyArray<Context>>;
|
|
884
886
|
//#endregion
|
|
885
887
|
//#region src/config/parser.d.ts
|
|
886
888
|
declare const defaultPaginationKeywords: readonly ["after", "before", "cursor", "offset", "page", "start"];
|
|
@@ -908,7 +910,7 @@ declare const clientPluginHandler: ({
|
|
|
908
910
|
}: Parameters<PluginHandler>[0]) => void;
|
|
909
911
|
//#endregion
|
|
910
912
|
//#region src/plugins/shared/utils/config.d.ts
|
|
911
|
-
declare const definePluginConfig: <T extends Plugin.Types>(defaultConfig: Plugin.Config<T>) => (userConfig?: Omit<
|
|
913
|
+
declare const definePluginConfig: <T extends Plugin.Types>(defaultConfig: Plugin.Config<T>) => (userConfig?: Omit<T["config"], "name">) => Omit<Plugin.Config<T>, "name"> & {
|
|
912
914
|
/**
|
|
913
915
|
* Cast name to `any` so it doesn't throw type error in `plugins` array.
|
|
914
916
|
* We could allow any `string` as plugin `name` in the object syntax, but
|
|
@@ -917,6 +919,435 @@ declare const definePluginConfig: <T extends Plugin.Types>(defaultConfig: Plugin
|
|
|
917
919
|
*/
|
|
918
920
|
name: any;
|
|
919
921
|
};
|
|
922
|
+
declare namespace types_d_exports {
|
|
923
|
+
export { AccessLevel, FunctionParameter, FunctionTypeParameter, ObjectValue, SyntaxKindKeyword, createAnonymousFunction, createArrayLiteralExpression, createArrowFunction, createAsExpression, createAssignment, createAwaitExpression, createBlock, createConditionalExpression, createEnumDeclaration, createForOfStatement, createFunctionTypeNode, createGetAccessorDeclaration, createIndexedAccessTypeNode, createKeywordTypeNode, createLiteralTypeNode, createMappedTypeNode, createNamespaceDeclaration, createNewExpression, createNull, createObjectType, createParameterDeclaration, createPropertyAccessChain, createPropertyAccessExpression, createPropertyAssignment, createRegularExpressionLiteral, createStringLiteral, createTemplateLiteralType, createTypeAliasDeclaration, createTypeNode, createTypeOfExpression, createTypeOperatorNode, createTypeParameterDeclaration, createTypeParenthesizedNode, createTypeReferenceNode, syntaxKindKeyword, toExpression, toParameterDeclarations, toTypeParameters };
|
|
924
|
+
}
|
|
925
|
+
type AccessLevel = 'private' | 'protected' | 'public';
|
|
926
|
+
type FunctionParameter = {
|
|
927
|
+
accessLevel?: AccessLevel;
|
|
928
|
+
default?: any;
|
|
929
|
+
isReadOnly?: boolean;
|
|
930
|
+
isRequired?: boolean;
|
|
931
|
+
name: string;
|
|
932
|
+
type?: any | ts.TypeNode;
|
|
933
|
+
} | {
|
|
934
|
+
destructure: ReadonlyArray<FunctionParameter>;
|
|
935
|
+
type?: any | ts.TypeNode;
|
|
936
|
+
};
|
|
937
|
+
interface FunctionTypeParameter {
|
|
938
|
+
default?: any;
|
|
939
|
+
extends?: string | ts.TypeNode;
|
|
940
|
+
name: string | ts.Identifier;
|
|
941
|
+
}
|
|
942
|
+
declare const createTypeNode: (base: any | ts.TypeNode, args?: (any | ts.TypeNode)[]) => ts.TypeNode;
|
|
943
|
+
declare const createPropertyAccessChain: ({
|
|
944
|
+
expression,
|
|
945
|
+
name
|
|
946
|
+
}: {
|
|
947
|
+
expression: ts.Expression;
|
|
948
|
+
name: string | ts.MemberName;
|
|
949
|
+
}) => ts.PropertyAccessChain;
|
|
950
|
+
declare const createPropertyAccessExpression: ({
|
|
951
|
+
expression,
|
|
952
|
+
isOptional,
|
|
953
|
+
name
|
|
954
|
+
}: {
|
|
955
|
+
expression: string | ts.Expression;
|
|
956
|
+
isOptional?: boolean;
|
|
957
|
+
name: string | number | ts.MemberName;
|
|
958
|
+
}) => ts.PropertyAccessChain | ts.PropertyAccessExpression | ts.ElementAccessExpression;
|
|
959
|
+
declare const createNull: () => ts.NullLiteral;
|
|
960
|
+
/**
|
|
961
|
+
* Convert an unknown value to an expression.
|
|
962
|
+
* @param identifiers - list of keys that are treated as identifiers.
|
|
963
|
+
* @param shorthand - if shorthand syntax is allowed.
|
|
964
|
+
* @param unescape - if string should be unescaped.
|
|
965
|
+
* @param value - the unknown value.
|
|
966
|
+
* @returns ts.Expression
|
|
967
|
+
*/
|
|
968
|
+
declare const toExpression: <T = unknown>({
|
|
969
|
+
identifiers,
|
|
970
|
+
isValueAccess,
|
|
971
|
+
shorthand,
|
|
972
|
+
unescape,
|
|
973
|
+
value
|
|
974
|
+
}: {
|
|
975
|
+
identifiers?: string[];
|
|
976
|
+
isValueAccess?: boolean;
|
|
977
|
+
shorthand?: boolean;
|
|
978
|
+
unescape?: boolean;
|
|
979
|
+
value: T;
|
|
980
|
+
}) => ts.Expression | undefined;
|
|
981
|
+
/**
|
|
982
|
+
* Convert parameters to the declaration array expected by TypeScript
|
|
983
|
+
* Compiler API.
|
|
984
|
+
* @param parameters - the parameters to convert to declarations
|
|
985
|
+
* @returns ts.ParameterDeclaration[]
|
|
986
|
+
*/
|
|
987
|
+
declare const toParameterDeclarations: (parameters: ReadonlyArray<FunctionParameter>) => ts.ParameterDeclaration[];
|
|
988
|
+
type SyntaxKindKeyword = 'any' | 'async' | 'boolean' | 'export' | 'never' | 'number' | 'private' | 'protected' | 'public' | 'readonly' | 'static' | 'string' | 'undefined' | 'unknown' | 'void';
|
|
989
|
+
declare const syntaxKindKeyword: <T extends SyntaxKindKeyword>({
|
|
990
|
+
keyword
|
|
991
|
+
}: {
|
|
992
|
+
keyword: T;
|
|
993
|
+
}) => T extends "protected" ? ts.SyntaxKind.ProtectedKeyword : T extends "public" ? ts.SyntaxKind.PublicKeyword : T extends "private" ? ts.SyntaxKind.PrivateKeyword : T extends "export" ? ts.SyntaxKind.ExportKeyword : T extends "async" ? ts.SyntaxKind.ExportKeyword : T extends "readonly" ? ts.SyntaxKind.ExportKeyword : T extends "static" ? ts.SyntaxKind.ExportKeyword : ts.SyntaxKind.AnyKeyword | ts.SyntaxKind.BooleanKeyword | ts.SyntaxKind.NeverKeyword | ts.SyntaxKind.NumberKeyword | ts.SyntaxKind.StringKeyword | ts.SyntaxKind.UndefinedKeyword | ts.SyntaxKind.UnknownKeyword | ts.SyntaxKind.VoidKeyword;
|
|
994
|
+
declare const createKeywordTypeNode: ({
|
|
995
|
+
keyword
|
|
996
|
+
}: {
|
|
997
|
+
keyword: Extract<SyntaxKindKeyword, "any" | "boolean" | "never" | "number" | "string" | "undefined" | "unknown" | "void">;
|
|
998
|
+
}) => ts.KeywordTypeNode<ts.SyntaxKind.VoidKeyword | ts.SyntaxKind.AnyKeyword | ts.SyntaxKind.BooleanKeyword | ts.SyntaxKind.NeverKeyword | ts.SyntaxKind.NumberKeyword | ts.SyntaxKind.StringKeyword | ts.SyntaxKind.UndefinedKeyword | ts.SyntaxKind.UnknownKeyword>;
|
|
999
|
+
declare const toTypeParameters: (types: (FunctionTypeParameter | ts.TypeParameterDeclaration)[]) => ts.TypeParameterDeclaration[];
|
|
1000
|
+
declare const createTypeOperatorNode: ({
|
|
1001
|
+
operator,
|
|
1002
|
+
type
|
|
1003
|
+
}: {
|
|
1004
|
+
operator: "keyof" | "readonly" | "unique";
|
|
1005
|
+
type: ts.TypeNode;
|
|
1006
|
+
}) => ts.TypeOperatorNode;
|
|
1007
|
+
declare const createTypeParameterDeclaration: ({
|
|
1008
|
+
constraint,
|
|
1009
|
+
defaultType,
|
|
1010
|
+
modifiers,
|
|
1011
|
+
name
|
|
1012
|
+
}: {
|
|
1013
|
+
constraint?: ts.TypeNode;
|
|
1014
|
+
defaultType?: ts.TypeNode;
|
|
1015
|
+
modifiers?: Array<ts.Modifier>;
|
|
1016
|
+
name: string | ts.Identifier;
|
|
1017
|
+
}) => ts.TypeParameterDeclaration;
|
|
1018
|
+
declare const createMappedTypeNode: ({
|
|
1019
|
+
members,
|
|
1020
|
+
nameType,
|
|
1021
|
+
questionToken,
|
|
1022
|
+
readonlyToken,
|
|
1023
|
+
type,
|
|
1024
|
+
typeParameter
|
|
1025
|
+
}: {
|
|
1026
|
+
members?: ts.NodeArray<ts.TypeElement>;
|
|
1027
|
+
nameType?: ts.TypeNode;
|
|
1028
|
+
questionToken?: ts.QuestionToken | ts.PlusToken | ts.MinusToken;
|
|
1029
|
+
readonlyToken?: ts.ReadonlyKeyword | ts.PlusToken | ts.MinusToken;
|
|
1030
|
+
type?: ts.TypeNode;
|
|
1031
|
+
typeParameter: ts.TypeParameterDeclaration;
|
|
1032
|
+
}) => ts.MappedTypeNode;
|
|
1033
|
+
declare const createLiteralTypeNode: ({
|
|
1034
|
+
literal
|
|
1035
|
+
}: {
|
|
1036
|
+
literal: ts.LiteralTypeNode["literal"];
|
|
1037
|
+
}) => ts.LiteralTypeNode;
|
|
1038
|
+
/**
|
|
1039
|
+
* Create arrow function type expression.
|
|
1040
|
+
*/
|
|
1041
|
+
declare const createArrowFunction: ({
|
|
1042
|
+
async,
|
|
1043
|
+
comment,
|
|
1044
|
+
multiLine,
|
|
1045
|
+
parameters,
|
|
1046
|
+
returnType,
|
|
1047
|
+
statements,
|
|
1048
|
+
types
|
|
1049
|
+
}: {
|
|
1050
|
+
async?: boolean;
|
|
1051
|
+
comment?: Comments;
|
|
1052
|
+
multiLine?: boolean;
|
|
1053
|
+
parameters?: ReadonlyArray<FunctionParameter>;
|
|
1054
|
+
returnType?: string | ts.TypeNode;
|
|
1055
|
+
statements?: ts.Statement[] | ts.Expression;
|
|
1056
|
+
types?: FunctionTypeParameter[];
|
|
1057
|
+
}) => ts.ArrowFunction;
|
|
1058
|
+
/**
|
|
1059
|
+
* Create anonymous function type expression.
|
|
1060
|
+
*/
|
|
1061
|
+
declare const createAnonymousFunction: ({
|
|
1062
|
+
async,
|
|
1063
|
+
comment,
|
|
1064
|
+
multiLine,
|
|
1065
|
+
parameters,
|
|
1066
|
+
returnType,
|
|
1067
|
+
statements,
|
|
1068
|
+
types
|
|
1069
|
+
}: {
|
|
1070
|
+
async?: boolean;
|
|
1071
|
+
comment?: Comments;
|
|
1072
|
+
multiLine?: boolean;
|
|
1073
|
+
parameters?: FunctionParameter[];
|
|
1074
|
+
returnType?: string | ts.TypeNode;
|
|
1075
|
+
statements?: ReadonlyArray<ts.Statement>;
|
|
1076
|
+
types?: FunctionTypeParameter[];
|
|
1077
|
+
}) => ts.FunctionExpression;
|
|
1078
|
+
/**
|
|
1079
|
+
* Create Array type expression.
|
|
1080
|
+
*/
|
|
1081
|
+
declare const createArrayLiteralExpression: <T>({
|
|
1082
|
+
elements,
|
|
1083
|
+
multiLine
|
|
1084
|
+
}: {
|
|
1085
|
+
/**
|
|
1086
|
+
* The array to create.
|
|
1087
|
+
*/
|
|
1088
|
+
elements: T[];
|
|
1089
|
+
/**
|
|
1090
|
+
* Should the array be multi line?
|
|
1091
|
+
*
|
|
1092
|
+
* @default false
|
|
1093
|
+
*/
|
|
1094
|
+
multiLine?: boolean;
|
|
1095
|
+
}) => ts.ArrayLiteralExpression;
|
|
1096
|
+
declare const createAwaitExpression: ({
|
|
1097
|
+
expression
|
|
1098
|
+
}: {
|
|
1099
|
+
expression: ts.Expression;
|
|
1100
|
+
}) => ts.AwaitExpression;
|
|
1101
|
+
declare const createFunctionTypeNode: ({
|
|
1102
|
+
parameters,
|
|
1103
|
+
returnType,
|
|
1104
|
+
typeParameters
|
|
1105
|
+
}: {
|
|
1106
|
+
parameters?: ts.ParameterDeclaration[];
|
|
1107
|
+
returnType: ts.TypeNode;
|
|
1108
|
+
typeParameters?: ts.TypeParameterDeclaration[];
|
|
1109
|
+
}) => ts.FunctionTypeNode;
|
|
1110
|
+
type ObjectValue = {
|
|
1111
|
+
assertion?: 'any' | ts.TypeNode;
|
|
1112
|
+
comments?: Comments;
|
|
1113
|
+
spread: string;
|
|
1114
|
+
} | {
|
|
1115
|
+
comments?: Comments;
|
|
1116
|
+
isValueAccess?: boolean;
|
|
1117
|
+
key: string;
|
|
1118
|
+
shorthand?: boolean;
|
|
1119
|
+
value: any;
|
|
1120
|
+
};
|
|
1121
|
+
/**
|
|
1122
|
+
* Create Object type expression.
|
|
1123
|
+
* @param comments - comments to add to each property.
|
|
1124
|
+
* @param identifier - keys that should be treated as identifiers.
|
|
1125
|
+
* @param multiLine - if the object should be multiline.
|
|
1126
|
+
* @param obj - the object to create expression with.
|
|
1127
|
+
* @param shorthand - if shorthand syntax should be used.
|
|
1128
|
+
* @param unescape - if properties strings should be unescaped.
|
|
1129
|
+
* @returns ts.ObjectLiteralExpression
|
|
1130
|
+
*/
|
|
1131
|
+
declare const createObjectType: <T extends Record<string, any> | Array<ObjectValue>>({
|
|
1132
|
+
comments,
|
|
1133
|
+
identifiers,
|
|
1134
|
+
multiLine,
|
|
1135
|
+
obj,
|
|
1136
|
+
shorthand,
|
|
1137
|
+
unescape
|
|
1138
|
+
}: {
|
|
1139
|
+
comments?: Comments;
|
|
1140
|
+
identifiers?: string[];
|
|
1141
|
+
multiLine?: boolean;
|
|
1142
|
+
obj: T;
|
|
1143
|
+
shorthand?: boolean;
|
|
1144
|
+
unescape?: boolean;
|
|
1145
|
+
}) => ts.ObjectLiteralExpression;
|
|
1146
|
+
/**
|
|
1147
|
+
* Create enum declaration. Example `export enum T = { X, Y };`
|
|
1148
|
+
* @param asConst - whether to use const enums.
|
|
1149
|
+
* @param comments - comments to add to each property.
|
|
1150
|
+
* @param leadingComment - leading comment to add to enum.
|
|
1151
|
+
* @param name - the name of the enum.
|
|
1152
|
+
* @param obj - the object representing the enum.
|
|
1153
|
+
* @returns ts.EnumDeclaration
|
|
1154
|
+
*/
|
|
1155
|
+
declare const createEnumDeclaration: <T extends Record<string, any> | Array<ObjectValue>>({
|
|
1156
|
+
asConst,
|
|
1157
|
+
comments: enumMemberComments,
|
|
1158
|
+
leadingComment: comments,
|
|
1159
|
+
name,
|
|
1160
|
+
obj
|
|
1161
|
+
}: {
|
|
1162
|
+
asConst: boolean;
|
|
1163
|
+
comments?: Record<string | number, Comments>;
|
|
1164
|
+
leadingComment?: Comments;
|
|
1165
|
+
name: string | ts.TypeReferenceNode;
|
|
1166
|
+
obj: T;
|
|
1167
|
+
}) => ts.EnumDeclaration;
|
|
1168
|
+
/**
|
|
1169
|
+
* Create namespace declaration. Example `export namespace MyNamespace { ... }`
|
|
1170
|
+
* @param name - the name of the namespace.
|
|
1171
|
+
* @param nodes - the nodes in the namespace.
|
|
1172
|
+
* @returns
|
|
1173
|
+
*/
|
|
1174
|
+
declare const createNamespaceDeclaration: ({
|
|
1175
|
+
name,
|
|
1176
|
+
statements
|
|
1177
|
+
}: {
|
|
1178
|
+
name: string;
|
|
1179
|
+
statements: Array<ts.Statement>;
|
|
1180
|
+
}) => ts.ModuleDeclaration;
|
|
1181
|
+
declare const createIndexedAccessTypeNode: ({
|
|
1182
|
+
indexType,
|
|
1183
|
+
objectType
|
|
1184
|
+
}: {
|
|
1185
|
+
indexType: ts.TypeNode;
|
|
1186
|
+
objectType: ts.TypeNode;
|
|
1187
|
+
}) => ts.IndexedAccessTypeNode;
|
|
1188
|
+
declare const createGetAccessorDeclaration: ({
|
|
1189
|
+
modifiers,
|
|
1190
|
+
name,
|
|
1191
|
+
returnType,
|
|
1192
|
+
statements
|
|
1193
|
+
}: {
|
|
1194
|
+
modifiers?: Modifier | ReadonlyArray<Modifier>;
|
|
1195
|
+
name: string | ts.PropertyName;
|
|
1196
|
+
returnType?: string | ts.Identifier;
|
|
1197
|
+
statements: ReadonlyArray<ts.Statement>;
|
|
1198
|
+
}) => ts.GetAccessorDeclaration;
|
|
1199
|
+
declare const createStringLiteral: ({
|
|
1200
|
+
isSingleQuote,
|
|
1201
|
+
text
|
|
1202
|
+
}: {
|
|
1203
|
+
isSingleQuote?: boolean;
|
|
1204
|
+
text: string;
|
|
1205
|
+
}) => ts.StringLiteral;
|
|
1206
|
+
declare const createConditionalExpression: ({
|
|
1207
|
+
condition,
|
|
1208
|
+
whenFalse,
|
|
1209
|
+
whenTrue
|
|
1210
|
+
}: {
|
|
1211
|
+
condition: ts.Expression;
|
|
1212
|
+
whenFalse: ts.Expression;
|
|
1213
|
+
whenTrue: ts.Expression;
|
|
1214
|
+
}) => ts.ConditionalExpression;
|
|
1215
|
+
declare const createTypeOfExpression: ({
|
|
1216
|
+
text
|
|
1217
|
+
}: {
|
|
1218
|
+
text: string | ts.Identifier;
|
|
1219
|
+
}) => ts.TypeOfExpression;
|
|
1220
|
+
/**
|
|
1221
|
+
* Create a type alias declaration. Example `export type X = Y;`.
|
|
1222
|
+
* @param comment (optional) comments to add
|
|
1223
|
+
* @param name the name of the type
|
|
1224
|
+
* @param type the type
|
|
1225
|
+
* @returns ts.TypeAliasDeclaration
|
|
1226
|
+
*/
|
|
1227
|
+
declare const createTypeAliasDeclaration: ({
|
|
1228
|
+
comment,
|
|
1229
|
+
exportType,
|
|
1230
|
+
name,
|
|
1231
|
+
type,
|
|
1232
|
+
typeParameters
|
|
1233
|
+
}: {
|
|
1234
|
+
comment?: Comments;
|
|
1235
|
+
exportType?: boolean;
|
|
1236
|
+
name: string | ts.TypeReferenceNode;
|
|
1237
|
+
type: string | ts.TypeNode | ts.Identifier;
|
|
1238
|
+
typeParameters?: FunctionTypeParameter[];
|
|
1239
|
+
}) => ts.TypeAliasDeclaration;
|
|
1240
|
+
declare const createTypeReferenceNode: ({
|
|
1241
|
+
typeArguments,
|
|
1242
|
+
typeName
|
|
1243
|
+
}: {
|
|
1244
|
+
typeArguments?: ts.TypeNode[];
|
|
1245
|
+
typeName: string | ts.EntityName;
|
|
1246
|
+
}) => ts.TypeReferenceNode;
|
|
1247
|
+
declare const createTypeParenthesizedNode: ({
|
|
1248
|
+
type
|
|
1249
|
+
}: {
|
|
1250
|
+
type: ts.TypeNode;
|
|
1251
|
+
}) => ts.ParenthesizedTypeNode;
|
|
1252
|
+
declare const createParameterDeclaration: ({
|
|
1253
|
+
initializer,
|
|
1254
|
+
modifiers,
|
|
1255
|
+
name,
|
|
1256
|
+
required,
|
|
1257
|
+
type
|
|
1258
|
+
}: {
|
|
1259
|
+
initializer?: ts.Expression;
|
|
1260
|
+
modifiers?: ReadonlyArray<ts.ModifierLike>;
|
|
1261
|
+
name: string | ts.BindingName;
|
|
1262
|
+
required?: boolean;
|
|
1263
|
+
type?: ts.TypeNode;
|
|
1264
|
+
}) => ts.ParameterDeclaration;
|
|
1265
|
+
declare const createNewExpression: ({
|
|
1266
|
+
argumentsArray,
|
|
1267
|
+
expression,
|
|
1268
|
+
typeArguments
|
|
1269
|
+
}: {
|
|
1270
|
+
argumentsArray?: Array<ts.Expression>;
|
|
1271
|
+
expression: ts.Expression;
|
|
1272
|
+
typeArguments?: Array<ts.TypeNode>;
|
|
1273
|
+
}) => ts.NewExpression;
|
|
1274
|
+
declare const createForOfStatement: ({
|
|
1275
|
+
awaitModifier,
|
|
1276
|
+
expression,
|
|
1277
|
+
initializer,
|
|
1278
|
+
statement
|
|
1279
|
+
}: {
|
|
1280
|
+
awaitModifier?: ts.AwaitKeyword;
|
|
1281
|
+
expression: ts.Expression;
|
|
1282
|
+
initializer: ts.ForInitializer;
|
|
1283
|
+
statement: ts.Statement;
|
|
1284
|
+
}) => ts.ForOfStatement;
|
|
1285
|
+
declare const createAssignment: ({
|
|
1286
|
+
left,
|
|
1287
|
+
right
|
|
1288
|
+
}: {
|
|
1289
|
+
left: ts.Expression;
|
|
1290
|
+
right: ts.Expression;
|
|
1291
|
+
}) => ts.AssignmentExpression<ts.EqualsToken>;
|
|
1292
|
+
declare const createBlock: ({
|
|
1293
|
+
multiLine,
|
|
1294
|
+
statements
|
|
1295
|
+
}: {
|
|
1296
|
+
multiLine?: boolean;
|
|
1297
|
+
statements: ReadonlyArray<ts.Statement>;
|
|
1298
|
+
}) => ts.Block;
|
|
1299
|
+
declare const createPropertyAssignment: ({
|
|
1300
|
+
initializer,
|
|
1301
|
+
name
|
|
1302
|
+
}: {
|
|
1303
|
+
initializer: ts.Expression;
|
|
1304
|
+
name: string | ts.PropertyName;
|
|
1305
|
+
}) => ts.PropertyAssignment;
|
|
1306
|
+
declare const createRegularExpressionLiteral: ({
|
|
1307
|
+
flags,
|
|
1308
|
+
text
|
|
1309
|
+
}: {
|
|
1310
|
+
flags?: ReadonlyArray<"g" | "i" | "m" | "s" | "u" | "y">;
|
|
1311
|
+
text: string;
|
|
1312
|
+
}) => ts.RegularExpressionLiteral;
|
|
1313
|
+
declare const createAsExpression: ({
|
|
1314
|
+
expression,
|
|
1315
|
+
type
|
|
1316
|
+
}: {
|
|
1317
|
+
expression: ts.Expression;
|
|
1318
|
+
type: ts.TypeNode;
|
|
1319
|
+
}) => ts.AsExpression;
|
|
1320
|
+
declare const createTemplateLiteralType: ({
|
|
1321
|
+
value
|
|
1322
|
+
}: {
|
|
1323
|
+
value: ReadonlyArray<string | ts.TypeNode>;
|
|
1324
|
+
}) => ts.TemplateLiteralTypeNode;
|
|
1325
|
+
//#endregion
|
|
1326
|
+
//#region src/tsc/utils.d.ts
|
|
1327
|
+
interface ImportExportItemObject<Name extends string | undefined = string | undefined, Alias extends string | undefined = undefined> {
|
|
1328
|
+
alias?: Alias;
|
|
1329
|
+
asType?: boolean;
|
|
1330
|
+
name: Name;
|
|
1331
|
+
}
|
|
1332
|
+
/**
|
|
1333
|
+
* Print a TypeScript node to a string.
|
|
1334
|
+
* @param node the node to print
|
|
1335
|
+
* @returns string
|
|
1336
|
+
*/
|
|
1337
|
+
declare function tsNodeToString({
|
|
1338
|
+
node,
|
|
1339
|
+
unescape
|
|
1340
|
+
}: {
|
|
1341
|
+
node: ts.Node;
|
|
1342
|
+
unescape?: boolean;
|
|
1343
|
+
}): string;
|
|
1344
|
+
type Modifier = AccessLevel | 'async' | 'export' | 'readonly' | 'static';
|
|
1345
|
+
type CommentLines = Array<string | null | false | undefined>;
|
|
1346
|
+
type CommentObject = {
|
|
1347
|
+
jsdoc?: boolean;
|
|
1348
|
+
lines: CommentLines;
|
|
1349
|
+
};
|
|
1350
|
+
type Comments = CommentLines | Array<CommentObject>;
|
|
920
1351
|
declare namespace module_d_exports {
|
|
921
1352
|
export { ImportExportItem, createCallExpression, createConstVariable, createExportAllDeclaration, createNamedExportDeclarations, createNamedImportDeclarations };
|
|
922
1353
|
}
|
|
@@ -1096,7 +1527,8 @@ declare const tsc: {
|
|
|
1096
1527
|
exportClass,
|
|
1097
1528
|
extendedClasses,
|
|
1098
1529
|
name,
|
|
1099
|
-
nodes
|
|
1530
|
+
nodes,
|
|
1531
|
+
typeParameters
|
|
1100
1532
|
}: {
|
|
1101
1533
|
decorator?: {
|
|
1102
1534
|
args: any[];
|
|
@@ -1106,6 +1538,7 @@ declare const tsc: {
|
|
|
1106
1538
|
extendedClasses?: ReadonlyArray<string>;
|
|
1107
1539
|
name: string;
|
|
1108
1540
|
nodes: ReadonlyArray<typescript0.ClassElement>;
|
|
1541
|
+
typeParameters?: ReadonlyArray<typescript0.TypeParameterDeclaration>;
|
|
1109
1542
|
}) => typescript0.ClassDeclaration;
|
|
1110
1543
|
conditionalExpression: ({
|
|
1111
1544
|
condition,
|
|
@@ -1209,9 +1642,7 @@ declare const tsc: {
|
|
|
1209
1642
|
returnType?: string | typescript0.Identifier;
|
|
1210
1643
|
statements: ReadonlyArray<typescript0.Statement>;
|
|
1211
1644
|
}) => typescript0.GetAccessorDeclaration;
|
|
1212
|
-
identifier: ({
|
|
1213
|
-
text
|
|
1214
|
-
}: {
|
|
1645
|
+
identifier: (args: string | {
|
|
1215
1646
|
text: string;
|
|
1216
1647
|
}) => typescript0.Identifier;
|
|
1217
1648
|
ifStatement: ({
|
|
@@ -1345,6 +1776,13 @@ declare const tsc: {
|
|
|
1345
1776
|
required?: boolean;
|
|
1346
1777
|
type?: typescript0.TypeNode;
|
|
1347
1778
|
}) => typescript0.ParameterDeclaration;
|
|
1779
|
+
prefixUnaryExpression: ({
|
|
1780
|
+
expression,
|
|
1781
|
+
prefix
|
|
1782
|
+
}: {
|
|
1783
|
+
expression: string | typescript0.Expression;
|
|
1784
|
+
prefix: ("!" | "-") | typescript0.PrefixUnaryOperator;
|
|
1785
|
+
}) => typescript0.PrefixUnaryExpression;
|
|
1348
1786
|
propertyAccessExpression: ({
|
|
1349
1787
|
expression,
|
|
1350
1788
|
isOptional,
|
|
@@ -1368,12 +1806,12 @@ declare const tsc: {
|
|
|
1368
1806
|
}) => typescript0.PropertyAssignment;
|
|
1369
1807
|
propertyDeclaration: ({
|
|
1370
1808
|
initializer,
|
|
1371
|
-
|
|
1809
|
+
modifiers,
|
|
1372
1810
|
name,
|
|
1373
1811
|
type
|
|
1374
1812
|
}: {
|
|
1375
1813
|
initializer?: typescript0.Expression;
|
|
1376
|
-
|
|
1814
|
+
modifiers?: Modifier | ReadonlyArray<Modifier>;
|
|
1377
1815
|
name: string | typescript0.PropertyName;
|
|
1378
1816
|
type?: typescript0.TypeNode;
|
|
1379
1817
|
}) => typescript0.PropertyDeclaration;
|
|
@@ -1639,7 +2077,8 @@ declare const compiler: {
|
|
|
1639
2077
|
exportClass,
|
|
1640
2078
|
extendedClasses,
|
|
1641
2079
|
name,
|
|
1642
|
-
nodes
|
|
2080
|
+
nodes,
|
|
2081
|
+
typeParameters
|
|
1643
2082
|
}: {
|
|
1644
2083
|
decorator?: {
|
|
1645
2084
|
args: any[];
|
|
@@ -1649,6 +2088,7 @@ declare const compiler: {
|
|
|
1649
2088
|
extendedClasses?: ReadonlyArray<string>;
|
|
1650
2089
|
name: string;
|
|
1651
2090
|
nodes: ReadonlyArray<typescript0.ClassElement>;
|
|
2091
|
+
typeParameters?: ReadonlyArray<typescript0.TypeParameterDeclaration>;
|
|
1652
2092
|
}) => typescript0.ClassDeclaration;
|
|
1653
2093
|
conditionalExpression: ({
|
|
1654
2094
|
condition,
|
|
@@ -1752,9 +2192,7 @@ declare const compiler: {
|
|
|
1752
2192
|
returnType?: string | typescript0.Identifier;
|
|
1753
2193
|
statements: ReadonlyArray<typescript0.Statement>;
|
|
1754
2194
|
}) => typescript0.GetAccessorDeclaration;
|
|
1755
|
-
identifier: ({
|
|
1756
|
-
text
|
|
1757
|
-
}: {
|
|
2195
|
+
identifier: (args: string | {
|
|
1758
2196
|
text: string;
|
|
1759
2197
|
}) => typescript0.Identifier;
|
|
1760
2198
|
ifStatement: ({
|
|
@@ -1888,6 +2326,13 @@ declare const compiler: {
|
|
|
1888
2326
|
required?: boolean;
|
|
1889
2327
|
type?: typescript0.TypeNode;
|
|
1890
2328
|
}) => typescript0.ParameterDeclaration;
|
|
2329
|
+
prefixUnaryExpression: ({
|
|
2330
|
+
expression,
|
|
2331
|
+
prefix
|
|
2332
|
+
}: {
|
|
2333
|
+
expression: string | typescript0.Expression;
|
|
2334
|
+
prefix: ("!" | "-") | typescript0.PrefixUnaryOperator;
|
|
2335
|
+
}) => typescript0.PrefixUnaryExpression;
|
|
1891
2336
|
propertyAccessExpression: ({
|
|
1892
2337
|
expression,
|
|
1893
2338
|
isOptional,
|
|
@@ -1911,12 +2356,12 @@ declare const compiler: {
|
|
|
1911
2356
|
}) => typescript0.PropertyAssignment;
|
|
1912
2357
|
propertyDeclaration: ({
|
|
1913
2358
|
initializer,
|
|
1914
|
-
|
|
2359
|
+
modifiers,
|
|
1915
2360
|
name,
|
|
1916
2361
|
type
|
|
1917
2362
|
}: {
|
|
1918
2363
|
initializer?: typescript0.Expression;
|
|
1919
|
-
|
|
2364
|
+
modifiers?: Modifier | ReadonlyArray<Modifier>;
|
|
1920
2365
|
name: string | typescript0.PropertyName;
|
|
1921
2366
|
type?: typescript0.TypeNode;
|
|
1922
2367
|
}) => typescript0.PropertyDeclaration;
|
|
@@ -2142,5 +2587,5 @@ declare module '@hey-api/codegen-core' {
|
|
|
2142
2587
|
*/
|
|
2143
2588
|
declare const defineConfig: <T extends MaybeArray<UserConfig>>(config: LazyOrAsync<T>) => Promise<T>;
|
|
2144
2589
|
//#endregion
|
|
2145
|
-
export { type Client as AngularClient, type Client$1 as AxiosClient, type Client$2 as Client, type DefinePlugin, type ExpressionTransformer, type Client$3 as FetchClient, type IR,
|
|
2590
|
+
export { type Client as AngularClient, type Client$1 as AxiosClient, type Client$2 as Client, type DefinePlugin, type ExpressionTransformer, type Client$3 as FetchClient, type IR, Logger, type Client$4 as NextClient, type Client$5 as NuxtClient, type Client$6 as OfetchClient, type OpenApi, type OpenApiMetaObject, type OpenApiOperationObject, type OpenApiParameterObject, type OpenApiRequestBodyObject, type OpenApiResponseObject, type OpenApiSchemaObject, type Plugin, type TypeTransformer, type UserConfig, clientDefaultConfig, clientDefaultMeta, clientPluginHandler, compiler, createClient, defaultPaginationKeywords, defaultPlugins, defineConfig, definePluginConfig, tsc, utils };
|
|
2146
2591
|
//# sourceMappingURL=index.d.cts.map
|