type CourseRatingLanguage = "id" | "en";
type CourseRatingSentiment = "impressed" | "improvement";
type CourseTag = {
    id: number | null;
    label: string;
    category: "impressed" | "improvement";
    is_other: boolean;
    requires_text: boolean;
};
type CourseRatingData = {
    id: string;
    title: string;
    description?: string;
    setting_id?: number;
    custom_title?: string;
    tags?: CourseTag[];
};
type CourseRatingLabels = {
    title: string;
    description: string;
    ratingAriaLabel: string;
    closeLabel: string;
    impressiveQuestion: string;
    improvementQuestion: string;
    otherQuestion: string;
    submit: string;
    successTitle: string;
    successDescription: string;
    backToHome: string;
    nextCourse: string;
    others: string;
    loading: string;
    submitError: string;
    otherInputQuestion: string;
    otherImpressedQuestion: string;
    otherImprovementQuestion: string;
    feedbackImpressedQuestion: string;
    feedbackImprovementQuestion: string;
};
type CourseRatingTheme = {
    primaryColor?: string;
    starColor?: string;
    inactiveStarColor?: string;
    textColor?: string;
    mutedTextColor?: string;
    buttonTextColor?: string;
    courseButtonColor?: string;
    backgroundColor?: string;
    borderColor?: string;
    borderRadius?: number;
};
type CourseRatingAssets<TImage = unknown> = {
    logoImage?: TImage;
    mascotImage?: TImage;
    ratingBackgroundImage?: TImage;
    ratingBackgroundImageMobile?: TImage;
    ratingBackgroundImageDesktop?: TImage;
    successBackgroundImage?: TImage;
    successBackgroundImageMobile?: TImage;
    successBackgroundImageDesktop?: TImage;
};
type CourseRatingSubmitPayload = {
    courseId: string;
    setting_id: number;
    star_rating: number;
    selected_tag_ids: number[];
    is_other_selected: boolean;
    other_text: string | null;
    feedback_text: string | null;
};
type CourseRatingProps<TImage = unknown> = {
    data?: CourseRatingData[] | null;
    onSubmitRating: (payload: CourseRatingSubmitPayload) => void | Promise<void>;
    onDone?: () => void;
    onBackToHome?: () => void;
    enableClose?: boolean;
    onClose?: () => void;
    language?: CourseRatingLanguage;
    labels?: Partial<CourseRatingLabels>;
    feedbackOptions?: string[];
    goodRatingThreshold?: number;
    assets?: CourseRatingAssets<TImage>;
    theme?: CourseRatingTheme;
};
type CourseRatingFormState = {
    rating?: number;
    selectedReasons: string[];
    otherText?: string;
    feedbackText?: string;
};
type BuildPayloadInput = {
    course: CourseRatingData;
    rating: number;
    selectedReasons: string[];
    language: CourseRatingLanguage;
    labels: CourseRatingLabels;
    goodRatingThreshold?: number;
    otherText?: string;
    feedbackText?: string;
    index: number;
    total: number;
};
type RatingDistribution = {
    stars: number;
    percentage: number;
};
type CourseRatingSummaryData = {
    averageRating: number;
    totalRatings: number;
    distribution: RatingDistribution[];
};

declare const DEFAULT_GOOD_RATING_THRESHOLD = 4;
declare const DEFAULT_FEEDBACK_OPTIONS: readonly ["Akurasi & Relevansi Modul", "Durasi Materi", "Audio/Desain Visual", "Others"];
declare const DEFAULT_THEME: Required<CourseRatingTheme>;
declare const DEFAULT_LABELS: Record<CourseRatingLanguage, CourseRatingLabels>;
declare function getLabels(language?: CourseRatingLanguage, overrides?: Partial<CourseRatingLabels>): CourseRatingLabels;
declare function getTheme(overrides?: CourseRatingTheme): Required<CourseRatingTheme>;

declare function normalizeFeedbackOptions(options: readonly string[] | undefined, othersLabel?: string): string[];
declare function isOthersOption(option: string, othersLabel?: string): boolean;

declare function buildSubmitPayload(input: BuildPayloadInput): CourseRatingSubmitPayload;

declare function getRatingSentiment(rating: number, goodRatingThreshold?: number): CourseRatingSentiment;
declare function getQuestionForRating(rating: number, labels: CourseRatingLabels, goodRatingThreshold?: number, customTitle?: string): string;
declare function getFeedbackQuestion(rating: number, labels: CourseRatingLabels, goodRatingThreshold?: number): string;

type RatingValidationResult = {
    isValid: boolean;
    hasRating: boolean;
    hasReason: boolean;
    needsOtherText: boolean;
    hasOtherText: boolean;
    hasFeedbackText: boolean;
};
declare function validateRatingForm(state: CourseRatingFormState, othersLabel?: string): RatingValidationResult;

export { type BuildPayloadInput, type CourseRatingAssets, type CourseRatingData, type CourseRatingFormState, type CourseRatingLabels, type CourseRatingLanguage, type CourseRatingProps, type CourseRatingSentiment, type CourseRatingSubmitPayload, type CourseRatingSummaryData, type CourseRatingTheme, type CourseTag, DEFAULT_FEEDBACK_OPTIONS, DEFAULT_GOOD_RATING_THRESHOLD, DEFAULT_LABELS, DEFAULT_THEME, type RatingDistribution, type RatingValidationResult, buildSubmitPayload, getFeedbackQuestion, getLabels, getQuestionForRating, getRatingSentiment, getTheme, isOthersOption, normalizeFeedbackOptions, validateRatingForm };
