UNPKG

@microblink/blinkid-in-browser-sdk

Version:

A simple ID scanning library for WebAssembly-enabled browsers.

43 lines (42 loc) 2.29 kB
/** * Copyright (c) Microblink Ltd. All rights reserved. */ import { Recognizer, RecognizerRunner, WasmSDK } from "./DataStructures"; import { MetadataCallbacks } from "./MetadataCallbacks"; import { WasmSDKLoadSettings } from "./WasmLoadSettings"; export * from "./DataStructures"; export * from "./MetadataCallbacks"; export * from "./FrameCapture"; export * from "./VideoRecognizer"; export * from "./WasmLoadSettings"; /** * Check if browser supports ES6, which is prerequisite for this SDK to execute. * * IMPORTANT: it's not possible to run this function from MicroblinkSDK if browser doesn't support * ES6 since this file won't be able to load. * * This function is here as a placeholder so it can be copied to standalone JS file or directly into 'index.html'. */ /** * Checks if browser is supported by the SDK. The minimum requirements for the browser is * the support for WebAssembly. If your browser does not support executing WebAssembly, * this function will return `false`. */ export declare function isBrowserSupported(): boolean; /** * Asynchronously loads and compiles the WebAssembly module. * @param loadSettings Object defining the settings for loading the WebAssembly module. * @returns Promise that resolves if WebAssembly module was successfully loaded and rejects if not. */ export declare function loadWasmModule(loadSettings: WasmSDKLoadSettings): Promise<any>; /** * Function for creating a new RecognizerRunner. * Note that it is currently not possible to have multiple instances of RecognizerRunner per instance of WasmSDK. * Attempt to create new instance of RecognizerRunner prior deleting the previous one will fail. * @param wasmSDK Instance of WasmSDK which will be used to communicate with the WebAssembly module. * @param recognizers Array of recognizers that will be used by RecognizerRunner. * @param allowMultipleResults Whether or not it is allowed to return multiple results from single recognition session. * See README.md for more information. * @param metadataCallbacks */ export declare function createRecognizerRunner(wasmSDK: WasmSDK, recognizers: Array<Recognizer>, allowMultipleResults?: boolean, metadataCallbacks?: MetadataCallbacks): Promise<RecognizerRunner>;