imessage-ts
Version:
TypeScript library for interacting with iMessage on macOS - send messages, monitor chats, and automate responses
46 lines • 1.16 kB
TypeScript
import { DatabaseOptions } from '../types';
/**
* Class to handle access to the iMessage database
*/
export declare class Database {
private sqliteDb;
private options;
constructor(options?: DatabaseOptions);
/**
* Initialize the database connection
*/
initialize(): Promise<void>;
/**
* Close the database connection
*/
close(): void;
/**
* Execute a SQL query and return the results
*/
query<T = any>(sql: string, params?: any): Promise<T[]>;
/**
* Execute a SQL query and return a single result
*/
queryOne<T = any>(sql: string, params?: any): Promise<T | null>;
/**
* Format SQL for sqlite3 (replacing $ params with ?)
*/
private formatSqlForSqlite3;
/**
* Format params for sqlite3 (turns named params into positional params)
*/
private formatParamsForSqlite3;
/**
* Get the database path
*/
getDatabasePath(): string;
/**
* Get the attachments path
*/
getAttachmentsPath(): string;
/**
* Get the poll interval
*/
getPollInterval(): number;
}
//# sourceMappingURL=database.d.ts.map