typograf 6.15.0 → 7.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (308) hide show
  1. package/CHANGELOG.md +447 -0
  2. package/LICENSE.md +1 -1
  3. package/README.md +1 -1
  4. package/dist/consts.d.ts +2 -0
  5. package/dist/data/be.d.ts +8 -0
  6. package/dist/data/bg.d.ts +8 -0
  7. package/dist/data/ca.d.ts +8 -0
  8. package/dist/data/common.d.ts +6 -0
  9. package/dist/data/cs.d.ts +8 -0
  10. package/dist/data/da.d.ts +8 -0
  11. package/dist/data/de.d.ts +8 -0
  12. package/dist/data/el.d.ts +8 -0
  13. package/dist/data/en-GB.d.ts +8 -0
  14. package/dist/data/en-US.d.ts +8 -0
  15. package/dist/data/eo.d.ts +8 -0
  16. package/dist/data/es.d.ts +8 -0
  17. package/dist/data/et.d.ts +8 -0
  18. package/dist/data/fi.d.ts +8 -0
  19. package/dist/data/fr.d.ts +9 -0
  20. package/dist/data/ga.d.ts +8 -0
  21. package/dist/data/hu.d.ts +8 -0
  22. package/dist/data/index.d.ts +1 -0
  23. package/dist/data/it.d.ts +8 -0
  24. package/dist/data/lv.d.ts +8 -0
  25. package/dist/data/nl.d.ts +8 -0
  26. package/dist/data/no.d.ts +8 -0
  27. package/dist/data/pl.d.ts +8 -0
  28. package/dist/data/ro.d.ts +8 -0
  29. package/dist/data/ru.d.ts +19 -0
  30. package/dist/data/sk.d.ts +8 -0
  31. package/dist/data/sl.d.ts +8 -0
  32. package/dist/data/sr.d.ts +8 -0
  33. package/dist/data/sv.d.ts +8 -0
  34. package/dist/data/tr.d.ts +8 -0
  35. package/dist/data/uk.d.ts +8 -0
  36. package/dist/data.d.ts +16 -0
  37. package/dist/groupIndexes.d.ts +1 -0
  38. package/dist/helpers/object.d.ts +4 -0
  39. package/dist/helpers/regExp.d.ts +4 -0
  40. package/dist/helpers/string.d.ts +6 -0
  41. package/dist/htmlEntities/index.d.ts +41 -0
  42. package/dist/htmlEntities/invisible.d.ts +2 -0
  43. package/dist/htmlEntities/visible.d.ts +2 -0
  44. package/dist/htmlTags/block.d.ts +1 -0
  45. package/dist/htmlTags/inline.d.ts +1 -0
  46. package/dist/locale.d.ts +5 -0
  47. package/dist/main.d.ts +130 -0
  48. package/dist/prefs.d.ts +6 -0
  49. package/dist/rule.d.ts +9 -0
  50. package/dist/rules/common/html/e-mail.d.ts +2 -0
  51. package/dist/rules/common/html/e-mail.test.d.ts +1 -0
  52. package/dist/rules/common/html/escape.d.ts +2 -0
  53. package/dist/rules/common/html/escape.test.d.ts +1 -0
  54. package/dist/rules/common/html/index.d.ts +1 -0
  55. package/dist/rules/common/html/nbr.d.ts +2 -0
  56. package/dist/rules/common/html/nbr.test.d.ts +1 -0
  57. package/dist/rules/common/html/p.d.ts +2 -0
  58. package/dist/rules/common/html/p.test.d.ts +1 -0
  59. package/dist/rules/common/html/processingAttrs.d.ts +4 -0
  60. package/dist/rules/common/html/quot.d.ts +2 -0
  61. package/dist/rules/common/html/quot.test.d.ts +1 -0
  62. package/dist/rules/common/html/stripTags.d.ts +2 -0
  63. package/dist/rules/common/html/stripTags.test.d.ts +1 -0
  64. package/dist/rules/common/html/url.d.ts +2 -0
  65. package/dist/rules/common/html/url.test.d.ts +1 -0
  66. package/dist/rules/common/index.d.ts +7 -0
  67. package/dist/rules/common/nbsp/afterNumber.d.ts +2 -0
  68. package/dist/rules/common/nbsp/afterNumber.test.d.ts +1 -0
  69. package/dist/rules/common/nbsp/afterParagraphMark.d.ts +2 -0
  70. package/dist/rules/common/nbsp/afterParagraphMark.test.d.ts +1 -0
  71. package/dist/rules/common/nbsp/afterSectionMark.d.ts +2 -0
  72. package/dist/rules/common/nbsp/afterSectionMark.test.d.ts +1 -0
  73. package/dist/rules/common/nbsp/afterShortWord.d.ts +4 -0
  74. package/dist/rules/common/nbsp/afterShortWord.test.d.ts +1 -0
  75. package/dist/rules/common/nbsp/beforeShortLastNumber.d.ts +4 -0
  76. package/dist/rules/common/nbsp/beforeShortLastNumber.test.d.ts +1 -0
  77. package/dist/rules/common/nbsp/beforeShortLastWord.d.ts +4 -0
  78. package/dist/rules/common/nbsp/beforeShortLastWord.test.d.ts +1 -0
  79. package/dist/rules/common/nbsp/dpi.d.ts +2 -0
  80. package/dist/rules/common/nbsp/dpi.test.d.ts +1 -0
  81. package/dist/rules/common/nbsp/index.d.ts +1 -0
  82. package/dist/rules/common/nbsp/nowrap.d.ts +2 -0
  83. package/dist/rules/common/nbsp/nowrap.test.d.ts +1 -0
  84. package/dist/rules/common/nbsp/replaceNbsp.d.ts +2 -0
  85. package/dist/rules/common/nbsp/replaceNbsp.test.d.ts +1 -0
  86. package/dist/rules/common/number/digitGrouping.d.ts +4 -0
  87. package/dist/rules/common/number/digitGrouping.test.d.ts +1 -0
  88. package/dist/rules/common/number/fraction.d.ts +2 -0
  89. package/dist/rules/common/number/fraction.test.d.ts +1 -0
  90. package/dist/rules/common/number/index.d.ts +1 -0
  91. package/dist/rules/common/number/mathSigns.d.ts +2 -0
  92. package/dist/rules/common/number/mathSigns.test.d.ts +1 -0
  93. package/dist/rules/common/number/times.d.ts +2 -0
  94. package/dist/rules/common/number/times.test.d.ts +1 -0
  95. package/dist/rules/common/other/delBOM.d.ts +2 -0
  96. package/dist/rules/common/other/delBOM.test.d.ts +1 -0
  97. package/dist/rules/common/other/index.d.ts +1 -0
  98. package/dist/rules/common/other/repeatWord.d.ts +4 -0
  99. package/dist/rules/common/other/repeatWord.test.d.ts +1 -0
  100. package/dist/rules/common/punctuation/apostrophe.d.ts +2 -0
  101. package/dist/rules/common/punctuation/apostrophe.test.d.ts +1 -0
  102. package/dist/rules/common/punctuation/delDoublePunctuation.d.ts +2 -0
  103. package/dist/rules/common/punctuation/delDoublePunctuation.test.d.ts +1 -0
  104. package/dist/rules/common/punctuation/hellip.d.ts +2 -0
  105. package/dist/rules/common/punctuation/hellip.en-US.test.d.ts +1 -0
  106. package/dist/rules/common/punctuation/hellip.ru.test.d.ts +1 -0
  107. package/dist/rules/common/punctuation/index.d.ts +1 -0
  108. package/dist/rules/common/punctuation/quote.d.ts +5 -0
  109. package/dist/rules/common/punctuation/quote.de.test.d.ts +1 -0
  110. package/dist/rules/common/punctuation/quote.en-GB.test.d.ts +1 -0
  111. package/dist/rules/common/punctuation/quote.en-US.test.d.ts +1 -0
  112. package/dist/rules/common/punctuation/quote.fi.test.d.ts +1 -0
  113. package/dist/rules/common/punctuation/quote.fr.test.d.ts +1 -0
  114. package/dist/rules/common/punctuation/quote.pl.test.d.ts +1 -0
  115. package/dist/rules/common/punctuation/quote.ru.test.d.ts +1 -0
  116. package/dist/rules/common/punctuation/quoteLink.d.ts +2 -0
  117. package/dist/rules/common/punctuation/quoteLink.test.d.ts +1 -0
  118. package/dist/rules/common/space/afterColon.d.ts +2 -0
  119. package/dist/rules/common/space/afterColon.test.d.ts +1 -0
  120. package/dist/rules/common/space/afterComma.d.ts +2 -0
  121. package/dist/rules/common/space/afterComma.test.d.ts +1 -0
  122. package/dist/rules/common/space/afterExclamationMark.d.ts +2 -0
  123. package/dist/rules/common/space/afterExclamationMark.test.d.ts +1 -0
  124. package/dist/rules/common/space/afterQuestionMark.d.ts +2 -0
  125. package/dist/rules/common/space/afterQuestionMark.test.d.ts +1 -0
  126. package/dist/rules/common/space/afterSemicolon.d.ts +2 -0
  127. package/dist/rules/common/space/afterSemicolon.test.d.ts +1 -0
  128. package/dist/rules/common/space/beforeBracket.d.ts +2 -0
  129. package/dist/rules/common/space/beforeBracket.test.d.ts +1 -0
  130. package/dist/rules/common/space/bracket.d.ts +2 -0
  131. package/dist/rules/common/space/bracket.test.d.ts +1 -0
  132. package/dist/rules/common/space/delBeforeDot.d.ts +2 -0
  133. package/dist/rules/common/space/delBeforeDot.test.d.ts +1 -0
  134. package/dist/rules/common/space/delBeforePercent.d.ts +2 -0
  135. package/dist/rules/common/space/delBeforePercent.test.d.ts +1 -0
  136. package/dist/rules/common/space/delBeforePunctuation.d.ts +2 -0
  137. package/dist/rules/common/space/delBeforePunctuation.test.d.ts +1 -0
  138. package/dist/rules/common/space/delBetweenExclamationMarks.d.ts +2 -0
  139. package/dist/rules/common/space/delBetweenExclamationMarks.test.d.ts +1 -0
  140. package/dist/rules/common/space/delLeadingBlanks.d.ts +2 -0
  141. package/dist/rules/common/space/delLeadingBlanks.test.d.ts +1 -0
  142. package/dist/rules/common/space/delRepeatN.d.ts +4 -0
  143. package/dist/rules/common/space/delRepeatN.test.d.ts +1 -0
  144. package/dist/rules/common/space/delRepeatSpace.d.ts +2 -0
  145. package/dist/rules/common/space/delRepeatSpace.test.d.ts +1 -0
  146. package/dist/rules/common/space/delTrailingBlanks.d.ts +2 -0
  147. package/dist/rules/common/space/delTrailingBlanks.test.d.ts +1 -0
  148. package/dist/rules/common/space/index.d.ts +1 -0
  149. package/dist/rules/common/space/insertFinalNewline.d.ts +2 -0
  150. package/dist/rules/common/space/insertFinalNewline.test.d.ts +1 -0
  151. package/dist/rules/common/space/replaceTab.d.ts +2 -0
  152. package/dist/rules/common/space/replaceTab.test.d.ts +1 -0
  153. package/dist/rules/common/space/squareBracket.d.ts +2 -0
  154. package/dist/rules/common/space/squareBracket.test.d.ts +1 -0
  155. package/dist/rules/common/space/trimLeft.d.ts +2 -0
  156. package/dist/rules/common/space/trimLeft.test.d.ts +1 -0
  157. package/dist/rules/common/space/trimRight.d.ts +2 -0
  158. package/dist/rules/common/space/trimRight.test.d.ts +1 -0
  159. package/dist/rules/common/symbols/arrow.d.ts +2 -0
  160. package/dist/rules/common/symbols/arrow.test.d.ts +1 -0
  161. package/dist/rules/common/symbols/cf.d.ts +2 -0
  162. package/dist/rules/common/symbols/cf.test.d.ts +1 -0
  163. package/dist/rules/common/symbols/copy.d.ts +2 -0
  164. package/dist/rules/common/symbols/copy.test.d.ts +1 -0
  165. package/dist/rules/common/symbols/index.d.ts +1 -0
  166. package/dist/rules/en-US/dash/index.d.ts +1 -0
  167. package/dist/rules/en-US/dash/main.d.ts +2 -0
  168. package/dist/rules/en-US/dash/main.test.d.ts +1 -0
  169. package/dist/rules/en-US/index.d.ts +1 -0
  170. package/dist/rules/index.d.ts +3 -0
  171. package/dist/rules/ru/dash/centuries.d.ts +4 -0
  172. package/dist/rules/ru/dash/centuries.test.d.ts +1 -0
  173. package/dist/rules/ru/dash/daysMonth.d.ts +4 -0
  174. package/dist/rules/ru/dash/daysMonth.test.d.ts +1 -0
  175. package/dist/rules/ru/dash/de.d.ts +2 -0
  176. package/dist/rules/ru/dash/de.test.d.ts +1 -0
  177. package/dist/rules/ru/dash/decade.d.ts +4 -0
  178. package/dist/rules/ru/dash/decade.test.d.ts +1 -0
  179. package/dist/rules/ru/dash/directSpeech.d.ts +2 -0
  180. package/dist/rules/ru/dash/directSpeech.test.d.ts +1 -0
  181. package/dist/rules/ru/dash/index.d.ts +1 -0
  182. package/dist/rules/ru/dash/izpod.d.ts +2 -0
  183. package/dist/rules/ru/dash/izpod.test.d.ts +1 -0
  184. package/dist/rules/ru/dash/izza.d.ts +2 -0
  185. package/dist/rules/ru/dash/izza.test.d.ts +1 -0
  186. package/dist/rules/ru/dash/ka.d.ts +2 -0
  187. package/dist/rules/ru/dash/ka.test.d.ts +1 -0
  188. package/dist/rules/ru/dash/kakto.d.ts +2 -0
  189. package/dist/rules/ru/dash/kakto.test.d.ts +1 -0
  190. package/dist/rules/ru/dash/koe.d.ts +2 -0
  191. package/dist/rules/ru/dash/koe.test.d.ts +1 -0
  192. package/dist/rules/ru/dash/main.d.ts +2 -0
  193. package/dist/rules/ru/dash/main.test.d.ts +1 -0
  194. package/dist/rules/ru/dash/month.d.ts +4 -0
  195. package/dist/rules/ru/dash/month.test.d.ts +1 -0
  196. package/dist/rules/ru/dash/surname.d.ts +2 -0
  197. package/dist/rules/ru/dash/surname.test.d.ts +1 -0
  198. package/dist/rules/ru/dash/taki.d.ts +2 -0
  199. package/dist/rules/ru/dash/taki.test.d.ts +1 -0
  200. package/dist/rules/ru/dash/time.d.ts +4 -0
  201. package/dist/rules/ru/dash/time.test.d.ts +1 -0
  202. package/dist/rules/ru/dash/to.d.ts +2 -0
  203. package/dist/rules/ru/dash/to.test.d.ts +1 -0
  204. package/dist/rules/ru/dash/weekday.d.ts +4 -0
  205. package/dist/rules/ru/dash/weekday.test.d.ts +1 -0
  206. package/dist/rules/ru/dash/years.d.ts +4 -0
  207. package/dist/rules/ru/dash/years.test.d.ts +1 -0
  208. package/dist/rules/ru/date/fromISO.d.ts +2 -0
  209. package/dist/rules/ru/date/fromISO.test.d.ts +1 -0
  210. package/dist/rules/ru/date/index.d.ts +1 -0
  211. package/dist/rules/ru/date/weekday.d.ts +2 -0
  212. package/dist/rules/ru/date/weekday.test.d.ts +1 -0
  213. package/dist/rules/ru/index.d.ts +11 -0
  214. package/dist/rules/ru/money/currency.d.ts +2 -0
  215. package/dist/rules/ru/money/currency.test.d.ts +1 -0
  216. package/dist/rules/ru/money/index.d.ts +1 -0
  217. package/dist/rules/ru/money/ruble.d.ts +2 -0
  218. package/dist/rules/ru/money/ruble.test.d.ts +1 -0
  219. package/dist/rules/ru/nbsp/abbr.d.ts +2 -0
  220. package/dist/rules/ru/nbsp/abbr.test.d.ts +1 -0
  221. package/dist/rules/ru/nbsp/addr.d.ts +2 -0
  222. package/dist/rules/ru/nbsp/addr.test.d.ts +1 -0
  223. package/dist/rules/ru/nbsp/afterNumberSign.d.ts +2 -0
  224. package/dist/rules/ru/nbsp/afterNumberSign.test.d.ts +1 -0
  225. package/dist/rules/ru/nbsp/beforeParticle.d.ts +2 -0
  226. package/dist/rules/ru/nbsp/beforeParticle.test.d.ts +1 -0
  227. package/dist/rules/ru/nbsp/centuries.d.ts +2 -0
  228. package/dist/rules/ru/nbsp/centuries.test.d.ts +1 -0
  229. package/dist/rules/ru/nbsp/dayMonth.d.ts +2 -0
  230. package/dist/rules/ru/nbsp/dayMonth.test.d.ts +1 -0
  231. package/dist/rules/ru/nbsp/index.d.ts +1 -0
  232. package/dist/rules/ru/nbsp/initials.d.ts +2 -0
  233. package/dist/rules/ru/nbsp/initials.test.d.ts +1 -0
  234. package/dist/rules/ru/nbsp/m.d.ts +2 -0
  235. package/dist/rules/ru/nbsp/m.test.d.ts +1 -0
  236. package/dist/rules/ru/nbsp/mln.d.ts +2 -0
  237. package/dist/rules/ru/nbsp/mln.test.d.ts +1 -0
  238. package/dist/rules/ru/nbsp/ooo.d.ts +2 -0
  239. package/dist/rules/ru/nbsp/ooo.test.d.ts +1 -0
  240. package/dist/rules/ru/nbsp/page.d.ts +2 -0
  241. package/dist/rules/ru/nbsp/page.test.d.ts +1 -0
  242. package/dist/rules/ru/nbsp/ps.d.ts +2 -0
  243. package/dist/rules/ru/nbsp/ps.test.d.ts +1 -0
  244. package/dist/rules/ru/nbsp/rubleKopek.d.ts +2 -0
  245. package/dist/rules/ru/nbsp/rubleKopek.test.d.ts +1 -0
  246. package/dist/rules/ru/nbsp/see.d.ts +2 -0
  247. package/dist/rules/ru/nbsp/see.test.d.ts +1 -0
  248. package/dist/rules/ru/nbsp/year.d.ts +2 -0
  249. package/dist/rules/ru/nbsp/year.test.d.ts +1 -0
  250. package/dist/rules/ru/nbsp/years.d.ts +2 -0
  251. package/dist/rules/ru/nbsp/years.test.d.ts +1 -0
  252. package/dist/rules/ru/number/comma.d.ts +2 -0
  253. package/dist/rules/ru/number/comma.test.d.ts +1 -0
  254. package/dist/rules/ru/number/index.d.ts +1 -0
  255. package/dist/rules/ru/number/ordinals.d.ts +2 -0
  256. package/dist/rules/ru/number/ordinals.test.d.ts +1 -0
  257. package/dist/rules/ru/optalign/bracket.d.ts +4 -0
  258. package/dist/rules/ru/optalign/bracket.test.d.ts +1 -0
  259. package/dist/rules/ru/optalign/comma.d.ts +4 -0
  260. package/dist/rules/ru/optalign/comma.test.d.ts +1 -0
  261. package/dist/rules/ru/optalign/helpers.d.ts +2 -0
  262. package/dist/rules/ru/optalign/index.d.ts +1 -0
  263. package/dist/rules/ru/optalign/quote.d.ts +4 -0
  264. package/dist/rules/ru/optalign/quote.test.d.ts +1 -0
  265. package/dist/rules/ru/other/accent.d.ts +2 -0
  266. package/dist/rules/ru/other/accent.test.d.ts +1 -0
  267. package/dist/rules/ru/other/index.d.ts +1 -0
  268. package/dist/rules/ru/other/phone-number.d.ts +2 -0
  269. package/dist/rules/ru/other/phone-number.test.d.ts +1 -0
  270. package/dist/rules/ru/punctuation/ano.d.ts +2 -0
  271. package/dist/rules/ru/punctuation/ano.test.d.ts +1 -0
  272. package/dist/rules/ru/punctuation/exclamation.d.ts +2 -0
  273. package/dist/rules/ru/punctuation/exclamation.test.d.ts +1 -0
  274. package/dist/rules/ru/punctuation/exclamationQuestion.d.ts +2 -0
  275. package/dist/rules/ru/punctuation/exclamationQuestion.test.d.ts +1 -0
  276. package/dist/rules/ru/punctuation/hellipQuestion.d.ts +2 -0
  277. package/dist/rules/ru/punctuation/hellipQuestion.test.d.ts +1 -0
  278. package/dist/rules/ru/punctuation/index.d.ts +1 -0
  279. package/dist/rules/ru/space/afterHellip.d.ts +2 -0
  280. package/dist/rules/ru/space/afterHellip.test.d.ts +1 -0
  281. package/dist/rules/ru/space/index.d.ts +1 -0
  282. package/dist/rules/ru/space/year.d.ts +2 -0
  283. package/dist/rules/ru/space/year.test.d.ts +1 -0
  284. package/dist/rules/ru/symbols/NN.d.ts +2 -0
  285. package/dist/rules/ru/symbols/NN.test.d.ts +1 -0
  286. package/dist/rules/ru/symbols/index.d.ts +1 -0
  287. package/dist/rules/ru/typo/index.d.ts +1 -0
  288. package/dist/rules/ru/typo/switchingKeyboardLayout.d.ts +2 -0
  289. package/dist/rules/ru/typo/switchingKeyboardLayout.test.d.ts +1 -0
  290. package/dist/safeTags.d.ts +42 -0
  291. package/dist/typograf.all.d.ts +2 -0
  292. package/dist/typograf.all.js +3274 -3543
  293. package/dist/typograf.all.min.js +2 -2
  294. package/dist/typograf.css +5 -5
  295. package/dist/typograf.d.ts +3 -0
  296. package/dist/typograf.es.mjs +3268 -0
  297. package/dist/typograf.js +3175 -3050
  298. package/dist/typograf.min.js +2 -2
  299. package/dist/typograf.titles.js +1 -409
  300. package/dist/typograf.titles.json +1 -409
  301. package/dist/version.d.ts +1 -0
  302. package/docs/RULES.en-US.md +105 -105
  303. package/docs/RULES.ru.md +105 -105
  304. package/docs/RULES_SORTED.en-US.md +105 -105
  305. package/docs/RULES_SORTED.ru.md +105 -105
  306. package/package.json +47 -31
  307. package/dist/typograf.es.js +0 -3143
  308. package/typograf.d.ts +0 -51
