globals.d.ts 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. /* tslint:disable */
  2. /* eslint-disable */
  3. /**
  4. * Swagger Petstore - OpenAPI 3.0 - version 1.0.27
  5. *
  6. * This is a sample Pet Store Server based on the OpenAPI 3.0 specification. You can find out more about
  7. Swagger at [https://swagger.io](https://swagger.io). In the third iteration of the pet store, we've switched to the design first approach!
  8. You can now help us improve the API whether it's by making changes to the definition itself or to the code.
  9. That way, with time, we can improve the API in general, and expose some of the new features in OAS3.
  10. Some useful links:
  11. - [The Pet Store repository](https://github.com/swagger-api/swagger-petstore)
  12. - [The source API definition for the Pet Store](https://github.com/swagger-api/swagger-petstore/blob/master/src/main/resources/openapi.yaml)
  13. *
  14. * OpenAPI version: 3.0.4
  15. *
  16. * Contact:
  17. *
  18. * NOTE: This file is auto generated by the alova's vscode plugin.
  19. *
  20. * https://alova.js.org/devtools/vscode
  21. *
  22. * **Do not edit the file manually.**
  23. */
  24. import type { Alova, AlovaMethodCreateConfig, AlovaGenerics, Method } from 'alova';
  25. import type { $$userConfigMap, alovaInstance } from './index';
  26. import type apiDefinitions from './apiDefinitions';
  27. type CollapsedAlova = typeof alovaInstance;
  28. type UserMethodConfigMap = typeof $$userConfigMap;
  29. type Alova2MethodConfig<Responded> =
  30. CollapsedAlova extends Alova<
  31. AlovaGenerics<
  32. any,
  33. any,
  34. infer RequestConfig,
  35. infer Response,
  36. infer ResponseHeader,
  37. infer L1Cache,
  38. infer L2Cache,
  39. infer SE
  40. >
  41. >
  42. ? Omit<
  43. AlovaMethodCreateConfig<
  44. AlovaGenerics<Responded, any, RequestConfig, Response, ResponseHeader, L1Cache, L2Cache, SE>,
  45. any,
  46. Responded
  47. >,
  48. 'params'
  49. >
  50. : never;
  51. // Extract the return type of transform function that define in $$userConfigMap, if it not exists, use the default type.
  52. type ExtractUserDefinedTransformed<
  53. DefinitionKey extends keyof typeof apiDefinitions,
  54. Default
  55. > = DefinitionKey extends keyof UserMethodConfigMap
  56. ? UserMethodConfigMap[DefinitionKey]['transform'] extends (...args: any[]) => any
  57. ? Awaited<ReturnType<UserMethodConfigMap[DefinitionKey]['transform']>>
  58. : Default
  59. : Default;
  60. type Alova2Method<
  61. Responded,
  62. DefinitionKey extends keyof typeof apiDefinitions,
  63. CurrentConfig extends Alova2MethodConfig<any>
  64. > =
  65. CollapsedAlova extends Alova<
  66. AlovaGenerics<
  67. any,
  68. any,
  69. infer RequestConfig,
  70. infer Response,
  71. infer ResponseHeader,
  72. infer L1Cache,
  73. infer L2Cache,
  74. infer SE
  75. >
  76. >
  77. ? Method<
  78. AlovaGenerics<
  79. CurrentConfig extends undefined
  80. ? ExtractUserDefinedTransformed<DefinitionKey, Responded>
  81. : CurrentConfig['transform'] extends (...args: any[]) => any
  82. ? Awaited<ReturnType<CurrentConfig['transform']>>
  83. : ExtractUserDefinedTransformed<DefinitionKey, Responded>,
  84. any,
  85. RequestConfig,
  86. Response,
  87. ResponseHeader,
  88. L1Cache,
  89. L2Cache,
  90. SE
  91. >
  92. >
  93. : never;
  94. export interface ApiResponse {
  95. code?: number;
  96. type?: string;
  97. message?: string;
  98. }
  99. declare global {
  100. interface Apis {
  101. sys: {
  102. auth<
  103. Config extends Alova2MethodConfig<loginModel> & {
  104. data: loginModel;
  105. }
  106. >(
  107. config: Config
  108. ): Alova2Method<loginModel, 'sys.auth', Config>;
  109. }
  110. }
  111. var Apis: Apis;
  112. }
  113. export interface loginModel{
  114. captchaCode?: string;
  115. code?: string;
  116. grant_type?: string;
  117. mobile?: string;
  118. password?: string;
  119. [property: string]: any;
  120. }