typecomposer 0.1.26 → 0.1.27

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 (384) hide show
  1. package/core/app/Validate.d.ts +61 -0
  2. package/core/app/Validate.js +2 -0
  3. package/core/app/Validate.js.map +1 -0
  4. package/core/app/index.d.ts +39 -0
  5. package/core/app/index.js +174 -0
  6. package/core/app/index.js.map +1 -0
  7. package/core/components/AlertPanel.d.ts +31 -0
  8. package/core/components/AlertPanel.js +74 -0
  9. package/core/components/AlertPanel.js.map +1 -0
  10. package/core/components/AvatarPanel.d.ts +20 -0
  11. package/core/components/AvatarPanel.js +62 -0
  12. package/core/components/AvatarPanel.js.map +1 -0
  13. package/core/components/BorderPanel.d.ts +27 -0
  14. package/core/components/BorderPanel.js +89 -0
  15. package/core/components/BorderPanel.js.map +1 -0
  16. package/core/components/CardPanel.d.ts +4 -0
  17. package/core/components/CardPanel.js +10 -0
  18. package/core/components/CardPanel.js.map +1 -0
  19. package/core/components/CheckBox.d.ts +34 -0
  20. package/core/components/CheckBox.js +107 -0
  21. package/core/components/CheckBox.js.map +1 -0
  22. package/core/components/ColorPicker.d.ts +9 -0
  23. package/core/components/ColorPicker.js +32 -0
  24. package/core/components/ColorPicker.js.map +1 -0
  25. package/core/components/ContextMenu.d.ts +14 -0
  26. package/core/components/ContextMenu.js +62 -0
  27. package/core/components/ContextMenu.js.map +1 -0
  28. package/core/components/DialogPanel.d.ts +14 -0
  29. package/core/components/DialogPanel.js +62 -0
  30. package/core/components/DialogPanel.js.map +1 -0
  31. package/core/components/DropDown.d.ts +51 -0
  32. package/core/components/DropDown.js +213 -0
  33. package/core/components/DropDown.js.map +1 -0
  34. package/core/components/FlowPanel.d.ts +10 -0
  35. package/core/components/FlowPanel.js +39 -0
  36. package/core/components/FlowPanel.js.map +1 -0
  37. package/core/components/ForEach.d.ts +10 -0
  38. package/core/components/ForEach.js +86 -0
  39. package/core/components/ForEach.js.map +1 -0
  40. package/core/components/GridPanel.d.ts +9 -0
  41. package/core/components/GridPanel.js +29 -0
  42. package/core/components/GridPanel.js.map +1 -0
  43. package/core/components/HBox.d.ts +4 -0
  44. package/core/components/HBox.js +9 -0
  45. package/core/components/HBox.js.map +1 -0
  46. package/core/components/LazyLoading.d.ts +18 -0
  47. package/core/components/LazyLoading.js +35 -0
  48. package/core/components/LazyLoading.js.map +1 -0
  49. package/core/components/ListPanel.d.ts +26 -0
  50. package/core/components/ListPanel.js +152 -0
  51. package/core/components/ListPanel.js.map +1 -0
  52. package/core/components/PopUpButton.d.ts +17 -0
  53. package/core/components/PopUpButton.js +54 -0
  54. package/core/components/PopUpButton.js.map +1 -0
  55. package/core/components/ScrollPanel.d.ts +13 -0
  56. package/core/components/ScrollPanel.js +34 -0
  57. package/core/components/ScrollPanel.js.map +1 -0
  58. package/core/components/StackPanel.d.ts +4 -0
  59. package/core/components/StackPanel.js +9 -0
  60. package/core/components/StackPanel.js.map +1 -0
  61. package/core/components/TabItem.d.ts +18 -0
  62. package/core/components/TabItem.js +81 -0
  63. package/core/components/TabItem.js.map +1 -0
  64. package/core/components/TabPanel.d.ts +24 -0
  65. package/core/components/TabPanel.js +95 -0
  66. package/core/components/TabPanel.js.map +1 -0
  67. package/core/components/TablePanel.d.ts +32 -0
  68. package/core/components/TablePanel.js +125 -0
  69. package/core/components/TablePanel.js.map +1 -0
  70. package/core/components/TextEdit.d.ts +31 -0
  71. package/core/components/TextEdit.js +172 -0
  72. package/core/components/TextEdit.js.map +1 -0
  73. package/core/components/TextField.d.ts +32 -0
  74. package/core/components/TextField.js +147 -0
  75. package/core/components/TextField.js.map +1 -0
  76. package/core/components/ToggleButton.d.ts +6 -0
  77. package/core/components/ToggleButton.js +19 -0
  78. package/core/components/ToggleButton.js.map +1 -0
  79. package/core/components/VBox.d.ts +4 -0
  80. package/core/components/VBox.js +9 -0
  81. package/core/components/VBox.js.map +1 -0
  82. package/core/components/VirtualScroll copy 2.d.ts +24 -0
  83. package/core/components/VirtualScroll copy 2.js +98 -0
  84. package/core/components/VirtualScroll copy 2.js.map +1 -0
  85. package/core/components/VirtualScroll.d.ts +19 -0
  86. package/core/components/VirtualScroll.js +46 -0
  87. package/core/components/VirtualScroll.js.map +1 -0
  88. package/core/components/index.d.ts +26 -0
  89. package/core/components/index.js +28 -0
  90. package/core/components/index.js.map +1 -0
  91. package/core/decorators/RegisterComponent.d.ts +8 -0
  92. package/core/decorators/RegisterComponent.js +5 -0
  93. package/core/decorators/RegisterComponent.js.map +1 -0
  94. package/core/decorators/StyleLink.d.ts +1 -0
  95. package/core/decorators/StyleLink.js +13 -0
  96. package/core/decorators/StyleLink.js.map +1 -0
  97. package/core/decorators/index.d.ts +4 -0
  98. package/core/decorators/index.js +6 -0
  99. package/core/decorators/index.js.map +1 -0
  100. package/core/element/AbbreviationElement.d.ts +6 -0
  101. package/core/element/AbbreviationElement.js +11 -0
  102. package/core/element/AbbreviationElement.js.map +1 -0
  103. package/core/element/AnchorElement.d.ts +23 -0
  104. package/core/element/AnchorElement.js +29 -0
  105. package/core/element/AnchorElement.js.map +1 -0
  106. package/core/element/AreaElement.d.ts +17 -0
  107. package/core/element/AreaElement.js +10 -0
  108. package/core/element/AreaElement.js.map +1 -0
  109. package/core/element/ArticleElement.d.ts +4 -0
  110. package/core/element/ArticleElement.js +11 -0
  111. package/core/element/ArticleElement.js.map +1 -0
  112. package/core/element/AudioElement.d.ts +11 -0
  113. package/core/element/AudioElement.js +9 -0
  114. package/core/element/AudioElement.js.map +1 -0
  115. package/core/element/BaseElement.d.ts +7 -0
  116. package/core/element/BaseElement.js +10 -0
  117. package/core/element/BaseElement.js.map +1 -0
  118. package/core/element/BodyElement.d.ts +4 -0
  119. package/core/element/BodyElement.js +10 -0
  120. package/core/element/BodyElement.js.map +1 -0
  121. package/core/element/BoldElement.d.ts +4 -0
  122. package/core/element/BoldElement.js +9 -0
  123. package/core/element/BoldElement.js.map +1 -0
  124. package/core/element/BreakElement.d.ts +4 -0
  125. package/core/element/BreakElement.js +9 -0
  126. package/core/element/BreakElement.js.map +1 -0
  127. package/core/element/ButtonElement.d.ts +25 -0
  128. package/core/element/ButtonElement.js +46 -0
  129. package/core/element/ButtonElement.js.map +1 -0
  130. package/core/element/CanvasElement.d.ts +4 -0
  131. package/core/element/CanvasElement.js +13 -0
  132. package/core/element/CanvasElement.js.map +1 -0
  133. package/core/element/CaptionElement.d.ts +4 -0
  134. package/core/element/CaptionElement.js +12 -0
  135. package/core/element/CaptionElement.js.map +1 -0
  136. package/core/element/CiteElement.d.ts +4 -0
  137. package/core/element/CiteElement.js +10 -0
  138. package/core/element/CiteElement.js.map +1 -0
  139. package/core/element/CodeElement.d.ts +6 -0
  140. package/core/element/CodeElement.js +12 -0
  141. package/core/element/CodeElement.js.map +1 -0
  142. package/core/element/DataListElement.d.ts +4 -0
  143. package/core/element/DataListElement.js +12 -0
  144. package/core/element/DataListElement.js.map +1 -0
  145. package/core/element/DefinitionDescriptionElement.d.ts +4 -0
  146. package/core/element/DefinitionDescriptionElement.js +12 -0
  147. package/core/element/DefinitionDescriptionElement.js.map +1 -0
  148. package/core/element/DefinitionElement.d.ts +4 -0
  149. package/core/element/DefinitionElement.js +12 -0
  150. package/core/element/DefinitionElement.js.map +1 -0
  151. package/core/element/DeletedTextElement.d.ts +6 -0
  152. package/core/element/DeletedTextElement.js +14 -0
  153. package/core/element/DeletedTextElement.js.map +1 -0
  154. package/core/element/DetailsElement.d.ts +8 -0
  155. package/core/element/DetailsElement.js +27 -0
  156. package/core/element/DetailsElement.js.map +1 -0
  157. package/core/element/DialogElement.d.ts +6 -0
  158. package/core/element/DialogElement.js +13 -0
  159. package/core/element/DialogElement.js.map +1 -0
  160. package/core/element/DivElement.d.ts +4 -0
  161. package/core/element/DivElement.js +9 -0
  162. package/core/element/DivElement.js.map +1 -0
  163. package/core/element/EmElement.d.ts +4 -0
  164. package/core/element/EmElement.js +9 -0
  165. package/core/element/EmElement.js.map +1 -0
  166. package/core/element/EmbedElement.d.ts +9 -0
  167. package/core/element/EmbedElement.js +18 -0
  168. package/core/element/EmbedElement.js.map +1 -0
  169. package/core/element/FieldSetElement.d.ts +8 -0
  170. package/core/element/FieldSetElement.js +33 -0
  171. package/core/element/FieldSetElement.js.map +1 -0
  172. package/core/element/FooterElement.d.ts +4 -0
  173. package/core/element/FooterElement.js +12 -0
  174. package/core/element/FooterElement.js.map +1 -0
  175. package/core/element/FormElement.d.ts +13 -0
  176. package/core/element/FormElement.js +9 -0
  177. package/core/element/FormElement.js.map +1 -0
  178. package/core/element/Fragment.d.ts +33 -0
  179. package/core/element/Fragment.js +146 -0
  180. package/core/element/Fragment.js.map +1 -0
  181. package/core/element/H1Element.d.ts +4 -0
  182. package/core/element/H1Element.js +9 -0
  183. package/core/element/H1Element.js.map +1 -0
  184. package/core/element/H2Element.d.ts +4 -0
  185. package/core/element/H2Element.js +9 -0
  186. package/core/element/H2Element.js.map +1 -0
  187. package/core/element/H3Element.d.ts +4 -0
  188. package/core/element/H3Element.js +9 -0
  189. package/core/element/H3Element.js.map +1 -0
  190. package/core/element/H4Element.d.ts +4 -0
  191. package/core/element/H4Element.js +9 -0
  192. package/core/element/H4Element.js.map +1 -0
  193. package/core/element/H5Element.d.ts +4 -0
  194. package/core/element/H5Element.js +9 -0
  195. package/core/element/H5Element.js.map +1 -0
  196. package/core/element/H6Element.d.ts +4 -0
  197. package/core/element/H6Element.js +9 -0
  198. package/core/element/H6Element.js.map +1 -0
  199. package/core/element/HeadElement.d.ts +4 -0
  200. package/core/element/HeadElement.js +10 -0
  201. package/core/element/HeadElement.js.map +1 -0
  202. package/core/element/HeaderElement.d.ts +4 -0
  203. package/core/element/HeaderElement.js +12 -0
  204. package/core/element/HeaderElement.js.map +1 -0
  205. package/core/element/HorizontalRuleElement.d.ts +4 -0
  206. package/core/element/HorizontalRuleElement.js +12 -0
  207. package/core/element/HorizontalRuleElement.js.map +1 -0
  208. package/core/element/HtmlElement.d.ts +8 -0
  209. package/core/element/HtmlElement.js +18 -0
  210. package/core/element/HtmlElement.js.map +1 -0
  211. package/core/element/IFrameElement.d.ts +27 -0
  212. package/core/element/IFrameElement.js +66 -0
  213. package/core/element/IFrameElement.js.map +1 -0
  214. package/core/element/ILayout.d.ts +4 -0
  215. package/core/element/ILayout.js +8 -0
  216. package/core/element/ILayout.js.map +1 -0
  217. package/core/element/IconElement.d.ts +13 -0
  218. package/core/element/IconElement.js +31 -0
  219. package/core/element/IconElement.js.map +1 -0
  220. package/core/element/ImageElement.d.ts +18 -0
  221. package/core/element/ImageElement.js +16 -0
  222. package/core/element/ImageElement.js.map +1 -0
  223. package/core/element/InputElement.d.ts +37 -0
  224. package/core/element/InputElement.js +81 -0
  225. package/core/element/InputElement.js.map +1 -0
  226. package/core/element/LabelElement.d.ts +7 -0
  227. package/core/element/LabelElement.js +9 -0
  228. package/core/element/LabelElement.js.map +1 -0
  229. package/core/element/LegendElement.d.ts +6 -0
  230. package/core/element/LegendElement.js +14 -0
  231. package/core/element/LegendElement.js.map +1 -0
  232. package/core/element/ListItemElement.d.ts +11 -0
  233. package/core/element/ListItemElement.js +27 -0
  234. package/core/element/ListItemElement.js.map +1 -0
  235. package/core/element/MainElement.d.ts +4 -0
  236. package/core/element/MainElement.js +9 -0
  237. package/core/element/MainElement.js.map +1 -0
  238. package/core/element/NavElement.d.ts +4 -0
  239. package/core/element/NavElement.js +9 -0
  240. package/core/element/NavElement.js.map +1 -0
  241. package/core/element/OrderedListElement.d.ts +4 -0
  242. package/core/element/OrderedListElement.js +9 -0
  243. package/core/element/OrderedListElement.js.map +1 -0
  244. package/core/element/ParagraphElement.d.ts +4 -0
  245. package/core/element/ParagraphElement.js +9 -0
  246. package/core/element/ParagraphElement.js.map +1 -0
  247. package/core/element/PreElement.d.ts +4 -0
  248. package/core/element/PreElement.js +9 -0
  249. package/core/element/PreElement.js.map +1 -0
  250. package/core/element/SectionElement.d.ts +4 -0
  251. package/core/element/SectionElement.js +11 -0
  252. package/core/element/SectionElement.js.map +1 -0
  253. package/core/element/SelectElement.d.ts +4 -0
  254. package/core/element/SelectElement.js +11 -0
  255. package/core/element/SelectElement.js.map +1 -0
  256. package/core/element/SourceElement.d.ts +7 -0
  257. package/core/element/SourceElement.js +13 -0
  258. package/core/element/SourceElement.js.map +1 -0
  259. package/core/element/SpanElement.d.ts +4 -0
  260. package/core/element/SpanElement.js +9 -0
  261. package/core/element/SpanElement.js.map +1 -0
  262. package/core/element/StrongElement.d.ts +4 -0
  263. package/core/element/StrongElement.js +11 -0
  264. package/core/element/StrongElement.js.map +1 -0
  265. package/core/element/StyleElement.d.ts +4 -0
  266. package/core/element/StyleElement.js +9 -0
  267. package/core/element/StyleElement.js.map +1 -0
  268. package/core/element/SummaryElement.d.ts +4 -0
  269. package/core/element/SummaryElement.js +11 -0
  270. package/core/element/SummaryElement.js.map +1 -0
  271. package/core/element/SvgElement.d.ts +17 -0
  272. package/core/element/SvgElement.js +149 -0
  273. package/core/element/SvgElement.js.map +1 -0
  274. package/core/element/TableBodyElement.d.ts +4 -0
  275. package/core/element/TableBodyElement.js +9 -0
  276. package/core/element/TableBodyElement.js.map +1 -0
  277. package/core/element/TableCellElement.d.ts +9 -0
  278. package/core/element/TableCellElement.js +24 -0
  279. package/core/element/TableCellElement.js.map +1 -0
  280. package/core/element/TableColElement.d.ts +6 -0
  281. package/core/element/TableColElement.js +12 -0
  282. package/core/element/TableColElement.js.map +1 -0
  283. package/core/element/TableColGroupElement.d.ts +6 -0
  284. package/core/element/TableColGroupElement.js +14 -0
  285. package/core/element/TableColGroupElement.js.map +1 -0
  286. package/core/element/TableElement.d.ts +44 -0
  287. package/core/element/TableElement.js +227 -0
  288. package/core/element/TableElement.js.map +1 -0
  289. package/core/element/TableFootElement.d.ts +4 -0
  290. package/core/element/TableFootElement.js +9 -0
  291. package/core/element/TableFootElement.js.map +1 -0
  292. package/core/element/TableFootRowElement.d.ts +8 -0
  293. package/core/element/TableFootRowElement.js +22 -0
  294. package/core/element/TableFootRowElement.js.map +1 -0
  295. package/core/element/TableHeadCellElement.d.ts +9 -0
  296. package/core/element/TableHeadCellElement.js +23 -0
  297. package/core/element/TableHeadCellElement.js.map +1 -0
  298. package/core/element/TableHeadElement.d.ts +4 -0
  299. package/core/element/TableHeadElement.js +9 -0
  300. package/core/element/TableHeadElement.js.map +1 -0
  301. package/core/element/TableHeadRowElement.d.ts +10 -0
  302. package/core/element/TableHeadRowElement.js +28 -0
  303. package/core/element/TableHeadRowElement.js.map +1 -0
  304. package/core/element/TableRowElement.d.ts +10 -0
  305. package/core/element/TableRowElement.js +28 -0
  306. package/core/element/TableRowElement.js.map +1 -0
  307. package/core/element/TextAreaElement.d.ts +6 -0
  308. package/core/element/TextAreaElement.js +9 -0
  309. package/core/element/TextAreaElement.js.map +1 -0
  310. package/core/element/UListElement.d.ts +4 -0
  311. package/core/element/UListElement.js +9 -0
  312. package/core/element/UListElement.js.map +1 -0
  313. package/core/element/VideoElement.d.ts +12 -0
  314. package/core/element/VideoElement.js +15 -0
  315. package/core/element/VideoElement.js.map +1 -0
  316. package/core/element/index.d.ts +71 -0
  317. package/core/element/index.js +72 -0
  318. package/core/element/index.js.map +1 -0
  319. package/core/event/index.d.ts +16 -0
  320. package/core/event/index.js +75 -0
  321. package/core/event/index.js.map +1 -0
  322. package/core/index.d.ts +9 -0
  323. package/core/index.js +10 -0
  324. package/core/index.js.map +1 -0
  325. package/core/ref/RefBoolean.d.ts +26 -0
  326. package/core/ref/RefBoolean.js +58 -0
  327. package/core/ref/RefBoolean.js.map +1 -0
  328. package/core/ref/RefContainer.d.ts +25 -0
  329. package/core/ref/RefContainer.js +105 -0
  330. package/core/ref/RefContainer.js.map +1 -0
  331. package/core/ref/RefList.d.ts +51 -0
  332. package/core/ref/RefList.js +155 -0
  333. package/core/ref/RefList.js.map +1 -0
  334. package/core/ref/RefMap.d.ts +25 -0
  335. package/core/ref/RefMap.js +71 -0
  336. package/core/ref/RefMap.js.map +1 -0
  337. package/core/ref/RefNumber.d.ts +30 -0
  338. package/core/ref/RefNumber.js +69 -0
  339. package/core/ref/RefNumber.js.map +1 -0
  340. package/core/ref/RefObject.d.ts +30 -0
  341. package/core/ref/RefObject.js +211 -0
  342. package/core/ref/RefObject.js.map +1 -0
  343. package/core/ref/RefProperty.d.ts +3 -0
  344. package/core/ref/RefProperty.js +46 -0
  345. package/core/ref/RefProperty.js.map +1 -0
  346. package/core/ref/RefSet.d.ts +25 -0
  347. package/core/ref/RefSet.js +72 -0
  348. package/core/ref/RefSet.js.map +1 -0
  349. package/core/ref/RefState.d.ts +23 -0
  350. package/core/ref/RefState.js +79 -0
  351. package/core/ref/RefState.js.map +1 -0
  352. package/core/ref/RefString.d.ts +75 -0
  353. package/core/ref/RefString.js +202 -0
  354. package/core/ref/RefString.js.map +1 -0
  355. package/core/ref/index.d.ts +21 -0
  356. package/core/ref/index.js +64 -0
  357. package/core/ref/index.js.map +1 -0
  358. package/core/router/RouteView.d.ts +19 -0
  359. package/core/router/RouteView.js +75 -0
  360. package/core/router/RouteView.js.map +1 -0
  361. package/core/router/Router.d.ts +70 -0
  362. package/core/router/Router.js +287 -0
  363. package/core/router/Router.js.map +1 -0
  364. package/core/router/RouterEvent.d.ts +36 -0
  365. package/core/router/RouterEvent.js +43 -0
  366. package/core/router/RouterEvent.js.map +1 -0
  367. package/core/router/RouterGuard.d.ts +12 -0
  368. package/core/router/RouterGuard.js +3 -0
  369. package/core/router/RouterGuard.js.map +1 -0
  370. package/core/router/index.d.ts +4 -0
  371. package/core/router/index.js +5 -0
  372. package/core/router/index.js.map +1 -0
  373. package/core/styles/index.d.ts +97 -0
  374. package/core/styles/index.js +36 -0
  375. package/core/styles/index.js.map +1 -0
  376. package/global/index.d.ts +79 -0
  377. package/global/index.js +931 -0
  378. package/global/index.js.map +1 -0
  379. package/global/safari-polyfill.d.ts +0 -0
  380. package/global/safari-polyfill.js +234 -0
  381. package/global/safari-polyfill.js.map +1 -0
  382. package/index.d.ts +3 -0
  383. package/index.js.map +1 -0
  384. package/package.json +7 -3
