import { TemplateRef } from '@angular/core'; import { PassThroughOption, PassThrough } from 'primeng/api'; /** * Custom pass-through(pt) options. * @template I Type of instance. * * @see {@link MeterGroup.pt} * @group Interface */ interface MeterGroupPassThroughOptions { /** * 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 meters' DOM element. */ meters?: PassThroughOption; /** * Used to pass attributes to the meter's DOM element. */ meter?: PassThroughOption; /** * Used to pass attributes to the label list's DOM element. */ labelList?: PassThroughOption; /** * Used to pass attributes to the label's DOM element. */ label?: PassThroughOption; /** * Used to pass attributes to the label icon's DOM element. */ labelIcon?: PassThroughOption; /** * Used to pass attributes to the label marker's DOM element. */ labelMarker?: PassThroughOption; /** * Used to pass attributes to the label text's DOM element. */ labelText?: PassThroughOption; } /** * Defines valid pass-through options in MeterGroup. * @see {@link MeterGroupPassThroughOptions} * * @template I Type of instance. */ type MeterGroupPassThrough = PassThrough>; /** * Custom label template context. * @group Interface */ interface MeterGroupLabelTemplateContext { /** * Array of meter items. */ $implicit: MeterItem[]; /** * Total percent of the metergroup items. */ totalPercent: number; /** * Array of sequential sum of values of metergroup items. */ percentages: number[]; } /** * Custom meter template context. * @group Interface */ interface MeterGroupMeterTemplateContext { /** * Current meter item. */ $implicit: MeterItem; /** * Current index of the meter item. */ index: number; /** * Current orientation of the component. */ orientation: 'horizontal' | 'vertical'; /** * Style class of the meter item. */ class: string; /** * Size (width/height percentage) of the meter item. */ size: string; /** * Total percent of all metergroup items. */ totalPercent: number; /** * DataP attributes. */ dataP: string; } /** * Custom icon template context. * @group Interface */ interface MeterGroupIconTemplateContext { /** * Current meter item. */ $implicit: MeterItem; /** * Icon class of the meter item. */ icon: string | undefined; } /** * Defines valid templates in MeterGroup. * @group Templates */ interface MeterGroupTemplates { /** * Custom label template. * @param {Object} context - label context. */ label(context: MeterGroupLabelTemplateContext): TemplateRef; /** * Custom meter item template. * @param {Object} context - meter context. */ meter(context: MeterGroupMeterTemplateContext): TemplateRef; /** * Custom start template. * @param {Object} context - start context. */ start(context: MeterGroupLabelTemplateContext): TemplateRef; /** * Custom end template. * @param {Object} context - end context. */ end(context: MeterGroupLabelTemplateContext): TemplateRef; /** * Custom icon template. * @param {Object} context - icon context. */ icon(context: MeterGroupIconTemplateContext): TemplateRef; } /** * Represents a meter item configuration. * @group Interface */ interface MeterItem { /** * Label of the meter item. */ label?: string; /** * Value of the meter item. */ value?: number; /** * Color of the meter item. */ color?: string; /** * Icon of the meter item. */ icon?: string; } export type { MeterGroupIconTemplateContext, MeterGroupLabelTemplateContext, MeterGroupMeterTemplateContext, MeterGroupPassThrough, MeterGroupPassThroughOptions, MeterGroupTemplates, MeterItem };