import { AttributeModifier, AttributeType, ElementSchema, IWorkRecord, MarkerConfig, SchemaId, Template, WorkRecordData } from '../interfaces'; import { AttributeDefinition, AttributeDefinitions, AttributeFileData, AttributeFileValue, AttributeValue, DataSource, DehydratedAttributeValue, DehydratedElementData, eDocuImageSize, ElementAttributeData, ElementData, ElementFormData, ElementTemplateV1, FileBatchResponse, GetElementV1Response, GetElementV2Response, Operation, PreparedFiles } from '../interfaces/element.interface'; import { IListingConfig } from '../interfaces/listing.interface'; import { ElementGetQueryParams, ElementPrivileges } from '../services/edocu/elements'; import { MainStore } from '../stores/mainStore'; export declare class Element { childrenData: ElementData[]; originalData?: ElementData; data?: ElementData; dataHash?: string; children: Element[]; childrenCount?: number; workRecords: Map; workRecordsCount?: number; effects: Record>; relationElements: { [attribute: string]: Element[]; }; references: { [attribute: string]: Element[]; }; interalListingHashes: string[]; predecessors?: Element[]; predecessorsCount?: number; hash: string; store: MainStore; completeData: boolean; loading: boolean; loadingPromise: Promise | undefined; errored?: Error; dirty: boolean; source: DataSource; parent?: Element; autoSave: boolean; saveHandler: () => void; onChangeDataHash: () => void; listeners: (() => void)[]; changeListenerRef?: () => void; constructor(store: MainStore, hash: string, data?: ElementData, shouldLoad?: boolean); getChangeListenerTopic(): string | undefined; registerChangeListener(): () => void; destructor(): void; static get TYPE(): string; static get ATTRIBUTES(): { ELEMENT_NAME: string; ARCHIVED: string; ELEMENT_PARENT: string; }; static get SHORTNAME(): string; static get PREVIEW_ATTRIBUTES(): string[]; static get LINEVIEW_ATTRIBUTES(): string[]; static get GEO_RELATION_ATTRIBUTES(): string[]; static get DISABLED_ATTRIBUTES(): string[]; getPrefilledAttributes(): Record; get mapLabel(): string | null; get markerConfig(): MarkerConfig; get elementName(): string; get organization(): string | undefined; get sortValue(): string; get type(): string | undefined; get displayType(): string; addInteralListingHash(hash: string): void; initialize(): Promise; get privileges(): ElementPrivileges | undefined; getEditableAttributes(): string[]; extendElementData(data?: Partial, onlyAcceptNewerTimestamp?: boolean): void; setAttributes(values: ElementFormData): Record; getAttributeFile(attribute: string): AttributeFileData | undefined; getAttributeFirstFileUri(attribute: string, size?: eDocuImageSize): string | undefined; getAttributeElementValue(attribute: string, onlyModel?: new (...params: unknown[]) => T): T[] | undefined; getAttributeTextValue(attribute: string): string; loadRaw(force?: boolean): Promise | undefined>; loadElementQuery(queryParams: ElementGetQueryParams): Promise; loadData(force?: boolean, queryParams?: ElementGetQueryParams): Promise | undefined>; setResponseScopeData(response?: GetElementV1Response | GetElementV2Response): void; loadAttributes(attributes: string[]): Promise; createWorkRecord(data: WorkRecordData): Promise; createCountingWorkRecord(data: WorkRecordData): Promise; instantiateReferences(references: { [attribute: string]: ElementData[]; }): Record; loadRelation(relation: string): Promise; togglePublishAttributes(publish: boolean): Promise; updateDataHash(): void; getLocalFiles(modified: DehydratedElementData): { files: PreparedFiles[]; fileAttributes: string[]; }; autoUpdate(): false | Promise | undefined; update(data?: ElementFormData): Promise; uploadFiles(files: PreparedFiles[]): Promise<{ ok: boolean; files: PreparedFiles[]; error?: Error; } | void>; dispose(): void; static GET_QUERY_PARAMS(): ElementGetQueryParams; static LISTING_TITLE(mainStore: MainStore, _preset?: IListingConfig): string; static LISTING_PRESETS(_mainStore: MainStore, _payload?: string): IListingConfig[]; performFileAction(action: 'archived' | 'relevant' | 'public', attribute: string, fileHash: string): Promise; archive(): Promise; unarchive(): Promise; static dehydrateDataAndUnwrapValues(element: Partial): Record; static dehydrateData(element: Partial): DehydratedElementData; static dehydrateAttributeValue(value: AttributeValue): DehydratedAttributeValue; get elementSchemaId(): SchemaId | undefined; get template(): ElementTemplateV1 | Template | undefined; getAttributeType(attributeKey: string): AttributeType | undefined; isAttributeMultiple(attributeKey: string): boolean; get typeData(): AttributeDefinitions | ElementSchema | undefined; getAttributeDefinition(attribute: string): AttributeDefinition | undefined; attributeExists(attribute: string): boolean; setAttributeValue(attribute: string, value: AttributeValue | AttributeFileData | undefined, isPublic?: boolean): boolean; getAttributeRawValue(attribute: string): AttributeValue | undefined; getAttributeValue(attribute: string): AttributeValue | AttributeFileData | undefined; hydrateRelationElements(): void; performUpdate(modified: ElementAttributeData, original: ElementAttributeData): Promise; getEffects(attribute: string): AttributeModifier['effects']; computeEffects(template: Template): void; getEvaluatedEffects(template?: Template): Record; } /** * This method is used to break references and safely work with this data. * It clones the provided data object and returns a new object with the same structure and values. * This ensures that any modifications made to the cloned object will not affect the original data object. * * @param data - The data object to be cloned. * @returns A new object with the same structure and values as the provided data object. */ export declare const cloneElementData: (data: Partial) => ElementData; export declare const getPatchedElementFromOperations: (operations: Operation[], elementData: ElementFormData) => { element: ElementFormData; }; export declare const getAttributeNameFromOperation: (op: Operation) => string; export declare const evaluateModifiers: (data: Record, modifiers: AttributeModifier[]) => AttributeModifier["effects"]; export declare const transformUploadedFiles: (uploadedFiles: FileBatchResponse, organization: string) => { [x: string]: AttributeFileValue[]; };