// Type definitions for klaw 1.3 // Project: https://github.com/jprichardson/node-klaw // Definitions by: Matthew McEachen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// import * as fs from "fs"; import { Readable, ReadableOptions } from 'stream'; declare function K(root: string, options?: K.Options): K.Walker; declare namespace K { interface Item { path: string; stats: fs.Stats; } type QueueMethod = "shift" | "pop"; interface Options extends ReadableOptions { queueMethod?: QueueMethod; pathSorter?: (pathA: string, pathB: string) => number; fs?: any; // fs or mock-fs filter?: (path: string) => boolean; } type Event = "close" | "data" | "end" | "readable" | "error"; interface Walker { on(event: Event, listener: Function): this; on(event: "close" | "end" | "readable", listener: () => void): this; on(event: "data", listener: (item: Item) => void): this; on(event: "error", listener: (err: Error) => void): this; read(): Item; } } export = K;