/* auto-generated by NAPI-RS */ /* eslint-disable */ export declare class ApplicationInfo { processId: number name: string objectId: number constructor(processId: number, name: string, objectId: number) get processGroupId(): number get bundleIdentifier(): string get icon(): Buffer } export declare class ApplicationListChangedSubscriber { unsubscribe(): void } export declare class ApplicationStateChangedSubscriber { unsubscribe(): void } export declare class AudioCaptureSession { get sampleRate(): number get channels(): number get actualSampleRate(): number stop(): void } export declare class ShareableContent { static onApplicationListChanged(callback: ((err: Error | null, ) => void)): ApplicationListChangedSubscriber static onAppStateChanged(app: ApplicationInfo, callback: ((err: Error | null, ) => void)): ApplicationStateChangedSubscriber constructor() static applications(): Array static applicationWithProcessId(processId: number): ApplicationInfo | null static tapAudio(processId: number, audioStreamCallback: ((err: Error | null, arg: Float32Array) => void)): AudioCaptureSession static tapGlobalAudio(excludedProcesses: Array | undefined | null, audioStreamCallback: ((err: Error | null, arg: Float32Array) => void)): AudioCaptureSession static isUsingMicrophone(processId: number): boolean } export declare function decodeAudio(buf: Uint8Array, destSampleRate?: number | undefined | null, filename?: string | undefined | null, signal?: AbortSignal | undefined | null): Promise /** Decode audio file into a Float32Array */ export declare function decodeAudioSync(buf: Uint8Array, destSampleRate?: number | undefined | null, filename?: string | undefined | null): Float32Array export declare function mintChallengeResponse(resource: string, bits?: number | undefined | null): Promise export declare function verifyChallengeResponse(response: string, bits: number, resource: string): Promise export declare class DocStorage { constructor(path: string) validate(): Promise setSpaceId(spaceId: string): Promise } export declare class DocStoragePool { constructor() /** Initialize the database and run migrations. */ connect(universalId: string, path: string): Promise disconnect(universalId: string): Promise checkpoint(universalId: string): Promise crawlDocData(universalId: string, docId: string): Promise setSpaceId(universalId: string, spaceId: string): Promise pushUpdate(universalId: string, docId: string, update: Uint8Array): Promise getDocSnapshot(universalId: string, docId: string): Promise setDocSnapshot(universalId: string, snapshot: DocRecord): Promise getDocUpdates(universalId: string, docId: string): Promise> markUpdatesMerged(universalId: string, docId: string, updates: Array): Promise deleteDoc(universalId: string, docId: string): Promise getDocClocks(universalId: string, after?: Date | undefined | null): Promise> getDocClock(universalId: string, docId: string): Promise getDocIndexedClock(universalId: string, docId: string): Promise setDocIndexedClock(universalId: string, docId: string, indexedClock: Date, indexerVersion: number): Promise clearDocIndexedClock(universalId: string, docId: string): Promise getBlob(universalId: string, key: string): Promise setBlob(universalId: string, blob: SetBlob): Promise deleteBlob(universalId: string, key: string, permanently: boolean): Promise releaseBlobs(universalId: string): Promise listBlobs(universalId: string): Promise> getPeerRemoteClocks(universalId: string, peer: string): Promise> getPeerRemoteClock(universalId: string, peer: string, docId: string): Promise setPeerRemoteClock(universalId: string, peer: string, docId: string, clock: Date): Promise getPeerPulledRemoteClocks(universalId: string, peer: string): Promise> getPeerPulledRemoteClock(universalId: string, peer: string, docId: string): Promise setPeerPulledRemoteClock(universalId: string, peer: string, docId: string, clock: Date): Promise getPeerPushedClocks(universalId: string, peer: string): Promise> getPeerPushedClock(universalId: string, peer: string, docId: string): Promise setPeerPushedClock(universalId: string, peer: string, docId: string, clock: Date): Promise clearClocks(universalId: string): Promise setBlobUploadedAt(universalId: string, peer: string, blobId: string, uploadedAt?: Date | undefined | null): Promise getBlobUploadedAt(universalId: string, peer: string, blobId: string): Promise ftsAddDocument(id: string, indexName: string, docId: string, text: string, index: boolean): Promise ftsFlushIndex(id: string): Promise ftsIndexVersion(): Promise ftsDeleteDocument(id: string, indexName: string, docId: string): Promise ftsGetDocument(id: string, indexName: string, docId: string): Promise ftsSearch(id: string, indexName: string, query: string): Promise> ftsGetMatches(id: string, indexName: string, docId: string, query: string): Promise> } export interface Blob { key: string data: Uint8Array mime: string size: number createdAt: Date } export interface DocClock { docId: string timestamp: Date } export interface DocIndexedClock { docId: string timestamp: Date indexerVersion: number } export interface DocRecord { docId: string bin: Uint8Array timestamp: Date } export interface DocUpdate { docId: string timestamp: Date bin: Uint8Array } export interface ListedBlob { key: string size: number mime: string createdAt: Date } export interface NativeBlockInfo { blockId: string flavour: string content?: Array blob?: Array refDocId?: Array refInfo?: Array parentFlavour?: string parentBlockId?: string additional?: string } export interface NativeCrawlResult { blocks: Array title: string summary: string } export interface NativeMatch { start: number end: number } export interface NativeSearchHit { id: string score: number terms: Array } export interface SetBlob { key: string data: Uint8Array mime: string } export declare class SqliteConnection { constructor(path: string) connect(): Promise addBlob(key: string, blob: Uint8Array): Promise getBlob(key: string): Promise deleteBlob(key: string): Promise getBlobKeys(): Promise> getUpdates(docId?: string | undefined | null): Promise> getDocTimestamps(): Promise> deleteUpdates(docId?: string | undefined | null): Promise getUpdatesCount(docId?: string | undefined | null): Promise getAllUpdates(): Promise> insertUpdates(updates: Array): Promise replaceUpdates(docId: string | undefined | null, updates: Array): Promise getServerClock(key: string): Promise setServerClock(key: string, data: Uint8Array): Promise getServerClockKeys(): Promise> clearServerClock(): Promise delServerClock(key: string): Promise getSyncMetadata(key: string): Promise setSyncMetadata(key: string, data: Uint8Array): Promise getSyncMetadataKeys(): Promise> clearSyncMetadata(): Promise delSyncMetadata(key: string): Promise initVersion(): Promise setVersion(version: number): Promise getMaxVersion(): Promise close(): Promise get isClose(): boolean static validate(path: string): Promise migrateAddDocId(): Promise /** * Flush the WAL file to the database file. * See https://www.sqlite.org/pragma.html#pragma_wal_checkpoint:~:text=PRAGMA%20schema.wal_checkpoint%3B */ checkpoint(): Promise } export interface BlobRow { key: string data: Buffer timestamp: Date } export interface DocTimestampRow { docId?: string timestamp: Date } export interface InsertRow { docId?: string data: Uint8Array } export interface UpdateRow { id: number timestamp: Date data: Buffer docId?: string } export declare enum ValidationResult { MissingTables = 0, MissingDocIdColumn = 1, MissingVersionColumn = 2, GeneralError = 3, Valid = 4 }