import ARToolKit from "./ARToolKit" ; exports constructor param { string } src param { string } onload param { string } onerror export class ARToolKitCameraParam { public complete : boolean ; private id : number ; private _src : string | Uint8Array ; private onload : ( ) => any ; private onerror : ( error : Error ) => any ; constructor ( src , onload , onerror ) { this . id = - 1 ; this . _src = "" ; this . complete = false ; this . onload = onload ; this . onerror = onerror ; if ( src ) { this . load ( src ) ; } } param { string } src public load ( src ) { if ( this . _src !== "" ) { throw new Error ( "ARCameraParam: Trying to load camera parameters twice." ) ; } this . _src = src ; if ( src ) { ARToolKit . loadCamera ( src , ( id ) => { this . id = id ; this . complete = true ; setTimeout ( ( ) => { this . onload ( ) ; } ) ; } , ( err ) => { this . onerror ( err ) ; } ) ; } } get src ( ) { return this . _src ; } set src ( src ) { this . load ( src ) ; } /**
     * Destroys the camera parameter and frees associated Emscripten resources.
     */ public dispose ( ) { if ( this . id !== - 1 ) { ARToolKit . deleteCamera ( this . id ) ; } this . id = - 1 ; this . _src = "" ; this . complete = false ; } } export default ARToolKitCameraParam ;