1.14.5 • Published 6 months ago

@types/proxy-lists v1.14.5

Weekly downloads
286
License
MIT
Repository
github
Last release
6 months ago

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

// Type definitions for proxy-lists 1.14
// Project: https://github.com/chill117/proxy-lists#readme
// Definitions by: BehindTheMath <https://github.com/BehindTheMath>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3

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

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: Thu, 08 Jul 2021 20:19:58 GMT
  • Dependencies: @types/request
  • Global values: none

Credits

These definitions were written by BehindTheMath.

1.14.5

6 months ago

1.14.4

7 months ago

1.14.3

8 months ago

1.14.2

3 years ago

1.14.1

4 years ago

1.14.0

6 years ago