import type { Lang, TopLangData } from "../fetchers/types.js"; import type { CommonCardOptions } from "./options.js"; declare const MIN_CARD_WIDTH = 280; type TopLangLayout = "compact" | "normal" | "donut" | "donut-vertical" | "pie"; interface TopLangOptions extends CommonCardOptions { locale: string; hide_title: boolean; card_width: number; hide: Array; layout: TopLangLayout; custom_title: string; langs_count: number; disable_animations: boolean; hide_progress: boolean; hide_values: boolean; prog_bar_bg_color: string; stats_format: "percentages" | "bytes"; } /** * Retrieves the programming language whose name is the longest. * * @param arr Array of programming languages. * @returns Longest programming language object. */ declare const getLongestLang: (arr: Array) => Pick; /** * Convert degrees to radians. * * @param angleInDegrees Angle in degrees. * @returns Angle in radians. */ declare const degreesToRadians: (angleInDegrees: number) => number; /** * Convert radians to degrees. * * @param angleInRadians Angle in radians. * @returns Angle in degrees. */ declare const radiansToDegrees: (angleInRadians: number) => number; /** * Convert polar coordinates to cartesian coordinates. * * @param centerX Center x coordinate. * @param centerY Center y coordinate. * @param radius Radius of the circle. * @param angleInDegrees Angle in degrees. * @returns Cartesian coordinates. */ declare const polarToCartesian: (centerX: number, centerY: number, radius: number, angleInDegrees: number) => { x: number; y: number; }; /** * Convert cartesian coordinates to polar coordinates. * * @param centerX Center x coordinate. * @param centerY Center y coordinate. * @param x Point x coordinate. * @param y Point y coordinate. * @returns Polar coordinates. */ declare const cartesianToPolar: (centerX: number, centerY: number, x: number, y: number) => { radius: number; angleInDegrees: number; }; /** * Calculates length of circle. * * @param radius Radius of the circle. * @returns The length of the circle. */ declare const getCircleLength: (radius: number) => number; /** * Calculates height for the compact layout. * * @param totalLangs Total number of languages. * @returns Card height. */ declare const calculateCompactLayoutHeight: (totalLangs: number) => number; /** * Calculates height for the normal layout. * * @param totalLangs Total number of languages. * @returns Card height. */ declare const calculateNormalLayoutHeight: (totalLangs: number) => number; /** * Calculates height for the donut layout. * * @param totalLangs Total number of languages. * @returns Card height. */ declare const calculateDonutLayoutHeight: (totalLangs: number) => number; /** * Calculates height for the donut vertical layout. * * @param totalLangs Total number of languages. * @returns Card height. */ declare const calculateDonutVerticalLayoutHeight: (totalLangs: number) => number; /** * Calculates height for the pie layout. * * @param totalLangs Total number of languages. * @returns Card height. */ declare const calculatePieLayoutHeight: (totalLangs: number) => number; /** * Calculates the center translation needed to keep the donut chart centred. * * @param totalLangs Total number of languages. * @returns Donut center translation. */ declare const donutCenterTranslation: (totalLangs: number) => number; /** * Trim top languages to lang_count while also hiding certain languages. * * @param topLangs Top languages. * @param langs_count Number of languages to show. * @param hide Languages to hide. * @returns Trimmed top languages and total size. */ declare const trimTopLanguages: (topLangs: TopLangData, langs_count: number, hide?: Array) => { langs: Array; totalLanguageSize: number; }; /** * Get default languages count for provided card layout. * * @param props Function properties. * @param props.layout Input layout string. * @param props.hide_progress Input hide_progress parameter value. * @returns Default languages count for input layout. */ declare const getDefaultLanguagesCountByLayout: ({ layout, hide_progress, }: { layout?: TopLangLayout | undefined; hide_progress?: boolean | undefined; }) => number; /** * Renders card that display user's most frequently used programming languages. * * @param topLangs User's most frequently used programming languages. * @param options Card options. * @returns Language card SVG object. */ declare const renderTopLanguages: (topLangs: TopLangData, options?: Partial) => string; export { getLongestLang, degreesToRadians, radiansToDegrees, polarToCartesian, cartesianToPolar, getCircleLength, calculateCompactLayoutHeight, calculateNormalLayoutHeight, calculateDonutLayoutHeight, calculateDonutVerticalLayoutHeight, calculatePieLayoutHeight, donutCenterTranslation, trimTopLanguages, renderTopLanguages, MIN_CARD_WIDTH, getDefaultLanguagesCountByLayout, }; //# sourceMappingURL=top-languages.d.ts.map