import { GlideRecord } from "./GlideRecord"; import { GlideScriptableInputStream } from "./GlideScriptableInputStream"; /** * The Scoped GlideSysAttachment API provides a way to handle attachments */ export declare class GlideSysAttachment { /** * Add single attribute to an existing attachment record */ addAttribute( sysAttachmentID: string, attrKey: string, attrValue: string ): void; /** * Add all attributes to existing attachment record */ addMultipleAttributes( sysAttachmentID: string, attrsKeyValuePair: Map ): void; constructor(); /** * Copies attachments from the source record to the target record. Returns array of sys_ids of the attachments that were copied */ copy( sourceTable: string, sourceID: string, targetTable: string, targetID: string ): Array; /** * Copies attachments from the source record to the target record. Returns array of sys_ids of the attachments that were copied */ static copy( sourceTable: string, sourceID: string, targetTable: string, targetID: string ): Array; /** * Delete all attributes from existing attachment record */ deleteAllAttributes(sysAttachmentID: string): boolean; /** * Deletes the specified attachment */ deleteAttachment(sysAttachmentID: string): void; /** * Delete single attribute from an existing attachment record */ deleteAttribute(sysAttachmentID: string, attrKey: string): boolean; /** * Fetch all attributes from an existing attachment record */ fetchAllAttributes(sysAttachmentID: string): GlideRecord; /** * Fetch a single attribute from an existing attachment record */ fetchAttribute(sysAttachmentID: string, attrKey: string): GlideRecord; /** * Returns a GlideRecord containing the matching attachment metadata such as name, type, or size */ getAttachments(tableName: string, sys_id: string): GlideRecord; /** * Returns the attachment content as a string */ getContent(sysAttachment: GlideRecord): string; /** * Returns the attachment content as a string with base64 encoding */ getContentBase64(sysAttachment: GlideRecord): string; /** * Returns a GlideScriptableInputStream object given the sys_id of an attachment */ getContentStream(sysAttachmentID: string): GlideScriptableInputStream; /** * Update attributes for an existing attachment record */ updateAllAttributes( sysAttachmentID: string, attrsKeyValuePair: Map ): void; /** * Update a single attribute for an existing attachment record */ updateAttribute( sysAttachmentID: string, attrKey: string, attrValue: string ): void; /** * Attaches a specified attachment to the specified record. Returns attachment sys_id or null if the attachment was not added */ write( gr: GlideRecord, fileName: string, contentType: string, content: string ): string; /** * Inserts an attachment for the specified record using base64 encoded content. Returns sys_id of the attachment created */ writeBase64( gr: GlideRecord, fileName: string, contentType: string, contentBase64: string ): string; /** * Inserts an attachment using the input stream. Returns sys_id of the attachment created */ writeContentStream( gr: GlideRecord, fileName: string, contentType: string, is: GlideScriptableInputStream ): string; }