From 6b7097c0359bfc25d1cd034db66c8d4800b87e13 Mon Sep 17 00:00:00 2001 From: YujiaCheng1996 Date: Mon, 10 Mar 2025 10:23:34 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E9=9A=90=E8=97=8F=E6=B2=A1=E7=94=A8?= =?UTF-8?q?=E7=9A=84type=20Request?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit address https://github.com/fjc0k/yapi-to-typescript/issues/90 --- src/Generator.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Generator.ts b/src/Generator.ts index 9c04773..1958566 100644 --- a/src/Generator.ts +++ b/src/Generator.ts @@ -508,7 +508,10 @@ export class Generator { } type UserRequestRestArgs = RequestFunctionRestArgs - + ${ !syntheticalConfig.reactHooks || + !syntheticalConfig.reactHooks.enabled + ? '' + : dedent` // Request: 目前 React Hooks 功能有用到 export type Request = ( TRequestConfig['requestDataOptional'] extends true @@ -516,7 +519,7 @@ export class Generator { : (requestData: TRequestData, ...args: RequestFunctionRestArgs) => TRequestResult ) & { requestConfig: TRequestConfig - } + }`} ${content.join('\n\n').trim()} `