-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🏷️ move swagger-client types to d.ts
- Loading branch information
1 parent
a7a2e45
commit 44a5be5
Showing
3 changed files
with
28 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,27 @@ | ||
// There are no official types for swagger-client. These has been inspired by: | ||
// - https://github.com/swagger-api/swagger-js/blob/master/src/execute/index.js | ||
declare module 'swagger-client/es/execute' { | ||
export function execute (req: unknown): unknown | ||
import type { Request, Response, SupportedHTTPMethods } from 'swagger-ui' | ||
|
||
export interface ExecuteData { | ||
contextUrl: string; | ||
fetch: (arg: unknown) => unknown; | ||
method: SupportedHTTPMethods; | ||
operation: unknown; | ||
operationId: string; | ||
parameters: unknown; | ||
pathName: string; | ||
requestBody?: unknown; | ||
requestContentType: string; | ||
requestInterceptor?: ((request: Request) => Promise<Request> | Request) | undefined; | ||
responseContentType: string; | ||
responseInterceptor?: ((response: Response) => Promise<Response> | Response) | undefined; | ||
scheme: string; | ||
securities: unknown; | ||
server: string; | ||
serverVariables: unknown; | ||
spec: unknown; | ||
} | ||
function execute (req: ExecuteData): unknown | ||
export { execute } | ||
} |