@cardscan.ai/insurance-cardscan-react
Version:
A library that makes it easy to add health insurance card scanning to any web application
66 lines (65 loc) • 2.66 kB
TypeScript
import { Dispatch, MutableRefObject, SetStateAction } from "react";
import { CameraPermissionModalConfig, ErrorModalT } from "../types/Modals/ErrorModal";
import React from "react";
import { ModelPrediction } from "./types/Model";
import { WebToMobileHandOffConfig } from "../components/ErrorModal/components/WebToMobile/WebToMobile";
import { HelpModalConfig } from "../components/ErrorModal/components/HelpModal/HelpModal";
import { RequestPermissionModalConfig } from "../components/RequestingPermissionModal/RequestingPermissionModal";
import { NoCameraModalConfig } from "../types/Modals/NoCameraModal";
import { CardScanApi } from "@cardscan.ai/cardscan-client";
import { LogLevel, CardScanError } from "../types/types";
export type GlobalContent = {
logging: LogLevel;
modelState: any;
scanDebugState: any;
threshold: any;
setThreshold: any;
laplacianThreshold: any;
setLaplacianThreshold: any;
scanFreqency: any;
setScanFreqency: any;
bufferSize: any;
setBufferSize: any;
bufferRef: any;
debugCanvasBestRef: any;
bestScore: any;
bestClass: ModelPrediction | null;
lastClass: string;
bestLaplacian: any;
debugCanvasLatestRef: any;
latestScore: any;
latestLaplacian: any;
debugMenu: boolean;
videoMetadata: any;
showCurtain: boolean;
onCloseBtn: any;
closeButton: any;
isMobile: boolean;
isMobileOnLandscape: boolean;
stateMachineState: any;
fullScreen: boolean;
stateMachineSend: any;
stateMachineService: any;
handleRetryButton: () => void;
cardScanApi: MutableRefObject<CardScanApi<"camel"> | null>;
showErrorModal: ErrorModalT;
cameraPermissionModalConfig?: CameraPermissionModalConfig;
webToMobileHandoffConfig?: WebToMobileHandOffConfig;
setShowErrorModal: Dispatch<SetStateAction<ErrorModalT>>;
videoRef: React.RefObject<HTMLVideoElement>;
setVideoMetadata: Dispatch<SetStateAction<{
[key: string]: any;
}>>;
onError?: (error: CardScanError) => void;
setScanDebugState: React.Dispatch<React.SetStateAction<string>>;
backsideSupport: boolean;
helpModalConfig?: HelpModalConfig;
requestPermissionModalConfig?: RequestPermissionModalConfig;
noCameraModalConfig?: NoCameraModalConfig;
webviewVersion?: string | null;
mobileSdkVersion?: string | null;
webToMobileTimer: number | null;
setWebToMobileTimer: Dispatch<SetStateAction<number | null>>;
};
export declare const MyGlobalContext: React.Context<GlobalContent>;
export declare const useGlobalContext: () => GlobalContent;