import { SharePointQueryable, SharePointQueryableInstance, SharePointQueryableCollection } from "./sharepointqueryable"; export interface AttachmentFileInfo { name: string; content: string | Blob | ArrayBuffer; } /** * Describes a collection of Item objects * */ export declare class AttachmentFiles extends SharePointQueryableCollection { /** * Creates a new instance of the AttachmentFiles class * * @param baseUrl The url or SharePointQueryable which forms the parent of this attachments collection */ constructor(baseUrl: string | SharePointQueryable, path?: string); /** * Gets a Attachment File by filename * * @param name The name of the file, including extension. */ getByName(name: string): AttachmentFile; /** * Adds a new attachment to the collection. Not supported for batching. * * @param name The name of the file, including extension. * @param content The Base64 file content. */ add(name: string, content: string | Blob | ArrayBuffer): Promise; /** * Adds multiple new attachment to the collection. Not supported for batching. * * @files name The collection of files to add */ addMultiple(files: AttachmentFileInfo[]): Promise; /** * Delete multiple attachments from the collection. Not supported for batching. * * @files name The collection of files to delete */ deleteMultiple(...files: string[]): Promise; /** * Delete multiple attachments from the collection and sends it to recycle bin. Not supported for batching. * * @files name The collection of files to delete */ recycleMultiple(...files: string[]): Promise; } /** * Describes a single attachment file instance * */ export declare class AttachmentFile extends SharePointQueryableInstance { /** * Gets the contents of the file as text * */ getText(): Promise; /** * Gets the contents of the file as a blob, does not work in Node.js * */ getBlob(): Promise; /** * Gets the contents of a file as an ArrayBuffer, works in Node.js */ getBuffer(): Promise; /** * Gets the contents of a file as an ArrayBuffer, works in Node.js */ getJSON(): Promise; /** * Sets the content of a file. Not supported for batching * * @param content The value to set for the file contents */ setContent(content: string | ArrayBuffer | Blob): Promise; /** * Delete this attachment file * * @param eTag Value used in the IF-Match header, by default "*" */ delete(eTag?: string): Promise; /** * Delete this attachment file and send it to Recycle Bin * * @param eTag Value used in the IF-Match header, by default "*" */ recycle(eTag?: string): Promise; } export interface AttachmentFileAddResult { file: AttachmentFile; data: any; }