import { WatchedData } from '../docs/docs'; declare class Snapshot { #private; constructor(path_: string); /** * Updates the snapshot of the directory being watched. * @returns a Promise that resolves when the snapshot has been updated */ update(): Promise; /** * Registers a handler to be called when the snapshot is updated. * * @param handler - The function to be called when an update occurs. * @param onlyOnce - If true, the handler will be removed after it is called once. * Defaults to false, meaning the handler will be called on every update. * @throws {TypeError} If the handler is not a function. * @throws {TypeError} If onlyOnce is not a boolean. */ onUpdate(handler: () => any, onlyOnce?: boolean): void; /** * Indicates whether the snapshot is currently being updated. * @returns true if the snapshot is being updated, false otherwise. */ get isProcessing(): boolean; /** * Indicates whether the snapshot has been marked as deleted. * @returns true if the snapshot is marked as deleted, false otherwise. */ get isDeleted(): boolean; /** * Returns a Map of the current children of the directory being watched. * The keys of the Map are the paths of the children, and the values are * `WatchedData` objects representing the children. * @returns a Map of the current children of the directory being watched */ get children(): Map; /** * Returns the path of the directory being watched in the snapshot. * @returns The path of the directory being watched. */ get path(): string; /** * Returns a JSON-serializable object representing the current snapshot of the * directory being watched. The object is a nested object where each key is a * file/folder name and each value is either another nested object (if the * value is a folder) or the file/folder name (if the value is a file). This * can be used to serialize the snapshot to a JSON file or send it over a * network connection. * @returns a JSON-serializable object representing the current snapshot * @private */ _toJSON(): SnapshotJSON; /** * Updates the internal path of the snapshot to the specified new path. * @param newPath The new path to set for the snapshot. * @private */ _updatePath(newPath: string): void; } export default Snapshot; type SnapshotJSON = { [path: string]: string | SnapshotJSON; };