Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

editor.ts

18 lines628 Bytes

1import { Schema } from "effect";
2import { TrimmedNonEmptyString } from "./baseSchemas";
3​
4export const EDITORS = [
5 { id: "cursor", label: "Cursor", command: "cursor" },
6 { id: "vscode", label: "VS Code", command: "code" },
7 { id: "zed", label: "Zed", command: "zed" },
8 { id: "file-manager", label: "File Manager", command: null },
9] as const;
10​
11export const EditorId = Schema.Literals(EDITORS.map((e) => e.id));
12export type EditorId = typeof EditorId.Type;
13​
14export const OpenInEditorInput = Schema.Struct({
15 cwd: TrimmedNonEmptyString,
16 editor: EditorId,
17});
18export type OpenInEditorInput = typeof OpenInEditorInput.Type;