JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 415706
  • Score
    100M100P100Q176415F
  • License MIT

TypeScript definitions for klaw

Package Exports

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@types/klaw) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    Installation

    npm install --save @types/klaw

    Summary

    This package contains type definitions for klaw (https://github.com/jprichardson/node-klaw).

    Details

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

    index.d.ts

    // Type definitions for klaw 1.3
    // Project: https://github.com/jprichardson/node-klaw
    // Definitions by: Matthew McEachen <https://github.com/mceachen>
    // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
    
    /// <reference types="node" />
    
    import { Stats } 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: Stats;
        }
    
        type QueueMethod = "shift" | "pop";
    
        interface Options extends ReadableOptions {
            queueMethod?: QueueMethod | undefined;
            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;
    

    Additional Details

    • Last updated: Thu, 14 Sep 2023 01:49:18 GMT
    • Dependencies: @types/node
    • Global values: none

    Credits

    These definitions were written by Matthew McEachen.