2023-03-27 14:59:36 +08:00
|
|
|
/* auto-generated by NAPI-RS */
|
2023-12-06 08:03:05 +00:00
|
|
|
/* eslint-disable */
|
2025-06-18 13:57:01 +08:00
|
|
|
export declare class ApplicationInfo {
|
|
|
|
processId: number
|
|
|
|
name: string
|
|
|
|
objectId: number
|
|
|
|
constructor(processId: number, name: string, objectId: number)
|
2025-02-27 03:19:52 +00:00
|
|
|
get processGroupId(): number
|
2025-02-18 09:54:59 +00:00
|
|
|
get bundleIdentifier(): string
|
|
|
|
get icon(): Buffer
|
|
|
|
}
|
|
|
|
|
|
|
|
export declare class ApplicationListChangedSubscriber {
|
|
|
|
unsubscribe(): void
|
|
|
|
}
|
|
|
|
|
|
|
|
export declare class ApplicationStateChangedSubscriber {
|
|
|
|
unsubscribe(): void
|
|
|
|
}
|
|
|
|
|
2025-04-21 08:35:32 +00:00
|
|
|
export declare class AudioCaptureSession {
|
2025-02-28 13:24:02 +00:00
|
|
|
get sampleRate(): number
|
|
|
|
get channels(): number
|
2025-04-21 08:35:32 +00:00
|
|
|
get actualSampleRate(): number
|
2025-06-18 13:57:01 +08:00
|
|
|
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<ApplicationInfo>
|
|
|
|
static applicationWithProcessId(processId: number): ApplicationInfo | null
|
|
|
|
static tapAudio(processId: number, audioStreamCallback: ((err: Error | null, arg: Float32Array) => void)): AudioCaptureSession
|
|
|
|
static tapGlobalAudio(excludedProcesses: Array<ApplicationInfo> | undefined | null, audioStreamCallback: ((err: Error | null, arg: Float32Array) => void)): AudioCaptureSession
|
|
|
|
static isUsingMicrophone(processId: number): boolean
|
2025-02-18 09:54:59 +00:00
|
|
|
}
|
|
|
|
|
2025-06-18 13:57:01 +08:00
|
|
|
export declare function decodeAudio(buf: Uint8Array, destSampleRate?: number | undefined | null, filename?: string | undefined | null, signal?: AbortSignal | undefined | null): Promise<Float32Array>
|
|
|
|
|
|
|
|
/** 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<string>
|
|
|
|
|
|
|
|
export declare function verifyChallengeResponse(response: string, bits: number, resource: string): Promise<boolean>
|
2025-01-20 08:48:03 +00:00
|
|
|
export declare class DocStorage {
|
|
|
|
constructor(path: string)
|
|
|
|
validate(): Promise<boolean>
|
|
|
|
setSpaceId(spaceId: string): Promise<void>
|
|
|
|
}
|
|
|
|
|
2025-01-06 09:38:03 +00:00
|
|
|
export declare class DocStoragePool {
|
|
|
|
constructor()
|
2024-12-13 06:13:05 +00:00
|
|
|
/** Initialize the database and run migrations. */
|
2025-01-06 09:38:03 +00:00
|
|
|
connect(universalId: string, path: string): Promise<void>
|
2025-01-20 08:48:03 +00:00
|
|
|
disconnect(universalId: string): Promise<void>
|
|
|
|
checkpoint(universalId: string): Promise<void>
|
2025-01-21 06:07:03 +00:00
|
|
|
setSpaceId(universalId: string, spaceId: string): Promise<void>
|
2025-01-06 09:38:03 +00:00
|
|
|
pushUpdate(universalId: string, docId: string, update: Uint8Array): Promise<Date>
|
|
|
|
getDocSnapshot(universalId: string, docId: string): Promise<DocRecord | null>
|
|
|
|
setDocSnapshot(universalId: string, snapshot: DocRecord): Promise<boolean>
|
|
|
|
getDocUpdates(universalId: string, docId: string): Promise<Array<DocUpdate>>
|
|
|
|
markUpdatesMerged(universalId: string, docId: string, updates: Array<Date>): Promise<number>
|
|
|
|
deleteDoc(universalId: string, docId: string): Promise<void>
|
|
|
|
getDocClocks(universalId: string, after?: Date | undefined | null): Promise<Array<DocClock>>
|
|
|
|
getDocClock(universalId: string, docId: string): Promise<DocClock | null>
|
|
|
|
getBlob(universalId: string, key: string): Promise<Blob | null>
|
|
|
|
setBlob(universalId: string, blob: SetBlob): Promise<void>
|
|
|
|
deleteBlob(universalId: string, key: string, permanently: boolean): Promise<void>
|
|
|
|
releaseBlobs(universalId: string): Promise<void>
|
|
|
|
listBlobs(universalId: string): Promise<Array<ListedBlob>>
|
|
|
|
getPeerRemoteClocks(universalId: string, peer: string): Promise<Array<DocClock>>
|
2025-01-17 00:22:18 +08:00
|
|
|
getPeerRemoteClock(universalId: string, peer: string, docId: string): Promise<DocClock | null>
|
2025-01-06 09:38:03 +00:00
|
|
|
setPeerRemoteClock(universalId: string, peer: string, docId: string, clock: Date): Promise<void>
|
|
|
|
getPeerPulledRemoteClocks(universalId: string, peer: string): Promise<Array<DocClock>>
|
2025-01-17 00:22:18 +08:00
|
|
|
getPeerPulledRemoteClock(universalId: string, peer: string, docId: string): Promise<DocClock | null>
|
2025-01-06 09:38:03 +00:00
|
|
|
setPeerPulledRemoteClock(universalId: string, peer: string, docId: string, clock: Date): Promise<void>
|
|
|
|
getPeerPushedClocks(universalId: string, peer: string): Promise<Array<DocClock>>
|
2025-01-17 00:22:18 +08:00
|
|
|
getPeerPushedClock(universalId: string, peer: string, docId: string): Promise<DocClock | null>
|
2025-01-06 09:38:03 +00:00
|
|
|
setPeerPushedClock(universalId: string, peer: string, docId: string, clock: Date): Promise<void>
|
|
|
|
clearClocks(universalId: string): Promise<void>
|
2025-03-14 18:05:54 +08:00
|
|
|
setBlobUploadedAt(universalId: string, peer: string, blobId: string, uploadedAt?: Date | undefined | null): Promise<void>
|
|
|
|
getBlobUploadedAt(universalId: string, peer: string, blobId: string): Promise<Date | null>
|
2024-12-13 06:13:05 +00:00
|
|
|
}
|
|
|
|
|
2025-06-18 13:57:01 +08:00
|
|
|
export interface Blob {
|
|
|
|
key: string
|
|
|
|
data: Uint8Array
|
|
|
|
mime: string
|
|
|
|
size: number
|
|
|
|
createdAt: Date
|
2025-02-18 09:54:59 +00:00
|
|
|
}
|
|
|
|
|
2025-06-18 13:57:01 +08:00
|
|
|
export interface DocClock {
|
|
|
|
docId: string
|
|
|
|
timestamp: Date
|
2025-02-18 09:54:59 +00:00
|
|
|
}
|
|
|
|
|
2025-06-18 13:57:01 +08:00
|
|
|
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 SetBlob {
|
|
|
|
key: string
|
|
|
|
data: Uint8Array
|
|
|
|
mime: string
|
|
|
|
}
|
2024-07-08 15:04:37 +08:00
|
|
|
export declare class SqliteConnection {
|
2023-10-19 15:17:04 +08:00
|
|
|
constructor(path: string)
|
|
|
|
connect(): Promise<void>
|
|
|
|
addBlob(key: string, blob: Uint8Array): Promise<void>
|
|
|
|
getBlob(key: string): Promise<BlobRow | null>
|
|
|
|
deleteBlob(key: string): Promise<void>
|
|
|
|
getBlobKeys(): Promise<Array<string>>
|
|
|
|
getUpdates(docId?: string | undefined | null): Promise<Array<UpdateRow>>
|
2025-01-20 08:48:03 +00:00
|
|
|
getDocTimestamps(): Promise<Array<DocTimestampRow>>
|
2024-05-16 06:30:53 +00:00
|
|
|
deleteUpdates(docId?: string | undefined | null): Promise<void>
|
2023-10-19 15:17:04 +08:00
|
|
|
getUpdatesCount(docId?: string | undefined | null): Promise<number>
|
|
|
|
getAllUpdates(): Promise<Array<UpdateRow>>
|
|
|
|
insertUpdates(updates: Array<InsertRow>): Promise<void>
|
|
|
|
replaceUpdates(docId: string | undefined | null, updates: Array<InsertRow>): Promise<void>
|
2024-05-16 06:31:04 +00:00
|
|
|
getServerClock(key: string): Promise<BlobRow | null>
|
|
|
|
setServerClock(key: string, data: Uint8Array): Promise<void>
|
|
|
|
getServerClockKeys(): Promise<Array<string>>
|
|
|
|
clearServerClock(): Promise<void>
|
|
|
|
delServerClock(key: string): Promise<void>
|
|
|
|
getSyncMetadata(key: string): Promise<BlobRow | null>
|
|
|
|
setSyncMetadata(key: string, data: Uint8Array): Promise<void>
|
|
|
|
getSyncMetadataKeys(): Promise<Array<string>>
|
|
|
|
clearSyncMetadata(): Promise<void>
|
|
|
|
delSyncMetadata(key: string): Promise<void>
|
2023-10-19 15:17:04 +08:00
|
|
|
initVersion(): Promise<void>
|
|
|
|
setVersion(version: number): Promise<void>
|
|
|
|
getMaxVersion(): Promise<number>
|
|
|
|
close(): Promise<void>
|
|
|
|
get isClose(): boolean
|
|
|
|
static validate(path: string): Promise<ValidationResult>
|
|
|
|
migrateAddDocId(): Promise<void>
|
2024-09-25 04:06:03 +00:00
|
|
|
/**
|
|
|
|
* 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<void>
|
2023-06-07 14:52:19 +08:00
|
|
|
}
|
2023-12-06 08:03:05 +00:00
|
|
|
|
|
|
|
export interface BlobRow {
|
|
|
|
key: string
|
|
|
|
data: Buffer
|
|
|
|
timestamp: Date
|
|
|
|
}
|
|
|
|
|
2025-01-20 08:48:03 +00:00
|
|
|
export interface DocTimestampRow {
|
|
|
|
docId?: string
|
|
|
|
timestamp: Date
|
|
|
|
}
|
|
|
|
|
2023-12-06 08:03:05 +00:00
|
|
|
export interface InsertRow {
|
|
|
|
docId?: string
|
|
|
|
data: Uint8Array
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface UpdateRow {
|
|
|
|
id: number
|
|
|
|
timestamp: Date
|
|
|
|
data: Buffer
|
|
|
|
docId?: string
|
|
|
|
}
|
|
|
|
|
2024-07-08 15:04:37 +08:00
|
|
|
export declare enum ValidationResult {
|
2023-12-06 08:03:05 +00:00
|
|
|
MissingTables = 0,
|
|
|
|
MissingDocIdColumn = 1,
|
|
|
|
MissingVersionColumn = 2,
|
|
|
|
GeneralError = 3,
|
|
|
|
Valid = 4
|
|
|
|
}
|