UNPKG

groupdocs-annotation-cloud

Version:
1,518 lines (1,517 loc) 33.5 kB
/// <reference types="node" /> /** * Defines options for annotating documents */ export declare class AnnotateOptions { /** * Attribute type map */ static attributeTypeMap: Array<{ name: string; baseName: string; type: string; }>; /** * Returns attribute type map */ static getAttributeTypeMap(): { name: string; baseName: string; type: string; }[]; /** * Input document description */ fileInfo: FileInfo; /** * List of annotations to add to the document */ annotations: Array<AnnotationInfo>; /** * First page number when saving page range */ firstPage: number; /** * Last page number when saving page range */ lastPage: number; /** * Indicates whether to save only annotated pages */ onlyAnnotatedPages: boolean; /** * Path to output document in the cloud storage. Required for Add method. Not required if Annotate (with file result) method used. */ outputPath: string; /** * The path to directory containing custom fonts in storage */ fontsPath: string; constructor(init?: Partial<AnnotateOptions>); } /** * Describes annotation properties */ export declare class AnnotationInfo { /** * Attribute type map */ static attributeTypeMap: Array<{ name: string; baseName: string; type: string; }>; /** * Returns attribute type map */ static getAttributeTypeMap(): { name: string; baseName: string; type: string; }[]; /** * Gets or sets the unique identifier */ id: number; /** * Gets or sets the annotation text */ text: string; /** * GGets or sets text to be replaced */ textToReplace: string; /** * Gets or sets text horizontal alignment */ horizontalAlignment: AnnotationInfo.HorizontalAlignmentEnum; /** * Gets or sets text vertical alignment */ verticalAlignment: AnnotationInfo.VerticalAlignmentEnum; /** * Gets or sets the creator unique identifier */ creatorId: number; /** * Gets or sets the name of the creator */ creatorName: string; /** * Gets or sets the creator's email */ creatorEmail: string; /** * Gets or sets the box where annotation will be placed */ box: Rectangle; /** * Gets or sets collection of points that describe rectangles with text */ points: Array<Point>; /** * Gets or sets the number of page where annotation will be placed */ pageNumber: number; /** * Gets or sets the annotation position */ annotationPosition: Point; /** * Gets or sets the annotation SVG path */ svgPath: string; /** * Gets or sets the annotation type */ type: AnnotationInfo.TypeEnum; /** * Gets or sets the array of annotation replies */ replies: Array<AnnotationReplyInfo>; /** * Gets or sets the annotation created on date */ createdOn: Date; /** * Gets or sets the annotation's font color */ fontColor: number; /** * Gets or sets the annotation's pen color */ penColor: number; /** * Gets or sets the annotation's pen width */ penWidth: number; /** * Gets or sets the annotation's pen style */ penStyle: AnnotationInfo.PenStyleEnum; /** * Gets or sets the annotation's background color */ backgroundColor: number; /** * Gets or sets annotation color */ squigglyColor: number; /** * Gets or sets the annotation's font family */ fontFamily: string; /** * Gets or sets the annotation's font size */ fontSize: number; /** * Gets or sets the annotation's opacity */ opacity: number; /** * Gets or sets the watermark annotation's rotation angle */ angle: number; /** * Gets or sets z-index. Default value is 0 The z-index property specifies the stack order of an element. */ zIndex: number; /** * Gets or sets annotation link url */ url: string; /** * Gets or sets image file path in cloud storage, for Image annotations */ imagePath: string; /** * Sets auto scale for watermark annotation */ autoScale: boolean; constructor(init?: Partial<AnnotationInfo>); } export declare namespace AnnotationInfo { enum HorizontalAlignmentEnum { None, Left, Center, Right } enum VerticalAlignmentEnum { None, Top, Center, Bottom } enum TypeEnum { None, Area, Arrow, Distance, Ellipse, Link, Point, Polyline, ResourcesRedaction, TextField, TextHighlight, TextRedaction, TextReplacement, TextStrikeout, TextUnderline, Watermark, Image, TextSquiggly } enum PenStyleEnum { Solid, Dash, DashDot, Dot, LongDash, DashDotDot } } /** * Describes annotation reply properties */ export declare class AnnotationReplyInfo { /** * Attribute type map */ static attributeTypeMap: Array<{ name: string; baseName: string; type: string; }>; /** * Returns attribute type map */ static getAttributeTypeMap(): { name: string; baseName: string; type: string; }[]; /** * Gets or sets the unique identifier */ id: number; /** * Gets or sets the user's unique identifier */ userId: number; /** * Gets or sets the user's name */ userName: string; /** * Gets or sets the user email */ userEmail: string; /** * Gets or sets the message */ comment: string; /** * Gets or sets the reply time */ repliedOn: Date; /** * Gets or sets the parent reply unique identifier */ parentReplyId: number; constructor(init?: Partial<AnnotationReplyInfo>); } export declare class ApiError { /** * Attribute type map */ static attributeTypeMap: Array<{ name: string; baseName: string; type: string; }>; /** * Returns attribute type map */ static getAttributeTypeMap(): { name: string; baseName: string; type: string; }[]; code: string; message: string; description: string; dateTime: Date; innerError: ApiError; constructor(init?: Partial<ApiError>); } export declare class ApiErrorResponse { /** * Attribute type map */ static attributeTypeMap: Array<{ name: string; baseName: string; type: string; }>; /** * Returns attribute type map */ static getAttributeTypeMap(): { name: string; baseName: string; type: string; }[]; requestId: string; error: ApiError; constructor(init?: Partial<ApiErrorResponse>); } /** * Metered license consumption information */ export declare class ConsumptionResult { /** * Attribute type map */ static attributeTypeMap: Array<{ name: string; baseName: string; type: string; }>; /** * Returns attribute type map */ static getAttributeTypeMap(): { name: string; baseName: string; type: string; }[]; /** * Amount of used credits */ credit: number; /** * Amount of MBs processed */ quantity: number; /** * Billed API calls number */ billedApiCalls: number; constructor(init?: Partial<ConsumptionResult>); } /** * Class for disc space information. */ export declare class DiscUsage { /** * Attribute type map */ static attributeTypeMap: Array<{ name: string; baseName: string; type: string; }>; /** * Returns attribute type map */ static getAttributeTypeMap(): { name: string; baseName: string; type: string; }[]; /** * Application used disc space. */ usedSize: number; /** * Total disc space. */ totalSize: number; constructor(init?: Partial<DiscUsage>); } /** * Describes document basic info */ export declare class DocumentInfo { /** * Attribute type map */ static attributeTypeMap: Array<{ name: string; baseName: string; type: string; }>; /** * Returns attribute type map */ static getAttributeTypeMap(): { name: string; baseName: string; type: string; }[]; /** * Gets or sets the document name */ name: string; /** * Gets or sets the document path */ path: string; /** * Gets or sets the document extension */ extension: string; /** * Gets or sets the file format */ fileFormat: string; /** * Gets or sets the document size */ size: number; /** * Gets or sets the document date modified */ dateModified: Date; /** * Gets or sets the pages */ pages: Array<PageInfo>; constructor(init?: Partial<DocumentInfo>); } /** * The error details */ export declare class ErrorDetails { /** * Attribute type map */ static attributeTypeMap: Array<{ name: string; baseName: string; type: string; }>; /** * Returns attribute type map */ static getAttributeTypeMap(): { name: string; baseName: string; type: string; }[]; /** * The request id */ requestId: string; /** * Date */ date: Date; constructor(init?: Partial<ErrorDetails>); } /** * File info */ export declare class FileInfo { /** * Attribute type map */ static attributeTypeMap: Array<{ name: string; baseName: string; type: string; }>; /** * Returns attribute type map */ static getAttributeTypeMap(): { name: string; baseName: string; type: string; }[]; /** * File path in storage */ filePath: string; /** * Storage name */ storageName: string; /** * Version ID */ versionId: string; /** * Password to open file */ password: string; constructor(init?: Partial<FileInfo>); } /** * File versions FileVersion. */ export declare class FileVersions { /** * Attribute type map */ static attributeTypeMap: Array<{ name: string; baseName: string; type: string; }>; /** * Returns attribute type map */ static getAttributeTypeMap(): { name: string; baseName: string; type: string; }[]; /** * File versions FileVersion. */ value: Array<FileVersion>; constructor(init?: Partial<FileVersions>); } /** * Files list */ export declare class FilesList { /** * Attribute type map */ static attributeTypeMap: Array<{ name: string; baseName: string; type: string; }>; /** * Returns attribute type map */ static getAttributeTypeMap(): { name: string; baseName: string; type: string; }[]; /** * Files and folders contained by folder StorageFile. */ value: Array<StorageFile>; constructor(init?: Partial<FilesList>); } /** * File upload result */ export declare class FilesUploadResult { /** * Attribute type map */ static attributeTypeMap: Array<{ name: string; baseName: string; type: string; }>; /** * Returns attribute type map */ static getAttributeTypeMap(): { name: string; baseName: string; type: string; }[]; /** * List of uploaded file names */ uploaded: Array<string>; /** * List of errors. */ errors: Array<Error>; constructor(init?: Partial<FilesUploadResult>); } /** * File format */ export declare class Format { /** * Attribute type map */ static attributeTypeMap: Array<{ name: string; baseName: string; type: string; }>; /** * Returns attribute type map */ static getAttributeTypeMap(): { name: string; baseName: string; type: string; }[]; /** * File format extension */ extension: string; /** * File format name */ fileFormat: string; constructor(init?: Partial<Format>); } /** * Describes object which contains list of supported file formats */ export declare class FormatsResult { /** * Attribute type map */ static attributeTypeMap: Array<{ name: string; baseName: string; type: string; }>; /** * Returns attribute type map */ static getAttributeTypeMap(): { name: string; baseName: string; type: string; }[]; /** * Supported file formats */ formats: Array<Format>; constructor(init?: Partial<FormatsResult>); } /** * Provides information for the object link This is supposed to be an atom:link, therefore it should have all attributes specified here http://tools.ietf.org/html/rfc4287#section-4.2.7 */ export declare class Link { /** * Attribute type map */ static attributeTypeMap: Array<{ name: string; baseName: string; type: string; }>; /** * Returns attribute type map */ static getAttributeTypeMap(): { name: string; baseName: string; type: string; }[]; /** * The \"href\" attribute contains the link's IRI. atom:link elements MUST have an href attribute, whose value MUST be a IRI reference */ href: string; /** * atom:link elements MAY have a \"rel\" attribute that indicates the link relation type. If the \"rel\" attribute is not present, the link element MUST be interpreted as if the link relation type is \"alternate\" */ rel: string; /** * On the link element, the \"type\" attribute's value is an advisory media type: it is a hint about the type of the representation that is expected to be returned when the value of the href attribute is dereferenced. Note that the type attribute does not override the actual media type returned with the representation */ type: string; /** * The \"title\" attribute conveys human-readable information about the link. The content of the \"title\" attribute is Language-Sensitive */ title: string; constructor(init?: Partial<Link>); } /** * Reference to document */ export declare class LinkElement { /** * Attribute type map */ static attributeTypeMap: Array<{ name: string; baseName: string; type: string; }>; /** * Returns attribute type map */ static getAttributeTypeMap(): { name: string; baseName: string; type: string; }[]; /** * Link to the document */ link: AnnotationApiLink; constructor(init?: Partial<LinkElement>); } /** * Error */ export declare class ModelError { /** * Attribute type map */ static attributeTypeMap: Array<{ name: string; baseName: string; type: string; }>; /** * Returns attribute type map */ static getAttributeTypeMap(): { name: string; baseName: string; type: string; }[]; /** * Code */ code: string; /** * Message */ message: string; /** * Description */ description: string; /** * Inner Error */ innerError: ErrorDetails; constructor(init?: Partial<ModelError>); } /** * Object exists */ export declare class ObjectExist { /** * Attribute type map */ static attributeTypeMap: Array<{ name: string; baseName: string; type: string; }>; /** * Returns attribute type map */ static getAttributeTypeMap(): { name: string; baseName: string; type: string; }[]; /** * Indicates that the file or folder exists. */ exists: boolean; /** * True if it is a folder, false if it is a file. */ isFolder: boolean; constructor(init?: Partial<ObjectExist>); } /** * Represents collection of document pages image representations */ export declare class PageImages { /** * Attribute type map */ static attributeTypeMap: Array<{ name: string; baseName: string; type: string; }>; /** * Returns attribute type map */ static getAttributeTypeMap(): { name: string; baseName: string; type: string; }[]; /** * The total count of page image entries in collection */ totalCount: number; /** * The collection of pages image representations */ entries: Array<PageImage>; constructor(init?: Partial<PageImages>); } /** * Describes page information */ export declare class PageInfo { /** * Attribute type map */ static attributeTypeMap: Array<{ name: string; baseName: string; type: string; }>; /** * Returns attribute type map */ static getAttributeTypeMap(): { name: string; baseName: string; type: string; }[]; /** * Gets or sets the page number */ number: number; /** * Gets or sets the page width */ width: number; /** * Gets or sets the page height */ height: number; constructor(init?: Partial<PageInfo>); } /** * Describes point where annotation will be placed */ export declare class Point { /** * Attribute type map */ static attributeTypeMap: Array<{ name: string; baseName: string; type: string; }>; /** * Returns attribute type map */ static getAttributeTypeMap(): { name: string; baseName: string; type: string; }[]; /** * Gets or sets the x coordinate */ x: number; /** * Gets or sets the y coordinate */ y: number; constructor(init?: Partial<Point>); } /** * Represents options for GetPages API method */ export declare class PreviewOptions { /** * Attribute type map */ static attributeTypeMap: Array<{ name: string; baseName: string; type: string; }>; /** * Returns attribute type map */ static getAttributeTypeMap(): { name: string; baseName: string; type: string; }[]; /** * Input document description */ fileInfo: FileInfo; /** * Preview format. Supported values are: PNG, JPEG or BMP. Default value is PNG. */ format: PreviewOptions.FormatEnum; /** * Page numbers to preview. All pages proceeded if not specified. */ pageNumbers: Array<number>; /** * Preview image width. Not required. Default width used if not specified or 0. */ width: number; /** * Preview image height. Not required. Default width used if not specified or 0. */ height: number; /** * Gets or sets the resolution for generated images, in dots per inch. The default value is 96. */ resolution: number; /** * Render document comments. Default value is 'false'. */ renderComments: boolean; /** * The property that controls whether annotations will be generated on the preview. Default State - true. */ renderAnnotations: boolean; /** * The path to directory containing custom fonts in storage */ fontsPath: string; constructor(init?: Partial<PreviewOptions>); } export declare namespace PreviewOptions { enum FormatEnum { PNG, JPEG, BMP } } /** * Describes rectangle where annotation will be placed */ export declare class Rectangle { /** * Attribute type map */ static attributeTypeMap: Array<{ name: string; baseName: string; type: string; }>; /** * Returns attribute type map */ static getAttributeTypeMap(): { name: string; baseName: string; type: string; }[]; /** * Gets or sets the x coordinate of the rectangle upper left corner */ x: number; /** * Gets or sets the y coordinate of the rectangle upper left corner */ y: number; /** * Gets or sets the rectangle width */ width: number; /** * Gets or sets the rectangle height */ height: number; constructor(init?: Partial<Rectangle>); } /** * Options for removing annotations */ export declare class RemoveOptions { /** * Attribute type map */ static attributeTypeMap: Array<{ name: string; baseName: string; type: string; }>; /** * Returns attribute type map */ static getAttributeTypeMap(): { name: string; baseName: string; type: string; }[]; /** * Input document description */ fileInfo: FileInfo; /** * List of annotation IDs to remove from the document */ annotationIds: Array<number>; /** * Path to output document in the cloud storage. */ outputPath: string; constructor(init?: Partial<RemoveOptions>); } /** * Storage exists */ export declare class StorageExist { /** * Attribute type map */ static attributeTypeMap: Array<{ name: string; baseName: string; type: string; }>; /** * Returns attribute type map */ static getAttributeTypeMap(): { name: string; baseName: string; type: string; }[]; /** * Shows that the storage exists. */ exists: boolean; constructor(init?: Partial<StorageExist>); } /** * File or folder information */ export declare class StorageFile { /** * Attribute type map */ static attributeTypeMap: Array<{ name: string; baseName: string; type: string; }>; /** * Returns attribute type map */ static getAttributeTypeMap(): { name: string; baseName: string; type: string; }[]; /** * File or folder name. */ name: string; /** * True if it is a folder. */ isFolder: boolean; /** * File or folder last modified DateTime. */ modifiedDate: Date; /** * File or folder size. */ size: number; /** * File or folder path. */ path: string; constructor(init?: Partial<StorageFile>); } /** * Provides information for the words api resource link */ export declare class AnnotationApiLink extends Link { /** * Attribute type map */ static attributeTypeMap: Array<{ name: string; baseName: string; type: string; }>; /** * Returns attribute type map */ static getAttributeTypeMap(): { name: string; baseName: string; type: string; }[]; constructor(init?: Partial<AnnotationApiLink>); } /** * File Version */ export declare class FileVersion extends StorageFile { /** * Attribute type map */ static attributeTypeMap: Array<{ name: string; baseName: string; type: string; }>; /** * Returns attribute type map */ static getAttributeTypeMap(): { name: string; baseName: string; type: string; }[]; /** * File Version ID. */ versionId: string; /** * Specifies whether the file is (true) or is not (false) the latest version of an file. */ isLatest: boolean; constructor(init?: Partial<FileVersion>); } /** * The document page image representation */ export declare class PageImage extends LinkElement { /** * Attribute type map */ static attributeTypeMap: Array<{ name: string; baseName: string; type: string; }>; /** * Returns attribute type map */ static getAttributeTypeMap(): { name: string; baseName: string; type: string; }[]; /** * Gets or sets the page number */ number: number; constructor(init?: Partial<PageImage>); } declare const enumsMap: { "AnnotationInfo.HorizontalAlignmentEnum": typeof AnnotationInfo.HorizontalAlignmentEnum; "AnnotationInfo.VerticalAlignmentEnum": typeof AnnotationInfo.VerticalAlignmentEnum; "AnnotationInfo.TypeEnum": typeof AnnotationInfo.TypeEnum; "AnnotationInfo.PenStyleEnum": typeof AnnotationInfo.PenStyleEnum; "PreviewOptions.FormatEnum": typeof PreviewOptions.FormatEnum; }; declare const typeMap: { AnnotateOptions: typeof AnnotateOptions; AnnotationInfo: typeof AnnotationInfo; AnnotationReplyInfo: typeof AnnotationReplyInfo; ApiError: typeof ApiError; ApiErrorResponse: typeof ApiErrorResponse; ConsumptionResult: typeof ConsumptionResult; DiscUsage: typeof DiscUsage; DocumentInfo: typeof DocumentInfo; ErrorDetails: typeof ErrorDetails; FileInfo: typeof FileInfo; FileVersions: typeof FileVersions; FilesList: typeof FilesList; FilesUploadResult: typeof FilesUploadResult; Format: typeof Format; FormatsResult: typeof FormatsResult; Link: typeof Link; LinkElement: typeof LinkElement; ModelError: typeof ModelError; ObjectExist: typeof ObjectExist; PageImages: typeof PageImages; PageInfo: typeof PageInfo; Point: typeof Point; PreviewOptions: typeof PreviewOptions; Rectangle: typeof Rectangle; RemoveOptions: typeof RemoveOptions; StorageExist: typeof StorageExist; StorageFile: typeof StorageFile; AnnotationApiLink: typeof AnnotationApiLink; FileVersion: typeof FileVersion; PageImage: typeof PageImage; }; export { enumsMap, typeMap }; /** * Request model for Annotate operation. */ export declare class AnnotateRequest { /** * Annotation options */ options: AnnotateOptions; constructor(options: AnnotateOptions); } /** * Request model for AnnotateDirect operation. */ export declare class AnnotateDirectRequest { /** * Annotation options */ options: AnnotateOptions; constructor(options: AnnotateOptions); } /** * Request model for Extract operation. */ export declare class ExtractRequest { /** * Input file information */ fileInfo: FileInfo; constructor(fileInfo: FileInfo); } /** * Request model for RemoveAnnotations operation. */ export declare class RemoveAnnotationsRequest { /** * Remove annotations options */ options: RemoveOptions; constructor(options: RemoveOptions); } /** * Request model for CopyFile operation. */ export declare class CopyFileRequest { /** * Source file path e.g. '/folder/file.ext' */ srcPath: string; /** * Destination file path */ destPath: string; /** * Source storage name */ srcStorageName: string; /** * Destination storage name */ destStorageName: string; /** * File version ID to copy */ versionId: string; constructor(srcPath: string, destPath: string, srcStorageName?: string, destStorageName?: string, versionId?: string); } /** * Request model for DeleteFile operation. */ export declare class DeleteFileRequest { /** * File path e.g. '/folder/file.ext' */ path: string; /** * Storage name */ storageName: string; /** * File version ID to delete */ versionId: string; constructor(path: string, storageName?: string, versionId?: string); } /** * Request model for DownloadFile operation. */ export declare class DownloadFileRequest { /** * File path e.g. '/folder/file.ext' */ path: string; /** * Storage name */ storageName: string; /** * File version ID to download */ versionId: string; constructor(path: string, storageName?: string, versionId?: string); } /** * Request model for MoveFile operation. */ export declare class MoveFileRequest { /** * Source file path e.g. '/src.ext' */ srcPath: string; /** * Destination file path e.g. '/dest.ext' */ destPath: string; /** * Source storage name */ srcStorageName: string; /** * Destination storage name */ destStorageName: string; /** * File version ID to move */ versionId: string; constructor(srcPath: string, destPath: string, srcStorageName?: string, destStorageName?: string, versionId?: string); } /** * Request model for UploadFile operation. */ export declare class UploadFileRequest { /** * Path where to upload including filename and extension e.g. /file.ext or /Folder 1/file.ext If the content is multipart and path does not contains the file name it tries to get them from filename parameter from Content-Disposition header. */ path: string; /** * File to upload */ file: Buffer; /** * Storage name */ storageName: string; constructor(path: string, file: Buffer, storageName?: string); } /** * Request model for CopyFolder operation. */ export declare class CopyFolderRequest { /** * Source folder path e.g. '/src' */ srcPath: string; /** * Destination folder path e.g. '/dst' */ destPath: string; /** * Source storage name */ srcStorageName: string; /** * Destination storage name */ destStorageName: string; constructor(srcPath: string, destPath: string, srcStorageName?: string, destStorageName?: string); } /** * Request model for CreateFolder operation. */ export declare class CreateFolderRequest { /** * Folder path to create e.g. 'folder_1/folder_2/' */ path: string; /** * Storage name */ storageName: string; constructor(path: string, storageName?: string); } /** * Request model for DeleteFolder operation. */ export declare class DeleteFolderRequest { /** * Folder path e.g. '/folder' */ path: string; /** * Storage name */ storageName: string; /** * Enable to delete folders, subfolders and files */ recursive: boolean; constructor(path: string, storageName?: string, recursive?: boolean); } /** * Request model for GetFilesList operation. */ export declare class GetFilesListRequest { /** * Folder path e.g. '/folder' */ path: string; /** * Storage name */ storageName: string; constructor(path: string, storageName?: string); } /** * Request model for MoveFolder operation. */ export declare class MoveFolderRequest { /** * Folder path to move e.g. '/folder' */ srcPath: string; /** * Destination folder path to move to e.g '/dst' */ destPath: string; /** * Source storage name */ srcStorageName: string; /** * Destination storage name */ destStorageName: string; constructor(srcPath: string, destPath: string, srcStorageName?: string, destStorageName?: string); } /** * Request model for GetInfo operation. */ export declare class GetInfoRequest { /** * Document path in storage and password */ fileInfo: FileInfo; constructor(fileInfo: FileInfo); } /** * Request model for DeletePages operation. */ export declare class DeletePagesRequest { /** * Document info to remove preview */ fileInfo: FileInfo; constructor(fileInfo: FileInfo); } /** * Request model for GetPages operation. */ export declare class GetPagesRequest { /** * Document preview options */ options: PreviewOptions; constructor(options: PreviewOptions); } /** * Request model for GetDiscUsage operation. */ export declare class GetDiscUsageRequest { /** * Storage name */ storageName: string; constructor(storageName?: string); } /** * Request model for GetFileVersions operation. */ export declare class GetFileVersionsRequest { /** * File path e.g. '/file.ext' */ path: string; /** * Storage name */ storageName: string; constructor(path: string, storageName?: string); } /** * Request model for ObjectExists operation. */ export declare class ObjectExistsRequest { /** * File or folder path e.g. '/file.ext' or '/folder' */ path: string; /** * Storage name */ storageName: string; /** * File version ID */ versionId: string; constructor(path: string, storageName?: string, versionId?: string); } /** * Request model for StorageExists operation. */ export declare class StorageExistsRequest { /** * Storage name */ storageName: string; constructor(storageName: string); }