import { StateInfo } from "./interfaces"; import { ModelRequestArgs as RequestArgs } from "./argumentTypes"; export declare class Model { stateInfo: StateInfo; /** * Model class; parent class to all worker objects. Used to submit requests, etc. * @param {dictionary} stateInfo - Dictionary containing user-agent, rate limiter, and username/API key if logged in. */ constructor(stateInfo: StateInfo); /** * Send a request to the e621.net servers. * @param {string} query_url - The query url, not including 'https://www.e621.net' * @param {string} method - One of the valid HTTP methods, e.g. POST, PUT, DELETE. * @param multipart - A stream object, used for uploading files to the e621.net server. * @returns - A rate-limited promise, the completion of which contains the response from the server. */ submit_request: ({ query_url, method, multipart, }: RequestArgs) => Promise>; /** * Schedules a download request for a given file. Used to conveniently rate-limit requests for users. * @param {string} file_url - a string of the url desired to download. Must be entire URL, e.g. "https://static.e621.net/etc..." * @returns a stream object of the given url's contents, for consumption by the end-user as desired. */ schedule_download: (file_url: string) => Promise>; /** * Produces an ampersand-delimited string of arguments for passing through to submit_request. * @param query_args - A dictionary containing keys in the form of parameter names, and values representing their arguments. * @returns - An ampersand-delimited string of arguments for passing through to submit_request. */ protected generate_query_url: (query_args: {}) => string; /** * Checks the state-info dictionary to determine if the user is fully logged-in. * @returns True if logged in, false if not */ is_logged_in: () => boolean; }