import { URLSearchParams, URL } from 'url'; import { AxiosRequestConfig } from 'axios'; import { Validator } from './validators.js'; export type SearchParams = Record | [string, string][] | string | URLSearchParams; export declare function params(search: SearchParams): URLSearchParams; /** * Responsible for requesting data from the bugzilla instance handling any * necessary authentication and error handling that must happen. The chief * access is through the `get`, `post` and `put` methods. */ export declare abstract class BugzillaLink { protected readonly instance: URL; constructor(instance: URL); protected abstract request(config: AxiosRequestConfig, validator: Validator): Promise; protected buildURL(path: string, query?: SearchParams): URL; get(path: string, validator: Validator, searchParams?: SearchParams): Promise; post(path: string, validator: Validator, content: R, searchParams?: SearchParams): Promise; put(path: string, validator: Validator, content: R, searchParams?: SearchParams): Promise; } export declare class PublicLink extends BugzillaLink { protected request(config: AxiosRequestConfig, validator: Validator): Promise; } /** * Handles authentication using an API key. */ export declare class ApiKeyLink extends BugzillaLink { private readonly apiKey; constructor(instance: URL, apiKey: string); protected request(config: AxiosRequestConfig, validator: Validator): Promise; } /** * Handles authentication using a username and password. */ export declare class PasswordLink extends BugzillaLink { private readonly username; private readonly password; private readonly restrictLogin; private token; constructor(instance: URL, username: string, password: string, restrictLogin: boolean); private login; protected request(config: AxiosRequestConfig, validator: Validator): Promise; }