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.fileSystem.on("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.fileSystem.off("publish") * ``` */ export declare type ListenTo = Pick, "addListener" | "removeListener" | "on" | "off">; export declare type FileSystem = { "local-change": { root: CID; path: DistinctivePath>; }; "publish": { root: CID; }; }; export declare function createEmitter(): EventEmitter; export declare function listenTo(emitter: EventEmitter): ListenTo;