npm.io
2.0.5 • Published 2 years ago

@types/parcel__watcher

Licence
MIT
Version
2.0.5
Deps
1
Size
5 kB
Vulns
0
Weekly
0
Stars
51.4K

Installation

npm install --save @types/parcel__watcher

Summary

This package contains type definitions for @parcel/watcher (https://github.com/parcel-bundler/watcher#readme).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/parcel__watcher.

index.d.ts

/// <reference types="node"/>

export class ParcelWatcherSubscription {
    unsubscribe(): Promise<void>;
}

export type ParcelWatcherEventType = "create" | "update" | "delete";

export interface ParcelWatcherEvent {
    type: ParcelWatcherEventType;
    path: string;
}

export type ParcelWatcherBackend = "fs-events" | "watchman" | "inotify" | "windows" | "brute-force";

export interface ParcelWatcherOptions {
    ignore?: string[] | undefined;
    backend?: ParcelWatcherBackend | undefined;
}

export type ParcelWatcherCallback = (error?: Error, events?: ParcelWatcherEvent[]) => any;

export function getEventsSince(
    dirPath: string,
    snapshotPath: string,
    options?: ParcelWatcherOptions,
): Promise<ParcelWatcherEvent[]>;

export function subscribe(
    dirPath: string,
    callback: ParcelWatcherCallback,
    options?: ParcelWatcherOptions,
): Promise<ParcelWatcherSubscription>;

export function unsubscribe(
    dirPath: string,
    callback: ParcelWatcherCallback,
    options?: ParcelWatcherOptions,
): Promise<void>;

export function writeSnapshot(dirPath: string, snapshotPath: string, options?: ParcelWatcherOptions): Promise<void>;

Additional Details

  • Last updated: Tue, 07 Nov 2023 0939 GMT
  • Dependencies: @types/node

Credits

These definitions were written by Matt Kane.