Latest Socket ResearchMalicious Chrome Extension Performs Hidden Affiliate Hijacking.Details
Socket
Book a DemoInstallSign in
Socket

@types/klaw

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/klaw

TypeScript definitions for klaw

ts5.1
ts5.2
ts5.3
ts5.4
ts5.5
ts5.6
ts5.7
ts5.8
ts5.9
ts6.0
latest
Source
npmnpm
Version
3.0.7
Version published
Weekly downloads
494K
-3.35%
Maintainers
1
Weekly downloads
 
Created
Source

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.

index.d.ts

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

declare module "klaw" {
    import * as fs from "fs";
    import { Readable, ReadableOptions } from "stream";

    // forward-compatible iterator type for TS <5.6
    global {
        // eslint-disable-next-line @typescript-eslint/no-empty-interface
        interface AsyncIteratorObject<T, TReturn, TNext> {}
    }
    interface StreamIterator<T> extends AsyncIterator<T, any, any>, AsyncIteratorObject<T, any, any> {
        [Symbol.asyncIterator](): StreamIterator<T>;
    }

    function K(root: string, options?: K.Options): K.Walker;

    namespace K {
        interface Item {
            path: string;
            stats: fs.Stats;
        }

        type QueueMethod = "shift" | "pop";

        interface Options extends ReadableOptions {
            queueMethod?: QueueMethod | undefined;
            pathSorter?: ((pathA: string, pathB: string) => number) | undefined;
            fs?: any; // fs or mock-fs
            filter?: ((path: string) => boolean) | undefined;
            depthLimit?: number | undefined;
            preserveSymlinks?: boolean | undefined;
        }

        type Event = "close" | "data" | "end" | "error" | "pause" | "readable" | "resume";

        interface Walker extends Readable, AsyncIterable<Item> {
            on(event: Event, listener: Function): this;
            on(event: "close", listener: () => void): this;
            on(event: "data", listener: (item: Item) => void): this;
            on(event: "end", listener: () => void): this;
            on(event: "readable", listener: () => void): this;
            on(event: "error", listener: (err: Error) => void): this;
            read(): Item;
            [Symbol.asyncIterator](): StreamIterator<Item>;
        }
    }

    export = K;
}

Additional Details

  • Last updated: Mon, 02 Jun 2025 15:36:26 GMT
  • Dependencies: @types/node

Credits

These definitions were written by Matthew McEachen, and Pascal Sthamer.

FAQs

Package last updated on 02 Jun 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts