mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
Add typings for swagger-ui-react (#37569)
* Typings for swagger-ui-react * Typings for swagger-ui-react * Typings for swagger-ui-react * Typings for swagger-ui-react
This commit is contained in:
parent
79ac56e605
commit
695d1e2dc4
27
types/swagger-ui-react/index.d.ts
vendored
Normal file
27
types/swagger-ui-react/index.d.ts
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
// Type definitions for swagger-ui-react 3.23
|
||||
// Project: https://github.com/swagger-api/swagger-ui#readme
|
||||
// Definitions by: viki.green <https://github.com/VictoriaGreen93>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
import * as React from 'react';
|
||||
|
||||
interface Request {
|
||||
[k: string]: any;
|
||||
}
|
||||
interface Response {
|
||||
[k: string]: any;
|
||||
}
|
||||
type System = any;
|
||||
|
||||
export interface SwaggerUIProps {
|
||||
spec?: object;
|
||||
url?: string;
|
||||
onComplete?: (system: System) => void;
|
||||
requestInterceptor?: (req: Request) => Request | Promise<Request>;
|
||||
responseInterceptor?: (res: Response) => Response | Promise<Response>;
|
||||
docExpansion: 'list' | 'full' | 'none';
|
||||
}
|
||||
|
||||
declare class SwaggerUI extends React.PureComponent<SwaggerUIProps> {}
|
||||
export default SwaggerUI;
|
||||
13
types/swagger-ui-react/swagger-ui-react-tests.tsx
Normal file
13
types/swagger-ui-react/swagger-ui-react-tests.tsx
Normal file
@ -0,0 +1,13 @@
|
||||
import * as React from 'react';
|
||||
import SwaggerUI from 'swagger-ui-react';
|
||||
|
||||
<div>
|
||||
<SwaggerUI
|
||||
docExpansion="none"
|
||||
url="www.example.com/swagger.json"
|
||||
requestInterceptor={request => {
|
||||
console.log(request);
|
||||
return request;
|
||||
}}
|
||||
/>
|
||||
</div>;
|
||||
25
types/swagger-ui-react/tsconfig.json
Normal file
25
types/swagger-ui-react/tsconfig.json
Normal file
@ -0,0 +1,25 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"jsx": "react",
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictFunctionTypes": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"swagger-ui-react-tests.tsx"
|
||||
]
|
||||
}
|
||||
1
types/swagger-ui-react/tslint.json
Normal file
1
types/swagger-ui-react/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Loading…
Reference in New Issue
Block a user