Changeset 79a0317 for imaps-frontend/node_modules/chokidar/esm/index.d.ts
Legend:
- Unmodified
- Added
- Removed
-
imaps-frontend/node_modules/chokidar/esm/index.d.ts
r0c6b92a r79a0317 1 /*! chokidar - MIT License (c) 2012 Paul Miller (paulmillr.com) */ 1 2 import { Stats } from 'fs'; 2 3 import { EventEmitter } from 'events'; 3 4 import { ReaddirpStream, ReaddirpOptions, EntryInfo } from 'readdirp'; 4 import { NodeFsHandler, EventName, Path } from './handler.js';5 import { NodeFsHandler, EventName, Path, EVENTS as EV, WatchHandlers } from './handler.js'; 5 6 type AWF = { 6 7 stabilityThreshold: number; … … 34 35 }; 35 36 export type ThrottleType = 'readdir' | 'watch' | 'add' | 'remove' | 'change'; 36 export type EmitArgs = [EventName, Path | Error, any?, any?, any?]; 37 export type EmitArgs = [path: Path, stats?: Stats]; 38 export type EmitErrorArgs = [error: Error, stats?: Stats]; 39 export type EmitArgsWithName = [event: EventName, ...EmitArgs]; 37 40 export type MatchFunction = (val: string, stats?: Stats) => boolean; 38 41 export interface MatcherObject { … … 68 71 filterDir(entry: EntryInfo): boolean; 69 72 } 73 export interface FSWatcherKnownEventMap { 74 [EV.READY]: []; 75 [EV.RAW]: Parameters<WatchHandlers['rawEmitter']>; 76 [EV.ERROR]: Parameters<WatchHandlers['errHandler']>; 77 [EV.ALL]: [event: EventName, ...EmitArgs]; 78 } 79 export type FSWatcherEventMap = FSWatcherKnownEventMap & { 80 [k in Exclude<EventName, keyof FSWatcherKnownEventMap>]: EmitArgs; 81 }; 70 82 /** 71 83 * Watches files & directories for changes. Emitted events: … … 76 88 * .on('add', path => log('File', path, 'was added')) 77 89 */ 78 export declare class FSWatcher extends EventEmitter {90 export declare class FSWatcher extends EventEmitter<FSWatcherEventMap> { 79 91 closed: boolean; 80 92 options: FSWInstanceOptions; … … 86 98 _watched: Map<string, DirEntry>; 87 99 _pendingWrites: Map<string, any>; 88 _pendingUnlinks: Map<string, EmitArgs >;100 _pendingUnlinks: Map<string, EmitArgsWithName>; 89 101 _readyCount: number; 90 102 _emitReady: () => void; … … 92 104 _userIgnored?: MatchFunction; 93 105 _readyEmitted: boolean; 94 _emitRaw: () => void;106 _emitRaw: WatchHandlers['rawEmitter']; 95 107 _boundRemove: (dir: string, item: string) => void; 96 108 _nodeFsHandler: NodeFsHandler; … … 202 214 }; 203 215 export default _default; 204 //# sourceMappingURL=index.d.ts.map
Note:
See TracChangeset
for help on using the changeset viewer.