@@ -80,7 +80,7 @@ impl ImpitResponse {
8080 }
8181 }
8282
83- fn get_inner_response ( & self , env : & Env , mut this : This < Object > ) -> Result < Object > {
83+ fn get_inner_response ( & self , env : & Env , mut this : This < Object > ) -> Result < Object < ' _ > > {
8484 let cached_response = this. get :: < Object > ( INNER_RESPONSE_PROPERTY_NAME ) ?;
8585
8686 if cached_response. is_none ( ) {
@@ -140,7 +140,7 @@ impl ImpitResponse {
140140 }
141141
142142 #[ napi( ts_return_type = "Promise<ArrayBuffer>" ) ]
143- pub fn array_buffer ( & self , env : & Env , this : This < Object > ) -> Result < Object > {
143+ pub fn array_buffer ( & self , env : & Env , this : This < Object > ) -> Result < Object < ' _ > > {
144144 let response = self . get_inner_response ( env, this) ?;
145145
146146 response
@@ -150,7 +150,7 @@ impl ImpitResponse {
150150 }
151151
152152 #[ napi( ts_return_type = "Promise<Uint8Array>" ) ]
153- pub fn bytes ( & self , env : & Env , this : This < Object > ) -> Result < Object > {
153+ pub fn bytes ( & self , env : & Env , this : This < Object > ) -> Result < Object < ' _ > > {
154154 let array_buffer_promise = self . array_buffer ( env, this) ?;
155155 let then: Function < ' _ , Function < Object , Unknown > , Object > =
156156 array_buffer_promise. get_named_property ( "then" ) ?;
@@ -164,7 +164,7 @@ impl ImpitResponse {
164164 }
165165
166166 #[ napi( ts_return_type = "Promise<string>" ) ]
167- pub fn text ( & self , env : & Env , this : This < Object > ) -> Result < Unknown > {
167+ pub fn text ( & self , env : & Env , this : This < Object > ) -> Result < Unknown < ' _ > > {
168168 let response = self . get_inner_response ( env, this) ?;
169169
170170 response
@@ -173,7 +173,7 @@ impl ImpitResponse {
173173 }
174174
175175 #[ napi( ts_return_type = "Promise<any>" ) ]
176- pub fn json ( & self , env : & Env , this : This < Object > ) -> Result < Unknown > {
176+ pub fn json ( & self , env : & Env , this : This < Object > ) -> Result < Unknown < ' _ > > {
177177 let response = self . get_inner_response ( env, this) ?;
178178
179179 response
@@ -186,7 +186,7 @@ impl ImpitResponse {
186186 js_name = "body" ,
187187 ts_return_type = "ReadableStream<Uint8Array>"
188188 ) ]
189- pub fn body ( & self , env : & Env , this : This < Object > ) -> Result < Object > {
189+ pub fn body ( & self , env : & Env , this : This < Object > ) -> Result < Object < ' _ > > {
190190 let response = self . get_inner_response ( env, this) ?;
191191
192192 response. get_named_property ( "body" )
0 commit comments