@wordpress/wordcount
Version:
WordPress word count utility.
8 lines (7 loc) • 2.32 kB
Source Map (JSON)
{
"version": 3,
"sources": ["../src/types.ts"],
"sourcesContent": ["/**\n * Possible ways of counting text.\n */\nexport type Strategy =\n\t| 'words'\n\t| 'characters_excluding_spaces'\n\t| 'characters_including_spaces';\n\n/**\n * L10n settings for word counting.\n */\nexport interface L10n {\n\t/**\n\t * The type of count to perform.\n\t */\n\ttype?: Strategy;\n\n\t/**\n\t * Array of shortcode names to be removed during counting.\n\t */\n\tshortcodes?: string[];\n}\n\n/**\n * Base settings fields that can be configured by users.\n */\nexport type UserSettings = Partial< Omit< Settings, 'type' | 'shortcodes' > >;\n\n/**\n * Complete settings object with all required properties.\n * This includes both static defaults and dynamic runtime properties.\n */\nexport interface Settings {\n\t/**\n\t * The type of count being performed (set at runtime).\n\t */\n\ttype: Strategy;\n\n\t/**\n\t * Regular expression that matches HTML tags.\n\t */\n\tHTMLRegExp: RegExp;\n\n\t/**\n\t * Regular expression that matches HTML comments.\n\t */\n\tHTMLcommentRegExp: RegExp;\n\n\t/**\n\t * Regular expression that matches spaces in HTML.\n\t */\n\tspaceRegExp: RegExp;\n\n\t/**\n\t * Regular expression that matches HTML entities.\n\t */\n\tHTMLEntityRegExp: RegExp;\n\n\t/**\n\t * Regular expression that matches word connectors, like em-dash.\n\t */\n\tconnectorRegExp: RegExp;\n\n\t/**\n\t * Regular expression that matches various characters to be removed when counting.\n\t */\n\tremoveRegExp: RegExp;\n\n\t/**\n\t * Regular expression that matches astral UTF-16 code points.\n\t */\n\tastralRegExp: RegExp;\n\n\t/**\n\t * Regular expression that matches words.\n\t */\n\twordsRegExp: RegExp;\n\n\t/**\n\t * Regular expression that matches characters excluding spaces.\n\t */\n\tcharacters_excluding_spacesRegExp: RegExp;\n\n\t/**\n\t * Regular expression that matches characters including spaces.\n\t */\n\tcharacters_including_spacesRegExp: RegExp;\n\n\t/**\n\t * Localization settings.\n\t */\n\tl10n: L10n;\n\n\t/**\n\t * Array of shortcode names (set at runtime from l10n.shortcodes).\n\t */\n\tshortcodes: string[];\n\n\t/**\n\t * Regular expression for matching shortcodes (generated at runtime).\n\t */\n\tshortcodesRegExp?: RegExp;\n}\n"],
"mappings": ";;;;;;;;;;;;;;;;AAAA;AAAA;",
"names": []
}