You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tauri-plugins-workspace/plugins/fs-watch/guest-js/dist/index.d.ts

46 lines
1.1 KiB

import { UnlistenFn } from "@tauri-apps/api/event";
export interface WatchOptions {
recursive?: boolean;
}
export interface DebouncedWatchOptions extends WatchOptions {
delayMs?: number;
}
export interface RawEvent {
path: string | null;
operation: number;
cookie: number | null;
}
export type DebouncedEvent = {
type: "NoticeWrite";
payload: string;
} | {
type: "NoticeRemove";
payload: string;
} | {
type: "Create";
payload: string;
} | {
type: "Write";
payload: string;
} | {
type: "Chmod";
payload: string;
} | {
type: "Remove";
payload: string;
} | {
type: "Rename";
payload: string;
} | {
type: "Rescan";
payload: null;
} | {
type: "Error";
payload: {
error: string;
path: string | null;
};
};
export declare function watch(paths: string | string[], options: DebouncedWatchOptions, cb: (event: DebouncedEvent) => void): Promise<UnlistenFn>;
export declare function watchImmediate(paths: string | string[], options: WatchOptions, cb: (event: RawEvent) => void): Promise<UnlistenFn>;