diff --git a/.gitignore b/.gitignore index 9707a23..bdeb873 100755 --- a/.gitignore +++ b/.gitignore @@ -37,4 +37,4 @@ coverage stats.html examples src/node.mjs -lightweight +lightweight/index.js diff --git a/lightweight/index.d.ts b/lightweight/index.d.ts index 912e1a9..f6336fd 100644 --- a/lightweight/index.d.ts +++ b/lightweight/index.d.ts @@ -35,7 +35,7 @@ type ScreenshotOptions = { overlay?: ScreenshotOverlay } -export type MqlOptions = { +type MqlClientOptions = { endpoint?: string; apiKey?: string; retry?: number; @@ -54,7 +54,7 @@ type MqlQueryOptions = { type?: "audio" | "author" | "auto" | "boolean" | "date" | "description" | "email" | "image" | "ip" | "lang" | "logo" | "number" | "object" | "publisher" | "regexp" | "string" | "title" | "url" | "video"; } -export type MicrolinkApiOptions = { +type MicrolinkApiOptions = { adblock?: boolean; animations?: boolean; audio?: boolean; @@ -152,7 +152,7 @@ export type MqlPayload = { headers: { [key: string]: string }; } -export type MqlResponse = MqlPayload & { +type MqlResponse = MqlPayload & { response: { url: string; statusCode: number; @@ -174,9 +174,11 @@ export type MqlError = { url: string; } +export type MqlOptions = MqlClientOptions & MicrolinkApiOptions; + declare function mql( url: string, - opts?: MqlOptions & MicrolinkApiOptions, + opts?: MqlOptions, gotOpts?: object ): Promise; diff --git a/src/node.d.ts b/src/node.d.ts index fdc76c4..e1f8541 100644 --- a/src/node.d.ts +++ b/src/node.d.ts @@ -1,4 +1,4 @@ -import { MqlPayload, MqlOptions, MicrolinkApiOptions } from '../lightweight' +import { MqlPayload, MqlOptions } from '../lightweight' export { MqlError, MqlPayload } from '../lightweight' @@ -14,14 +14,14 @@ export type MqlResponse = MqlPayload & { declare function mql( url: string, - opts?: MqlOptions & MicrolinkApiOptions, + opts?: MqlOptions, gotOpts?: object ): Promise; declare namespace mql { function stream( url: string, - opts?: MqlOptions & MicrolinkApiOptions, + opts?: MqlOptions, gotOpts?: object ): NodeJS.ReadableStream; }