-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
22 additions
and
76 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
10 changes: 4 additions & 6 deletions
10
src/parts/HandleElectronMessagePort/HandleElectronMessagePort.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,9 @@ | ||
import * as HandleIpc from '../HandleIpc/HandleIpc.ts' | ||
import * as IpcChild from '../IpcChild/IpcChild.ts' | ||
import * as IpcChildType from '../IpcChildType/IpcChildType.ts' | ||
import { ElectronMessagePortRpcClient } from '@lvce-editor/rpc' | ||
import * as CommandMap from '../CommandMap/CommandMap.ts' | ||
|
||
export const handleElectronMessagePort = async (messagePort: any) => { | ||
const ipc = await IpcChild.listen({ | ||
method: IpcChildType.ElectronMessagePort, | ||
await ElectronMessagePortRpcClient.create({ | ||
messagePort, | ||
commandMap: CommandMap.commandMap, | ||
}) | ||
HandleIpc.handleIpc(ipc) | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,9 @@ | ||
import * as IpcChildModule from '../IpcChildModule/IpcChildModule.ts' | ||
|
||
export const listen = async ({ | ||
method, | ||
...params | ||
}: { | ||
method: number | ||
[key: string]: any | ||
}) => { | ||
const module = await IpcChildModule.getModule(method) | ||
export const listen = async ({ method, ...params }: { method: number; [key: string]: any }) => { | ||
const module = IpcChildModule.getModule(method) | ||
// @ts-ignore | ||
const rawIpc = await module.listen(params) | ||
const rpc = await module.create(params) | ||
// @ts-ignore | ||
if (module.signal) { | ||
// @ts-ignore | ||
module.signal(rawIpc) | ||
} | ||
|
||
// @ts-ignore | ||
const ipc = module.wrap(rawIpc) | ||
return ipc | ||
return rpc | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
import * as HandleIpc from '../HandleIpc/HandleIpc.ts' | ||
import * as IpcChild from '../IpcChild/IpcChild.ts' | ||
import * as IpcChildType from '../IpcChildType/IpcChildType.ts' | ||
import * as CommandMap from '../CommandMap/CommandMap.ts' | ||
|
||
export const listen = async () => { | ||
const ipc = await IpcChild.listen({ method: IpcChildType.Auto() }) | ||
HandleIpc.handleIpc(ipc) | ||
await IpcChild.listen({ | ||
method: IpcChildType.Auto(), | ||
commandMap: CommandMap.commandMap, | ||
}) | ||
} |