Code Monkey home page Code Monkey logo

Comments (3)

hanspeter1 avatar hanspeter1 commented on July 20, 2024 1
declare module "http2-proxy" {
    import * as Http from "http";
    import * as Http2 from "http2";
    import * as Net from "net";

    function web(req: Http.IncomingMessage | Http2.Http2ServerRequest, res: Http.ServerResponse | Http2.Http2ServerResponse, options: webOptions, callback?: (err: Error, req: Http.IncomingMessage | Http2.Http2ServerRequest, res: Http.ServerResponse | Http2.Http2ServerResponse) => void): void

    function ws(req: Http.IncomingMessage | Http2.Http2ServerRequest, socket: Net.Socket, head: Buffer, options: wsOptions, callback?: (err: Error, req: Http.IncomingMessage | Http2.Http2ServerRequest, socket: Net.Socket, head: Buffer) => void): void

    interface options {
        hostname: string;
        port: number;
        protocol?: "http" | "https";
        path?: string;
        proxyTimeout?: number;
        proxyName?: string;

        onReq?(req: Http.IncomingMessage | Http2.Http2ServerRequest, options: Http.RequestOptions, callback: (err?: Error) => void): void;
    }

    interface webOptions extends options {
        onRes?(req: Http.IncomingMessage | Http2.Http2ServerRequest, res: Http.ServerResponse | Http2.Http2ServerResponse, proxyRes: Http.ServerResponse, callback: () => any): void
    }

    interface wsOptions extends options {
        onRes?(req: Http.IncomingMessage | Http2.Http2ServerRequest, socket: Net.Socket, proxyRes: Http.ServerResponse, callback: () => any): void
    }
}

from node-http2-proxy.

ronag avatar ronag commented on July 20, 2024 1

PR is welcome.

from node-http2-proxy.

masx200 avatar masx200 commented on July 20, 2024

Only one type declaration file is needed, it should be easier.

from node-http2-proxy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.