util.d.ts 693 B

1234567891011121314151617
  1. import { SocksClientOptions, SocksClientChainOptions } from './constants';
  2. /**
  3. * Error wrapper for SocksClient
  4. */
  5. declare class SocksClientError extends Error {
  6. options: SocksClientOptions | SocksClientChainOptions;
  7. constructor(message: string, options: SocksClientOptions | SocksClientChainOptions);
  8. }
  9. /**
  10. * Shuffles a given array.
  11. * @param array The array to shuffle.
  12. */
  13. declare function shuffleArray(array: any[]): void;
  14. declare type RequireOnlyOne<T, Keys extends keyof T = keyof T> = Pick<T, Exclude<keyof T, Keys>> & {
  15. [K in Keys]?: Required<Pick<T, K>> & Partial<Record<Exclude<Keys, K>, undefined>>;
  16. }[Keys];
  17. export { RequireOnlyOne, SocksClientError, shuffleArray };