@@ -0,0 +1,8 @@
1
+ declare const _default: {
2
+ 'no/char': string;
3
+ 'no/quote': {
4
+ left: string;
5
+ right: string;
6
+ };
7
+ };
8
+ export default _default;
@@ -0,0 +1,8 @@
1
+ declare const _default: {
2
+ 'pl/char': string;
3
+ 'pl/quote': {
4
+ left: string;
5
+ right: string;
6
+ };
7
+ };
8
+ export default _default;
@@ -0,0 +1,8 @@
1
+ declare const _default: {
2
+ 'ro/char': string;
3
+ 'ro/quote': {
4
+ left: string;
5
+ right: string;
6
+ };
7
+ };
8
+ export default _default;
@@ -0,0 +1,19 @@
1
+ declare const _default: {
2
+ 'ru/char': string;
3
+ 'ru/dashBefore': string;
4
+ 'ru/dashAfter': string;
5
+ 'ru/dashAfterDe': string;
6
+ 'ru/l': string;
7
+ 'ru/L': string;
8
+ 'ru/month': string;
9
+ 'ru/monthGenCase': string;
10
+ 'ru/monthPreCase': string;
11
+ 'ru/quote': {
12
+ left: string;
13
+ right: string;
14
+ removeDuplicateQuotes: boolean;
15
+ };
16
+ 'ru/shortMonth': string;
17
+ 'ru/weekday': string;
18
+ };
19
+ export default _default;
@@ -0,0 +1,8 @@
1
+ declare const _default: {
2
+ 'sk/char': string;
3
+ 'sk/quote': {
4
+ left: string;
5
+ right: string;
6
+ };
7
+ };
8
+ export default _default;
@@ -0,0 +1,8 @@
1
+ declare const _default: {
2
+ 'sl/char': string;
3
+ 'sl/quote': {
4
+ left: string;
5
+ right: string;
6
+ };
7
+ };
8
+ export default _default;
@@ -0,0 +1,8 @@
1
+ declare const _default: {
2
+ 'sr/char': string;
3
+ 'sr/quote': {
4
+ left: string;
5
+ right: string;
6
+ };
7
+ };
8
+ export default _default;
@@ -0,0 +1,8 @@
1
+ declare const _default: {
2
+ 'sv/char': string;
3
+ 'sv/quote': {
4
+ left: string;
5
+ right: string;
6
+ };
7
+ };
8
+ export default _default;
@@ -0,0 +1,8 @@
1
+ declare const _default: {
2
+ 'tr/char': string;
3
+ 'tr/quote': {
4
+ left: string;
5
+ right: string;
6
+ };
7
+ };
8
+ export default _default;
@@ -0,0 +1,8 @@
1
+ declare const _default: {
2
+ 'uk/char': string;
3
+ 'uk/quote': {
4
+ left: string;
5
+ right: string;
6
+ };
7
+ };
8
+ export default _default;
package/dist/data.d.ts ADDED
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Get data for use in rules.
3
+ */
4
+ export declare function getData(key: string): unknown;
5
+ /**
6
+ * Set data for use in rules.
7
+ */
8
+ export declare function setData(newData: Record<string, unknown>): void;
9
+ export type DataChar = string;
10
+ export type DataCommonQuote = string;
11
+ export type DataQuote = {
12
+ left: string;
13
+ right: string;
14
+ spacing?: boolean;
15
+ removeDuplicateQuotes?: true;
16
+ };
@@ -0,0 +1 @@
1
+ export declare const groupIndexes: Record<string, number>;
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Get a deep copy of a object.
3
+ */
4
+ export declare function deepCopy<T>(obj: T): T;
@@ -0,0 +1,4 @@
1
+ export declare const regExpUrl: RegExp;
2
+ export declare const regExpNumber = "\\d+([.,]\\d+)?";
3
+ export declare const regExpDigit: RegExp;
4
+ export declare function isDigit(symbol: string): boolean;
@@ -0,0 +1,6 @@
1
+ export declare function repeat(symbol: string, count: number): string;
2
+ export declare function replaceNbsp(text: string): string;
3
+ export declare function replace(text: string, re: [RegExp, string][]): string;
4
+ export declare function isHTML(text: string): boolean;
5
+ export declare function removeCR(text: string): string;
6
+ export declare function fixLineEnding(text: string, type: 'CRLF' | 'CR' | 'LF'): string;
@@ -0,0 +1,41 @@
1
+ import type { TypografContext } from '../main';
2
+ export type Entity = [string, number];
3
+ export type TypografHtmlEntityType = 'name' | 'digit' | 'default';
4
+ interface HtmlEntityInfo {
5
+ name: string;
6
+ nameEntity: string;
7
+ digitEntity: string;
8
+ utf: string;
9
+ reName: RegExp;
10
+ reUtf: RegExp;
11
+ }
12
+ declare class HtmlEntities {
13
+ private entities;
14
+ private invisibleEntities;
15
+ private entitiesByName;
16
+ private entitiesByNameEntity;
17
+ private entitiesByDigitEntity;
18
+ private entitiesByUtf;
19
+ constructor();
20
+ /**
21
+ * Entities as name or digit to UTF-8.
22
+ */
23
+ toUtf(context: TypografContext): void;
24
+ /**
25
+ * Entities in decimal or hexadecimal form to UTF-8.
26
+ */
27
+ decHexToUtf(text: string): string;
28
+ /**
29
+ * Restore HTML entities in text.
30
+ */
31
+ restore(context: TypografContext): void;
32
+ /**
33
+ * Get a entity by utf using the type.
34
+ */
35
+ getByUtf(symbol: string, type?: TypografHtmlEntityType): HtmlEntityInfo | string | undefined;
36
+ private prepareEntities;
37
+ private prepareListParam;
38
+ private restoreEntitiesByIndex;
39
+ }
40
+ export declare const htmlEntities: HtmlEntities;
41
+ export {};
@@ -0,0 +1,2 @@
1
+ import { Entity } from '.';
2
+ export declare const invisibleEntities: Entity[];
@@ -0,0 +1,2 @@
1
+ import { Entity } from '.';
2
+ export declare const visibleEntities: Entity[];
@@ -0,0 +1 @@
1
+ export declare const blockElements: string[];
@@ -0,0 +1 @@
1
+ export declare const inlineElements: string[];
@@ -0,0 +1,5 @@
1
+ export declare function addLocale(locale: string): void;
2
+ export declare function getLocales(): string[];
3
+ export declare function hasLocale(locale: string): boolean;
4
+ export declare function prepareLocale(locale1?: string | string[], locale2?: string | string[]): string[];
5
+ export declare function checkLocales(locales: string[]): void;
package/dist/main.d.ts ADDED
@@ -0,0 +1,130 @@
1
+ import { TypografHtmlEntityType } from './htmlEntities/index';
2
+ import { SafeTags } from './safeTags';
3
+ export type TypografLineEnding = 'LF' | 'CR' | 'CRLF';
4
+ export interface TypografHtmlEntity {
5
+ type: TypografHtmlEntityType;
6
+ onlyInvisible: boolean;
7
+ list?: string[];
8
+ }
9
+ export type TypofrafRuleFilter = (rule: TypografRuleInternal) => boolean;
10
+ export interface TypografPrefs {
11
+ locale: string | string[];
12
+ lineEnding?: TypografLineEnding;
13
+ htmlEntity?: Partial<TypografHtmlEntity>;
14
+ live?: boolean;
15
+ enableRule?: string | string[];
16
+ disableRule?: string | string[];
17
+ processingSeparateParts?: boolean;
18
+ ruleFilter?: TypofrafRuleFilter;
19
+ }
20
+ export interface TypografExecutePrefs {
21
+ locale?: string | string[];
22
+ lineEnding?: TypografLineEnding;
23
+ htmlEntity?: Partial<TypografHtmlEntity>;
24
+ processingSeparateParts?: boolean;
25
+ ruleFilter?: TypofrafRuleFilter;
26
+ }
27
+ export interface TypografPrefsInternal {
28
+ locale: string[];
29
+ lineEnding: TypografLineEnding;
30
+ htmlEntity: TypografHtmlEntity;
31
+ live: boolean;
32
+ enableRule: string | string[];
33
+ disableRule: string | string[];
34
+ processingSeparateParts: boolean;
35
+ ruleFilter: TypofrafRuleFilter;
36
+ }
37
+ export interface TypografContext {
38
+ text: string;
39
+ isHTML: boolean;
40
+ prefs: TypografPrefsInternal;
41
+ safeTags: SafeTags;
42
+ getData: (key: string) => unknown;
43
+ }
44
+ export interface TypografRule<T = Record<string, unknown>> {
45
+ name: string;
46
+ handler: (this: Typograf, text: string, settings: T, context: TypografContext) => string;
47
+ queue?: string;
48
+ index?: string | number;
49
+ disabled?: boolean;
50
+ live?: boolean;
51
+ settings?: T;
52
+ htmlAttrs?: boolean;
53
+ }
54
+ export interface TypografRuleInternal {
55
+ name: string;
56
+ handler: (text: string, settings: unknown, context: TypografContext) => string;
57
+ shortName: string;
58
+ locale: string;
59
+ group: string;
60
+ queue: string;
61
+ index: number;
62
+ enabled: boolean;
63
+ live: boolean;
64
+ settings: unknown;
65
+ htmlAttrs: boolean;
66
+ }
67
+ export declare class Typograf {
68
+ safeTags: SafeTags;
69
+ onBeforeRule?: (ruleName: string, context: TypografContext) => void;
70
+ onAfterRule?: (ruleName: string, context: TypografContext) => void;
71
+ private prefs;
72
+ private rules;
73
+ private innerRules;
74
+ private rulesByQueues;
75
+ private innerRulesByQueues;
76
+ private enabledRules;
77
+ private settings;
78
+ private separatePartsTags;
79
+ constructor(prefs: TypografPrefs);
80
+ static addRule(rule: TypografRule): void;
81
+ static addRules(rules: TypografRule[]): void;
82
+ /**
83
+ * Add internal rule.
84
+ * Internal rules are executed before main rules.
85
+ */
86
+ static addInnerRule(rule: TypografRule): void;
87
+ static addInnerRules(rules: TypografRule[]): void;
88
+ static getRule(ruleName: string): TypografRuleInternal | null;
89
+ static getRules(): TypografRuleInternal[];
90
+ static getInnerRules(): TypografRuleInternal[];
91
+ static getLocales(): string[];
92
+ static addLocale(locale: string): void;
93
+ static hasLocale(locale: string): boolean;
94
+ static setData(data: Record<string, unknown>): void;
95
+ static getData(key: string): unknown;
96
+ static groups: {
97
+ name: string;
98
+ title: Record<string, string>;
99
+ }[];
100
+ static titles: Record<string, Record<string, string>>;
101
+ static version: string;
102
+ /**
103
+ * Execute typographical rules for text.
104
+ */
105
+ execute(text: string | number, prefs?: TypografExecutePrefs): string;
106
+ getSetting(ruleName: string, setting: string): unknown;
107
+ setSetting(ruleName: string, setting: string, value: unknown): void;
108
+ isEnabledRule(ruleName: string): boolean;
109
+ isDisabledRule(ruleName: string): boolean;
110
+ enableRule(ruleName: string | string[]): void;
111
+ disableRule(ruleName: string | string[]): void;
112
+ /**
113
+ * Add safe tag.
114
+ *
115
+ * @example
116
+ * // const typograf = new Typograf({ locale: 'ru' });
117
+ * // typograf.addSafeTag('<mytag>', '</mytag>');
118
+ * // typograf.addSafeTag('<mytag>', '</mytag>', '.*?');
119
+ * // typograf.addSafeTag(/<mytag>.*?</mytag>/gi);
120
+ */
121
+ addSafeTag(startTag: string | RegExp, endTag?: string, middle?: string): void;
122
+ private prepareContext;
123
+ private splitBySeparateParts;
124
+ private process;
125
+ private executeRules;
126
+ private ruleIterator;
127
+ private prepareRuleSettings;
128
+ private enable;
129
+ private enableByMask;
130
+ }
@@ -0,0 +1,6 @@
1
+ import type { TypografLineEnding, TypografExecutePrefs, TypografPrefs, TypografPrefsInternal } from './main';
2
+ export declare function prepareHtmlEntity(htmlEntity?: Partial<TypografPrefsInternal['htmlEntity']>): TypografPrefsInternal['htmlEntity'];
3
+ export declare function prepareLineEnding(lineEnding?: TypografLineEnding): TypografLineEnding;
4
+ export declare function prepareProcessingSeparateParts(value?: boolean): boolean;
5
+ export declare function preparePrefs(prefs: TypografPrefs): TypografPrefsInternal;
6
+ export declare function prepareContextPrefs(prefs: TypografPrefsInternal, executePrefs?: TypografExecutePrefs): TypografPrefsInternal;
package/dist/rule.d.ts ADDED
@@ -0,0 +1,9 @@
1
+ import { TypografRule, TypografRuleInternal } from './main';
2
+ export declare const DEFAULT_RULE_INDEX = 0;
3
+ export declare const DEFAULT_QUEUE_NAME = "default";
4
+ export declare function addInnerRule(rule: TypografRule): void;
5
+ export declare function addRule(rule: TypografRule): void;
6
+ export declare function sortRules(rules: TypografRuleInternal[]): void;
7
+ export declare function getRules(): TypografRuleInternal[];
8
+ export declare function getInnerRules(): TypografRuleInternal[];
9
+ export declare function prepareRule(rule: TypografRule): TypografRuleInternal;
@@ -0,0 +1,2 @@
1
+ import type { TypografRule } from '../../../main';
2
+ export declare const eMailRule: TypografRule;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ import type { TypografRule } from '../../../main';
2
+ export declare const escapeRule: TypografRule;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ import type { TypografRule } from '../../../main';
2
+ export declare const nbrRule: TypografRule;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ import type { TypografRule } from '../../../main';
2
+ export declare const pRule: TypografRule;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ import type { TypografRule } from '../../../main';
2
+ export declare const processingAttrsRule: TypografRule<{
3
+ attrs: string[];
4
+ }>;
@@ -0,0 +1,2 @@
1
+ import type { TypografRule } from '../../../main';
2
+ export declare const quotRule: TypografRule;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ import type { TypografRule } from '../../../main';
2
+ export declare const stripTagsRule: TypografRule;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ import type { TypografRule } from '../../../main';
2
+ export declare const urlRule: TypografRule;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,7 @@
1
+ import './html/index';
2
+ import './nbsp/index';
3
+ import './number/index';
4
+ import './other/index';
5
+ import './punctuation/index';
6
+ import './space/index';
7
+ import './symbols/index';
@@ -0,0 +1,2 @@
1
+ import type { TypografRule } from '../../../main';
2
+ export declare const afterNumberRule: TypografRule;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ import type { TypografRule } from '../../../main';
2
+ export declare const afterParagraphMarkRule: TypografRule;
@@ -0,0 +1,2 @@
1
+ import type { TypografRule } from '../../../main';
2
+ export declare const afterSectionMarkRule: TypografRule;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ import type { TypografRule } from '../../../main';
2
+ export declare const afterShortWordRule: TypografRule<{
3
+ lengthShortWord: number;
4
+ }>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ import type { TypografRule } from '../../../main';
2
+ export declare const beforeShortLastNumberRule: TypografRule<{
3
+ lengthLastNumber: number;
4
+ }>;
@@ -0,0 +1,4 @@
1
+ import type { TypografRule } from '../../../main';
2
+ export declare const beforeShortLastWordRule: TypografRule<{
3
+ lengthLastWord: number;
4
+ }>;
@@ -0,0 +1,2 @@
1
+ import type { TypografRule } from '../../../main';
2
+ export declare const dpiRule: TypografRule;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ import type { TypografRule } from '../../../main';
2
+ export declare const nowrapRule: TypografRule;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ import type { TypografRule } from '../../../main';
2
+ export declare const replaceNbspRule: TypografRule;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ import type { TypografRule } from '../../../main';
2
+ export declare const digitGroupingRule: TypografRule<{
3
+ space: string;
4
+ }>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ import type { TypografRule } from '../../../main';
2
+ export declare const fractionRule: TypografRule;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ import type { TypografRule } from '../../../main';
2
+ export declare const mathSignsRule: TypografRule;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ import type { TypografRule } from '../../../main';
2
+ export declare const timesRule: TypografRule;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ import type { TypografRule } from '../../../main';
2
+ export declare const delBOMRule: TypografRule;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ import type { TypografRule } from '../../../main';
2
+ export declare const repeatWordRule: TypografRule<{
3
+ min: number;
4
+ }>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ import type { TypografRule } from '../../../main';
2
+ export declare const apostropheRule: TypografRule;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ import type { TypografRule } from '../../../main';
2
+ export declare const delDoublePunctuationRule: TypografRule;
@@ -0,0 +1,2 @@
1
+ import type { TypografRule } from '../../../main';
2
+ export declare const hellipRule: TypografRule;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,5 @@
1
+ import type { TypografRule } from '../../../main';
2
+ import { DataQuote } from '../../../data';
3
+ type QuoteRuleSettings = Record<string, DataQuote>;
4
+ export declare const quoteRule: TypografRule<QuoteRuleSettings>;
5
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};