From b0d7bf215bc1ab432c895a24065b81ec50d7b8da Mon Sep 17 00:00:00 2001 From: ZHAO Jin-Xiang Date: Fri, 24 Mar 2023 13:40:07 +0800 Subject: [PATCH] fix: type definition for transformRequestOption --- index.d.ts | 4 ++-- package.json | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/index.d.ts b/index.d.ts index 22cde2c..fb25206 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1,2 +1,2 @@ -import { AxiosRequestConfig, AxiosPromise } from 'axios'; -export default function mpAdapter(config: AxiosRequestConfig): AxiosPromise; +import type { AxiosRequestConfig, AxiosPromise } from 'axios'; +export default function mpAdapter(config: AxiosRequestConfig, { transformRequestOption }?: { transformRequestOption?: ((requestOption: any) => any) | undefined }): AxiosPromise; diff --git a/package.json b/package.json index a8e2dc3..cc4a5d4 100755 --- a/package.json +++ b/package.json @@ -5,6 +5,7 @@ "main": "dist/index.js", "jsnext:main": "dist/index.esm.js", "module": "dist/index.esm.js", + "types": "index.d.ts", "miniprogram": "dist/miniprogram", "sideEffects": false, "scripts": { @@ -58,4 +59,4 @@ "dependencies": { "axios": "^0.19.2" } -} \ No newline at end of file +}