/// <reference types="fhir" />
import Attachment from '../lib/models/fhir/Attachment';
export interface IParams {
    limit?: number;
    offset?: number;
    start_date?: string;
    end_date?: string;
    tags?: string[];
    exclude_tags?: string[];
    exclude_flags?: string[];
    annotations?: string[];
    resourceType?: string;
    partner?: string;
}
/** The record we expose to users should not expose any sensitive information.
 * It implies dataKey, attachmentKey, internal tags used to distinguish fhir resource types,
 * client ids. It should only expose annotations created by the users of SDK.
 * Annotations are treated internally as custom tags by the SDK which can be used for filtering
 * by the users of SDK
 */
export interface Record {
    id?: string;
    fhirResource: fhir.DomainResource;
    annotations?: string[];
    customCreationDate?: Date;
    updatedDate?: Date;
    partner?: string;
}
interface AppData {
    id?: string;
    data: any;
    annotations?: string[];
    customCreationDate?: Date;
    updatedDate?: Date;
    partner?: string;
}
export interface FetchResponse {
    totalCount: number;
    records: Record[] | AppData[];
}
declare type IAttachment = {
    isImage?: boolean;
    hasPreview?: boolean;
    hasThumb?: boolean;
    id?: string;
};
export declare const getCleanAttachmentsFromResource: (resource: any) => any[];
export declare const setAttachmentsToResource: (resourceWithoutAttachments: any, attachments: Attachment[]) => fhir.DomainResource;
export declare const attachBlobs: ({ encryptedFiles, ownerId, oldAttachments, newAttachments, resource, }: {
    encryptedFiles: Uint8Array[];
    ownerId: string;
    oldAttachments: File[];
    newAttachments: IAttachment[];
    resource: fhir.DomainResource;
}) => Promise<fhir.DomainResource[]>;
export declare const prepareSearchParameters: (params: IParams) => {
    limit?: number;
    offset?: number;
    start_date?: string;
    end_date?: string;
    tags?: string[];
    exclude_tags?: string[];
    exclude_flags?: string[];
    annotations?: string[];
    resourceType?: string;
    partner?: string;
};
declare const fhirService: {
    setFhirVersion(fhirVersion: string): void;
    getFhirVersion(): string;
    createResource(ownerId: string, fhirResource: fhir.DomainResource, date?: Date, annotations?: string[]): Promise<Record>;
    handleAttachments(ownerId: string, resource: fhir.DomainResource): Promise<(fhir.DomainResource | {
        commonKeyId: string;
        encryptedKey: any;
    } | any[])[]>;
    updateResource(ownerId: string, fhirResource: fhir.DomainResource, date: any, annotations?: string[]): Promise<Record>;
    updateAttachments(ownerId: string, resource: fhir.DomainResource, annotations: string[]): Promise<(fhir.DomainResource | {
        commonKeyId: string;
        encryptedKey: any;
    } | any[])[]>;
    fetchResource(ownerId: string, resourceId: string): Promise<Record>;
    deleteResource(ownerId: string, resourceId: string): Promise<void>;
    countResources(ownerId: string, params?: IParams): Promise<number>;
    fetchResources(ownerId: string, params?: IParams): Promise<FetchResponse>;
    downloadResource(ownerId: string, resourceId: string, options?: {
        imageSize: string;
    }): Promise<Record>;
};
export default fhirService;
