import { AttributeType } from "../data/attribute"; import { IAnnotationContainer, IMarkup } from "../data/annotations"; import { IAccessRecord } from "../data/access"; import { IRelation } from "../data/relation"; import { ISignatureModifier } from "./signature-modifier"; /** * Fluent interface that enables you to modify the associated object */ export interface IObjectBuilder { /** * Sets the string attribute value * * @param name Attribute name * @param value Attribute value * @returns Self */ setAttribute(name: string, value: any, type: AttributeType): IObjectBuilder; /** * Adds access record to an object * * @param record Access record * @returns Self */ setAccess(record: IAccessRecord): IObjectBuilder; /** * Removes access record * * @param record Access record * @returns Self */ removeAccess(record: IAccessRecord): IObjectBuilder; /** * Adds a relation * * @param relation Relation * @returns Self */ addRelation(relation: IRelation): IObjectBuilder; /** * Removes relation * * @param relationId Relation id * @returns Self */ removeRelation(relationId: string): IObjectBuilder; /** * Sets new type. It is recommended to use this method only for recovering permanently deleted objects. In other cases, this can lead to system malfunction. * * @param typeId Type id * @returns Self */ setTypeId(typeId: number): IObjectBuilder; /** * Sets new parent * * @param parentId Parent id * @returns Self */ setParentId(parentId: string): IObjectBuilder; /** * Adds file snapshot * * @param reason Reason * @returns Self */ createSnapshot(reason: string): IObjectBuilder; /** * Makes file snapshot actual * * @param version Version of file snapshot to make actual * @param reason Reason * @returns Self */ createSnapshotFrom(version: string, reason: string): IObjectBuilder; /** * Adds a new file to the associated object * * @param file File identificator * @param file File interface * @param creationTime File creation time * @param lastAccessTime File last access time * @param lastWriteTime File last write time * @returns Fluent interface that enables you to modify the associated object */ addFile(fileId: string, file: File, creationTime: Date, lastAccessTime: Date, lastWriteTime: Date): IObjectBuilder; /** * Removes file from actual file snapshot by identifier * @param fileId file identificator * @returns Fluent interface that enables you to modify the associated object */ removeFile(fileId: string): IObjectBuilder; /** * Sets permanently deleted flag * * @param isDeleted Value * @returns Self */ setIsDeleted(isDeleted: boolean): IObjectBuilder; /** * Set flag in recycle bin * * @param isInRecycleBin Value * @returns Self */ setIsInRecycleBin(isInRecycleBin: boolean): IObjectBuilder; /** * Sets frozen flag * * @param isFreezed Value * @returns Self */ setIsFreezed(isFreezed: boolean): IObjectBuilder; /** * Sets object's secret info * * @param isSecret Value * @returns Self */ setIsSecret(isSecret: boolean): IObjectBuilder; /** * Adds or changes a annotation * * @param container Annotation container * @param attrbutes Annotation attributes * @returns Self */ addAnnotationContainer(container: IAnnotationContainer, attrbutes: any): IObjectBuilder; /** * * @param markups */ addMarkups(markups: IMarkup[]): IObjectBuilder; /** * Sets new signature requests to the selected file * * @param fileId file id * @returns Fluent interface that enables you to modify the signatures of the filtered files */ setSignatures(fileId: string): ISignatureModifier; }