import * as i0 from '@angular/core';
import { OnInit, OnChanges, ElementRef, EventEmitter, ChangeDetectorRef, SimpleChanges, PipeTransform } from '@angular/core';
import { ControlValueAccessor } from '@angular/forms';
import { CssClassBuilder, Nullable } from '@fundamental-ngx/cdk/utils';
import { FormItemControl } from '@fundamental-ngx/core/form';

declare const INDICATOR_PREFIX = "fd-rating-indicator";
declare const INDICATOR_CLASSES: {
    halves: string;
    icon: string;
    hideDynamicText: string;
};
declare const INDICATOR_DEFAULT_CAPACITY = 5;
type RatingIndicatorSize = 'xs' | 'sm' | 'md' | 'lg' | 'cozy' | 'compact' | 'condensed';
declare enum RatingIndicatorSizeEnum {
    'xs' = 0,
    'sm' = 1,
    'md' = 2,
    'lg' = 3,
    'cozy' = 4,
    'compact' = 5,
    'condensed' = 6
}

interface NumberKey<T> {
    [key: number]: T;
}
interface RatingViewItem {
    rate: number;
    votes: number;
}
declare class RatingIndicatorComponent implements OnInit, OnChanges, CssClassBuilder, ControlValueAccessor, FormItemControl {
    readonly elementRef: ElementRef;
    private readonly _changeDetectorRef;
    /** User's custom classes */
    class: string;
    /** Sets [name] attribute of input. */
    name: string;
    /**
     * Sets the aria-label attribute to the element.
     */
    ariaLabel: Nullable<string>;
    /**
     * Sets the aria-labelledby attribute to the element.
     */
    ariaLabelledBy: Nullable<string>;
    /**
     * Sets the aria-disabled attribute to the element.
     * Sets the is-disabled class to the element.
     * Whether the rating indicator is disabled
     */
    disabled: boolean;
    /**
     * Whether the rating indicator is in displayMode
     */
    displayMode: boolean;
    /**
     * Whether the rating indicator is in non-interactive state.
     */
    nonInteractive: boolean;
    /**
     * Number of rates to display
     */
    set indicatorCapacity(value: number);
    /**
     * Whether or not to display half values.
     */
    allowHalves: boolean;
    /**
     * User's value number of ratings. If provided, Overrides ratingAverage.
     */
    value: number;
    /**
     * Total number of ratings. If provided, will display text showing the total number of ratings.
     */
    totalRatings: number;
    /**
     * Rating average
     */
    ratingAverage: number;
    /**
     * Object containing key-value pairs where the key is the rating and the value is the total sum of those ratings.
     * Overrides totalRatings and ratingAverage.
     */
    ratings: NumberKey<number>;
    /**
     * Whether or not to display the popover that shows the sum of each rating. Requires [ratings] object.
     */
    displayAllRatings: boolean;
    /**
     * Icon class for rated icon from fundamental-styles lib https://sap.github.io/fundamental-styles/?path=/docs/components-icon--sizes
     */
    ratedIcon: string;
    /**
     * Icon class for unrated icon from fundamental-styles lib https://sap.github.io/fundamental-styles/?path=/docs/components-icon--sizes
     */
    unratedIcon: string;
    /**
     * Possible values are 'xs', 'sm', 'md', 'lg', 'cozy', 'compact', 'condensed'
     */
    size: RatingIndicatorSize;
    /**
     * Text divider label between view value and indicator count.
     */
    dynamicTextIndicator: string;
    /**
     * Fired when the user sets or changes their rating.
     */
    ratingChanged: EventEmitter<number>;
    /** @hidden */
    sizeClass: string;
    /** @hidden */
    _rates: {
        id: string;
        value: number;
    }[];
    /** @hidden */
    _ratingItems: RatingViewItem[];
    /** @hidden */
    get viewRatingUID(): number;
    /** @hidden */
    get indicatorCount(): number;
    /** @hidden */
    get viewValue(): number;
    /** @hidden */
    private _ratingUID;
    /** @hidden */
    private _indicatorCapacity;
    /** @hidden */
    private _value;
    /** @hidden */
    private _hideDynamicText;
    /** @hidden */
    constructor(elementRef: ElementRef, _changeDetectorRef: ChangeDetectorRef);
    /** @hidden
     * CssClassBuilder interface implementation
     * function must return single string
     * function is responsible for order which css classes are applied
     */
    buildComponentCssClass(): string[];
    /** @hidden */
    onChange: (value: number) => void;
    /** @hidden */
    onTouched: () => void;
    /** @hidden */
    ngOnInit(): void;
    /** @hidden */
    ngOnChanges(changes: SimpleChanges): void;
    /** @hidden */
    writeValue(value: number): void;
    /** @hidden */
    registerOnChange(fn: (value: number) => void): void;
    /** @hidden */
    registerOnTouched(fn: () => void): void;
    /** @hidden */
    setDisabledState(isDisabled: boolean): void;
    /** @hidden */
    onSelect(value: number): void;
    /**
     * @hidden
     * Generate rating items for popover content if rating object was defined
     */
    private _generateRatings;
    /**
     * @hidden
     * get converted viewValue for render in component template from original value if it still exists, or ratingAverage.
     */
    private _convertToValue;
    /**
     * @hidden
     * get converted value from original to view value with depends on halves
     * For example,
     *  original value is equal to 2.34, you will get and render 2
     *  original value is equal to 3.74, you will get and render 4
     */
    private _parseValue;
    /**
     * @hidden
     * get rating icons array with value and unic id
     */
    private _getRates;
    /**
     * @hidden
     * get rating icons array with value and unic id
     */
    private _getSizeClass;
    static ɵfac: i0.ɵɵFactoryDeclaration<RatingIndicatorComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<RatingIndicatorComponent, "fd-rating-indicator", never, { "class": { "alias": "class"; "required": false; }; "name": { "alias": "name"; "required": false; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; }; "ariaLabelledBy": { "alias": "ariaLabelledBy"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "displayMode": { "alias": "displayMode"; "required": false; }; "nonInteractive": { "alias": "nonInteractive"; "required": false; }; "indicatorCapacity": { "alias": "indicatorCapacity"; "required": false; }; "allowHalves": { "alias": "allowHalves"; "required": false; }; "value": { "alias": "value"; "required": false; }; "totalRatings": { "alias": "totalRatings"; "required": false; }; "ratingAverage": { "alias": "ratingAverage"; "required": false; }; "ratings": { "alias": "ratings"; "required": false; }; "displayAllRatings": { "alias": "displayAllRatings"; "required": false; }; "ratedIcon": { "alias": "ratedIcon"; "required": false; }; "unratedIcon": { "alias": "unratedIcon"; "required": false; }; "size": { "alias": "size"; "required": false; }; "dynamicTextIndicator": { "alias": "dynamicTextIndicator"; "required": false; }; }, { "ratingChanged": "ratingChanged"; }, never, never, true, never>;
}

declare class RatingStarLabelPipe implements PipeTransform {
    /** Transforms the value to a rating value string. */
    transform(index: number, controlsCount: number, useHalves: boolean): string;
    static ɵfac: i0.ɵɵFactoryDeclaration<RatingStarLabelPipe, never>;
    static ɵpipe: i0.ɵɵPipeDeclaration<RatingStarLabelPipe, "ratingStarLabel", true>;
}

/**
 * @deprecated
 * Use direct import of `RatingIndicatorComponent`
 */
declare class RatingIndicatorModule {
    static ɵfac: i0.ɵɵFactoryDeclaration<RatingIndicatorModule, never>;
    static ɵmod: i0.ɵɵNgModuleDeclaration<RatingIndicatorModule, never, [typeof RatingIndicatorComponent, typeof RatingStarLabelPipe], [typeof RatingIndicatorComponent, typeof RatingStarLabelPipe]>;
    static ɵinj: i0.ɵɵInjectorDeclaration<RatingIndicatorModule>;
}

export { INDICATOR_CLASSES, INDICATOR_DEFAULT_CAPACITY, INDICATOR_PREFIX, RatingIndicatorComponent, RatingIndicatorModule, RatingIndicatorSizeEnum, RatingStarLabelPipe };
export type { RatingIndicatorSize };
