reading-time-estimator
Version:
A medium's like reading time estimator with internationalization support
28 lines (27 loc) • 781 B
TypeScript
import type { SupportedLanguages } from './i18n';
/**
* Reading time estimator result shape
*/
type ReadingTime = {
/**
* Number of minutes to read the text
*/
readonly minutes: number;
/**
* Number of words in the text
*/
readonly words: number;
/**
* Localized message with the number of minutes to read the text
*/
readonly text: string;
};
/**
*
* @param {string} data - The text to be estimated
* @param {number} wordsPerMinute - The number of words per minute
* @param {SupportedLanguages} language - The language of the text
* @returns {ReadingTime} The estimated reading time
*/
export declare const readingTime: (data: string, wordsPerMinute?: number, language?: SupportedLanguages) => ReadingTime;
export {};