Typescript definition #50

已關閉
opened 2020-05-29 18:23:34 +00:00 by Ghost · 4 comment

There was no definition file so ...

It would be very cool if you add the definition (Change it, fix it .. but plz add it ;) )

declare module "greenlock-express" {
    import * as Http from "http";
    import * as Https from "https";
    import * as Http2 from "http2";
    import * as Express from "express";

    function init(options: initOptions): initReturnFunction & initReturnFunctionCluster

    interface initOptions {
        packageRoot: string;
        configDir: string;
        maintainerEmail: string;
        cluster?: boolean
        workers?: number
    }

    interface initReturnFunction {
        serve(func: (req: Http.IncomingMessage | Http2.Http2ServerRequest, res: Http.ServerResponse | Http2.Http2ServerResponse) => void): void;

        serve(express: Express.Application): void;
    }

    interface initReturnFunctionCluster {
        ready(func: (glx: glx) => void): initReturnFunctionCluster;

        master(func: () => void): initReturnFunctionCluster;
    }

    class glx {
        httpServer(): Http.Server;

        httpsServer(func?: (req: Http.IncomingMessage, res: Http.ServerResponse) => void): Https.Server
        httpsServer(serverOptions: null | Https.ServerOptions, func: (req: Http.IncomingMessage, res: Http.ServerResponse) => void): Https.Server

        http2Server(func?: (req: Http.IncomingMessage | Http2.Http2ServerRequest, res: Http.ServerResponse | Http2.Http2ServerResponse) => void): Http2.Http2Server
        http2Server(serverOptions: null | Http2.ServerOptions, func: (req: Http.IncomingMessage | Http2.Http2ServerRequest, res: Http.ServerResponse | Http2.Http2ServerResponse) => void): Http2.Http2Server

        serveApp(func: (req: Http.IncomingMessage | Http2.Http2ServerRequest, res: Http.ServerResponse | Http2.Http2ServerResponse) => void): void;

    }
}
There was no definition file so ... It would be very cool if you add the definition (Change it, fix it .. but plz add it ;) ) ``` declare module "greenlock-express" { import * as Http from "http"; import * as Https from "https"; import * as Http2 from "http2"; import * as Express from "express"; function init(options: initOptions): initReturnFunction & initReturnFunctionCluster interface initOptions { packageRoot: string; configDir: string; maintainerEmail: string; cluster?: boolean workers?: number } interface initReturnFunction { serve(func: (req: Http.IncomingMessage | Http2.Http2ServerRequest, res: Http.ServerResponse | Http2.Http2ServerResponse) => void): void; serve(express: Express.Application): void; } interface initReturnFunctionCluster { ready(func: (glx: glx) => void): initReturnFunctionCluster; master(func: () => void): initReturnFunctionCluster; } class glx { httpServer(): Http.Server; httpsServer(func?: (req: Http.IncomingMessage, res: Http.ServerResponse) => void): Https.Server httpsServer(serverOptions: null | Https.ServerOptions, func: (req: Http.IncomingMessage, res: Http.ServerResponse) => void): Https.Server http2Server(func?: (req: Http.IncomingMessage | Http2.Http2ServerRequest, res: Http.ServerResponse | Http2.Http2ServerResponse) => void): Http2.Http2Server http2Server(serverOptions: null | Http2.ServerOptions, func: (req: Http.IncomingMessage | Http2.Http2ServerRequest, res: Http.ServerResponse | Http2.Http2ServerResponse) => void): Http2.Http2Server serveApp(func: (req: Http.IncomingMessage | Http2.Http2ServerRequest, res: Http.ServerResponse | Http2.Http2ServerResponse) => void): void; } } ```
管理員

I don't know anything about Typescript, but this seems cool.

What would be the best path forward for maintaining this? I'm not the person to do it.

I don't mind putting it in the repo (it's been asked for before), but I also don't want to bear the burden if something changes and it needs updating.

Thoughts?

I don't know anything about Typescript, but this seems cool. What would be the best path forward for maintaining this? I'm not the person to do it. I don't mind putting it in the repo (it's been asked for before), but I also don't want to bear the burden if something changes and it needs updating. Thoughts?
Author

First of all, your API documentation is very confusing. So, my first question is: Are the definitions I created correct?
I love to help by creating the init Typescript definition file for:

  • Greenlock-express
  • Greenlock
  • … and all other plugins

but I cannot go over every commit in the future and change the definitions! That should be part of development.

First of all, your API documentation is very confusing. So, my first question is: Are the definitions I created correct? I love to help by creating the init Typescript definition file for: - Greenlock-express - Greenlock - … and all other plugins but I cannot go over every commit in the future and change the definitions! That should be part of development.
管理員

It looks right at-a-glance.

And, thinking about it, I don't really plan on much changing.

Now that Let's Encrypt / ACME has been fully ratified as RFC 8555, this is probably complete aside from occassional bugfixes and adding documentation.

It looks right at-a-glance. And, thinking about it, I don't really plan on much changing. Now that Let's Encrypt / ACME has been fully ratified as RFC 8555, this is probably complete aside from occassional bugfixes and adding documentation.
Ghost closed this issue 2020-06-17 16:56:17 +00:00
Author

I’d like TypeScript support for Greenlock & Greenlock Express as well. Ideally it’d be bundled with Greenlock itself; can I help make this happen? Or should I consider submitting to DefinitelyTyped instead?

I’d like TypeScript support for Greenlock & Greenlock Express as well. Ideally it’d be bundled with Greenlock itself; can I help make this happen? Or should I consider submitting to [DefinitelyTyped](https://definitelytyped.org) instead?
登入 才能加入這對話。
未選擇標籤
未選擇里程碑
No Assignees
2 參與者
訊息
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: root/greenlock-express.js#50
No description provided.