ngx-stars
Version:
Simple stars rating component for Angular >= 2
64 lines (63 loc) • 2.23 kB
TypeScript
import { EventEmitter, OnDestroy, OnInit } from '@angular/core';
import * as i0 from "@angular/core";
export declare class NgxStarsComponent implements OnInit, OnDestroy {
maxStars: number;
initialStars: number;
readonly: boolean;
size: number;
customSize: string;
color: string;
animation: boolean;
animationSpeed: number;
customPadding: string;
wholeStars: boolean;
customStarIcons: {
empty: string;
half: string;
full: string;
};
rtl: boolean;
ratingOutput: EventEmitter<number>;
rating: number;
editableStars: EditableStar[];
animationInterval: any;
animationRunning: boolean;
private customCssClasses;
private customClassIdentifier;
ngOnInit(): void;
ngOnDestroy(): void;
private setupStarImages;
private createCssClass;
starPadding(): {
[p: string]: string;
};
starColorAndSize(): {
[p: string]: string;
};
private starColor;
starSize(): {
[p: string]: string;
};
zeroStarLeft(): string;
private safeSize;
starAnimation(): void;
cancelStarAnimation(): void;
setRating(rating: number): void;
onStarHover(event: MouseEvent, clickedStar: EditableStar): void;
onStarClick(event: MouseEvent, clickedStar: EditableStar): void;
onZeroStarClick(): void;
onZeroStarHover(): void;
onStarsUnhover(): void;
private clickedInFirstHalf;
noop(): void;
private getStarClass;
getAriaLabel(): string;
static ɵfac: i0.ɵɵFactoryDeclaration<NgxStarsComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<NgxStarsComponent, "ngx-stars", never, { "maxStars": "maxStars"; "initialStars": "initialStars"; "readonly": "readonly"; "size": "size"; "customSize": "customSize"; "color": "color"; "animation": "animation"; "animationSpeed": "animationSpeed"; "customPadding": "customPadding"; "wholeStars": "wholeStars"; "customStarIcons": "customStarIcons"; "rtl": "rtl"; }, { "ratingOutput": "ratingOutput"; }, never, never, false>;
}
export declare type StarType = 'empty' | 'half' | 'full';
export declare class EditableStar {
position: number;
classname: string;
constructor(position: number);
}