diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2235f67..88d3361 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -44,8 +44,11 @@ jobs: uses: actions/setup-node@v3 with: node-version: lts/* - - name: Install - run: npm install --no-package-lock + - name: Setup PNPM + uses: pnpm/action-setup@v2 + with: + version: latest + run_install: true - name: Test run: npm test - name: Report diff --git a/lightweight/index.d.ts b/lightweight/index.d.ts index 178fd6f..7ef7842 100644 --- a/lightweight/index.d.ts +++ b/lightweight/index.d.ts @@ -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 & { @@ -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, diff --git a/src/node.d.ts b/src/node.d.ts index c7b7506..fdc76c4 100644 --- a/src/node.d.ts +++ b/src/node.d.ts @@ -1,6 +1,6 @@ import { MqlPayload, MqlOptions, MicrolinkApiOptions } from '../lightweight' -export { MqlPayload } from '../lightweight' +export { MqlError, MqlPayload } from '../lightweight' export type MqlResponse = MqlPayload & { response: { diff --git a/test/lightweight.test-d.ts b/test/lightweight.test-d.ts index 1512c41..98014a5 100644 --- a/test/lightweight.test-d.ts +++ b/test/lightweight.test-d.ts @@ -98,9 +98,6 @@ console.log(result.status) console.log(result.data) console.log(result.statusCode) console.log(result.headers) -console.log(result.more) -console.log(result.code) -console.log(result.url) /** stream */