import type { Delta, FileEvent, PathSpec } from '../types.ts'; import type { WatchQueue } from './queue/base.ts'; export interface CacheInvalidator { invalidateAfterWrite(path: PathSpec): Promise; invalidateAfterUnlink(path: PathSpec): Promise; invalidateSubtree(path: PathSpec): Promise; invalidateAncestors(path: PathSpec): Promise; } export interface WatchMount { readonly prefix: string; readonly cacheManager: CacheInvalidator | null; } export interface WatchRegistry { mountFor(path: string): WatchMount; } export interface DeltaHook { pull(root: PathSpec, checkpoint: string | null): Promise; } /** * Translation of one service notification into mount paths. * * The push counterpart of `DeltaHook`: where a hook pulls and diffs, this * maps a notification the service already delivered. Mirage owns no transport * either way, so the consumer runs the socket, the webhook receiver or the * change stream and passes what arrived here; only the path arithmetic lives * beside the backend, because the naming rules are the backend's and a * consumer reimplementing them drifts. * * A notification that names only a scope maps to `UNKNOWN` on that directory, * which the watcher reads as "re-inventory everything below". That is the * honest answer when the service cannot say more, so a hook never has to * invent a path it was not told about. * */ export interface WatchOptions { queue?: WatchQueue; } export interface WatchRuntime { watch(path: PathSpec | readonly PathSpec[], options?: WatchOptions): AsyncIterable; notify(change: FileEvent): Promise; close(): Promise; } //# sourceMappingURL=base.d.ts.map