Skip to content

Commit

Permalink
fix(types): expose MqlError
Browse files Browse the repository at this point in the history
  • Loading branch information
Kikobeats committed Oct 5, 2023
1 parent 91b4695 commit de79581
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
13 changes: 10 additions & 3 deletions lightweight/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,6 @@ export type MqlPayload = {
data: MqlResponseData;
statusCode: number;
headers: { [key: string]: string };
more?: string,
code?: string,
url?: string
}

export type MqlResponse = MqlPayload & {
Expand All @@ -164,6 +161,16 @@ export type MqlResponse = MqlPayload & {
};
}

export type MqlError = {
headers: { [key: string]: string };
name: string;
message: string;
status: MqlStatus;
code: string;
more: string;
url: string;
}

declare function mql(
url: string,
opts?: MqlOptions & MicrolinkApiOptions,
Expand Down
2 changes: 1 addition & 1 deletion src/node.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { MqlPayload, MqlOptions, MicrolinkApiOptions } from '../lightweight'

export { MqlPayload } from '../lightweight'
export { MqlError, MqlPayload } from '../lightweight'

export type MqlResponse = MqlPayload & {
response: {
Expand Down

1 comment on commit de79581

@vercel
Copy link

@vercel vercel bot commented on de79581 Oct 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.