mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 21:05:19 +00:00
feat(native): native reader for indexer (#14055)
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import type { CrawlResult } from '@affine/nbstore';
|
||||
|
||||
export interface Blob {
|
||||
key: string;
|
||||
// base64 encoded data
|
||||
@@ -149,4 +151,8 @@ export interface NbStorePlugin {
|
||||
uploadedAt: number | null;
|
||||
}) => Promise<void>;
|
||||
clearClocks: (options: { id: string }) => Promise<void>;
|
||||
crawlDocData: (options: {
|
||||
id: string;
|
||||
docId: string;
|
||||
}) => Promise<CrawlResult>;
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import {
|
||||
} from '@affine/core/modules/workspace-engine';
|
||||
import {
|
||||
type BlobRecord,
|
||||
type CrawlResult,
|
||||
type DocClock,
|
||||
type DocRecord,
|
||||
type ListedBlobRecord,
|
||||
@@ -336,4 +337,10 @@ export const NbStoreNativeDBApis: NativeDBApis = {
|
||||
uploadedAt: uploadedAt ? uploadedAt.getTime() : null,
|
||||
});
|
||||
},
|
||||
crawlDocData: async function (
|
||||
id: string,
|
||||
docId: string
|
||||
): Promise<CrawlResult> {
|
||||
return await NbStore.crawlDocData({ id, docId });
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user