27 lines
966 B
TypeScript
27 lines
966 B
TypeScript
/**
|
|
* Minimal key-value storage adapter.
|
|
* Pass `localStorage` in browser environments, or any Map-backed adapter for Node.js / tests.
|
|
*/
|
|
export interface IPluginStorage {
|
|
getItem(key: string): string | null;
|
|
setItem(key: string, value: string): void;
|
|
}
|
|
/**
|
|
* Minimal event emitter interface for the plugin events API.
|
|
* Compatible with Node.js EventEmitter, matrix-js-sdk MatrixClient, and similar clients.
|
|
*/
|
|
export interface IPluginEventClient {
|
|
on(event: string, handler: (...args: any[]) => void): void;
|
|
off(event: string, handler: (...args: any[]) => void): void;
|
|
}
|
|
/**
|
|
* In-memory storage implementation — used as the default when no storage adapter is provided.
|
|
*/
|
|
export declare class MemoryStorage implements IPluginStorage {
|
|
private readonly store;
|
|
/** @inheritdoc */
|
|
getItem(key: string): string | null;
|
|
/** @inheritdoc */
|
|
setItem(key: string, value: string): void;
|
|
}
|
|
//# sourceMappingURL=interfaces.d.ts.map
|