Open jyeros opened 4 years ago
I generated a declaration (.d.ts) file containing declare module 'swagger2-postman2'
, it could be used as an started point, but would be nice if there is one official. I needed to add 2 devDependencies
for types, openapi-types
and @types/postman-collection
declare module 'swagger2-to-postmanv2' {
interface ConvertOptions {
requestNameSource?: 'URL' | 'Fallback';
indentCharacter?: 'Space' | 'Tab';
collapseFolders?: boolean;
optimizeConversion?: boolean;
requestParametersResolution?: 'Example' | 'Schema';
exampleParametersResolution?: 'Example' | 'Schema';
folderStrategy?: 'Paths' | 'Tags';
includeAuthInfoInExample?: boolean;
}
type InputDataType = import('openapi-types').OpenAPIV2.Document | string;
interface Input {
type: 'file' | 'json' | 'string';
data: InputDataType;
}
interface OptionDefinition {
name: string;
id: string;
type: string;
default: unknown;
availableOptions: string[];
description: string;
external: boolean;
}
const validate: (
input: Input
) => {
result: boolean;
reason?: string;
};
const convert: <T>(
input: Input,
options: ConvertOptions,
callback: (
err: Error | null,
result: {
result: boolean;
output?: [
{
type: 'collection';
data: import('postman-collection').Collection;
}
];
}
) => T
) => T;
const getOptions: () => OptionDefinition[];
const getMetaData: <T>(
input: InputDataType,
callback: (
err: Error | null,
result: {
result: boolean;
swagger?: import('openapi-types').OpenAPIV2.Document;
reason?: string;
}
) => T
) => T;
}
I am using typescript and install
swagger2-postman2
, but when I import it i got the errorIf i try
npm install @types/swagger2-postman2
the response is no found.Could you provide
.d.ts
file with typescript types.