|
1 | 1 | <script lang="ts"> |
2 | | - import { apiImplementation, type API, type APINested } from "@kksh/demo-api" |
3 | | - import { IframeParentIO, RPCChannel, type DestroyableIoInterface } from "kkrpc/browser" |
| 2 | + import { apiImplementation } from "@kksh/demo-api" |
| 3 | + import type { API, APINested } from "@kksh/demo-api" |
| 4 | + import { IframeParentIO, RPCChannel } from "kkrpc/browser" |
| 5 | + import type { IoInterface } from "kkrpc/browser" |
4 | 6 | import { onDestroy, onMount } from "svelte" |
5 | 7 | import { toast } from "svelte-sonner" |
6 | 8 |
|
7 | 9 | let iframeRef: HTMLIFrameElement |
8 | 10 | let io: IframeParentIO | undefined |
9 | | - let rpc: RPCChannel<API, APINested, DestroyableIoInterface> |
| 11 | + let rpc: RPCChannel<API, APINested, IoInterface> |
10 | 12 |
|
11 | 13 | function onDestroyClicked(e: MouseEvent) { |
12 | 14 | rpc.getIO().destroy() |
|
18 | 20 | async function onIframeLoad() { |
19 | 21 | if (!iframeRef.contentWindow) return |
20 | 22 | io = new IframeParentIO(iframeRef.contentWindow) |
21 | | - rpc = new RPCChannel<API, APINested, DestroyableIoInterface>(io, { expose: apiImplementation }) |
| 23 | + rpc = new RPCChannel<API, APINested, IoInterface>(io, { expose: apiImplementation }) |
22 | 24 | } |
23 | 25 |
|
24 | 26 | function onMultiplyClicked(e: MouseEvent) { |
|
0 commit comments