Typescript definition #50

已关闭
由 Ghost 于 2020-05-29 18:23:34 +00:00 打开 · 4 评论

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?
作者

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.
Ghost2020-06-17 16:56:17 +00:00 关闭此工单
作者

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?
登录 并参与到对话中。
未选择标签
未选择里程碑
未指派成员
2 名参与者
通知
到期时间
到期日期无效或超出范围。请使用 'yyyy-mm-dd' 格式。

未设置到期时间。

依赖工单

没有设置依赖项。

参考:root/greenlock-express.js#50
没有提供说明。