Typescript definition #50

Fermé
2020-05-29 18:23:34 +00:00 ouvert par Ghost · 4 commentaires

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; } } ```
Propriétaire

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?
Auteur

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.
Propriétaire

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 a fermé ce ticket 2020-06-17 16:56:17 +00:00.
Auteur

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?
Connectez-vous pour rejoindre cette conversation.
Sans labels
Sans jalon
Sans assignation
2 participants
Notifications
Échéance
La date d’échéance est invalide ou hors plage. Veuillez utiliser le format 'aaaa-mm-dd'.

Aucune échéance n'a été définie.

Dépendances

Aucune dépendance définie.

Référence : root/greenlock-express.js#50
Sans contenu.