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:

87 lines (86 loc) 3.73 kB
import { // @ngx-translate/core, AlertController, Alert } from 'angular-libs'; import { SingletonService } from '../singleton-service'; import { EvanTranslationService } from './translate'; import { EvanUtilService } from '../utils'; /**************************************************************************************************/ /** * Ionic AlertController wrapper for easier usage. * * @class Injectable EvanAlertService */ export declare class EvanAlertService { private alertCtrl; private translateService; private utils; private singleton; /** * require dependencies */ constructor(alertCtrl: AlertController, translateService: EvanTranslationService, utils: EvanUtilService, singleton: SingletonService); /** * Ionic AlertController.create wrapper to handle translations of the form. * * Usage: * await this * .alertService.showAlert( * '_dappdapps.alert.validTitle', * { * key: '_dappdapps.alert.dappMessage', * translateOptions: dapp * } * ); * * @param {string|any} title Title 'title' || { key: 'title', * translateOptions: { } } * @param {string|any} message Message 'message' || { key: 'message', * translateOptions: { } } * @param {Array<any>} buttons Buttons that should be display * @param {Array<any>} inputs Inputs that should be displayed * @return {Alert} this.alertCtrl.create result */ showAlert(title: string | any, message: string | any, buttons?: any[], inputs?: any[]): Alert; /** * Shows an alert with an submit and an cancel and returns an Promise, that is resolve by clicking * on the specific button. * * Usage: * await this * .alertService.showSubmitAlert( * '_dappdapps.alert.validTitle', * { * key: '_dappdapps.alert.dappMessage', * translateOptions: dapp * }, * 'cancel', * 'submit' * ); * * @param {string|any} title 'title' || { key: '', translateOptions: { } } * @param {string|any} message 'message' || { key: '', translateOptions: { } } * @param {string} cancelText 'cancelText' || { key: '', translateOptions: { } } * @param {string} submitText 'submitText' || { key: '', translateOptions: { } } * @param {Array<any>} inputs Inputs that should be displayed * @param {string} cancelClass custom class for cancel button * @param {string} submitClass custom class for submit button * @param {<type>} resolve The resolve * @param {<type>} reject The reject * @return {Promise} promise that is deployed on button reject / resolve */ showSubmitAlert(title: string | any, message: string | any, cancelText?: string, submitText?: string | any, inputs?: any[], cancelClass?: string, submitClass?: string): Promise<any>; /** * Adds an temporary style to show a better looking alert using the definition * colors and img. * Usage: * this.alertService.addDAppAlertStyle(this.dapps[dappKey]); * * @param {any} definition DApp bookmark definition */ addDAppAlertStyle(definition: any): void; /** * Remove an temporary style that was used for the DApp definition style. * * @param {any} definition DApp bookmark definition */ removeDAppAlertStyle(definition: any): void; }