downtils
Version:
Utilities for the downsided bot
89 lines • 4.07 kB
TypeScript
/// <reference types="node" />
import { ButtonPagination, RepliableInteraction, ButtonPaginationData, ButtonPaginationDataArray, ButtonPaginationInteractionOptions, ButtonPaginationMessageOptions, ButtonPaginationMaxType, ButtonPaginationIconType } from './commands/ButtonPagination.js';
import { handleErrors, EventError } from './commands/handleErrors.js';
/**
* Similiar to fs/promises readdir, however supports extension filtering.
* @param path The path to read
* @param extension The extension to filter by, or null to not filter by extension
* @returns A promise that resolves to an array of file names
*/
export declare function filesIn(path: string, extension?: string | string[] | null): Promise<string[]>;
/**
* Accepts an image url as a parameter and returns a buffer of the image
* @param url The url of the image to convert to a buffer
* @returns A promise that resolves to a buffer of the image
*/
export declare function toBuffer(url: string): Promise<Buffer>;
export declare function dimport(path: string): Promise<any>;
/**
* Module of fs-like functions
*/
export declare const fs: {
filesIn: typeof filesIn;
};
/**
* Module of functions which require requests (axios)
*/
export declare const request: {
toBuffer: typeof toBuffer;
create(config?: import("axios").AxiosRequestConfig<any> | undefined): import("axios").AxiosInstance;
Cancel: import("axios").CancelStatic;
CancelToken: import("axios").CancelTokenStatic;
Axios: typeof import("axios").Axios;
VERSION: string;
isCancel(value: any): boolean;
all<T>(values: (T | Promise<T>)[]): Promise<T[]>;
spread<T_1, R>(callback: (...args: T_1[]) => R): (array: T_1[]) => R;
isAxiosError(payload: any): payload is import("axios").AxiosError<unknown, any>;
defaults: import("axios").AxiosDefaults<any>;
interceptors: {
request: import("axios").AxiosInterceptorManager<import("axios").AxiosRequestConfig<any>>;
response: import("axios").AxiosInterceptorManager<import("axios").AxiosResponse<any, any>>;
};
};
/**
* Utility functions
*/
export declare const utility: {
dimport: typeof dimport;
handleErrors: typeof handleErrors;
};
export declare const discord: {
/**
* Makes a Button paginated message for embeds. Works with repliable interactions as well as messages.
* @param entity The interaction or message to reply to
* @param data The data to paginate
* @param options The pagination options
*/
ButtonPagination: typeof ButtonPagination;
};
export { ButtonPaginationData, ButtonPaginationDataArray, ButtonPaginationInteractionOptions, ButtonPaginationMessageOptions, ButtonPaginationMaxType, ButtonPaginationIconType, RepliableInteraction, EventError };
declare const _default: {
/**
* Makes a Button paginated message for embeds. Works with repliable interactions as well as messages.
* @param entity The interaction or message to reply to
* @param data The data to paginate
* @param options The pagination options
*/
ButtonPagination: typeof ButtonPagination;
dimport: typeof dimport;
handleErrors: typeof handleErrors;
toBuffer: typeof toBuffer;
create(config?: import("axios").AxiosRequestConfig<any> | undefined): import("axios").AxiosInstance;
Cancel: import("axios").CancelStatic;
CancelToken: import("axios").CancelTokenStatic;
Axios: typeof import("axios").Axios;
VERSION: string;
isCancel(value: any): boolean;
all<T>(values: (T | Promise<T>)[]): Promise<T[]>;
spread<T_1, R>(callback: (...args: T_1[]) => R): (array: T_1[]) => R;
isAxiosError(payload: any): payload is import("axios").AxiosError<unknown, any>;
defaults: import("axios").AxiosDefaults<any>;
interceptors: {
request: import("axios").AxiosInterceptorManager<import("axios").AxiosRequestConfig<any>>;
response: import("axios").AxiosInterceptorManager<import("axios").AxiosResponse<any, any>>;
};
filesIn: typeof filesIn;
};
export default _default;
//# sourceMappingURL=index.d.ts.map