import { DocumentCodes, SdkVerifierType, SupportedLanguages } from '../generated/zenid-enums.generated.js'; import { EncodedImage, SdkWizardStep, UploadReadyData } from '../generated/zenid-types.generated.js'; export declare enum NativeFunction { ProcessFrame = "nativeProcessFrame", SetVisualizerVersion = "nativeSetVisualizerVersion", InitOrRestart = "nativeInitOrRestart", RestartWithPreviousSettings = "nativeRestartWithPreviousSettings", GetRenderCommands = "nativeGetRenderCommands", ReadyForFrame = "nativeReadyForFrame", GetStateContainerJson = "nativeGetStateContainerJson", GetFrameProcessingResolution = "nativeGetFrameProcessingResolution", SubmitExternalResponse = "nativeSubmitExternalResponse", GetUploadReadyData = "nativeGetUploadReadyData", SetDebugVisualization = "nativeSetDebugVisualization", SetLanguage = "nativeSetLanguage", GetLanguageLocale = "nativeGetLanguageLocale", SetupResourceLoader = "nativeSetupResourceLoader", Authorize = "nativeAuthorize", GetChallengeToken = "nativeGetChallengeToken", SelectProfile = "nativeSelectProfile", Unload = "nativeUnload", GetSdkWizardSteps = "nativeGetSdkWizardSteps", MeasureAvailableRAM = "nativePrepareAndEstimateMemory", GetSupportedPageCount = "nativeGetSupportedPageCount" } export declare enum DataType { object = "object", string = "string" } export declare class ZenidSDK { private worker; private callbackMap; private callIdCounter; private initialized; private initPromise; private useSingleThread; debugVisualizationEnabled: boolean; private static instance; static get Instance(): ZenidSDK; private constructor(); /** * Initialize the SDK * @returns {Promise} Resolves when SDK is initialized */ setup(resourcePath: string, useSingleThreaded: boolean, assetUrls?: { wasmUrl?: string; emscriptenJsUrl?: string; }): Promise; /** * Generic method to call any native function * @param {string} functionName - Name of the native function to call * @param {...any} args - Arguments to pass to the function * @returns {Promise} Resolves with the result of the function call */ callNative(functionName: string, ...args: any[]): Promise; /** * Finds ArrayBuffers that can be transferred instead of copied * @param {Array} args - Arguments to search * @returns {Array} - Transferable objects */ private findTransferables; /** * Handle messages from the worker * @param {MessageEvent} e - Message event */ private handleWorkerMessage; /** * Register callbacks for a specific call ID * @param {string|number} id - Call ID * @param {Function} resolve - Resolve function * @param {Function} reject - Reject function */ private registerCallback; /** * Get a unique call ID * @returns {number} Unique call ID */ private getNextCallId; /** * Process a frame * @param {string} feature - Feature name * @param {Uint8ClampedArray} imageData - Pointer to the input image * @param {number} width - Image width * @param {number} height - Image height * @returns {Promise} - Processing result */ processFrame(feature: SdkVerifierType, imageData: Uint8ClampedArray, width: number, height: number): Promise; destroy(): void; /** * Kill all threads and workers * This is a utility method to forcefully terminate all resources * Especially useful for iOS WebKit memory.atomic.wait32 bug */ killAll(): void; IsUsingSingleThreaded(): boolean; setVisualizerVersion(visualizerVersion: number): Promise; initOrRestart(feature: SdkVerifierType, jsSettings: string): Promise; restartWithPreviousSettings(feature: SdkVerifierType): Promise; getRenderCommands(feature: SdkVerifierType, width: number, height: number): Promise; readyForFrame(feature: SdkVerifierType): Promise; submitExternalResponse(feature: SdkVerifierType, request: string): Promise; submitPhotoImage(feature: SdkVerifierType, encodedImage: EncodedImage): Promise; /** * Get upload-ready data as a JSON string * @param {string} feature - Feature name * @returns {Promise} - Parsed upload-ready data object */ getUploadReadyData(feature: SdkVerifierType): Promise; setDebugVisualization(isEnabled: boolean): Promise; setLanguage(language: SupportedLanguages): Promise; getLanguageLocale(): Promise; authorize(responseToken: string): Promise; unloadAll(): Promise; unloadFeature(feature: SdkVerifierType): Promise; getChallengeToken(): Promise; selectProfile(profileName: string): Promise; getStateContainerJson(feature: SdkVerifierType): Promise; getSdkWizardSteps(): Promise; getFrameProcessingResolution(feature: SdkVerifierType): Promise; /** * Measure available RAM by attempting to allocate memory blocks * @returns {Promise} Available RAM in bytes */ measureAvailableRAM(): Promise; /** * Gets the supported page count for a specific document code * @param documentCode - The document code value (from DocumentCodes enum) * @returns Number of supported pages (1 or 2) */ getSupportedPageCount(documentCode: DocumentCodes): Promise; } export default ZenidSDK; //# sourceMappingURL=zenid-sdk.d.ts.map