Typescript definition #50

Chiuso
aperto 2020-05-29 18:23:34 +00:00 da Ghost · 4 commenti

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; } } ```
Proprietario

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

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.
Proprietario

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 chiuso questo probleam 2020-06-17 16:56:17 +00:00
Autore

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?
Effettua l'accesso per partecipare alla conversazione.
Nessuna etichetta
Nessuna milestone
Nessuna assegnatario
2 Partecipanti
Notifiche
Data di scadenza
La data di scadenza non è valida o fuori intervallo. Si prega di utilizzare il formato 'aaaa-mm-dd'.

Nessuna data di scadenza impostata.

Dipendenze

Nessuna dipendenza impostata.

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