mirror of
https://github.com/toeverything/AFFiNE.git
synced 2025-10-26 11:37:06 +00:00
|
…
|
||
|---|---|---|
| .. | ||
| __tests__ | ||
| src | ||
| esbuild.config.js | ||
| package.json | ||
| README.md | ||
| tsconfig.json | ||
Affine Blocksuite format YDoc reader
Usage
read rootYDoc
import { readAllDocsFromRootDoc } from '@affine/reader';
const docs = readAllDocsFromRootDoc(rootDoc);
console.log(Array.from(docsWithTrash.entries()));
// [
// 'doc-id-1', { title: 'test doc title' },
// // ...
// ]
read YDoc
import { readAllBlocksFromDoc } from '@affine/reader';
const blocks = readAllBlocksFromDoc(doc);