import type { ApplicationEncryptor, Maxcryptor } from "@raytio/maxcryptor"; import type { Encrypted, Instance } from "@raytio/types"; /** * Decrypts any encrypted properties included in the supplied `instanceData`. * If nothing is encrypted the supplied `instanceData` is returned. * * It will reject if there are keys missing for any encrypted properties, or * if the encrypted data is invalid. If you don't want it to reject, you can * supply a `onCorruptedData` function which returns a value to use instead. * * @returns a copy of `instanceData` with all properties decrypted. */ export declare const decryptSharedData: ({ instanceData, maxcryptor, apiUrl, apiToken, onCorruptedData, }: { instanceData: Instance; maxcryptor: Maxcryptor; apiUrl: string; apiToken: string; /** * If you supply a function, it will be called instead of throwing an error, * and the value you return will be used instead of the corrupted field value. */ onCorruptedData?: (fieldName: string, fieldValue: Encrypted, error: Error) => any; }) => Promise<{ instance: Instance; applicationDecryptor: ApplicationEncryptor; }>;