curlconverter
Version:
convert curl commands to Python, JavaScript, Go, PHP and more
38 lines (37 loc) • 3.31 kB
TypeScript
import { Word } from "../../shell/Word.js";
import type { Request, Warnings } from "../../parse.js";
import type { QueryList, QueryDict } from "../../Query.js";
import type { FormParam } from "../../curl/form.js";
export declare const javaScriptSupportedArgs: Set<string>;
export declare const nodeSupportedArgs: Set<string>;
export declare const FORBIDDEN_METHODS: string[];
export declare const FORBIDDEN_HEADERS: string[];
export declare function reprObj(value: object, indentLevel?: number): string;
export declare function reprPairs(d: [Word, Word][], indentLevel: number | undefined, indent: string | undefined, list: boolean | undefined, imports: JSImports): string;
export declare function reprAsStringToStringDict(d: [Word, Word][], indentLevel: number | undefined, imports: JSImports, indent?: string): string;
export declare function reprAsStringTuples(d: [Word, Word][], indentLevel: number | undefined, imports: JSImports, indent?: string): string;
export declare function reprStringToStringList(d: [Word, Word | Word[]][], indentLevel: number | undefined, imports: JSImports, indent?: string, list?: boolean): string;
export declare function esc(s: string, quote?: "'" | '"'): string;
export declare function reprStr(s: string, quote?: "'" | '"'): string;
export type JSImports = [string, string][];
export declare function addImport(imports: JSImports, name: string, from: string): void;
export declare function reprImports(imports: JSImports): string;
export declare function reprImportsRequire(imports: JSImports): string;
export declare function repr(w: Word, imports: JSImports): string;
export declare function reprBrowser(w: Word, warnings: [string, string][]): string;
export declare function reprFetch(w: Word, isNode: boolean, imports: JSImports): string;
export declare function asParseFloat(w: Word, imports: JSImports): string;
export declare function asParseFloatTimes1000(w: Word, imports: JSImports): string;
export declare function asParseInt(w: Word, imports: JSImports): string;
export declare function bySecondElem(a: [string, string], b: [string, string]): number;
export declare function toURLSearchParams(query: [QueryList, QueryDict | null | undefined], imports: JSImports, indent?: number): string;
export declare function toDictOrURLSearchParams(query: [QueryList, QueryDict | null | undefined], imports: JSImports, indent?: number): string;
export declare function toFormData(multipartUploads: FormParam[], imports: JSImports, fetchImports: Set<string>, warnings: Warnings, isNode?: boolean): string;
export declare function getData(request: Request, isNode: boolean, imports: JSImports): [string, string | null];
export declare function _toJavaScriptOrNode(requests: Request[], warnings: Warnings, isNode: boolean): string;
export declare function _toJavaScript(requests: Request[], warnings?: Warnings): string;
export declare function _toNode(requests: Request[], warnings?: Warnings): string;
export declare function toJavaScriptWarn(curlCommand: string | string[], warnings?: Warnings): [string, Warnings];
export declare function toJavaScript(curlCommand: string | string[]): string;
export declare function toNodeWarn(curlCommand: string | string[], warnings?: Warnings): [string, Warnings];
export declare function toNode(curlCommand: string | string[]): string;