Repository navigation
Expand file tree
/
Copy pathcliCommand.ts
More file actions
43 lines (38 loc) · 1.57 KB
/
Copy pathcliCommand.ts
File metadata and controls
43 lines (38 loc) · 1.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import { DesktopCliCommandStateSchema } from "@t3tools/contracts";
import * as Effect from "effect/Effect";
import * as Schema from "effect/Schema";
import * as DesktopCliCommand from "../../app/DesktopCliCommand.ts";
import * as IpcChannels from "../channels.ts";
import { makeIpcMethod } from "../DesktopIpc.ts";
export const getCliCommandState = makeIpcMethod({
channel: IpcChannels.CLI_COMMAND_GET_STATE_CHANNEL,
payload: Schema.Void,
result: DesktopCliCommandStateSchema,
handler: Effect.fn("desktop.ipc.cliCommand.getState")(function* () {
return yield* (yield* DesktopCliCommand.DesktopCliCommand).state;
}),
});
export const installCliCommand = makeIpcMethod({
channel: IpcChannels.CLI_COMMAND_INSTALL_CHANNEL,
payload: Schema.Void,
result: DesktopCliCommandStateSchema,
handler: Effect.fn("desktop.ipc.cliCommand.install")(function* () {
return yield* (yield* DesktopCliCommand.DesktopCliCommand).install;
}),
});
export const uninstallCliCommand = makeIpcMethod({
channel: IpcChannels.CLI_COMMAND_UNINSTALL_CHANNEL,
payload: Schema.Void,
result: DesktopCliCommandStateSchema,
handler: Effect.fn("desktop.ipc.cliCommand.uninstall")(function* () {
return yield* (yield* DesktopCliCommand.DesktopCliCommand).uninstall;
}),
});
export const addCliCommandToPath = makeIpcMethod({
channel: IpcChannels.CLI_COMMAND_ADD_TO_PATH_CHANNEL,
payload: Schema.Void,
result: DesktopCliCommandStateSchema,
handler: Effect.fn("desktop.ipc.cliCommand.addToPath")(function* () {
return yield* (yield* DesktopCliCommand.DesktopCliCommand).addToPath;
}),
});