@@ -0,0 +1,211 @@
1
+ import { RefNumber, RefString, RefBoolean, RefMap, RefList, Ref, RefState } from ".";
2
+ import { RefContainer } from "./RefContainer";
3
+ import { RefSet } from "./RefSet";
4
+ class RefObjectContainer extends RefContainer {
5
+ refKey;
6
+ root;
7
+ instance = { value: null };
8
+ constructor(value, refKey, root) {
9
+ super(value, root);
10
+ this.refKey = refKey;
11
+ this.root = root;
12
+ RefObjectContainer.createObject.bind(this)(this.value, value, this);
13
+ }
14
+ valueOf() {
15
+ return this.instance.value;
16
+ }
17
+ static createObject(proxy, value, container) {
18
+ for (const key in value) {
19
+ const refKey = container.refKey && `${container.refKey}:${key}`;
20
+ if (value[key] instanceof Array) {
21
+ // @ts-ignore
22
+ proxy[key] = new RefList(...value[key], refKey);
23
+ }
24
+ else if (value[key] instanceof Set) {
25
+ // @ts-ignore
26
+ proxy[key] = new RefSet(value[key], refKey);
27
+ }
28
+ else if (value[key] instanceof Map) {
29
+ // @ts-ignore
30
+ proxy[key] = new RefMap(value[key], refKey);
31
+ }
32
+ else if (typeof value[key] === "string" || value[key] instanceof String) {
33
+ // @ts-ignore
34
+ proxy[key] = new RefString(value[key].valueOf(), refKey);
35
+ }
36
+ else if (typeof value[key] === "number" || value[key] instanceof Number) {
37
+ // @ts-ignore
38
+ proxy[key] = new RefNumber(value[key].valueOf(), refKey);
39
+ }
40
+ else if (typeof value[key] === "boolean" || value[key] instanceof Boolean) {
41
+ // @ts-ignore
42
+ proxy[key] = new RefBoolean(value[key].valueOf(), refKey);
43
+ }
44
+ else if (value[key] instanceof Element) {
45
+ //proxy[key] =
46
+ }
47
+ else if (value[key] instanceof Object) {
48
+ proxy[key] = creatObservador(value[key], new RefObjectContainer(value[key], refKey, (container["root"] || this)));
49
+ }
50
+ if (proxy[key] instanceof ref) {
51
+ // @ts-ignore
52
+ proxy[key]["container"].root = container.root || this;
53
+ }
54
+ }
55
+ }
56
+ static applyObject(proxy, value, container) {
57
+ const keysOld = Object.keys(proxy);
58
+ const keys = Object.keys(value);
59
+ const keysRemove = keysOld.filter((k) => !keys.includes(k));
60
+ const keysUpdate = keys.filter((k) => keysOld.includes(k));
61
+ const keysNew = keys.filter((k) => !keysOld.includes(k));
62
+ for (const key of keysRemove) {
63
+ if (!keys.includes(key)) {
64
+ // @ts-ignore
65
+ delete proxy[key];
66
+ }
67
+ }
68
+ for (const key of keysUpdate) {
69
+ // @ts-ignore
70
+ if (proxy[key] instanceof ref) {
71
+ // @ts-ignore
72
+ proxy[key].emit(key, value[key]);
73
+ }
74
+ // @ts-ignore
75
+ else if (!(proxy[key] instanceof Element) && proxy[key] instanceof Object) {
76
+ // @ts-ignore
77
+ RefObjectContainer.applyObject(proxy[key], value[key], container);
78
+ }
79
+ }
80
+ if (keysNew.length === 0)
81
+ return;
82
+ const newObject = {};
83
+ for (const key of keysNew) {
84
+ // @ts-ignore
85
+ newObject[key] = value[key];
86
+ }
87
+ RefObjectContainer.createObject.bind(this)(proxy, newObject, container);
88
+ }
89
+ emitAll(propertyName, value) {
90
+ super.emitAll(propertyName, value);
91
+ }
92
+ }
93
+ // @ts-ignore
94
+ function applyProxy(target, key, value, receiver, container) {
95
+ if (target[key] instanceof ref) {
96
+ // @ts-ignore
97
+ target[key].emit(key, value);
98
+ }
99
+ else if (!(target[key] instanceof Element) && target[key] instanceof Object) {
100
+ RefObjectContainer.applyObject(target[key], value, container);
101
+ }
102
+ else if (value !== undefined && value !== null) {
103
+ console.log("applyProxy", key, value);
104
+ RefObjectContainer.createObject(target, { [key]: value }, container);
105
+ }
106
+ else
107
+ Reflect.set(target, key, value, receiver);
108
+ return receiver;
109
+ }
110
+ function creatObservador(obj, container) {
111
+ const refObject = new Proxy(obj, {
112
+ // @ts-ignore
113
+ get(target, key, receiver) {
114
+ return Reflect.get(target, key, receiver);
115
+ },
116
+ // @ts-ignore
117
+ set(target, key, value, receiver) {
118
+ receiver = applyProxy(target, key, value, receiver, container);
119
+ console.log("set", key, value);
120
+ container.emitAll(key, value);
121
+ return receiver;
122
+ },
123
+ });
124
+ container.value = refObject;
125
+ return refObject;
126
+ }
127
+ export function ref(value, refKey) {
128
+ if (value === undefined || value === null)
129
+ throw new Error("ref: value cannot be null or undefined");
130
+ value = deepCopy(value);
131
+ if (typeof value === "string" || value instanceof String) {
132
+ return new RefString(value.valueOf(), refKey);
133
+ }
134
+ else if (typeof value === "number" || value instanceof Number) {
135
+ return new RefNumber(value.valueOf(), refKey);
136
+ }
137
+ else if (typeof value === "boolean" || value instanceof Boolean) {
138
+ return new RefBoolean(value.valueOf(), refKey);
139
+ }
140
+ else if (value instanceof Array) {
141
+ return new RefList(value, refKey);
142
+ }
143
+ else if (value instanceof Set) {
144
+ return new RefSet(value, refKey);
145
+ }
146
+ else if (value instanceof Map) {
147
+ return new RefMap(value, refKey);
148
+ }
149
+ const container = new RefObjectContainer(value, refKey || "");
150
+ const proxy = creatObservador(value, container);
151
+ const instance = {
152
+ value: proxy,
153
+ subscribe: container.subscribe.bind(container),
154
+ unsubscribe: container.unsubscribe.bind(container),
155
+ toString: container.toString.bind(container),
156
+ toJSON: container.toJSON.bind(container),
157
+ valueOf: container.valueOf.bind(container),
158
+ };
159
+ container["instance"] = instance;
160
+ Object.defineProperty(instance, Symbol.iterator, {
161
+ value: function* () {
162
+ for (const key in instance.value) {
163
+ yield instance.value[key]?.valueOf() || instance.value[key];
164
+ }
165
+ },
166
+ });
167
+ Object.defineProperty(instance, "value", {
168
+ get() {
169
+ return proxy;
170
+ },
171
+ set(value) {
172
+ RefObjectContainer.applyObject(proxy, value, container);
173
+ container.emitAll("value", value);
174
+ },
175
+ });
176
+ Object.setPrototypeOf(instance, ref.prototype);
177
+ // @ts-ignore
178
+ if (refKey)
179
+ Ref.set(refKey, instance);
180
+ return instance;
181
+ }
182
+ Object.defineProperty(ref, Symbol.hasInstance, {
183
+ value: function (instance) {
184
+ return (!!instance && typeof instance === "object" &&
185
+ (instance === ref ||
186
+ Object.getPrototypeOf(instance) === ref.prototype ||
187
+ instance instanceof RefString ||
188
+ instance instanceof RefNumber ||
189
+ instance instanceof RefBoolean ||
190
+ instance instanceof RefList ||
191
+ instance instanceof RefSet ||
192
+ instance instanceof RefMap ||
193
+ instance instanceof RefState));
194
+ },
195
+ });
196
+ export function computed(fn, observers) {
197
+ const r = ref(fn());
198
+ // @ts-ignore
199
+ const func = () => r.value = fn();
200
+ if (observers) {
201
+ for (const item of observers) {
202
+ if (item instanceof ref) {
203
+ // @ts-ignore
204
+ item.subscribe(func);
205
+ }
206
+ }
207
+ }
208
+ // @ts-ignore
209
+ return r;
210
+ }
211
+ //# sourceMappingURL=RefObject.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RefObject.js","sourceRoot":"","sources":["../../../src/core/ref/RefObject.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,SAAS,EAAwB,SAAS,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAmB,GAAG,EAAE,QAAQ,EAAE,MAAM,GAAG,CAAC;AACxI,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAU,MAAM,UAAU,CAAC;AAE1C,MAAM,kBAAmB,SAAQ,YAAY;IAKhC;IACA;IAJX,QAAQ,GAAmB,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;IAC3C,YACE,KAAa,EACJ,MAAc,EACd,IAAmB;QAE5B,KAAK,CAAC,KAAK,EAAE,IAAW,CAAC,CAAC;QAHjB,WAAM,GAAN,MAAM,CAAQ;QACd,SAAI,GAAJ,IAAI,CAAe;QAG5B,kBAAkB,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;IACtE,CAAC;IAED,OAAO;QACL,OAAO,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC;IAC7B,CAAC;IAED,MAAM,CAAC,YAAY,CAAC,KAAU,EAAE,KAAU,EAAE,SAA6B;QACvE,KAA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,EAAE,CAAC;YAC7B,IAAI,IAAI,YAAY,GAAG,EAAE,CAAC;gBACxB,aAAa;gBACb,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;YACvB,CAAC;QACH,CAAC;IACH,CAAC;IACD,aAAa;IACb,OAAO,CAAC,CAAC;AACX,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { RefString } from ".";
2
+ export declare function refProperty(value?: string, propertyName?: string): RefString;
3
+ export type refProperty = (value?: string, propertyName?: string) => RefString;
@@ -0,0 +1,46 @@
1
+ import { RefString } from ".";
2
+ export function refProperty(value, propertyName, target) {
3
+ if (!target)
4
+ throw new Error("refProperty: needs to be inside a component");
5
+ const ref = new RefString(value || target?.getAttribute(propertyName) || "");
6
+ // @ts-ignore
7
+ ref.propertyName = propertyName;
8
+ ref.subscribe((value) => {
9
+ // @ts-ignore
10
+ if (target?.getAttribute(ref.propertyName) === value)
11
+ return;
12
+ // @ts-ignore
13
+ target.setAttribute(ref.propertyName, value || "");
14
+ });
15
+ createObserver(target, ref);
16
+ return ref;
17
+ }
18
+ Object.defineProperty(refProperty, Symbol.hasInstance, {
19
+ value: function (instance) {
20
+ return !!instance && (instance instanceof RefString);
21
+ },
22
+ });
23
+ function createObserver(target, ref) {
24
+ if (target["___observer___"]) {
25
+ const ___refs___ = target["___observer___"]["___refs___"];
26
+ ___refs___.push(ref);
27
+ return target["___observer___"];
28
+ }
29
+ const observer = new MutationObserver((mutations) => {
30
+ mutations.forEach((mutation) => {
31
+ const items = observer["___refs___"];
32
+ if (mutation.attributeName) {
33
+ for (const ref of items) {
34
+ if (mutation.attributeName === ref.propertyName) {
35
+ ref.value = target.getAttribute(ref.propertyName) || "";
36
+ }
37
+ }
38
+ }
39
+ });
40
+ });
41
+ observer["___refs___"] = [ref];
42
+ observer.observe(target, { attributes: true });
43
+ target["___observer___"] = observer;
44
+ return observer;
45
+ }
46
+ //# sourceMappingURL=RefProperty.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Ref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IAClC,CAAC;IACD,MAAM,QAAQ,GAAG,IAAI,gBAAgB,CAAC,CAAC,SAAS,EAAE,EAAE;QAClD,SAAS,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,EAAE;YAC7B,MAAM,KAAK,GAAG,QAAQ,CAAC,YAAY,CAAC,CAAC;YACrC,IAAI,QAAQ,CAAC,aAAa,EAAE,CAAC;gBAC3B,KAAK,MAAM,GAAG,IAAI,KAAK,EAAE,CAAC;oBACxB,IAAI,QAAQ,CAAC,aAAa,KAAK,GAAG,CAAC,YAAY,EAAE,CAAC;wBAChD,GAAG,CAAC,KAAK,GAAG,MAAM,CAAC,YAAY,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC;oBAC1D,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IACH,QAAQ,CAAC,YAAY,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC/B,QAAQ,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC;IAC/C,MAAM,CAAC,gBAAgB,CAAC,GAAG,QAAQ,CAAC;IACpC,OAAO,QAAQ,CAAC;AAClB,CAAC"}
@@ -0,0 +1,25 @@
1
+ import { ref } from ".";
2
+ import { RefContainer } from "./RefContainer";
3
+ export declare function refSet<U>(values?: readonly U[] | null): RefSet<U>;
4
+ export type refSet<U> = Set<U> | RefSet<U>;
5
+ export declare class RefSet<U> extends Set<U> implements ref<Set<U>> {
6
+ readonly container: RefContainer;
7
+ readonly refKey: string;
8
+ constructor(values?: readonly U[] | null, refKey?: string);
9
+ private emit;
10
+ subscribe(target: (arg: Set<U>) => void): boolean;
11
+ subscribe(target: (arg: Set<U>) => void, onUnsubscribe: Function): boolean;
12
+ subscribe(target: object, propertyName: string | symbol): boolean;
13
+ subscribe(target: object, propertyName: string | symbol, onUnsubscribe: Function): boolean;
14
+ subscribe(target: object | ((arg: Set<U>) => void), propertyName: string | symbol | Function, onUnsubscribe?: Function): boolean;
15
+ unsubscribe(target: (arg: Set<U>) => void): boolean;
16
+ unsubscribe(targe: object, propertyName: string | symbol): boolean;
17
+ add(value: U): this;
18
+ delete(value: U): boolean;
19
+ clear(): void;
20
+ valueOf(): Set<U>;
21
+ static get [Symbol.species](): SetConstructor;
22
+ get value(): Set<U>;
23
+ set value(value: Set<U>);
24
+ toJSON(): any;
25
+ }
@@ -0,0 +1,72 @@
1
+ import { Ref } from ".";
2
+ import { RefContainer } from "./RefContainer";
3
+ export function refSet(values) {
4
+ return new RefSet(values);
5
+ }
6
+ Object.defineProperty(refSet, Symbol.hasInstance, {
7
+ value: function (instance) {
8
+ return !!instance && instance instanceof RefSet;
9
+ },
10
+ });
11
+ // @ts-ignore
12
+ export class RefSet extends Set {
13
+ container = new RefContainer(this);
14
+ refKey;
15
+ constructor(values, refKey) {
16
+ super();
17
+ this.refKey = refKey;
18
+ this.value = new Set(values);
19
+ refKey && Ref.set(refKey, this);
20
+ }
21
+ // @ts-ignore
22
+ emit(propertyName, value) {
23
+ this.container.emitAll(propertyName, value);
24
+ }
25
+ subscribe(target, propertyName, onUnsubscribe) {
26
+ return this.container.emit(this.container.subscribe(target, propertyName, onUnsubscribe), this);
27
+ }
28
+ unsubscribe(targe, propertyName = "") {
29
+ return this.container.unsubscribe(targe, propertyName);
30
+ }
31
+ add(value) {
32
+ const result = super.add(value);
33
+ this.container.emitAll("add", this);
34
+ return result;
35
+ }
36
+ delete(value) {
37
+ const result = super.delete(value);
38
+ this.container.emitAll("delete", this);
39
+ return result;
40
+ }
41
+ clear() {
42
+ super.clear();
43
+ this.container.emitAll("clear", this);
44
+ }
45
+ valueOf() {
46
+ return new Set(Array.from(this));
47
+ }
48
+ static get [Symbol.species]() {
49
+ return Set;
50
+ }
51
+ get value() {
52
+ return this.container.value.valueOf();
53
+ }
54
+ set value(value) {
55
+ if (this === value)
56
+ return;
57
+ super.clear();
58
+ for (const val of value) {
59
+ super.add(val);
60
+ }
61
+ this.emit("value", value);
62
+ }
63
+ toJSON() {
64
+ const obj = {};
65
+ let i = 0;
66
+ for (const v of this.value) {
67
+ obj[i++] = v;
68
+ }
69
+ return obj;
70
+ }
71
+ }
72
+ //# sourceMappingURL=RefSet.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RefSet.js","sourceRoot":"","sources":["../../../src/core/ref/RefSet.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAO,MAAM,GAAG,CAAC;AAC7B,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,MAAM,UAAU,MAAM,CAAI,MAA4B;IACpD,OAAO,IAAI,MAAM,CAAI,MAAM,CAAC,CAAC;AAC/B,CAAC;AAED,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,MAAM,CAAC,WAAW,EAAE;IAChD,KAAK,EAAE,UAAU,QAAa;QAC5B,OAAO,CAAC,CAAC,QAAQ,IAAI,QAAQ,YAAY,MAAM,CAAC;IAClD,CAAC;CACF,CAAC,CAAC;AAGH,aAAa;AACb,MAAM,OAAO,MAAU,SAAQ,GAAM;IAC1B,SAAS,GAAiB,IAAI,YAAY,CAAC,IAAI,CAAC,CAAC;IACjD,MAAM,CAAS;IAExB,YAAY,MAA4B,EAAE,MAAe;QACvD,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,KAAK,GAAG,IAAI,GAAG,CAAI,MAAM,CAAC,CAAC;QAChC,MAAM,IAAI,GAAG,CAAC,GAAG,CAAC,MAAM,EAAE,IAAW,CAAC,CAAC;IACzC,CAAC;IAED,aAAa;IACL,IAAI,CAAC,YAA6B,EAAE,KAAU;QACpD,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;IAC9C,CAAC;IAOD,SAAS,CAAC,MAAe,EAAE,YAAsB,EAAE,aAAuB;QACxE,OAAO,IAAI,CAAC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K,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACjB,CAAC;QACD,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IAC5B,CAAC;IAED,MAAM;QACJ,MAAM,GAAG,GAAQ,EAAE,CAAC;QACpB,IAAI,CAAC,GAAG,CAAC,CAAC;QACV,KAAK,MAAM,CAAC,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;YAC3B,GAAG,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;QACf,CAAC;QACD,OAAO,GAAG,CAAC;IACb,CAAC;CACF"}
@@ -0,0 +1,23 @@
1
+ import { ref } from ".";
2
+ export declare function refState<T>(refKey: string): RefState<T>;
3
+ export type refState<T> = RefState<T>;
4
+ export declare class RefState<T> implements ref<T> {
5
+ #private;
6
+ readonly refKey: string;
7
+ constructor(refKey: string);
8
+ get active(): boolean;
9
+ get ref(): ref<T>;
10
+ private emit;
11
+ subscribe(target: (arg: T) => void): boolean;
12
+ subscribe(target: (arg: T) => void, onUnsubscribe: Function): boolean;
13
+ subscribe(target: object, propertyName: string | symbol): boolean;
14
+ subscribe(target: object, propertyName: string | symbol, onUnsubscribe: Function): boolean;
15
+ subscribe(target: object | ((arg: boolean) => void), propertyName: string | symbol | Function, onUnsubscribe?: Function): boolean;
16
+ unsubscribe(target: (arg: T) => void): boolean;
17
+ unsubscribe(target: object, propertyName: string | symbol): boolean;
18
+ get value(): T;
19
+ set value(value: T);
20
+ valueOf(): T;
21
+ toJSON(): {};
22
+ toString(): string;
23
+ }
@@ -0,0 +1,79 @@
1
+ import { Ref } from ".";
2
+ export function refState(refKey) {
3
+ return new RefState(refKey);
4
+ }
5
+ Object.defineProperty(refState, Symbol.hasInstance, {
6
+ value: function (instance) {
7
+ return !!instance && instance instanceof RefState;
8
+ },
9
+ });
10
+ export class RefState {
11
+ refKey;
12
+ #ref;
13
+ #subscribers = [];
14
+ constructor(refKey) {
15
+ this.refKey = refKey;
16
+ this.#ref = Ref.get(refKey);
17
+ if (!this.#ref) {
18
+ Ref.onCreated(refKey, (ref) => {
19
+ this.#ref = ref;
20
+ for (const subscriber of this.#subscribers) {
21
+ // @ts-ignore
22
+ this.#ref?.subscribe(subscriber.target, subscriber.propertyName, subscriber.onUnsubscribe);
23
+ }
24
+ this.#subscribers = undefined;
25
+ });
26
+ }
27
+ }
28
+ get active() {
29
+ return !!this.#ref;
30
+ }
31
+ get ref() {
32
+ return this.#ref;
33
+ }
34
+ // @ts-ignore
35
+ emit(propertyName, value) {
36
+ if (this.ref) {
37
+ this.ref.value = value;
38
+ }
39
+ }
40
+ subscribe(target, propertyName, onUnsubscribe) {
41
+ if (this.ref) {
42
+ // @ts-ignore
43
+ return this.ref.subscribe(target, propertyName, onUnsubscribe);
44
+ }
45
+ this.#subscribers.push({ target, propertyName, onUnsubscribe });
46
+ return true;
47
+ }
48
+ unsubscribe(targe, propertyName = "") {
49
+ if (this.ref) {
50
+ // @ts-ignore
51
+ return this.ref.unsubscribe(targe, propertyName);
52
+ }
53
+ this.#subscribers = this.#subscribers.filter(subscriber => subscriber.target !== targe && subscriber.propertyName !== propertyName);
54
+ return true;
55
+ }
56
+ // @ts-ignore
57
+ get value() {
58
+ // @ts-ignore
59
+ return this.ref?.value;
60
+ }
61
+ // @ts-ignore
62
+ set value(value) {
63
+ if (this.ref) {
64
+ // @ts-ignore
65
+ this.ref.value = value;
66
+ }
67
+ }
68
+ valueOf() {
69
+ return this.ref?.valueOf();
70
+ }
71
+ // @ts-ignore
72
+ toJSON() {
73
+ return this.ref?.toJSON() || {};
74
+ }
75
+ toString() {
76
+ return "this.ref?.toString() || ";
77
+ }
78
+ }
79
+ //# sourceMappingURL=RefState.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RefState.js","sourceRoot":"","sources":["../../../src/core/ref/RefState.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAO,MAAM,GAAG,CAAC;AAE7B,MAAM,UAAU,QAAQ,CAAI,MAAc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;CACF"}
@@ -0,0 +1,75 @@
1
+ import { ref } from ".";
2
+ import { RefContainer } from "./RefContainer";
3
+ export declare function refString(value: string): RefString;
4
+ export type refString = string | RefString;
5
+ export declare class RefString implements ref<string> {
6
+ readonly container: RefContainer;
7
+ readonly [index: number]: string;
8
+ readonly refKey: string;
9
+ constructor(value: string, refKey?: string);
10
+ charAt(pos: number): string;
11
+ charCodeAt(index: number): number;
12
+ concat(...strings: string[]): string;
13
+ indexOf(searchString: string, position?: number): number;
14
+ lastIndexOf(searchString: string, position?: number): number;
15
+ localeCompare(that: string, locales?: Intl.LocalesArgument, options?: Intl.CollatorOptions): number;
16
+ match(regexp: string | RegExp): RegExpMatchArray | null;
17
+ replace(searchValue: string | RegExp, replacer: string): string;
18
+ search(searcher: string | RegExp): number;
19
+ slice(start?: number, end?: number): string;
20
+ split(separator: string | RegExp, limit?: number): string[];
21
+ substring(start: number, end?: number): string;
22
+ toLowerCase(): string;
23
+ toLocaleLowerCase(locales?: string): string;
24
+ toUpperCase(): string;
25
+ toLocaleUpperCase(locales?: string): string;
26
+ trim(): string;
27
+ substr(from: number, length?: number): string;
28
+ codePointAt(pos: number): number | undefined;
29
+ includes(searchString: string, position?: number): boolean;
30
+ endsWith(searchString: string, endPosition?: number): boolean;
31
+ normalize(form?: string): string;
32
+ repeat(count: number): string;
33
+ startsWith(searchString: string, position?: number): boolean;
34
+ anchor(name: string): string;
35
+ big(): string;
36
+ blink(): string;
37
+ bold(): string;
38
+ fixed(): string;
39
+ fontcolor(color: string): string;
40
+ fontsize(size: number | string): string;
41
+ italics(): string;
42
+ link(url: string): string;
43
+ small(): string;
44
+ strike(): string;
45
+ sub(): string;
46
+ sup(): string;
47
+ padStart(maxLength: number, fillString?: string): string;
48
+ padEnd(maxLength: number, fillString?: string): string;
49
+ trimEnd(): string;
50
+ trimStart(): string;
51
+ trimLeft(): string;
52
+ trimRight(): string;
53
+ matchAll(regexp: RegExp): RegExpStringIterator<RegExpExecArray>;
54
+ replaceAll(searchValue: string, replacer: string | ((substring: string, ...args: any[]) => string)): string;
55
+ [Symbol.iterator](): StringIterator<string>;
56
+ equals(value: string): boolean;
57
+ valueOf(): string;
58
+ get length(): number;
59
+ protected emit(propertyName: string | symbol, value: any): void;
60
+ subscribe(target: (arg: string) => void): boolean;
61
+ subscribe(target: (arg: string) => void, onUnsubscribe: Function): boolean;
62
+ subscribe(target: object, propertyName: string | symbol): boolean;
63
+ subscribe(target: object, propertyName: string | symbol, onUnsubscribe: Function): boolean;
64
+ subscribe(target: object | ((arg: string) => void), propertyName: string | symbol | Function, onUnsubscribe?: Function): boolean;
65
+ unsubscribe(target: (arg: string) => void): boolean;
66
+ unsubscribe(targe: object, propertyName: string | symbol): boolean;
67
+ [Symbol.toPrimitive](_hint: string): string;
68
+ static get [Symbol.species](): StringConstructor;
69
+ get value(): string;
70
+ set value(value: string);
71
+ toJSON(): string | {
72
+ value: string;
73
+ };
74
+ toString(): string;
75
+ }