mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-10 13:38:49 +08:00
refactor(editor): should not rely on doc collection type (#9501)
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
import { sha } from '@blocksuite/global/utils';
|
||||
import type { Doc, DocCollection, DocSnapshot } from '@blocksuite/store';
|
||||
import type { Doc, DocSnapshot, Workspace } from '@blocksuite/store';
|
||||
import { extMimeMap, getAssetName, Job } from '@blocksuite/store';
|
||||
|
||||
import { download, Unzip, Zip } from '../transformers/utils.js';
|
||||
import { replaceIdMiddleware, titleMiddleware } from './middlewares.js';
|
||||
|
||||
async function exportDocs(collection: DocCollection, docs: Doc[]) {
|
||||
async function exportDocs(collection: Workspace, docs: Doc[]) {
|
||||
const zip = new Zip();
|
||||
const job = new Job({
|
||||
schema: collection.schema,
|
||||
@@ -50,7 +50,7 @@ async function exportDocs(collection: DocCollection, docs: Doc[]) {
|
||||
return download(downloadBlob, `${collection.id}.bs.zip`);
|
||||
}
|
||||
|
||||
async function importDocs(collection: DocCollection, imported: Blob) {
|
||||
async function importDocs(collection: Workspace, imported: Blob) {
|
||||
const unzip = new Unzip();
|
||||
await unzip.load(imported);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user