@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:
76 lines (75 loc) • 2.7 kB
TypeScript
import { DomSanitizer, Camera, Platform } from 'angular-libs';
import { EvanUtilService } from '../utils';
import { EvanModalService } from './modal';
/**************************************************************************************************/
/**
* Picture taking service for HTML 5 / IOS / Android.
*
* @class Injectable EvanPictureService
*/
export declare class EvanPictureService {
private modalService;
private _DomSanitizer;
private utils;
private cordovaCamera;
private platform;
/**
* require dependencies
*/
constructor(modalService: EvanModalService, _DomSanitizer: DomSanitizer, utils: EvanUtilService, cordovaCamera: Camera, platform: Platform);
/**
* Takes an img. On Desktop the webcam will be used. On mobile IOS / Android
* internals will be used to access native cameras.
*
* Usage: const picture = await this.pictureService.takeSnapshot();
*
* @return {Promise<any>} the img data
* {
* name: 'capture.png',
* fileType: 'image/png',
* file: arrayBuffer,
* blobURI: this._DomSanitizer.bypassSecurityTrustUrl(dataUri)
* }
*/
takeSnapshot(): Promise<any>;
/**
* Transform a blob uri from an dataUrl
*
* @param {string} dataUrl data url that should be transformed
* @return {Promise<string>} blob uri
*/
getBlobUri(dataUrl: string): Promise<string>;
/**
* Transform a data uri in to an blob.
*
* @param {string} dataURI data uri that should be transformed
* @return {Promise<any>} transformed blob
*/
dataURItoBlob(dataURI: string): Promise<any>;
/**
* Transforms an blob into an data uri.
*
* @param {any} blob blob to transform
* @return {Promise<any>} transformed data uri
*/
blobToDataURI(blob: any): Promise<any>;
/**
* Transforms an blob into an array bugffer.
*
* @param {any} blob blob to transform
* @return {Promise<any>} transformed array buffer
*/
blobToArrayBuffer(blob: any): Promise<any>;
/**
* Takes an dataUri and resizes the img to an maximum px ratio of 1000px:1000px.
*
* @param {string} dataUri Data Uri
* @param {any} dimensions dimensions to transform the picture to (default max_width:
* 1000, max_height: 1000)
* @return {blob} Returns the resized img as a blob.
*/
resizeImage(dataUri: string, dimensions?: {
max_width: number;
max_height: number;
}): Promise<{}>;
}