mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-26 10:45:57 +08:00
feat(server): impl native reader for server (#14100)
This commit is contained in:
29
packages/backend/native/index.d.ts
vendored
29
packages/backend/native/index.d.ts
vendored
@@ -27,6 +27,29 @@ export declare function mergeUpdatesInApplyWay(updates: Array<Buffer>): Buffer
|
||||
|
||||
export declare function mintChallengeResponse(resource: string, bits?: number | undefined | null): Promise<string>
|
||||
|
||||
export interface NativeBlockInfo {
|
||||
blockId: string
|
||||
flavour: string
|
||||
content?: Array<string>
|
||||
blob?: Array<string>
|
||||
refDocId?: Array<string>
|
||||
refInfo?: Array<string>
|
||||
parentFlavour?: string
|
||||
parentBlockId?: string
|
||||
additional?: string
|
||||
}
|
||||
|
||||
export interface NativeCrawlResult {
|
||||
blocks: Array<NativeBlockInfo>
|
||||
title: string
|
||||
summary: string
|
||||
}
|
||||
|
||||
export interface NativeMarkdownResult {
|
||||
title: string
|
||||
markdown: string
|
||||
}
|
||||
|
||||
export interface ParsedDoc {
|
||||
name: string
|
||||
chunks: Array<Chunk>
|
||||
@@ -34,4 +57,10 @@ export interface ParsedDoc {
|
||||
|
||||
export declare function parseDoc(filePath: string, doc: Buffer): Promise<ParsedDoc>
|
||||
|
||||
export declare function parseDocFromBinary(docBin: Buffer, docId: string): NativeCrawlResult
|
||||
|
||||
export declare function parseDocToMarkdown(docBin: Buffer, docId: string, aiEditable?: boolean | undefined | null): NativeMarkdownResult
|
||||
|
||||
export declare function readAllDocIdsFromRootDoc(docBin: Buffer, includeTrash?: boolean | undefined | null): Array<string>
|
||||
|
||||
export declare function verifyChallengeResponse(response: string, bits: number, resource: string): Promise<boolean>
|
||||
|
||||
Reference in New Issue
Block a user