UNPKG

@funkit/connect

Version:

Funkit Connect SDK elevates DeFi apps via web2 sign-ins and one-click checkouts.

17 lines (16 loc) 825 B
import type { TFunction } from 'i18next'; /** * Formats seconds to mins and seconds string with i18n support * This is a translatable wrapper around the formatSecondsToReadableForm function * * @param seconds - Number of seconds to format * @param t - Translation function from i18next * @param specifyUnderMinute - If true, shows "< 1 min" for values under 60 seconds * @param omitSeconds - If true, rounds up to nearest minute * @returns Formatted and translated time string * * @example * formatSecondsTranslated(20, t, true) // "< 1分钟" in Chinese or "< 1 min" in English * formatSecondsTranslated(90, t) // "1分钟30秒" in Chinese or "1 min 30 s" in English */ export declare function formatSecondsTranslated(seconds: number, t: TFunction, specifyUnderMinute?: boolean, omitSeconds?: boolean): string;