diff options
| author | Adam Malczewski <[email protected]> | 2026-10-24 18:34:12 +0900 |
|---|---|---|
| committer | Adam Malczewski <[email protected]> | 2026-10-24 18:34:12 +0900 |
| commit | 48cdc3d19a319981a8a4128be98db3c283f81790 (patch) | |
| tree | 0fa6531f3b05c81348f9d3427e9021dbb4832b5d /src/features/markdown/types.ts | |
| parent | daefad66bdf8dee132d701a3b43ce0d227dde241 (diff) | |
| download | dispatch-web-48cdc3d19a319981a8a4128be98db3c283f81790.tar.gz dispatch-web-48cdc3d19a319981a8a4128be98db3c283f81790.zip | |
feat: render live text-file embeds in expandable Markdown blocks
Show rendered first/last six-line previews with expand, refresh and retry; bound and deduplicate context-guarded fetches. Verify 2586 tests twice with Node Web Storage compatibility flag, 2 live integration tests, typecheck, Biome and production build.
Diffstat (limited to 'src/features/markdown/types.ts')
| -rw-r--r-- | src/features/markdown/types.ts | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/features/markdown/types.ts b/src/features/markdown/types.ts new file mode 100644 index 0000000..cb3fe8d --- /dev/null +++ b/src/features/markdown/types.ts @@ -0,0 +1,13 @@ +import type { TextFileContextResponse, TextFileResponse } from "@dispatch/transport-contract"; + +export type TextFileState = + | { readonly kind: "loading" } + | { readonly kind: "error"; readonly message: string } + | { readonly kind: "ready"; readonly file: TextFileResponse }; +export interface TextFileClient { + subscribe(path: string, listener: (state: TextFileState) => void): () => void; + /** Refresh context as well as the live on-disk file. */ + refresh(path: string): void; + dispose(): void; +} +export type TextFileContext = TextFileContextResponse; |
