UNPKG

tajweed-ts

Version:

Tajweed and buck parsing library.

64 lines (62 loc) 2.04 kB
declare class Tajweed { meta: { identifier: string; type: string; description: string; default_css_class: string; html_color: string; }[]; constructor(); /** * Parses tajweed from the GlobalQuran and AlQuran APIs to return markup * @param string $text Verse text * @param boolean $fixWebkit Tries to fix for Chrome and Safari. This is experimental and has known problems. * @return string Parsed text that can be used to display tajweed */ parse(text: string, fixWebkit?: boolean): string; /** * [parseTajweed description] * @param string $text Verse text * @return String */ parseTajweed(text: string): string; /** * This method tries to add in a fix for webkit browsers that break with <tags> inside a string. * It does so by using the &zwj; joiner, but that does not always work. It's not smart enough to know, * for instance, when properly connect a meem to a yaa, among other things. Your best bet is to not use * this but use Firefox or the like. * See https://stackoverflow.com/questions/11155849/partially-colored-arabic-word-in-html * and https://bugs.webkit.org/show_bug.cgi?id=6148. * @param string $text Parsed tajweed verse with <tajweed> tags * @return string */ webkitFix(text: string): string; /** * [closeParsing description] * @param string text * @return string */ closeParsing(text: string): string; /** * Returns tajweed meta settings * @return array The Tajweed metadata array */ getMeta(): { identifier: string; type: string; description: string; default_css_class: string; html_color: string; }[]; } declare class Buck { trans: string; chars: string; buck: string; charsArr: string[]; buckArr: string[]; transArr: string[]; constructor(); toArabic(text: string[]): string; } export { Buck, Tajweed };