import { PassThroughOption, PassThrough } from 'primeng/api'; import { TemplateRef } from '@angular/core'; /** * Custom pass-through(pt) options. * @template I Type of instance. * * @see {@link Rating.pt} * @group Interface */ interface RatingPassThroughOptions { /** * Used to pass attributes to the host's DOM element. */ host?: PassThroughOption; /** * Used to pass attributes to the root's DOM element. */ root?: PassThroughOption; /** * Used to pass attributes to the option's DOM element. */ option?: PassThroughOption; /** * Used to pass attributes to the on icon's DOM element. */ onIcon?: PassThroughOption; /** * Used to pass attributes to the off icon's DOM element. */ offIcon?: PassThroughOption; /** * Used to pass attributes to the hidden option input container's DOM element. */ hiddenOptionInputContainer?: PassThroughOption; /** * Used to pass attributes to the hidden option input's DOM element. */ hiddenOptionInput?: PassThroughOption; } /** * Defines valid pass-through options in Rating component. * @see {@link RatingPassThroughOptions} * * @template I Type of instance. */ type RatingPassThrough = PassThrough>; /** * Custom change event. * @see {@link Rating.onRate} * @group Events */ interface RatingRateEvent { /** * Browser event */ originalEvent: Event; /** * Selected option value */ value: number; } /** * Custom icon template context. * @group Interface */ interface RatingIconTemplateContext { /** * Star value (1-based index). */ $implicit: number; /** * Style class of the icon. */ class: string; } /** * Defines valid templates in Rating. * @group Templates */ interface RatingTemplates { /** * Custom on icon template. * @param {RatingIconTemplateContext} context - icon context. */ onicon(context: RatingIconTemplateContext): TemplateRef; /** * Custom off icon template. * @param {RatingIconTemplateContext} context - icon context. */ officon(context: RatingIconTemplateContext): TemplateRef; } export type { RatingIconTemplateContext, RatingPassThrough, RatingPassThroughOptions, RatingRateEvent, RatingTemplates };