I'm in need of assistance with utilizing the Swagger Code Generator to create a TypeScript Fetch client suitable for browser use. Specifically, I am attempting to integrate the generated API client into a TypeScript-based React application.
After successfully generating the client (api.ts file), my progress is hindered by the initial imports that are included:
import * as querystring from "querystring";
import * as url from "url";
import * as isomorphicFetch from "isomorphic-fetch";
import * as assign from "core-js/library/fn/object/assign";
interface Dictionary<T> { [index: string]: T; }
export interface FetchAPI { (url: string, init?: any): Promise<any>; }
...
Even though I managed to locate TypeScript typings (@types) for isomorphic-fetch and core-js, I am unable to find similar typings for querystring and url. Consequently, I encounter a [ts] Cannot find module...
error for the imports of querystring
, url
, and assign
.
I am left wondering if this client was not designed to be used within a browser environment. If it is indeed meant for browser use, I would greatly appreciate any suggestions or guidance on where I may have gone astray.
Thank you in advance for any assistance provided!