Typescript definition #50

Closed
by Ghost opened 4 years ago · 4 comments
Ghost commented 4 years ago

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

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

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 4 years ago

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?
Sign in to join this conversation.
No Label
No Milestone
No Assignees
2 Participants
Notifications
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.