UNPKG

@evan.network/ui-angular-core

Version:

The angular-core operates as an global and central library for the evan.network Angular 5 frontend development. Using this project you will be able to to the following things:

140 lines (139 loc) 3.6 kB
import { OnInit, OnDestroy, // @angular/router AfterViewInit, ElementRef, DomSanitizer, ChangeDetectorRef } from 'angular-libs'; import { EvanAddressBookService } from '../../services/bcc/address-book'; import { EvanTranslationService } from '../../services/ui/translate'; import { EvanUtilService } from '../../services/utils'; /** * Component options structure interface */ export interface Options { video: boolean | any; cameraType: string; audio: boolean; width: number; height: number; fallbackSrc: string; fallbackMode: string; fallbackQuality: number; } /**************************************************************************************************/ /** * Component to take pictures using HTML 5. * * Usage: * picture = await this.modalService.createModal(SnapshotDialogComponent, {}); * * @class Component SnapshotDialogComponent */ export declare class SnapshotDialogComponent implements OnInit, AfterViewInit, OnDestroy { private addressBook; private translate; private element; private sanitizer; private utils; private ref; /***************** variables *****************/ /** * loading indicator */ private loading; /** * resolvle function that is applied from modal service */ private resolveDialog; /** * reject function that is applied from modal service */ private rejectDialog; /** * current video stream of the camera */ private stream; /** * camera device index (0, 1) */ private streamIndex; /** * browser type */ browser: any; /** * active camerea */ camera: any; /** * isSupportWebRTC */ isSupportWebRTC: boolean; /** * camera stream options */ options: any; /** * camera ion-select options */ selectOptions: any; /** * video src */ videoSrc: any; /** * trigger scale(1) transition animation */ private showAnimation; /***************** initialization *****************/ constructor(addressBook: EvanAddressBookService, translate: EvanTranslationService, element: ElementRef, sanitizer: DomSanitizer, utils: EvanUtilService, ref: ChangeDetectorRef); /** * initializes cameras and test browser for camerea support */ ngOnInit(): void; /** * start video capturing when canvas elements were rendered * * @return {<type>} { description_of_the_return_value } */ ngAfterViewInit(): void; /** * close camerea stream */ ngOnDestroy(): void; /***************** functions *****************/ /** * Switch to facing mode and setup web camera */ onWebRTC(): any; /** * use next available camera */ switchCamera(): Promise<{}>; /** * Setup web camera using native browser API */ setWebcam(): any; /** * Start capturing video stream */ startCapturingVideo(): any; /** * close active camera stream * * @return {<type>} { description_of_the_return_value } */ stopCapturing(): any; /** * resolve the dialoag and return the snapshot * * @return {<type>} { description_of_the_return_value } */ finish(): Promise<void>; /** * get the img data from the current canvas * * @return {any} img data */ takeSnapshot(): Promise<any>; /** * get maximum video height to prevent dialog scrolling */ videoMaxHeight(): string; }