@types/proxy-lists
TypeScript icon, indicating that this package has built-in type declarations

1.14.5 • Public • Published

Installation

npm install --save @types/proxy-lists

Summary

This package contains type definitions for proxy-lists (https://github.com/chill117/proxy-lists#readme).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/proxy-lists.

index.d.ts

import { EventEmitter } from "events";
import { CoreOptions as RequestOptions } from "request";

export function getProxies(options?: Partial<Options>): GetProxiesEventEmitter;

export function getProxiesFromSource(name: string, options?: Options): GetProxiesEventEmitter;

export function addSource(name: string, source: AddSource): void;

export function listSources(options?: ListSourcesOptions): Source[];

export class GetProxiesEventEmitter extends EventEmitter {
    on(event: "data", listener: (proxies: Proxy[]) => void): this;
    on(event: "error", listener: (error: any) => void): this;
    on(event: "end", listener: () => void): this;
}

export interface Options {
    filterMode?: "strict" | "loose" | undefined;
    countries?: string[] | undefined;
    countriesBlackList?: string[] | undefined;
    protocols?: Protocol[] | undefined;
    anonymityLevels?: AnonymityLevel[] | undefined;
    sourcesWhiteList?: string[] | undefined;
    sourcesBlackList?: string[] | undefined;
    series?: boolean | undefined;
    ipTypes?: IPType[] | undefined;
    defaultRequestOptions?: RequestOptions | undefined;
}

export type Protocol = "http" | "https" | "socks5" | "socks4";

export type AnonymityLevel = "transparent" | "anonymous" | "elite";

export type IPType = "ipv4" | "ipv6";

export interface Proxy {
    ipAddress: string;
    port: number;
    country: string;
    anonymityLevel?: AnonymityLevel | undefined;
    protocols?: Protocol[] | undefined;
    source: string;
    tunnel?: boolean | undefined;
}

export interface InternalOptions extends Options {
    sample?: boolean | undefined;
}

export interface AddSource {
    homeUrl: string;
    getProxies(options: InternalOptions): GetProxiesEventEmitter;
}

export interface ListSourcesOptions {
    sourcesWhiteList?: string[] | undefined;
    sourcesBlackList?: string[] | undefined;
}

export interface Source {
    name: string;
    homeUrl: string;
}

Additional Details

  • Last updated: Tue, 07 Nov 2023 09:09:39 GMT
  • Dependencies: @types/request

Credits

These definitions were written by BehindTheMath.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/proxy-lists

Weekly Downloads

66

Version

1.14.5

License

MIT

Unpacked Size

6.53 kB

Total Files

5

Last publish

Collaborators

  • types