Skip to content

Commit 8629494

Browse files
Fix JSRemote return typing and format runtime sources
Co-authored-by: Shelley <shelley@exe.dev>
1 parent f9f8c17 commit 8629494

File tree

2 files changed

+15
-9
lines changed

2 files changed

+15
-9
lines changed

Runtime/src/index.ts

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -283,15 +283,18 @@ export class SwiftRuntime {
283283
const requestHandlers: Partial<
284284
Record<
285285
ITCMethodName,
286-
(message: RequestMessage) => ResponseMessage["data"]["response"]
286+
(
287+
message: RequestMessage,
288+
) => ResponseMessage["data"]["response"]
287289
>
288290
> = {
289291
invokeRemoteJSObjectBody: (message) => {
290292
const invocationContext = message.data.request
291293
.parameters[0] as pointer;
292-
const hasError = this.exports.swjs_invoke_remote_jsobject_body(
293-
invocationContext,
294-
);
294+
const hasError =
295+
this.exports.swjs_invoke_remote_jsobject_body(
296+
invocationContext,
297+
);
295298
return {
296299
ok: true,
297300
value: {
@@ -335,7 +338,8 @@ export class SwiftRuntime {
335338
let returnValue: ResponseMessage["data"]["response"];
336339
try {
337340
const method = message.data.request.method;
338-
const handler = requestHandlers[method] ?? defaultRequestHandler;
341+
const handler =
342+
requestHandlers[method] ?? defaultRequestHandler;
339343
returnValue = handler(message);
340344
} catch (error) {
341345
returnValue = {
@@ -370,7 +374,8 @@ export class SwiftRuntime {
370374
},
371375
onResponse: (message) => {
372376
const method = message.data.requestMethod;
373-
const handler = responseHandlers[method] ?? defaultResponseHandler;
377+
const handler =
378+
responseHandlers[method] ?? defaultResponseHandler;
374379
handler(message);
375380
},
376381
});

Runtime/src/itc.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,10 @@ export class ITCInterface {
117117
return { object: objects, sendingContext, transfer };
118118
}
119119

120-
invokeRemoteJSObjectBody(
121-
invocationContext: pointer,
122-
): { object: undefined; transfer: Transferable[] } {
120+
invokeRemoteJSObjectBody(invocationContext: pointer): {
121+
object: undefined;
122+
transfer: Transferable[];
123+
} {
123124
return { object: undefined, transfer: [] };
124125
}
125126

0 commit comments

Comments
 (0)