JSPM

@types/responselike

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

TypeScript definitions for responselike

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/responselike) 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/responselike

    Summary

    This package contains type definitions for responselike (https://github.com/lukechilds/responselike#readme).

    Details

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

    index.d.ts

    /// <reference types="node" />
    
    import { IncomingMessage } from "http";
    import { Stream } from "stream";
    
    export = ResponseLike;
    
    /**
     * Returns a streamable response object similar to a [Node.js HTTP response stream](https://nodejs.org/api/http.html#http_class_http_incomingmessage).
     */
    declare class ResponseLike extends Stream.Readable {
        statusCode: number;
        headers: { [header: string]: string | string[] | undefined };
        body: Buffer;
        url: string;
    
        /**
         * @param statusCode HTTP response status code.
         * @param headers HTTP headers object. Keys will be automatically lowercased.
         * @param body A Buffer containing the response body. The Buffer contents will be streamable but is also exposed directly as `response.body`.
         * @param url Request URL string.
         */
        constructor(
            statusCode: number,
            headers: { [header: string]: string | string[] | undefined },
            body: Buffer,
            url: string,
        );
    }
    

    Additional Details

    • Last updated: Tue, 07 Nov 2023 15:11:36 GMT
    • Dependencies: @types/node

    Credits

    These definitions were written by BendingBender.