27 lines
1.1 KiB
TypeScript
27 lines
1.1 KiB
TypeScript
import { FetchHttpApi } from "./fetch.ts";
|
|
import { type FileType, type IHttpOpts, type Upload, type UploadOpts, type UploadResponse } from "./interface.ts";
|
|
export * from "./interface.ts";
|
|
export * from "./prefix.ts";
|
|
export * from "./errors.ts";
|
|
export * from "./method.ts";
|
|
export * from "./utils.ts";
|
|
export declare class MatrixHttpApi<O extends IHttpOpts> extends FetchHttpApi<O> {
|
|
private uploads;
|
|
/**
|
|
* Upload content to the homeserver
|
|
*
|
|
* @param file - The object to upload. On a browser, something that
|
|
* can be sent to XMLHttpRequest.send (typically a File). Under node.js,
|
|
* a Buffer, String or ReadStream.
|
|
*
|
|
* @param opts - options object
|
|
*
|
|
* @returns Promise which resolves to response object, or rejects with an error (usually a MatrixError).
|
|
* @throws May throw a `MatrixSafetyError` if content is deemed unsafe.
|
|
* @see MatrixSafetyError
|
|
*/
|
|
uploadContent(file: FileType, opts?: UploadOpts): Promise<UploadResponse>;
|
|
cancelUpload(promise: Promise<UploadResponse>): boolean;
|
|
getCurrentUploads(): Upload[];
|
|
}
|
|
//# sourceMappingURL=index.d.ts.map
|