index.d.ts 818 B

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