{"version":3,"file":"types.mjs","names":[],"sources":["../../src/types/types.ts"],"sourcesContent":["//\n// Copyright 2024 DXOS.org\n//\n\nimport { type EditorView } from '@codemirror/view';\nimport * as Schema from 'effect/Schema';\n\n// Runtime data structure.\nexport type Range = {\n  from: number;\n  to: number;\n};\n\n// Persistent data structure.\n// TODO(burdon): Rename annotation?\nexport type Comment = {\n  id: string;\n  cursor?: string;\n};\n\n/**\n * Callback that renders into a DOM element within the editor.\n */\nexport type RenderCallback<Props extends object> = (el: HTMLElement, props: Props, view: EditorView) => void;\n\nexport const EditorViewModes = ['preview', 'readonly', 'source'] as const;\nexport const EditorViewMode = Schema.Union([\n  Schema.Literal('preview').annotate({ title: 'Preview' }),\n  Schema.Literal('readonly').annotate({ title: 'Read-only' }),\n  Schema.Literal('source').annotate({ title: 'Source' }),\n]);\nexport type EditorViewMode = Schema.Schema.Type<typeof EditorViewMode>;\n\nexport const EditorInputModes = ['default', 'vim', 'vscode'] as const;\nexport const EditorInputMode = Schema.Union([\n  Schema.Literal('default').annotate({ title: 'Default' }),\n  Schema.Literal('vim').annotate({ title: 'Vim' }),\n  Schema.Literal('vscode').annotate({ title: 'VS Code' }),\n]);\nexport type EditorInputMode = Schema.Schema.Type<typeof EditorInputMode>;\n"],"mappings":";;AAyBA,IAAa,kBAAkB;CAAC;CAAW;CAAY;AAAQ;AAC/D,IAAa,iBAAiB,OAAO,MAAM;CACzC,OAAO,QAAQ,SAAS,CAAC,CAAC,SAAS,EAAE,OAAO,UAAU,CAAC;CACvD,OAAO,QAAQ,UAAU,CAAC,CAAC,SAAS,EAAE,OAAO,YAAY,CAAC;CAC1D,OAAO,QAAQ,QAAQ,CAAC,CAAC,SAAS,EAAE,OAAO,SAAS,CAAC;AACvD,CAAC;AAGD,IAAa,mBAAmB;CAAC;CAAW;CAAO;AAAQ;AAC3D,IAAa,kBAAkB,OAAO,MAAM;CAC1C,OAAO,QAAQ,SAAS,CAAC,CAAC,SAAS,EAAE,OAAO,UAAU,CAAC;CACvD,OAAO,QAAQ,KAAK,CAAC,CAAC,SAAS,EAAE,OAAO,MAAM,CAAC;CAC/C,OAAO,QAAQ,QAAQ,CAAC,CAAC,SAAS,EAAE,OAAO,UAAU,CAAC;AACxD,CAAC"}