From 38d041569aeb13fb085b4119ffbf3dade824857f Mon Sep 17 00:00:00 2001 From: LongYinan Date: Sun, 7 Jul 2024 21:03:14 +0800 Subject: [PATCH] fix(napi-derive): PromiseRaw typegen --- crates/backend/src/typegen.rs | 2 +- examples/napi/index.d.cts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/backend/src/typegen.rs b/crates/backend/src/typegen.rs index 0665f0dc..99465ed6 100644 --- a/crates/backend/src/typegen.rs +++ b/crates/backend/src/typegen.rs @@ -213,7 +213,7 @@ static KNOWN_TYPES: Lazy> = La ("Either26", ("{} | {} | {} | {} | {} | {} | {} | {} | {} | {} | {} | {} | {} | {} | {} | {} | {} | {} | {} | {} | {} | {} | {} | {} | {} | {}", false, true)), ("external", ("object", false, false)), ("Promise", ("Promise<{}>", false, false)), - ("PromiseRaw", ("PromiseRaw<{}>", false, false)), + ("PromiseRaw", ("Promise<{}>", false, false)), ("AbortSignal", ("AbortSignal", false, false)), ("JsGlobal", ("typeof global", false, false)), ("External", ("ExternalObject<{}>", false, false)), diff --git a/examples/napi/index.d.cts b/examples/napi/index.d.cts index 51f21488..8a55380e 100644 --- a/examples/napi/index.d.cts +++ b/examples/napi/index.d.cts @@ -328,9 +328,9 @@ export declare function callbackReturnPromise(functionInput: () => T | Promis export declare function callbackReturnPromiseAndSpawn(jsFunc: (arg0: string) => Promise): Promise -export declare function callCatchOnPromise(input: PromiseRaw): PromiseRaw +export declare function callCatchOnPromise(input: Promise): Promise -export declare function callFinallyOnPromise(input: PromiseRaw, onFinally: () => void): PromiseRaw +export declare function callFinallyOnPromise(input: Promise, onFinally: () => void): Promise export declare function callFunction(cb: () => number): number @@ -340,7 +340,7 @@ export declare function callFunctionWithArgAndCtx(ctx: Animal, cb: (arg: string) export declare function callLongThreadsafeFunction(tsfn: (err: Error | null, arg: number) => unknown): void -export declare function callThenOnPromise(input: PromiseRaw): PromiseRaw +export declare function callThenOnPromise(input: Promise): Promise export declare function callThreadsafeFunction(tsfn: (err: Error | null, arg: number) => unknown): void