import { CID } from "./common/cid.js"; import { EventEmitter } from "./common/event-emitter.js"; import { DistinctivePath, Partition, Partitioned } from "./path/index.js"; export { EventEmitter, EventEmitter as Emitter }; /** * Events interface. * * Subscribe to events using `on` and unsubscribe using `off`, * alternatively you can use `addListener` and `removeListener`. * * ```ts * program.on("fileSystem:local-change", ({ path, root }) => { * console.log("The file system has changed locally 🔔") * console.log("Changed path:", path) * console.log("New data root CID:", root) * }) * * program.off("fileSystem:publish") * ``` */ export declare type ListenTo = Pick, "addListener" | "removeListener" | "on" | "off">; export declare type FileSystem = { "fileSystem:local-change": { root: CID; path: DistinctivePath>; }; "fileSystem:publish": { root: CID; }; }; export declare type Session = { "session:create": { session: S; }; "session:destroy": { username: string; }; }; export declare type All = FileSystem & Session; export declare function createEmitter(): EventEmitter; export declare function listenTo(emitter: EventEmitter): ListenTo; export declare function merge(a: EventEmitter, b: EventEmitter): EventEmitter;