Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add .d.ts for TypeScript #21

Open
shuhei opened this issue May 9, 2019 · 2 comments
Open

Add .d.ts for TypeScript #21

shuhei opened this issue May 9, 2019 · 2 comments

Comments

@shuhei
Copy link
Owner

shuhei commented May 9, 2019

No description provided.

@shuhei
Copy link
Owner Author

shuhei commented May 9, 2019

Something like this?

import * as dns from "dns";
import { EventEmitter } from "events";
import OriginalHttpAgent, { HttpsAgent as OriginalHttpsAgent } from "agentkeepalive";

declare interface PollingOptions {
  interval?: number;
  retries?: number;
}

declare class Poller extends EventEmitter {
  constructor(options: PollingOptions): Poller;
  start(): void;
  stop(): void;
  getLookup(): typeof dns.lookup;
}

declare class DnsPolling extends EventEmitter {
  constructor(): DnsPolling;
  getLookup(hostname: string): typeof dns.lookup;
  stop(): void;
}

declare class HttpAgent extends OriginalHttpAgent {
}
declare class HttpsAgent extends OriginalHttpsAgent {
}

@mxs
Copy link

mxs commented Jun 8, 2021

This would be nice!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants