index.d.ts 885 B

123456789101112131415161718192021
  1. /// <reference types="node" />
  2. import { Url } from 'url';
  3. import { SocksProxy } from 'socks';
  4. import tls from 'tls';
  5. import { AgentOptions } from 'agent-base';
  6. import _SocksProxyAgent from './agent';
  7. declare function createSocksProxyAgent(opts: string | createSocksProxyAgent.SocksProxyAgentOptions): _SocksProxyAgent;
  8. declare namespace createSocksProxyAgent {
  9. interface BaseSocksProxyAgentOptions {
  10. host?: string | null;
  11. port?: string | number | null;
  12. username?: string | null;
  13. tls?: tls.ConnectionOptions | null;
  14. }
  15. export interface SocksProxyAgentOptions extends AgentOptions, BaseSocksProxyAgentOptions, Partial<Omit<Url & SocksProxy, keyof BaseSocksProxyAgentOptions>> {
  16. }
  17. export type SocksProxyAgent = _SocksProxyAgent;
  18. export const SocksProxyAgent: typeof _SocksProxyAgent;
  19. export {};
  20. }
  21. export = createSocksProxyAgent;