UNPKG

@logo-software/timer

Version:

Timer helps developer to set a specific time for their web apps and doSomething after completed.

87 lines (86 loc) 2.65 kB
/** * @license * Copyright LOGO YAZILIM SANAYİ VE TİCARET A.Ş. All Rights Reserved. * * Save to the extent permitted by law, you may not use, copy, modify, * distribute or create derivative works of this material or any part * of it without the prior written consent of LOGO YAZILIM SANAYİ VE TİCARET A.Ş. Limited. * Any reproduction of this material must contain this notice. */ import { EventEmitter, OnDestroy, OnInit } from '@angular/core'; import { TimerService } from './timer.service'; import { Lang } from './lang'; /** * Timer library lets your users to know their time in your app. * Add the below code to your code stack and give initializer parameters. * * <sub>app.component.html</sub> * * ```html * <logo-timer * [timeInMs]="1234567" * [id]="'myLogoTimer'" * [title]="'Estimated Time'" * [cssClasses]="'my-logo-timer-theme'" * [theme]="'primary'" * [isCountdown]="true" * [showIcon]="true" * [showProgressBar]="true" * [autoStart]="true" * [language]="{days: 'Gün', hours: 'Saat', minutes: 'Dk', seconds: 'Sn'}" * (onTimeCompleted)="sampleOnTimeEnd($event)" * > * </logo-timer> * ``` */ export declare class TimerComponent implements OnInit, OnDestroy { timerService: TimerService; /** * Set custom CSS Classes for design customization. */ cssClasses: string; /** * If set true, timer works as countdown clock, else timer starts from zero. */ isCountdown: boolean; /** * Timer starts or ends time in milliseconds */ timeInMs: number; /** * The text before the timer. */ title: string; /** * Identifier of the timer which is triggered when completed. */ id: string; /** * The Logo Theme based themes of the timer. */ theme: 'primary' | 'white' | 'success' | 'warning' | 'danger'; /** * Show icon or not before the timer text. */ showIcon: boolean; /** * Show progress bar or not after the title text. */ showProgressBar: boolean; /** * Language inputs for days, hours, minutes and seconds. Must be formatted as lang.ts file. */ language: Lang; /** * Auto start timer onInit or trigger it by your own function options. If set true, timer will start on init of the library else you need to start by your own trigger function. Default is true. */ autoStart: boolean; /** * Output of the completed timer. It returns the id that setted. */ onTimeCompleted: EventEmitter<string>; private watchTimer; constructor(timerService: TimerService); ngOnInit(): void; ngOnDestroy(): void; }