adnbn 0.5.6 → 0.6.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 (505) hide show
  1. package/dist/cli/builders/app/command.d.ts +3 -6
  2. package/dist/cli/builders/app/index.d.ts +2 -14
  3. package/dist/cli/builders/locale/FirefoxLocaleValidator.d.ts +4 -7
  4. package/dist/cli/builders/locale/LocaleBuilder.d.ts +3 -6
  5. package/dist/cli/builders/locale/LocaleBuilder.js +3 -1
  6. package/dist/cli/builders/locale/LocaleBuilder.js.map +1 -1
  7. package/dist/cli/builders/locale/LocaleStructureValidator.d.ts +8 -0
  8. package/dist/cli/builders/locale/LocaleStructureValidator.js +64 -0
  9. package/dist/cli/builders/locale/LocaleStructureValidator.js.map +1 -0
  10. package/dist/cli/builders/locale/LocaleValidator.d.ts +4 -7
  11. package/dist/cli/builders/locale/LocaleValidator.js +2 -0
  12. package/dist/cli/builders/locale/LocaleValidator.js.map +1 -1
  13. package/dist/cli/builders/locale/OperaLocaleValidator.d.ts +4 -7
  14. package/dist/cli/builders/locale/index.d.ts +10 -19
  15. package/dist/cli/builders/locale/index.js +2 -0
  16. package/dist/cli/builders/locale/index.js.map +1 -1
  17. package/dist/cli/builders/manifest/ManifestBase.d.ts +30 -18
  18. package/dist/cli/builders/manifest/ManifestBase.js +212 -70
  19. package/dist/cli/builders/manifest/ManifestBase.js.map +1 -1
  20. package/dist/cli/builders/manifest/ManifestV2.d.ts +5 -12
  21. package/dist/cli/builders/manifest/ManifestV2.js +8 -7
  22. package/dist/cli/builders/manifest/ManifestV2.js.map +1 -1
  23. package/dist/cli/builders/manifest/ManifestV3.d.ts +5 -12
  24. package/dist/cli/builders/manifest/ManifestV3.js +9 -6
  25. package/dist/cli/builders/manifest/ManifestV3.js.map +1 -1
  26. package/dist/cli/builders/manifest/index.d.ts +3 -14
  27. package/dist/cli/builders/manifest/utils.d.ts +10 -15
  28. package/dist/cli/builders/manifest/utils.js +14 -2
  29. package/dist/cli/builders/manifest/utils.js.map +1 -1
  30. package/dist/cli/bundler/index.d.ts +2 -16
  31. package/dist/cli/bundler/plugins/EntrypointPlugin.d.ts +10 -19
  32. package/dist/cli/bundler/plugins/EntrypointPlugin.js +1 -0
  33. package/dist/cli/bundler/plugins/EntrypointPlugin.js.map +1 -1
  34. package/dist/cli/bundler/plugins/GenerateJsonPlugin.d.ts +5 -7
  35. package/dist/cli/bundler/plugins/GenerateJsonPlugin.js +1 -0
  36. package/dist/cli/bundler/plugins/GenerateJsonPlugin.js.map +1 -1
  37. package/dist/cli/bundler/plugins/ManifestPlugin.d.ts +3 -11
  38. package/dist/cli/bundler/plugins/ManifestPlugin.js +1 -0
  39. package/dist/cli/bundler/plugins/ManifestPlugin.js.map +1 -1
  40. package/dist/cli/bundler/plugins/ReplacePlugin.d.ts +3 -5
  41. package/dist/cli/bundler/plugins/ReplacePlugin.js +1 -0
  42. package/dist/cli/bundler/plugins/ReplacePlugin.js.map +1 -1
  43. package/dist/cli/bundler/plugins/WatchPlugin.d.ts +3 -6
  44. package/dist/cli/bundler/plugins/WatchPlugin.js +1 -0
  45. package/dist/cli/bundler/plugins/WatchPlugin.js.map +1 -1
  46. package/dist/cli/bundler/plugins/index.d.ts +5 -14
  47. package/dist/cli/bundler/utils/index.d.ts +2 -3
  48. package/dist/cli/bundler/utils/optimization.d.ts +2 -6
  49. package/dist/cli/bundler/utils/optimization.js +10 -98
  50. package/dist/cli/bundler/utils/optimization.js.map +1 -1
  51. package/dist/cli/bundler/utils/output.d.ts +2 -5
  52. package/dist/cli/entrypoint/file/ExpressionFile.d.ts +4 -10
  53. package/dist/cli/entrypoint/file/OptionFile.d.ts +3 -9
  54. package/dist/cli/entrypoint/file/SourceFile.d.ts +7 -11
  55. package/dist/cli/entrypoint/file/SourceFile.js +1 -0
  56. package/dist/cli/entrypoint/file/SourceFile.js.map +1 -1
  57. package/dist/cli/entrypoint/file/index.d.ts +4 -8
  58. package/dist/cli/entrypoint/file/injectors/core.d.ts +2 -4
  59. package/dist/cli/entrypoint/file/injectors/index.d.ts +2 -4
  60. package/dist/cli/entrypoint/file/parsers/AbstractParser.d.ts +6 -12
  61. package/dist/cli/entrypoint/file/parsers/AbstractParser.js +1 -0
  62. package/dist/cli/entrypoint/file/parsers/AbstractParser.js.map +1 -1
  63. package/dist/cli/entrypoint/file/parsers/ClassParser.d.ts +9 -15
  64. package/dist/cli/entrypoint/file/parsers/ClassParser.js +3 -0
  65. package/dist/cli/entrypoint/file/parsers/ClassParser.js.map +1 -1
  66. package/dist/cli/entrypoint/file/parsers/FunctionParser.d.ts +9 -17
  67. package/dist/cli/entrypoint/file/parsers/FunctionParser.js +3 -0
  68. package/dist/cli/entrypoint/file/parsers/FunctionParser.js.map +1 -1
  69. package/dist/cli/entrypoint/file/parsers/JSDocParser.d.ts +2 -5
  70. package/dist/cli/entrypoint/file/parsers/NodeFinder.d.ts +4 -10
  71. package/dist/cli/entrypoint/file/parsers/NodeFinder.js +1 -0
  72. package/dist/cli/entrypoint/file/parsers/NodeFinder.js.map +1 -1
  73. package/dist/cli/entrypoint/file/parsers/ObjectParser.d.ts +7 -15
  74. package/dist/cli/entrypoint/file/parsers/ObjectParser.js +1 -0
  75. package/dist/cli/entrypoint/file/parsers/ObjectParser.js.map +1 -1
  76. package/dist/cli/entrypoint/file/parsers/SignatureBuilder.d.ts +4 -12
  77. package/dist/cli/entrypoint/file/parsers/SignatureBuilder.js +5 -4
  78. package/dist/cli/entrypoint/file/parsers/SignatureBuilder.js.map +1 -1
  79. package/dist/cli/entrypoint/file/parsers/TypeResolver.d.ts +5 -11
  80. package/dist/cli/entrypoint/file/parsers/TypeResolver.js +2 -0
  81. package/dist/cli/entrypoint/file/parsers/TypeResolver.js.map +1 -1
  82. package/dist/cli/entrypoint/file/parsers/helpers/memberFilters.d.ts +1 -3
  83. package/dist/cli/entrypoint/file/parsers/index.d.ts +7 -14
  84. package/dist/cli/entrypoint/file/parsers/types.d.ts +4 -6
  85. package/dist/cli/entrypoint/file/resolvers/ImportResolver.d.ts +2 -6
  86. package/dist/cli/entrypoint/file/resolvers/ImportResolver.js +1 -0
  87. package/dist/cli/entrypoint/file/resolvers/ImportResolver.js.map +1 -1
  88. package/dist/cli/entrypoint/file/resolvers/TsResolver.d.ts +2 -5
  89. package/dist/cli/entrypoint/file/resolvers/index.d.ts +2 -3
  90. package/dist/cli/entrypoint/file/types.d.ts +5 -7
  91. package/dist/cli/entrypoint/finder/AbstractAssetFinder.d.ts +3 -16
  92. package/dist/cli/entrypoint/finder/AbstractEntrypointFinder.d.ts +4 -17
  93. package/dist/cli/entrypoint/finder/AbstractEntrypointFinder.js +22 -17
  94. package/dist/cli/entrypoint/finder/AbstractEntrypointFinder.js.map +1 -1
  95. package/dist/cli/entrypoint/finder/AbstractFinder.d.ts +4 -15
  96. package/dist/cli/entrypoint/finder/AbstractFinder.js +7 -2
  97. package/dist/cli/entrypoint/finder/AbstractFinder.js.map +1 -1
  98. package/dist/cli/entrypoint/finder/AbstractOptionsFinder.d.ts +3 -16
  99. package/dist/cli/entrypoint/finder/AbstractPluginFinder.d.ts +3 -18
  100. package/dist/cli/entrypoint/finder/AbstractTransportFinder.d.ts +9 -26
  101. package/dist/cli/entrypoint/finder/AbstractViewFinder.d.ts +9 -24
  102. package/dist/cli/entrypoint/finder/AssetPluginFinder.d.ts +8 -19
  103. package/dist/cli/entrypoint/finder/AssetPluginFinder.js +2 -0
  104. package/dist/cli/entrypoint/finder/AssetPluginFinder.js.map +1 -1
  105. package/dist/cli/entrypoint/finder/BackgroundFinder.d.ts +5 -19
  106. package/dist/cli/entrypoint/finder/CommandFinder.d.ts +7 -22
  107. package/dist/cli/entrypoint/finder/ContentFinder.d.ts +5 -19
  108. package/dist/cli/entrypoint/finder/IconFinder.d.ts +12 -25
  109. package/dist/cli/entrypoint/finder/LocaleFinder.d.ts +14 -22
  110. package/dist/cli/entrypoint/finder/LocaleFinder.js +23 -9
  111. package/dist/cli/entrypoint/finder/LocaleFinder.js.map +1 -1
  112. package/dist/cli/entrypoint/finder/OffscreenFinder.d.ts +5 -26
  113. package/dist/cli/entrypoint/finder/OffscreenViewFinder.d.ts +8 -29
  114. package/dist/cli/entrypoint/finder/OffscreenViewFinder.js +1 -0
  115. package/dist/cli/entrypoint/finder/OffscreenViewFinder.js.map +1 -1
  116. package/dist/cli/entrypoint/finder/PageFinder.d.ts +5 -22
  117. package/dist/cli/entrypoint/finder/PluginFinder.d.ts +7 -19
  118. package/dist/cli/entrypoint/finder/PluginFinder.js +2 -0
  119. package/dist/cli/entrypoint/finder/PluginFinder.js.map +1 -1
  120. package/dist/cli/entrypoint/finder/PopupFinder.d.ts +5 -22
  121. package/dist/cli/entrypoint/finder/RelayFinder.d.ts +5 -25
  122. package/dist/cli/entrypoint/finder/ServiceFinder.d.ts +5 -25
  123. package/dist/cli/entrypoint/finder/SidebarFinder.d.ts +5 -22
  124. package/dist/cli/entrypoint/finder/index.d.ts +18 -43
  125. package/dist/cli/entrypoint/index.d.ts +4 -64
  126. package/dist/cli/entrypoint/name/InlineNameGenerator.d.ts +2 -12
  127. package/dist/cli/entrypoint/name/NameGenerator.d.ts +2 -11
  128. package/dist/cli/entrypoint/name/NameGenerator.js +1 -0
  129. package/dist/cli/entrypoint/name/NameGenerator.js.map +1 -1
  130. package/dist/cli/entrypoint/name/index.d.ts +2 -9
  131. package/dist/cli/entrypoint/parser/AbstractParser.d.ts +14 -29
  132. package/dist/cli/entrypoint/parser/AbstractParser.js +1 -0
  133. package/dist/cli/entrypoint/parser/AbstractParser.js.map +1 -1
  134. package/dist/cli/entrypoint/parser/BackgroundParser.d.ts +3 -23
  135. package/dist/cli/entrypoint/parser/CommandParser.d.ts +4 -24
  136. package/dist/cli/entrypoint/parser/CommandParser.js +20 -5
  137. package/dist/cli/entrypoint/parser/CommandParser.js.map +1 -1
  138. package/dist/cli/entrypoint/parser/ContentParser.d.ts +4 -23
  139. package/dist/cli/entrypoint/parser/OffscreenParser.d.ts +3 -28
  140. package/dist/cli/entrypoint/parser/PageParser.d.ts +3 -26
  141. package/dist/cli/entrypoint/parser/PopupParser.d.ts +3 -26
  142. package/dist/cli/entrypoint/parser/RelayParser.d.ts +4 -27
  143. package/dist/cli/entrypoint/parser/ServiceParser.d.ts +3 -27
  144. package/dist/cli/entrypoint/parser/SidebarParser.d.ts +3 -26
  145. package/dist/cli/entrypoint/parser/ViewParser.d.ts +60 -80
  146. package/dist/cli/entrypoint/parser/index.d.ts +9 -38
  147. package/dist/cli/entrypoint/utils/framework.d.ts +3 -12
  148. package/dist/cli/entrypoint/utils/index.d.ts +2 -10
  149. package/dist/cli/entrypoint/utils/resolve.d.ts +3 -5
  150. package/dist/cli/index.d.ts +1 -2
  151. package/dist/cli/plugins/asset.d.ts +2 -15
  152. package/dist/cli/plugins/background/Background.d.ts +4 -21
  153. package/dist/cli/plugins/background/BackgroundEntry.d.ts +7 -21
  154. package/dist/cli/plugins/background/BackgroundEntry.js +1 -0
  155. package/dist/cli/plugins/background/BackgroundEntry.js.map +1 -1
  156. package/dist/cli/plugins/background/BackgroundManifest.d.ts +5 -21
  157. package/dist/cli/plugins/background/Command.d.ts +6 -23
  158. package/dist/cli/plugins/background/Service.d.ts +5 -27
  159. package/dist/cli/plugins/background/ServiceDeclaration.d.ts +3 -17
  160. package/dist/cli/plugins/background/index.d.ts +2 -15
  161. package/dist/cli/plugins/bundler.d.ts +2 -15
  162. package/dist/cli/plugins/content/Content.d.ts +9 -24
  163. package/dist/cli/plugins/content/ContentDriver.d.ts +7 -22
  164. package/dist/cli/plugins/content/ContentDriver.js +1 -0
  165. package/dist/cli/plugins/content/ContentDriver.js.map +1 -1
  166. package/dist/cli/plugins/content/ContentManager.d.ts +8 -19
  167. package/dist/cli/plugins/content/ContentName.d.ts +5 -17
  168. package/dist/cli/plugins/content/ContentName.js +1 -0
  169. package/dist/cli/plugins/content/ContentName.js.map +1 -1
  170. package/dist/cli/plugins/content/Relay.d.ts +9 -30
  171. package/dist/cli/plugins/content/RelayDeclaration.d.ts +3 -17
  172. package/dist/cli/plugins/content/index.d.ts +2 -15
  173. package/dist/cli/plugins/content/index.js +14 -3
  174. package/dist/cli/plugins/content/index.js.map +1 -1
  175. package/dist/cli/plugins/content/types.d.ts +8 -16
  176. package/dist/cli/plugins/content/utils.d.ts +2 -11
  177. package/dist/cli/plugins/dotenv/index.d.ts +3 -16
  178. package/dist/cli/plugins/dotenv/utils.d.ts +4 -7
  179. package/dist/cli/plugins/html.d.ts +2 -15
  180. package/dist/cli/plugins/icon/Icon.d.ts +6 -22
  181. package/dist/cli/plugins/icon/declaration/IconDeclaration.d.ts +3 -16
  182. package/dist/cli/plugins/icon/declaration/index.d.ts +1 -13
  183. package/dist/cli/plugins/icon/index.d.ts +4 -21
  184. package/dist/cli/plugins/index.d.ts +22 -58
  185. package/dist/cli/plugins/index.js +32 -30
  186. package/dist/cli/plugins/index.js.map +1 -1
  187. package/dist/cli/plugins/locale/Locale.d.ts +3 -20
  188. package/dist/cli/plugins/locale/declaration/LocaleDeclaration.d.ts +4 -16
  189. package/dist/cli/plugins/locale/declaration/index.d.ts +1 -13
  190. package/dist/cli/plugins/locale/declaration/locale.d.ts +61 -11
  191. package/dist/cli/plugins/locale/index.d.ts +2 -15
  192. package/dist/cli/plugins/locale/index.js +44 -49
  193. package/dist/cli/plugins/locale/index.js.map +1 -1
  194. package/dist/cli/plugins/manifest.d.ts +2 -0
  195. package/dist/cli/plugins/manifest.js +27 -0
  196. package/dist/cli/plugins/manifest.js.map +1 -0
  197. package/dist/cli/plugins/meta/AbstractMeta.d.ts +2 -15
  198. package/dist/cli/plugins/meta/AbstractMeta.js +1 -0
  199. package/dist/cli/plugins/meta/AbstractMeta.js.map +1 -1
  200. package/dist/cli/plugins/meta/Author.d.ts +3 -16
  201. package/dist/cli/plugins/meta/Homepage.d.ts +3 -16
  202. package/dist/cli/plugins/meta/Incognito.d.ts +4 -16
  203. package/dist/cli/plugins/meta/SpecificSettings.d.ts +4 -16
  204. package/dist/cli/plugins/meta/index.d.ts +7 -20
  205. package/dist/cli/plugins/offscreen/Offscreen.d.ts +11 -35
  206. package/dist/cli/plugins/offscreen/OffscreenDeclaration.d.ts +3 -17
  207. package/dist/cli/plugins/offscreen/index.d.ts +2 -15
  208. package/dist/cli/plugins/optimization.d.ts +2 -15
  209. package/dist/cli/plugins/optimization.js +42 -13
  210. package/dist/cli/plugins/optimization.js.map +1 -1
  211. package/dist/cli/plugins/output.d.ts +2 -15
  212. package/dist/cli/plugins/page/Page.d.ts +8 -26
  213. package/dist/cli/plugins/page/declaration/PageDeclaration.d.ts +3 -16
  214. package/dist/cli/plugins/page/declaration/index.d.ts +1 -13
  215. package/dist/cli/plugins/page/index.d.ts +2 -15
  216. package/dist/cli/plugins/popup/Popup.d.ts +9 -27
  217. package/dist/cli/plugins/popup/declaration/PopupDeclaration.d.ts +3 -16
  218. package/dist/cli/plugins/popup/declaration/index.d.ts +1 -13
  219. package/dist/cli/plugins/popup/index.d.ts +2 -15
  220. package/dist/cli/plugins/public.d.ts +2 -15
  221. package/dist/cli/plugins/react.d.ts +2 -15
  222. package/dist/cli/plugins/sidebar/Sidebar.d.ts +9 -27
  223. package/dist/cli/plugins/sidebar/declaration/SidebarDeclaration.d.ts +3 -16
  224. package/dist/cli/plugins/sidebar/declaration/index.d.ts +1 -13
  225. package/dist/cli/plugins/sidebar/index.d.ts +2 -15
  226. package/dist/cli/plugins/style.d.ts +2 -15
  227. package/dist/cli/plugins/typescript/FileBuilder.d.ts +2 -15
  228. package/dist/cli/plugins/typescript/FileBuilder.js +1 -0
  229. package/dist/cli/plugins/typescript/FileBuilder.js.map +1 -1
  230. package/dist/cli/plugins/typescript/TypescriptConfig.d.ts +4 -17
  231. package/dist/cli/plugins/typescript/declaration/index.d.ts +2 -14
  232. package/dist/cli/plugins/typescript/declaration/transport/TransportDeclaration.d.ts +4 -17
  233. package/dist/cli/plugins/typescript/declaration/transport/TransportDeclaration.js +1 -0
  234. package/dist/cli/plugins/typescript/declaration/transport/TransportDeclaration.js.map +1 -1
  235. package/dist/cli/plugins/typescript/declaration/transport/index.d.ts +1 -13
  236. package/dist/cli/plugins/typescript/declaration/vendor/VendorDeclaration.d.ts +3 -16
  237. package/dist/cli/plugins/typescript/declaration/vendor/index.d.ts +1 -13
  238. package/dist/cli/plugins/typescript/index.d.ts +6 -20
  239. package/dist/cli/plugins/version/AbstractVersion.d.ts +2 -15
  240. package/dist/cli/plugins/version/AbstractVersion.js +2 -1
  241. package/dist/cli/plugins/version/AbstractVersion.js.map +1 -1
  242. package/dist/cli/plugins/version/AddonVersion.d.ts +3 -16
  243. package/dist/cli/plugins/version/BrowserMinimumVersion.d.ts +3 -16
  244. package/dist/cli/plugins/version/index.d.ts +5 -18
  245. package/dist/cli/plugins/view/View.d.ts +10 -24
  246. package/dist/cli/plugins/view/View.js +2 -0
  247. package/dist/cli/plugins/view/View.js.map +1 -1
  248. package/dist/cli/plugins/view/index.d.ts +3 -22
  249. package/dist/cli/plugins/view/index.js +26 -12
  250. package/dist/cli/plugins/view/index.js.map +1 -1
  251. package/dist/cli/resolvers/bundler.d.ts +4 -15
  252. package/dist/cli/resolvers/config.d.ts +2 -14
  253. package/dist/cli/resolvers/config.js +46 -11
  254. package/dist/cli/resolvers/config.js.map +1 -1
  255. package/dist/cli/resolvers/path.d.ts +11 -24
  256. package/dist/cli/resolvers/plugin.d.ts +3 -16
  257. package/dist/cli/utils/fs.d.ts +3 -5
  258. package/dist/cli/utils/path.d.ts +3 -5
  259. package/dist/cli/utils/string.d.ts +2 -4
  260. package/dist/cli/virtual/background.d.ts +1 -0
  261. package/dist/cli/virtual/command.d.ts +1 -0
  262. package/dist/cli/virtual/content.d.ts +1 -0
  263. package/dist/cli/virtual/index.d.ts +9 -0
  264. package/dist/cli/virtual/index.js +2 -2
  265. package/dist/cli/virtual/offscreen.background.d.ts +1 -0
  266. package/dist/cli/virtual/offscreen.d.ts +1 -0
  267. package/dist/cli/virtual/relay.d.ts +1 -0
  268. package/dist/cli/virtual/transport.d.ts +1 -0
  269. package/dist/cli/virtual/view.d.ts +1 -0
  270. package/dist/cli/virtual/virtual.d.ts +38 -38
  271. package/dist/entry/background/Builder.d.ts +3 -12
  272. package/dist/entry/background/Builder.js +1 -0
  273. package/dist/entry/background/Builder.js.map +1 -1
  274. package/dist/entry/background/index.d.ts +3 -12
  275. package/dist/entry/background/resolvers/definition.d.ts +3 -12
  276. package/dist/entry/background/resolvers/index.d.ts +1 -8
  277. package/dist/entry/command/Builder.d.ts +4 -12
  278. package/dist/entry/command/index.d.ts +3 -12
  279. package/dist/entry/command/resolvers/definition.d.ts +4 -13
  280. package/dist/entry/command/resolvers/index.d.ts +1 -8
  281. package/dist/entry/content/adapters/react/Builder.d.ts +3 -17
  282. package/dist/entry/content/adapters/react/Node.d.ts +6 -14
  283. package/dist/entry/content/adapters/react/Node.js +2 -0
  284. package/dist/entry/content/adapters/react/Node.js.map +1 -1
  285. package/dist/entry/content/adapters/react/index.d.ts +4 -18
  286. package/dist/entry/content/adapters/react/resolvers/index.d.ts +1 -8
  287. package/dist/entry/content/adapters/react/resolvers/render.d.ts +2 -11
  288. package/dist/entry/content/adapters/vanilla/Builder.d.ts +3 -17
  289. package/dist/entry/content/adapters/vanilla/Node.d.ts +2 -11
  290. package/dist/entry/content/adapters/vanilla/Node.js +2 -0
  291. package/dist/entry/content/adapters/vanilla/Node.js.map +1 -1
  292. package/dist/entry/content/adapters/vanilla/index.d.ts +4 -18
  293. package/dist/entry/content/core/AbstractMarker.d.ts +2 -11
  294. package/dist/entry/content/core/AbstractMarker.js +1 -0
  295. package/dist/entry/content/core/AbstractMarker.js.map +1 -1
  296. package/dist/entry/content/core/AttributeMarker.d.ts +3 -12
  297. package/dist/entry/content/core/Builder.d.ts +8 -17
  298. package/dist/entry/content/core/Context.d.ts +2 -11
  299. package/dist/entry/content/core/Context.js +1 -0
  300. package/dist/entry/content/core/Context.js.map +1 -1
  301. package/dist/entry/content/core/EventEmitter.d.ts +2 -11
  302. package/dist/entry/content/core/EventNode.d.ts +2 -11
  303. package/dist/entry/content/core/EventNode.js +2 -0
  304. package/dist/entry/content/core/EventNode.js.map +1 -1
  305. package/dist/entry/content/core/ManagedContext.d.ts +3 -12
  306. package/dist/entry/content/core/MarkerNode.d.ts +2 -11
  307. package/dist/entry/content/core/MarkerNode.js +2 -0
  308. package/dist/entry/content/core/MarkerNode.js.map +1 -1
  309. package/dist/entry/content/core/MountBuilder.d.ts +3 -16
  310. package/dist/entry/content/core/MountNode.d.ts +2 -11
  311. package/dist/entry/content/core/MountNode.js +2 -0
  312. package/dist/entry/content/core/MountNode.js.map +1 -1
  313. package/dist/entry/content/core/Node.d.ts +2 -11
  314. package/dist/entry/content/core/Node.js +2 -0
  315. package/dist/entry/content/core/Node.js.map +1 -1
  316. package/dist/entry/content/core/WeakMarker.d.ts +3 -12
  317. package/dist/entry/content/core/resolvers/anchor.d.ts +2 -11
  318. package/dist/entry/content/core/resolvers/container.d.ts +2 -11
  319. package/dist/entry/content/core/resolvers/definition.d.ts +3 -12
  320. package/dist/entry/content/core/resolvers/index.d.ts +6 -13
  321. package/dist/entry/content/core/resolvers/mount.d.ts +2 -11
  322. package/dist/entry/content/core/resolvers/render.d.ts +3 -12
  323. package/dist/entry/content/core/resolvers/watch.d.ts +4 -13
  324. package/dist/entry/content/index.d.ts +1 -8
  325. package/dist/entry/core/Builder.d.ts +2 -11
  326. package/dist/entry/offscreen/Builder.d.ts +8 -25
  327. package/dist/entry/offscreen/Builder.js +8 -1
  328. package/dist/entry/offscreen/Builder.js.map +1 -1
  329. package/dist/entry/offscreen/TransportBuilder.d.ts +6 -24
  330. package/dist/entry/offscreen/index.d.ts +4 -25
  331. package/dist/entry/relay/Builder.d.ts +7 -21
  332. package/dist/entry/relay/Builder.js +1 -0
  333. package/dist/entry/relay/Builder.js.map +1 -1
  334. package/dist/entry/relay/TransportBuilder.d.ts +6 -20
  335. package/dist/entry/relay/index.d.ts +4 -21
  336. package/dist/entry/service/Builder.d.ts +6 -20
  337. package/dist/entry/service/index.d.ts +2 -14
  338. package/dist/entry/transport/AbstractBuilder.d.ts +4 -14
  339. package/dist/entry/transport/index.d.ts +1 -14
  340. package/dist/entry/transport/resolvers/definition.d.ts +7 -20
  341. package/dist/entry/transport/resolvers/index.d.ts +1 -14
  342. package/dist/entry/view/adapters/react/Builder.d.ts +4 -16
  343. package/dist/entry/view/adapters/react/index.d.ts +4 -17
  344. package/dist/entry/view/adapters/react/resolvers/render.d.ts +2 -13
  345. package/dist/entry/view/adapters/vanilla/Builder.d.ts +3 -15
  346. package/dist/entry/view/adapters/vanilla/index.d.ts +4 -16
  347. package/dist/entry/view/core/Builder.d.ts +3 -14
  348. package/dist/entry/view/core/resolvers/container.d.ts +2 -13
  349. package/dist/entry/view/core/resolvers/definition.d.ts +3 -14
  350. package/dist/entry/view/core/resolvers/render.d.ts +3 -14
  351. package/dist/entry/view/index.d.ts +1 -10
  352. package/dist/index.d.ts +1 -43
  353. package/dist/locale/adapters/react/LocaleProvider.d.ts +4 -6
  354. package/dist/locale/adapters/react/LocaleProvider.js +5 -5
  355. package/dist/locale/adapters/react/LocaleProvider.js.map +1 -1
  356. package/dist/locale/adapters/react/context.d.ts +8 -13
  357. package/dist/locale/adapters/react/context.js +2 -5
  358. package/dist/locale/adapters/react/context.js.map +1 -1
  359. package/dist/locale/adapters/react/index.d.ts +2 -6
  360. package/dist/locale/helpers.d.ts +60 -36
  361. package/dist/locale/helpers.js +14 -14
  362. package/dist/locale/helpers.js.map +1 -1
  363. package/dist/locale/index.d.ts +3 -7
  364. package/dist/locale/index.js.map +1 -1
  365. package/dist/locale/providers/AbstractLocale.d.ts +5 -8
  366. package/dist/locale/providers/AbstractLocale.js +9 -6
  367. package/dist/locale/providers/AbstractLocale.js.map +1 -1
  368. package/dist/locale/providers/CustomLocale.d.ts +5 -8
  369. package/dist/locale/providers/CustomLocale.js +3 -1
  370. package/dist/locale/providers/CustomLocale.js.map +1 -1
  371. package/dist/locale/providers/DynamicLocale.d.ts +7 -11
  372. package/dist/locale/providers/DynamicLocale.js +1 -1
  373. package/dist/locale/providers/DynamicLocale.js.map +1 -1
  374. package/dist/locale/providers/NativeLocale.d.ts +7 -10
  375. package/dist/locale/providers/NativeLocale.js.map +1 -1
  376. package/dist/locale/providers/index.d.ts +3 -6
  377. package/dist/locale/utils.d.ts +11 -14
  378. package/dist/main/app.d.ts +1 -1
  379. package/dist/main/app.js +3 -2
  380. package/dist/main/app.js.map +1 -1
  381. package/dist/main/background.d.ts +3 -12
  382. package/dist/main/browser.d.ts +1 -1
  383. package/dist/main/command.d.ts +4 -13
  384. package/dist/main/config.d.ts +3 -16
  385. package/dist/main/config.js.map +1 -1
  386. package/dist/main/content.d.ts +6 -18
  387. package/dist/main/env.d.ts +7 -15
  388. package/dist/main/icon.d.ts +6 -7
  389. package/dist/main/index.d.ts +17 -43
  390. package/dist/main/manifest.d.ts +1 -7
  391. package/dist/main/offscreen.d.ts +9 -22
  392. package/dist/main/offscreen.js +1 -1
  393. package/dist/main/offscreen.js.map +1 -1
  394. package/dist/main/page.d.ts +7 -19
  395. package/dist/main/plugin.d.ts +3 -16
  396. package/dist/main/popup.d.ts +8 -18
  397. package/dist/main/popup.js +2 -2
  398. package/dist/main/popup.js.map +1 -1
  399. package/dist/main/relay.d.ts +8 -21
  400. package/dist/main/service.d.ts +6 -15
  401. package/dist/main/sidebar.d.ts +8 -18
  402. package/dist/main/sidebar.js +2 -2
  403. package/dist/main/sidebar.js.map +1 -1
  404. package/dist/main/view.d.ts +1 -9
  405. package/dist/message/MessageManager.d.ts +2 -5
  406. package/dist/message/adapters/react/index.d.ts +1 -2
  407. package/dist/message/adapters/react/useMessageHandler.d.ts +2 -5
  408. package/dist/message/handlers/AbstractHandler.d.ts +2 -5
  409. package/dist/message/handlers/GeneralHandler.d.ts +3 -6
  410. package/dist/message/handlers/GeneralHandler.js +1 -0
  411. package/dist/message/handlers/GeneralHandler.js.map +1 -1
  412. package/dist/message/handlers/MapHandler.d.ts +3 -6
  413. package/dist/message/handlers/MapHandler.js +1 -0
  414. package/dist/message/handlers/MapHandler.js.map +1 -1
  415. package/dist/message/handlers/SingleHandler.d.ts +3 -6
  416. package/dist/message/handlers/SingleHandler.js +2 -0
  417. package/dist/message/handlers/SingleHandler.js.map +1 -1
  418. package/dist/message/handlers/index.d.ts +3 -5
  419. package/dist/message/index.d.ts +9 -13
  420. package/dist/message/providers/AbstractMessage.d.ts +2 -5
  421. package/dist/message/providers/Message.d.ts +4 -7
  422. package/dist/message/providers/index.d.ts +1 -4
  423. package/dist/offscreen/OffscreenBackground.d.ts +2 -9
  424. package/dist/offscreen/OffscreenBridge.d.ts +8 -9
  425. package/dist/offscreen/OffscreenBridge.js +55 -7
  426. package/dist/offscreen/OffscreenBridge.js.map +1 -1
  427. package/dist/offscreen/OffscreenManager.d.ts +4 -15
  428. package/dist/offscreen/OffscreenMessage.d.ts +2 -14
  429. package/dist/offscreen/index.d.ts +5 -26
  430. package/dist/offscreen/providers/Offscreen.d.ts +3 -14
  431. package/dist/offscreen/providers/ProxyOffscreen.d.ts +7 -18
  432. package/dist/offscreen/providers/ProxyOffscreen.js +44 -23
  433. package/dist/offscreen/providers/ProxyOffscreen.js.map +1 -1
  434. package/dist/offscreen/providers/RegisterOffscreen.d.ts +5 -18
  435. package/dist/offscreen/providers/RegisterOffscreen.js +1 -0
  436. package/dist/offscreen/providers/RegisterOffscreen.js.map +1 -1
  437. package/dist/offscreen/providers/index.d.ts +3 -17
  438. package/dist/offscreen/utils.d.ts +1 -3
  439. package/dist/relay/RelayManager.d.ts +6 -16
  440. package/dist/relay/RelayMessage.d.ts +2 -14
  441. package/dist/relay/RelayPermission.d.ts +4 -15
  442. package/dist/relay/index.d.ts +4 -22
  443. package/dist/relay/providers/ProxyRelay.d.ts +8 -19
  444. package/dist/relay/providers/ProxyRelay.js +2 -0
  445. package/dist/relay/providers/ProxyRelay.js.map +1 -1
  446. package/dist/relay/providers/RegisterRelay.d.ts +4 -16
  447. package/dist/relay/providers/RegisterRelay.js +2 -0
  448. package/dist/relay/providers/RegisterRelay.js.map +1 -1
  449. package/dist/relay/providers/Relay.d.ts +3 -14
  450. package/dist/relay/providers/index.d.ts +3 -18
  451. package/dist/relay/utils.d.ts +3 -5
  452. package/dist/service/ServiceManager.d.ts +4 -15
  453. package/dist/service/ServiceMessage.d.ts +2 -14
  454. package/dist/service/index.d.ts +4 -19
  455. package/dist/service/providers/ProxyService.d.ts +4 -15
  456. package/dist/service/providers/RegisterService.d.ts +3 -15
  457. package/dist/service/providers/RegisterService.js +1 -0
  458. package/dist/service/providers/RegisterService.js.map +1 -1
  459. package/dist/service/providers/Service.d.ts +3 -14
  460. package/dist/service/providers/index.d.ts +3 -15
  461. package/dist/transport/BaseTransport.d.ts +2 -13
  462. package/dist/transport/BaseTransport.js +1 -0
  463. package/dist/transport/BaseTransport.js.map +1 -1
  464. package/dist/transport/ProxyTransport.d.ts +4 -14
  465. package/dist/transport/RegisterTransport.d.ts +4 -16
  466. package/dist/transport/RegisterTransport.js +13 -20
  467. package/dist/transport/RegisterTransport.js.map +1 -1
  468. package/dist/transport/TransportManager.d.ts +2 -13
  469. package/dist/transport/TransportMessage.d.ts +3 -13
  470. package/dist/transport/index.d.ts +1 -9
  471. package/dist/types/app.d.ts +8 -6
  472. package/dist/types/app.js +7 -1
  473. package/dist/types/app.js.map +1 -1
  474. package/dist/types/background.d.ts +20 -7
  475. package/dist/types/browser.d.ts +6 -8
  476. package/dist/types/command.d.ts +27 -7
  477. package/dist/types/config.d.ts +673 -11
  478. package/dist/types/content.d.ts +195 -7
  479. package/dist/types/entrypoint.d.ts +106 -7
  480. package/dist/types/entrypoint.js.map +1 -1
  481. package/dist/types/env.d.ts +4 -6
  482. package/dist/types/framework.d.ts +1 -3
  483. package/dist/types/helpers.d.ts +6 -7
  484. package/dist/types/icon.d.ts +3 -5
  485. package/dist/types/locale.d.ts +35 -29
  486. package/dist/types/locale.js.map +1 -1
  487. package/dist/types/manifest.d.ts +163 -7
  488. package/dist/types/manifest.js.map +1 -1
  489. package/dist/types/message.d.ts +17 -19
  490. package/dist/types/message.js +1 -1
  491. package/dist/types/message.js.map +1 -1
  492. package/dist/types/offscreen.d.ts +13 -23
  493. package/dist/types/offscreen.js +2 -0
  494. package/dist/types/offscreen.js.map +1 -1
  495. package/dist/types/page.d.ts +5 -16
  496. package/dist/types/plugin.d.ts +101 -11
  497. package/dist/types/popup.d.ts +5 -16
  498. package/dist/types/relay.d.ts +13 -21
  499. package/dist/types/service.d.ts +9 -18
  500. package/dist/types/sidebar.d.ts +7 -17
  501. package/dist/types/transport.d.ts +22 -29
  502. package/dist/types/view.d.ts +18 -24
  503. package/package.json +14 -16
  504. package/dist/config-BaSTGrd0.d.ts +0 -726
  505. package/dist/manifest-DKvERQ4d.d.ts +0 -503
@@ -1,17 +1,7 @@
1
- import { Root } from 'react-dom/client';
2
- import export_default$1 from '../../core/Builder.js';
3
- import { ViewConfig, ViewDefinition, ViewRenderValue, ViewRenderHandler } from '../../../../types/view.js';
4
- import '../../../core/Builder.js';
5
- import '../../../../manifest-DKvERQ4d.js';
6
- import 'react';
7
- import 'utility-types';
8
- import '../../../../types/app.js';
9
- import '../../../../types/browser.js';
10
- import '../../../../types/helpers.js';
11
- import '../../../../types/locale.js';
12
- import 'html-rspack-tags-plugin';
13
-
14
- declare class export_default<T extends ViewConfig> extends export_default$1<T> {
1
+ import { Root } from "react-dom/client";
2
+ import Builder from "../../core/Builder.js";
3
+ import { ViewConfig, ViewDefinition, ViewRenderHandler, ViewRenderValue } from "../../../../types/view.js";
4
+ export default class<T extends ViewConfig> extends Builder<T> {
15
5
  protected root?: Root;
16
6
  protected container?: Element;
17
7
  constructor(definition: ViewDefinition<T>);
@@ -19,5 +9,3 @@ declare class export_default<T extends ViewConfig> extends export_default$1<T> {
19
9
  build(): Promise<void>;
20
10
  destroy(): Promise<void>;
21
11
  }
22
-
23
- export { export_default as default };
@@ -1,17 +1,4 @@
1
- import { ViewDefinition, ViewConfig } from '../../../../types/view.js';
2
- export { default as Builder } from './Builder.js';
3
- import 'react';
4
- import 'utility-types';
5
- import 'html-rspack-tags-plugin';
6
- import '../../../../types/helpers.js';
7
- import '../../../../manifest-DKvERQ4d.js';
8
- import '../../../../types/app.js';
9
- import '../../../../types/browser.js';
10
- import '../../../../types/locale.js';
11
- import 'react-dom/client';
12
- import '../../core/Builder.js';
13
- import '../../../core/Builder.js';
14
-
15
- declare const _default: (definition: ViewDefinition<ViewConfig>) => void;
16
-
17
- export { _default as default };
1
+ import Builder from "./Builder.js";
2
+ export { Builder };
3
+ declare const _default: (definition: import("../../../../index.js").ViewDefinition<import("../../../../types/view.js").ViewConfig>) => void;
4
+ export default _default;
@@ -1,13 +1,2 @@
1
- import { ViewConfig, ViewRenderValue, ViewRenderHandler } from '../../../../../types/view.js';
2
- import 'react';
3
- import 'utility-types';
4
- import 'html-rspack-tags-plugin';
5
- import '../../../../../types/helpers.js';
6
- import '../../../../../manifest-DKvERQ4d.js';
7
- import '../../../../../types/app.js';
8
- import '../../../../../types/browser.js';
9
- import '../../../../../types/locale.js';
10
-
11
- declare const viewReactRenderResolver: <T extends ViewConfig>(render?: ViewRenderValue<T>) => ViewRenderHandler<T>;
12
-
13
- export { viewReactRenderResolver };
1
+ import { ViewRenderHandler, ViewRenderValue, ViewConfig } from "../../../../../types/view.js";
2
+ export declare const viewReactRenderResolver: <T extends ViewConfig>(render?: ViewRenderValue<T>) => ViewRenderHandler<T>;
@@ -1,20 +1,8 @@
1
- import export_default$1 from '../../core/Builder.js';
2
- import { ViewConfig, ViewDefinition } from '../../../../types/view.js';
3
- import '../../../core/Builder.js';
4
- import '../../../../manifest-DKvERQ4d.js';
5
- import 'react';
6
- import 'utility-types';
7
- import '../../../../types/app.js';
8
- import '../../../../types/browser.js';
9
- import '../../../../types/helpers.js';
10
- import '../../../../types/locale.js';
11
- import 'html-rspack-tags-plugin';
12
-
13
- declare class export_default<T extends ViewConfig> extends export_default$1<T> {
1
+ import Builder from "../../core/Builder.js";
2
+ import { ViewConfig, ViewDefinition } from "../../../../types/view.js";
3
+ export default class<T extends ViewConfig> extends Builder<T> {
14
4
  protected container?: Element;
15
5
  constructor(definition: ViewDefinition<T>);
16
6
  build(): Promise<void>;
17
7
  destroy(): Promise<void>;
18
8
  }
19
-
20
- export { export_default as default };
@@ -1,16 +1,4 @@
1
- import { ViewDefinition, ViewConfig } from '../../../../types/view.js';
2
- export { default as Builder } from './Builder.js';
3
- import 'react';
4
- import 'utility-types';
5
- import 'html-rspack-tags-plugin';
6
- import '../../../../types/helpers.js';
7
- import '../../../../manifest-DKvERQ4d.js';
8
- import '../../../../types/app.js';
9
- import '../../../../types/browser.js';
10
- import '../../../../types/locale.js';
11
- import '../../core/Builder.js';
12
- import '../../../core/Builder.js';
13
-
14
- declare const _default: (definition: ViewDefinition<ViewConfig>) => void;
15
-
16
- export { _default as default };
1
+ import Builder from "./Builder.js";
2
+ export { Builder };
3
+ declare const _default: (definition: import("../../../../index.js").ViewDefinition<import("../../../../types/view.js").ViewConfig>) => void;
4
+ export default _default;
@@ -1,15 +1,6 @@
1
- import export_default$1 from '../../core/Builder.js';
2
- import { ViewConfig, ViewBuilder, ViewResolvedDefinition, ViewDefinition, ViewContainerTag, ViewContainerOptions, ViewContainerFactory, ViewContainerCreator, ViewRenderValue, ViewRenderHandler } from '../../../types/view.js';
3
- import '../../../manifest-DKvERQ4d.js';
4
- import 'react';
5
- import 'utility-types';
6
- import '../../../types/app.js';
7
- import '../../../types/browser.js';
8
- import '../../../types/helpers.js';
9
- import '../../../types/locale.js';
10
- import 'html-rspack-tags-plugin';
11
-
12
- declare abstract class export_default<T extends ViewConfig> extends export_default$1 implements ViewBuilder {
1
+ import Builder from "../../core/Builder.js";
2
+ import { ViewBuilder, ViewConfig, ViewContainerCreator, ViewContainerFactory, ViewContainerOptions, ViewContainerTag, ViewDefinition, ViewRenderHandler, ViewRenderValue, ViewResolvedDefinition } from "../../../types/view.js";
3
+ export default abstract class<T extends ViewConfig> extends Builder implements ViewBuilder {
13
4
  protected readonly definition: ViewResolvedDefinition<T>;
14
5
  protected constructor(definition: ViewDefinition<T>);
15
6
  protected resolveContainer(container?: ViewContainerTag | ViewContainerOptions | ViewContainerFactory<T>): ViewContainerCreator<T>;
@@ -17,5 +8,3 @@ declare abstract class export_default<T extends ViewConfig> extends export_defau
17
8
  protected getProps(): T;
18
9
  build(): Promise<void>;
19
10
  }
20
-
21
- export { export_default as default };
@@ -1,13 +1,2 @@
1
- import { ViewConfig, ViewContainerTag, ViewContainerOptions, ViewContainerFactory, ViewContainerCreator } from '../../../../types/view.js';
2
- import 'react';
3
- import 'utility-types';
4
- import 'html-rspack-tags-plugin';
5
- import '../../../../types/helpers.js';
6
- import '../../../../manifest-DKvERQ4d.js';
7
- import '../../../../types/app.js';
8
- import '../../../../types/browser.js';
9
- import '../../../../types/locale.js';
10
-
11
- declare const viewContainerResolver: <T extends ViewConfig>(container?: ViewContainerTag | ViewContainerOptions | ViewContainerFactory<T>) => ViewContainerCreator<T>;
12
-
13
- export { viewContainerResolver };
1
+ import { ViewConfig, ViewContainerCreator, ViewContainerFactory, ViewContainerOptions, ViewContainerTag } from "../../../../types/view.js";
2
+ export declare const viewContainerResolver: <T extends ViewConfig>(container?: ViewContainerTag | ViewContainerOptions | ViewContainerFactory<T>) => ViewContainerCreator<T>;
@@ -1,14 +1,3 @@
1
- import { ViewConfig, ViewRenderValue, ViewRenderHandler, ViewDefinition } from '../../../../types/view.js';
2
- import 'react';
3
- import 'utility-types';
4
- import 'html-rspack-tags-plugin';
5
- import '../../../../types/helpers.js';
6
- import '../../../../manifest-DKvERQ4d.js';
7
- import '../../../../types/app.js';
8
- import '../../../../types/browser.js';
9
- import '../../../../types/locale.js';
10
-
11
- declare const isViewDefinition: <T extends ViewConfig = ViewConfig>(definition: any) => definition is ViewDefinition<T>;
12
- declare const isValidViewDefinitionRenderValue: <T extends ViewConfig = ViewConfig>(definition: any) => definition is ViewRenderValue<T> | ViewRenderHandler<T>;
13
-
14
- export { isValidViewDefinitionRenderValue, isViewDefinition };
1
+ import { ViewConfig, ViewDefinition, ViewRenderHandler, ViewRenderValue } from "../../../../types/view.js";
2
+ export declare const isViewDefinition: <T extends ViewConfig = ViewConfig>(definition: any) => definition is ViewDefinition<T>;
3
+ export declare const isValidViewDefinitionRenderValue: <T extends ViewConfig = ViewConfig>(definition: any) => definition is ViewRenderValue<T> | ViewRenderHandler<T>;
@@ -1,14 +1,3 @@
1
- import { ViewConfig, ViewRenderValue, ViewRenderHandler } from '../../../../types/view.js';
2
- import 'react';
3
- import 'utility-types';
4
- import 'html-rspack-tags-plugin';
5
- import '../../../../types/helpers.js';
6
- import '../../../../manifest-DKvERQ4d.js';
7
- import '../../../../types/app.js';
8
- import '../../../../types/browser.js';
9
- import '../../../../types/locale.js';
10
-
11
- declare const isValidViewRenderValue: (value: unknown) => value is string | number | Element;
12
- declare const viewRenderResolver: <T extends ViewConfig>(render?: ViewRenderValue<T> | ViewRenderHandler<T>) => ViewRenderHandler<T>;
13
-
14
- export { isValidViewRenderValue, viewRenderResolver };
1
+ import { ViewConfig, ViewRenderHandler, ViewRenderValue } from "../../../../types/view.js";
2
+ export declare const isValidViewRenderValue: (value: unknown) => value is string | number | Element;
3
+ export declare const viewRenderResolver: <T extends ViewConfig>(render?: ViewRenderValue<T> | ViewRenderHandler<T>) => ViewRenderHandler<T>;
@@ -1,10 +1 @@
1
- export { isValidViewDefinitionRenderValue, isViewDefinition } from './core/resolvers/definition.js';
2
- import '../../types/view.js';
3
- import 'react';
4
- import 'utility-types';
5
- import 'html-rspack-tags-plugin';
6
- import '../../types/helpers.js';
7
- import '../../manifest-DKvERQ4d.js';
8
- import '../../types/app.js';
9
- import '../../types/browser.js';
10
- import '../../types/locale.js';
1
+ export * from "./core/resolvers/definition.js";
package/dist/index.d.ts CHANGED
@@ -1,43 +1 @@
1
- export { Command, Mode } from './types/app.js';
2
- export { defineBackground } from './main/background.js';
3
- export { Browser, DataCollectionPermission } from './types/browser.js';
4
- export { defineCommand, defineExecuteActionCommand } from './main/command.js';
5
- export { defineConfig } from './main/config.js';
6
- export { defineContentScript, defineContentScriptAppend } from './main/content.js';
7
- export { getApp, getBrowser, getEnv, getManifestVersion, isBrowser } from './main/env.js';
8
- export { IconName, IconsMap, changeActionIcon, changeSidebarIcon, getIcons } from './main/icon.js';
9
- export { B as BackgroundConfig, a as BackgroundDefinition, b as BackgroundMainHandler, C as CommandConfig, c as CommandDefinition, d as CommandExecute, e as CommandExecuteActionName, f as CommandUnresolvedDefinition, g as ContentScriptAnchor, h as ContentScriptAnchorGetter, i as ContentScriptAppend, j as ContentScriptAppendDefinition, k as ContentScriptBuilder, l as ContentScriptConfig, m as ContentScriptContainerCreator, n as ContentScriptContainerFactory, o as ContentScriptContainerOptions, p as ContentScriptContainerTag, q as ContentScriptContext, r as ContentScriptDeclarative, s as ContentScriptDefinition, t as ContentScriptEntrypointOptions, u as ContentScriptEvent, v as ContentScriptEventCallback, w as ContentScriptEventEmitter, x as ContentScriptMainFunction, y as ContentScriptMarker, z as ContentScriptMarkerContract, A as ContentScriptMarkerGetter, D as ContentScriptMarkerResolver, E as ContentScriptMarkerType, F as ContentScriptMarkerValue, G as ContentScriptMatches, H as ContentScriptMount, I as ContentScriptMountFunction, J as ContentScriptNode, K as ContentScriptNodeSet, L as ContentScriptOptions, M as ContentScriptProps, N as ContentScriptRenderHandler, O as ContentScriptRenderReactComponent, P as ContentScriptRenderValue, Q as ContentScriptResolvedDefinition, R as ContentScriptWatchStrategy, S as ExecuteActionCommandDefinition, T as ManifestBuilder, U as ManifestIncognito } from './manifest-DKvERQ4d.js';
10
- export { OffscreenAlias, OffscreenMap, defineOffscreen, getOffscreen, getOffscreens } from './main/offscreen.js';
11
- export { PageAlias, PageMap, definePage, getPageUrl, getPages } from './main/page.js';
12
- export { definePlugin } from './main/plugin.js';
13
- export { PopupAlias, PopupMap, changePopup, definePopup, getPopups } from './main/popup.js';
14
- export { defineRelay, getRelay } from './main/relay.js';
15
- export { defineService, getService } from './main/service.js';
16
- export { SidebarAlias, SidebarMap, changeSidebar, defineSidebar, getSidebars } from './main/sidebar.js';
17
- export { ViewDefinition, ViewOptions } from './types/view.js';
18
- export { C as Config, a as ConfigDefinition, P as Plugin, b as PluginDefinition, R as ReadonlyConfig, U as UserConfig } from './config-BaSTGrd0.js';
19
- export { OffscreenDefinition, OffscreenReason, OffscreenUnresolvedDefinition } from './types/offscreen.js';
20
- export { PageConfig, PageDefinition, PageProps } from './types/page.js';
21
- export { RelayDefinition, RelayMethod, RelayUnresolvedDefinition } from './types/relay.js';
22
- export { ServiceDefinition } from './types/service.js';
23
- export { contentScriptAnchorResolver } from './entry/content/core/resolvers/anchor.js';
24
- export { contentScriptAwaitFirstResolver, contentScriptMutationObserverResolver } from './entry/content/core/resolvers/watch.js';
25
- export { contentScriptContainerResolver } from './entry/content/core/resolvers/container.js';
26
- export { contentScriptMountAppendResolver } from './entry/content/core/resolvers/mount.js';
27
- export { contentScriptRenderResolver } from './entry/content/core/resolvers/render.js';
28
- import 'react';
29
- import 'utility-types';
30
- import './types/helpers.js';
31
- import './types/locale.js';
32
- import '@rspack/core';
33
- import 'html-rspack-tags-plugin';
34
- import './types/env.js';
35
- import './types/transport.js';
36
- import './types/message.js';
37
- import './types/popup.js';
38
- import './relay/providers/ProxyRelay.js';
39
- import '@addon-core/inject-script';
40
- import './transport/ProxyTransport.js';
41
- import './transport/BaseTransport.js';
42
- import './relay/RelayPermission.js';
43
- import './types/sidebar.js';
1
+ export * from "./main/index.js";
@@ -1,9 +1,7 @@
1
- import React__default, { PropsWithChildren } from 'react';
2
-
3
- interface LocaleProviderProps {
1
+ import React, { PropsWithChildren } from "react";
2
+ export interface LocaleProviderProps {
4
3
  storage?: string | false;
5
4
  container?: string | Element | false;
6
5
  }
7
- declare const LocaleProvider: ({ children, storage, container }: PropsWithChildren<LocaleProviderProps>) => React__default.JSX.Element;
8
-
9
- export { type LocaleProviderProps, LocaleProvider as default };
6
+ declare const LocaleProvider: ({ children, storage, container }: PropsWithChildren<LocaleProviderProps>) => React.JSX.Element;
7
+ export default LocaleProvider;
@@ -5,11 +5,11 @@ import { DynamicLocale } from "./../../../locale/providers/index.js";
5
5
  const LocaleProvider = ({ children, storage, container = "html" }) => {
6
6
  const locale = useMemo(() => new DynamicLocale(storage), []);
7
7
  const [lang, setLang] = useState(locale.lang());
8
- const _ = useCallback((key, substitutions) => {
9
- return locale.trans(key, substitutions);
8
+ const t = useCallback((key, ...args) => {
9
+ return locale.trans(key, ...args);
10
10
  }, []);
11
- const choice = useCallback((key, count, substitutions) => {
12
- return locale.choice(key, count, substitutions);
11
+ const choice = useCallback((key, count, ...args) => {
12
+ return locale.choice(key, count, ...args);
13
13
  }, []);
14
14
  const change = useCallback((lang2) => {
15
15
  locale.change(lang2).catch((err) => console.error(`[LocaleProvider] Cannot find locale file for "${lang2}" language`, err));
@@ -38,7 +38,7 @@ const LocaleProvider = ({ children, storage, container = "html" }) => {
38
38
  LocaleContext.Provider,
39
39
  {
40
40
  value: {
41
- _,
41
+ t,
42
42
  choice,
43
43
  change,
44
44
  lang,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/locale/adapters/react/LocaleProvider.tsx"],"sourcesContent":["import React, {PropsWithChildren, useCallback, useEffect, useMemo, useState} from \"react\";\n\nimport {LocaleContext, LocaleContract} from \"./context\";\n\nimport {getLocaleDir, isLocaleRtl} from \"@locale/utils\";\n\nimport {DynamicLocale} from \"@locale/providers\";\n\nimport {Language} from \"@typing/locale\";\n\nexport interface LocaleProviderProps {\n storage?: string | false;\n container?: string | Element | false;\n}\n\nconst LocaleProvider = ({children, storage, container = \"html\"}: PropsWithChildren<LocaleProviderProps>) => {\n const locale = useMemo(() => new DynamicLocale(storage), []);\n\n const [lang, setLang] = useState<Language>(locale.lang());\n\n const _: LocaleContract[\"_\"] = useCallback((key, substitutions): string => {\n return locale.trans(key, substitutions);\n }, []);\n\n const choice: LocaleContract[\"choice\"] = useCallback((key, count, substitutions): string => {\n return locale.choice(key, count, substitutions);\n }, []);\n\n const change: LocaleContract[\"change\"] = useCallback((lang): void => {\n locale\n .change(lang)\n .catch(err => console.error(`[LocaleProvider] Cannot find locale file for \"${lang}\" language`, err));\n }, []);\n\n useEffect(() => {\n if (container === false) {\n return;\n }\n\n const element = typeof container === \"string\" ? document.querySelector(container) : container;\n\n if (element) {\n element.setAttribute(\"lang\", lang);\n element.setAttribute(\"dir\", getLocaleDir(lang));\n\n return () => {\n element.removeAttribute(\"lang\");\n element.removeAttribute(\"dir\");\n };\n }\n }, [lang, container]);\n\n useEffect(() => {\n locale.sync().then(lang => setLang(lang));\n }, []);\n\n useEffect(() => {\n return locale.watch(lang => setLang(lang));\n }, []);\n\n return (\n <LocaleContext.Provider\n value={{\n _,\n choice,\n change,\n lang,\n dir: getLocaleDir(lang),\n isRtl: isLocaleRtl(lang),\n }}\n >\n {children}\n </LocaleContext.Provider>\n );\n};\n\nexport default LocaleProvider;\n"],"mappings":"AAAA,OAAO,SAA2B,aAAa,WAAW,SAAS,gBAAe;AAElF,SAAQ,qBAAoC;AAE5C,SAAQ,cAAc,mBAAkB;AAExC,SAAQ,qBAAoB;AAS5B,MAAM,iBAAiB,CAAC,EAAC,UAAU,SAAS,YAAY,OAAM,MAA8C;AACxG,QAAM,SAAS,QAAQ,MAAM,IAAI,cAAc,OAAO,GAAG,CAAC,CAAC;AAE3D,QAAM,CAAC,MAAM,OAAO,IAAI,SAAmB,OAAO,KAAK,CAAC;AAExD,QAAM,IAAyB,YAAY,CAAC,KAAK,kBAA0B;AACvE,WAAO,OAAO,MAAM,KAAK,aAAa;AAAA,EAC1C,GAAG,CAAC,CAAC;AAEL,QAAM,SAAmC,YAAY,CAAC,KAAK,OAAO,kBAA0B;AACxF,WAAO,OAAO,OAAO,KAAK,OAAO,aAAa;AAAA,EAClD,GAAG,CAAC,CAAC;AAEL,QAAM,SAAmC,YAAY,CAACA,UAAe;AACjE,WACK,OAAOA,KAAI,EACX,MAAM,SAAO,QAAQ,MAAM,iDAAiDA,KAAI,cAAc,GAAG,CAAC;AAAA,EAC3G,GAAG,CAAC,CAAC;AAEL,YAAU,MAAM;AACZ,QAAI,cAAc,OAAO;AACrB;AAAA,IACJ;AAEA,UAAM,UAAU,OAAO,cAAc,WAAW,SAAS,cAAc,SAAS,IAAI;AAEpF,QAAI,SAAS;AACT,cAAQ,aAAa,QAAQ,IAAI;AACjC,cAAQ,aAAa,OAAO,aAAa,IAAI,CAAC;AAE9C,aAAO,MAAM;AACT,gBAAQ,gBAAgB,MAAM;AAC9B,gBAAQ,gBAAgB,KAAK;AAAA,MACjC;AAAA,IACJ;AAAA,EACJ,GAAG,CAAC,MAAM,SAAS,CAAC;AAEpB,YAAU,MAAM;AACZ,WAAO,KAAK,EAAE,KAAK,CAAAA,UAAQ,QAAQA,KAAI,CAAC;AAAA,EAC5C,GAAG,CAAC,CAAC;AAEL,YAAU,MAAM;AACZ,WAAO,OAAO,MAAM,CAAAA,UAAQ,QAAQA,KAAI,CAAC;AAAA,EAC7C,GAAG,CAAC,CAAC;AAEL,SACI;AAAA,IAAC,cAAc;AAAA,IAAd;AAAA,MACG,OAAO;AAAA,QACH;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA,KAAK,aAAa,IAAI;AAAA,QACtB,OAAO,YAAY,IAAI;AAAA,MAC3B;AAAA;AAAA,IAEC;AAAA,EACL;AAER;AAEA,IAAO,yBAAQ;","names":["lang"]}
1
+ {"version":3,"sources":["../../../../src/locale/adapters/react/LocaleProvider.tsx"],"sourcesContent":["import React, {PropsWithChildren, useCallback, useEffect, useMemo, useState} from \"react\";\n\nimport {LocaleContext, LocaleContract} from \"./context\";\n\nimport {getLocaleDir, isLocaleRtl} from \"@locale/utils\";\n\nimport {DynamicLocale} from \"@locale/providers\";\n\nimport {Language} from \"@typing/locale\";\n\nexport interface LocaleProviderProps {\n storage?: string | false;\n container?: string | Element | false;\n}\n\nconst LocaleProvider = ({children, storage, container = \"html\"}: PropsWithChildren<LocaleProviderProps>) => {\n const locale = useMemo(() => new DynamicLocale(storage), []);\n\n const [lang, setLang] = useState<Language>(locale.lang());\n\n const t: LocaleContract[\"t\"] = useCallback((key, ...args): string => {\n return locale.trans(key, ...args);\n }, []);\n\n const choice: LocaleContract[\"choice\"] = useCallback((key, count, ...args): string => {\n return locale.choice(key, count, ...args);\n }, []);\n\n const change: LocaleContract[\"change\"] = useCallback((lang): void => {\n locale\n .change(lang)\n .catch(err => console.error(`[LocaleProvider] Cannot find locale file for \"${lang}\" language`, err));\n }, []);\n\n useEffect(() => {\n if (container === false) {\n return;\n }\n\n const element = typeof container === \"string\" ? document.querySelector(container) : container;\n\n if (element) {\n element.setAttribute(\"lang\", lang);\n element.setAttribute(\"dir\", getLocaleDir(lang));\n\n return () => {\n element.removeAttribute(\"lang\");\n element.removeAttribute(\"dir\");\n };\n }\n }, [lang, container]);\n\n useEffect(() => {\n locale.sync().then(lang => setLang(lang));\n }, []);\n\n useEffect(() => {\n return locale.watch(lang => setLang(lang));\n }, []);\n\n return (\n <LocaleContext.Provider\n value={{\n t,\n choice,\n change,\n lang,\n dir: getLocaleDir(lang),\n isRtl: isLocaleRtl(lang),\n }}\n >\n {children}\n </LocaleContext.Provider>\n );\n};\n\nexport default LocaleProvider;\n"],"mappings":"AAAA,OAAO,SAA2B,aAAa,WAAW,SAAS,gBAAe;AAElF,SAAQ,qBAAoC;AAE5C,SAAQ,cAAc,mBAAkB;AAExC,SAAQ,qBAAoB;AAS5B,MAAM,iBAAiB,CAAC,EAAC,UAAU,SAAS,YAAY,OAAM,MAA8C;AACxG,QAAM,SAAS,QAAQ,MAAM,IAAI,cAAc,OAAO,GAAG,CAAC,CAAC;AAE3D,QAAM,CAAC,MAAM,OAAO,IAAI,SAAmB,OAAO,KAAK,CAAC;AAExD,QAAM,IAAyB,YAAY,CAAC,QAAQ,SAAiB;AACjE,WAAO,OAAO,MAAM,KAAK,GAAG,IAAI;AAAA,EACpC,GAAG,CAAC,CAAC;AAEL,QAAM,SAAmC,YAAY,CAAC,KAAK,UAAU,SAAiB;AAClF,WAAO,OAAO,OAAO,KAAK,OAAO,GAAG,IAAI;AAAA,EAC5C,GAAG,CAAC,CAAC;AAEL,QAAM,SAAmC,YAAY,CAACA,UAAe;AACjE,WACK,OAAOA,KAAI,EACX,MAAM,SAAO,QAAQ,MAAM,iDAAiDA,KAAI,cAAc,GAAG,CAAC;AAAA,EAC3G,GAAG,CAAC,CAAC;AAEL,YAAU,MAAM;AACZ,QAAI,cAAc,OAAO;AACrB;AAAA,IACJ;AAEA,UAAM,UAAU,OAAO,cAAc,WAAW,SAAS,cAAc,SAAS,IAAI;AAEpF,QAAI,SAAS;AACT,cAAQ,aAAa,QAAQ,IAAI;AACjC,cAAQ,aAAa,OAAO,aAAa,IAAI,CAAC;AAE9C,aAAO,MAAM;AACT,gBAAQ,gBAAgB,MAAM;AAC9B,gBAAQ,gBAAgB,KAAK;AAAA,MACjC;AAAA,IACJ;AAAA,EACJ,GAAG,CAAC,MAAM,SAAS,CAAC;AAEpB,YAAU,MAAM;AACZ,WAAO,KAAK,EAAE,KAAK,CAAAA,UAAQ,QAAQA,KAAI,CAAC;AAAA,EAC5C,GAAG,CAAC,CAAC;AAEL,YAAU,MAAM;AACZ,WAAO,OAAO,MAAM,CAAAA,UAAQ,QAAQA,KAAI,CAAC;AAAA,EAC7C,GAAG,CAAC,CAAC;AAEL,SACI;AAAA,IAAC,cAAc;AAAA,IAAd;AAAA,MACG,OAAO;AAAA,QACH;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA,KAAK,aAAa,IAAI;AAAA,QACtB,OAAO,YAAY,IAAI;AAAA,MAC3B;AAAA;AAAA,IAEC;AAAA,EACL;AAER;AAEA,IAAO,yBAAQ;","names":["lang"]}
@@ -1,18 +1,13 @@
1
- import * as React from 'react';
2
- import { LocaleStructure, Language, LocaleDir, LocaleNonPluralKeys, LocaleSubstitutionsFor, LocalePluralKeys } from '../../../types/locale.js';
3
- import { LocaleNativeStructure } from '../../providers/NativeLocale.js';
4
- import '../../providers/AbstractLocale.js';
5
-
6
- interface LocaleContract<S extends LocaleStructure = LocaleNativeStructure> {
1
+ import { LocaleDir, Language, LocaleNonPluralKeys, LocaleSubstitutionArgs, LocalePluralKeys } from "../../../types/locale.js";
2
+ import { LocaleNativeStructure } from "../../providers/index.js";
3
+ export interface LocaleContract<S extends object = LocaleNativeStructure> {
7
4
  lang: Language;
8
5
  dir: LocaleDir;
9
6
  isRtl: boolean;
10
- _<K extends LocaleNonPluralKeys<S>>(key: K, substitutions?: LocaleSubstitutionsFor<S, K>): string;
11
- choice<K extends LocalePluralKeys<S>>(key: K, count: number, substitutions?: LocaleSubstitutionsFor<S, K>): string;
7
+ t<K extends LocaleNonPluralKeys<S>>(key: K, ...args: LocaleSubstitutionArgs<S, K>): string;
8
+ choice<K extends LocalePluralKeys<S>>(key: K, count: number, ...args: LocaleSubstitutionArgs<S, K>): string;
12
9
  change(lang: Language): void;
13
10
  }
14
- declare const DefaultLocale: LocaleContract;
15
- declare const LocaleContext: React.Context<LocaleContract<LocaleNativeStructure>>;
16
- declare const useLocale: () => LocaleContract<LocaleNativeStructure>;
17
-
18
- export { DefaultLocale, LocaleContext, type LocaleContract, useLocale };
11
+ export declare const DefaultLocale: LocaleContract;
12
+ export declare const LocaleContext: import("react").Context<LocaleContract<LocaleNativeStructure>>;
13
+ export declare const useLocale: () => LocaleContract<LocaleNativeStructure>;
@@ -1,13 +1,10 @@
1
1
  import { createContext, useContext } from "react";
2
- import {
3
- LocaleDir,
4
- Language
5
- } from "./../../../types/locale.js";
2
+ import { LocaleDir, Language } from "./../../../types/locale.js";
6
3
  const DefaultLocale = {
7
4
  lang: Language.English,
8
5
  isRtl: false,
9
6
  dir: LocaleDir.LeftToRight,
10
- _(key) {
7
+ t(key) {
11
8
  return key;
12
9
  },
13
10
  choice(key) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/locale/adapters/react/context.ts"],"sourcesContent":["import {createContext, useContext} from \"react\";\n\nimport {\n LocaleDir,\n Language,\n LocaleNonPluralKeys,\n LocaleStructure,\n LocaleSubstitutionsFor,\n LocalePluralKeys,\n} from \"@typing/locale\";\n\nimport {LocaleNativeStructure} from \"@locale/providers\";\n\nexport interface LocaleContract<S extends LocaleStructure = LocaleNativeStructure> {\n lang: Language;\n\n dir: LocaleDir;\n\n isRtl: boolean;\n\n _<K extends LocaleNonPluralKeys<S>>(key: K, substitutions?: LocaleSubstitutionsFor<S, K>): string;\n\n choice<K extends LocalePluralKeys<S>>(key: K, count: number, substitutions?: LocaleSubstitutionsFor<S, K>): string;\n\n change(lang: Language): void;\n}\n\nexport const DefaultLocale: LocaleContract = {\n lang: Language.English,\n isRtl: false,\n dir: LocaleDir.LeftToRight,\n _(key: string): string {\n return key as string;\n },\n choice(key: string): string {\n return key;\n },\n change(_lang: Language) {},\n};\n\nexport const LocaleContext = createContext<LocaleContract>(DefaultLocale);\n\nLocaleContext.displayName = \"LocaleContext\";\n\nexport const useLocale = () => useContext(LocaleContext);\n"],"mappings":"AAAA,SAAQ,eAAe,kBAAiB;AAExC;AAAA,EACI;AAAA,EACA;AAAA,OAKG;AAkBA,MAAM,gBAAgC;AAAA,EACzC,MAAM,SAAS;AAAA,EACf,OAAO;AAAA,EACP,KAAK,UAAU;AAAA,EACf,EAAE,KAAqB;AACnB,WAAO;AAAA,EACX;AAAA,EACA,OAAO,KAAqB;AACxB,WAAO;AAAA,EACX;AAAA,EACA,OAAO,OAAiB;AAAA,EAAC;AAC7B;AAEO,MAAM,gBAAgB,cAA8B,aAAa;AAExE,cAAc,cAAc;AAErB,MAAM,YAAY,MAAM,WAAW,aAAa;","names":[]}
1
+ {"version":3,"sources":["../../../../src/locale/adapters/react/context.ts"],"sourcesContent":["import {createContext, useContext} from \"react\";\n\nimport {LocaleDir, Language, LocaleNonPluralKeys, LocaleSubstitutionArgs, LocalePluralKeys} from \"@typing/locale\";\n\nimport {LocaleNativeStructure} from \"@locale/providers\";\n\nexport interface LocaleContract<S extends object = LocaleNativeStructure> {\n lang: Language;\n\n dir: LocaleDir;\n\n isRtl: boolean;\n\n t<K extends LocaleNonPluralKeys<S>>(key: K, ...args: LocaleSubstitutionArgs<S, K>): string;\n\n choice<K extends LocalePluralKeys<S>>(key: K, count: number, ...args: LocaleSubstitutionArgs<S, K>): string;\n\n change(lang: Language): void;\n}\n\nexport const DefaultLocale: LocaleContract = {\n lang: Language.English,\n isRtl: false,\n dir: LocaleDir.LeftToRight,\n t(key: string): string {\n return key as string;\n },\n choice(key: string): string {\n return key;\n },\n change(_lang: Language) {},\n};\n\nexport const LocaleContext = createContext<LocaleContract>(DefaultLocale);\n\nLocaleContext.displayName = \"LocaleContext\";\n\nexport const useLocale = () => useContext(LocaleContext);\n"],"mappings":"AAAA,SAAQ,eAAe,kBAAiB;AAExC,SAAQ,WAAW,gBAA8E;AAkB1F,MAAM,gBAAgC;AAAA,EACzC,MAAM,SAAS;AAAA,EACf,OAAO;AAAA,EACP,KAAK,UAAU;AAAA,EACf,EAAE,KAAqB;AACnB,WAAO;AAAA,EACX;AAAA,EACA,OAAO,KAAqB;AACxB,WAAO;AAAA,EACX;AAAA,EACA,OAAO,OAAiB;AAAA,EAAC;AAC7B;AAEO,MAAM,gBAAgB,cAA8B,aAAa;AAExE,cAAc,cAAc;AAErB,MAAM,YAAY,MAAM,WAAW,aAAa;","names":[]}
@@ -1,6 +1,2 @@
1
- export { default as LocaleProvider, LocaleProviderProps } from './LocaleProvider.js';
2
- export { LocaleContract, useLocale } from './context.js';
3
- import 'react';
4
- import '../../../types/locale.js';
5
- import '../../providers/NativeLocale.js';
6
- import '../../providers/AbstractLocale.js';
1
+ export { default as LocaleProvider, type LocaleProviderProps } from "./LocaleProvider.js";
2
+ export { useLocale, type LocaleContract } from "./context.js";
@@ -1,47 +1,71 @@
1
- import { LocaleNonPluralKeys, LocaleSubstitutionsFor, LocalePluralKeys } from '../types/locale.js';
2
- import { LocaleNativeStructure } from './providers/NativeLocale.js';
3
- import './providers/AbstractLocale.js';
4
-
1
+ import { LocaleNativeStructure } from "./providers/index.js";
2
+ import { LocaleNonPluralKeys, LocalePluralKeys, LocaleSubstitutionArgs } from "../types/locale.js";
5
3
  /**
6
- * Translates a given locale key into the corresponding localized string.
4
+ * Translates a non-plural locale key.
7
5
  *
8
- * @template K - A type representing the non-plural keys of the locale structure.
9
- * @param {K} key - The locale key to be translated.
10
- * @param {LocaleSubstitutionsFor<LocaleNativeStructure, K>} [substitutions] - Optional substitutions to be applied
11
- * within the localized string. These are typically placeholders replaced with dynamic values.
12
- * @returns {string} - The translated string for the given key, with substitutions applied if provided.
6
+ * Substitutions are type-checked from the generated locale structure:
7
+ * keys without placeholders do not accept substitutions, while keys with
8
+ * placeholders require all declared substitution values.
9
+ *
10
+ * @example
11
+ * ```ts
12
+ * t("app.name");
13
+ * t("app.greeting", {name: "Alice"});
14
+ * ```
15
+ *
16
+ * @param key - The locale key to translate.
17
+ * @param args
18
+ * @returns The translated string.
13
19
  */
14
- declare const _: <K extends LocaleNonPluralKeys<LocaleNativeStructure>>(key: K, substitutions?: LocaleSubstitutionsFor<LocaleNativeStructure, K>) => string;
20
+ export declare const t: <K extends LocaleNonPluralKeys<LocaleNativeStructure>>(key: K, ...args: LocaleSubstitutionArgs<LocaleNativeStructure, K>) => string;
15
21
  /**
16
- * Translates a given locale key into the corresponding localized string
17
- * based on a specific count for pluralization.
18
- *
19
- * @template K - A type representing the non-plural keys of the locale structure.
20
- * @param {K} key - The locale key to be translated.
21
- * @param {number} count - The count used to determine the pluralization form.
22
- * @param {LocaleSubstitutionsFor<LocaleNativeStructure, K>} [substitutions] - Optional substitutions to be applied
23
- * within the localized string. These are typically placeholders replaced with dynamic values.
24
- * @returns {string} - The translated string for the given key, adjusted for pluralization and with substitutions applied if provided.
22
+ * Translates a plural locale key using the provided count.
23
+ *
24
+ * Substitutions are type-checked from the generated locale structure:
25
+ * keys without placeholders do not accept substitutions, while keys with
26
+ * placeholders require all declared substitution values.
27
+ *
28
+ * @example
29
+ * ```ts
30
+ * choice("cart.items", count, {count});
31
+ * ```
32
+ *
33
+ * @param key - The locale key to translate.
34
+ * @param count - The count used to select the plural form.
35
+ * @param args
36
+ * @returns The translated string.
25
37
  */
26
- declare const _c: <K extends LocalePluralKeys<LocaleNativeStructure>>(key: K, count: number, substitutions?: LocaleSubstitutionsFor<LocaleNativeStructure, K>) => string;
38
+ export declare const choice: <K extends LocalePluralKeys<LocaleNativeStructure>>(key: K, count: number, ...args: LocaleSubstitutionArgs<LocaleNativeStructure, K>) => string;
27
39
  /**
28
- * Converts a locale key into a standardized format and logs a warning if the key is not found
29
- * in the current language's locale keys.
40
+ * Converts a locale key to a browser message reference.
30
41
  *
31
- * @param {Extract<keyof LocaleNativeStructure, string>} key - The locale key to be converted.
32
- * This key must be a string and exist within the `LocaleNativeStructure`.
33
- * @returns {string} - The converted locale message key.
42
+ * This is useful for browser-managed extension fields that expect
43
+ * `__MSG_name__` references instead of already translated text.
44
+ *
45
+ * A warning is logged when the key does not exist in the generated locale keys.
46
+ *
47
+ * @example
48
+ * ```ts
49
+ * key("app.name"); // "__MSG_app_name__"
50
+ * ```
51
+ *
52
+ * @param value - The locale key to convert.
53
+ * @returns The browser message reference.
34
54
  */
35
- declare const __: (key: keyof LocaleNativeStructure & string) => string;
55
+ export declare const key: (value: keyof LocaleNativeStructure & string) => string;
36
56
  /**
37
- * Attempts to extract a locale key from the provided string and translates it
38
- * into the corresponding localized string. If no locale key can be extracted,
39
- * the original string is returned.
57
+ * Resolves a string that may contain a locale marker.
58
+ *
59
+ * When the input contains a locale marker, the marker is extracted and translated.
60
+ * Plain strings are returned unchanged.
61
+ *
62
+ * @example
63
+ * ```ts
64
+ * resolve("@app.name");
65
+ * resolve("Plain title");
66
+ * ```
40
67
  *
41
- * @param {string} input - The input string from which a locale key is to be extracted.
42
- * @returns {string} - The translated string if a locale key is successfully extracted,
43
- * or the original string if no locale key is found.
68
+ * @param input - A plain string or a marked locale key string.
69
+ * @returns The translated text when a marker is found, otherwise the original input.
44
70
  */
45
- declare const __t: (input: string) => string;
46
-
47
- export { _, __, __t, _c };
71
+ export declare const resolve: (input: string) => string;
@@ -1,29 +1,29 @@
1
1
  import { NativeLocale } from "./../locale/providers/index.js";
2
2
  import { convertLocaleMessageKey, extractLocaleKey } from "./../locale/utils.js";
3
- const _ = (key, substitutions) => {
4
- return NativeLocale.getInstance().trans(key, substitutions);
3
+ const t = (key2, ...args) => {
4
+ return NativeLocale.getInstance().trans(key2, ...args);
5
5
  };
6
- const _c = (key, count, substitutions) => {
7
- return NativeLocale.getInstance().choice(key, count, substitutions);
6
+ const choice = (key2, count, ...args) => {
7
+ return NativeLocale.getInstance().choice(key2, count, ...args);
8
8
  };
9
- const __ = (key) => {
9
+ const key = (value) => {
10
10
  const locale = NativeLocale.getInstance();
11
- if (!locale.keys().has(key)) {
12
- console.warn(`Locale key "${key}" not found in "${locale.lang()}" language.`);
11
+ if (!locale.keys().has(value)) {
12
+ console.warn(`Locale key "${value}" not found in "${locale.lang()}" language.`);
13
13
  }
14
- return convertLocaleMessageKey(key);
14
+ return convertLocaleMessageKey(value);
15
15
  };
16
- const __t = (input) => {
16
+ const resolve = (input) => {
17
17
  const localeKey = extractLocaleKey(input);
18
18
  if (localeKey) {
19
- return _(localeKey);
19
+ return t(localeKey);
20
20
  }
21
21
  return input;
22
22
  };
23
23
  export {
24
- _,
25
- __,
26
- __t,
27
- _c
24
+ choice,
25
+ key,
26
+ resolve,
27
+ t
28
28
  };
29
29
  //# sourceMappingURL=helpers.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/locale/helpers.ts"],"sourcesContent":["import {LocaleNativeStructure, NativeLocale} from \"@locale/providers\";\nimport {convertLocaleMessageKey, extractLocaleKey} from \"@locale/utils\";\nimport {LocaleNonPluralKeys, LocalePluralKeys, LocaleSubstitutionsFor} from \"@typing/locale\";\n\n/**\n * Translates a given locale key into the corresponding localized string.\n *\n * @template K - A type representing the non-plural keys of the locale structure.\n * @param {K} key - The locale key to be translated.\n * @param {LocaleSubstitutionsFor<LocaleNativeStructure, K>} [substitutions] - Optional substitutions to be applied\n * within the localized string. These are typically placeholders replaced with dynamic values.\n * @returns {string} - The translated string for the given key, with substitutions applied if provided.\n */\nexport const _ = <K extends LocaleNonPluralKeys<LocaleNativeStructure>>(\n key: K,\n substitutions?: LocaleSubstitutionsFor<LocaleNativeStructure, K>\n): string => {\n return NativeLocale.getInstance().trans(key, substitutions);\n};\n\n/**\n * Translates a given locale key into the corresponding localized string\n * based on a specific count for pluralization.\n *\n * @template K - A type representing the non-plural keys of the locale structure.\n * @param {K} key - The locale key to be translated.\n * @param {number} count - The count used to determine the pluralization form.\n * @param {LocaleSubstitutionsFor<LocaleNativeStructure, K>} [substitutions] - Optional substitutions to be applied\n * within the localized string. These are typically placeholders replaced with dynamic values.\n * @returns {string} - The translated string for the given key, adjusted for pluralization and with substitutions applied if provided.\n */\nexport const _c = <K extends LocalePluralKeys<LocaleNativeStructure>>(\n key: K,\n count: number,\n substitutions?: LocaleSubstitutionsFor<LocaleNativeStructure, K>\n): string => {\n return NativeLocale.getInstance().choice(key, count, substitutions);\n};\n\n/**\n * Converts a locale key into a standardized format and logs a warning if the key is not found\n * in the current language's locale keys.\n *\n * @param {Extract<keyof LocaleNativeStructure, string>} key - The locale key to be converted.\n * This key must be a string and exist within the `LocaleNativeStructure`.\n * @returns {string} - The converted locale message key.\n */\nexport const __ = (key: keyof LocaleNativeStructure & string): string => {\n const locale = NativeLocale.getInstance();\n\n if (!locale.keys().has(key)) {\n console.warn(`Locale key \"${key}\" not found in \"${locale.lang()}\" language.`);\n }\n\n return convertLocaleMessageKey(key);\n};\n\n/**\n * Attempts to extract a locale key from the provided string and translates it\n * into the corresponding localized string. If no locale key can be extracted,\n * the original string is returned.\n *\n * @param {string} input - The input string from which a locale key is to be extracted.\n * @returns {string} - The translated string if a locale key is successfully extracted,\n * or the original string if no locale key is found.\n */\nexport const __t = (input: string): string => {\n const localeKey = extractLocaleKey(input);\n\n if (localeKey) {\n return _(localeKey as LocaleNonPluralKeys<LocaleNativeStructure>);\n }\n\n return input;\n};\n"],"mappings":"AAAA,SAA+B,oBAAmB;AAClD,SAAQ,yBAAyB,wBAAuB;AAYjD,MAAM,IAAI,CACb,KACA,kBACS;AACT,SAAO,aAAa,YAAY,EAAE,MAAM,KAAK,aAAa;AAC9D;AAaO,MAAM,KAAK,CACd,KACA,OACA,kBACS;AACT,SAAO,aAAa,YAAY,EAAE,OAAO,KAAK,OAAO,aAAa;AACtE;AAUO,MAAM,KAAK,CAAC,QAAsD;AACrE,QAAM,SAAS,aAAa,YAAY;AAExC,MAAI,CAAC,OAAO,KAAK,EAAE,IAAI,GAAG,GAAG;AACzB,YAAQ,KAAK,eAAe,GAAG,mBAAmB,OAAO,KAAK,CAAC,aAAa;AAAA,EAChF;AAEA,SAAO,wBAAwB,GAAG;AACtC;AAWO,MAAM,MAAM,CAAC,UAA0B;AAC1C,QAAM,YAAY,iBAAiB,KAAK;AAExC,MAAI,WAAW;AACX,WAAO,EAAE,SAAuD;AAAA,EACpE;AAEA,SAAO;AACX;","names":[]}
1
+ {"version":3,"sources":["../../src/locale/helpers.ts"],"sourcesContent":["import {LocaleNativeStructure, NativeLocale} from \"@locale/providers\";\nimport {convertLocaleMessageKey, extractLocaleKey} from \"@locale/utils\";\nimport {LocaleNonPluralKeys, LocalePluralKeys, LocaleSubstitutionArgs} from \"@typing/locale\";\n\n/**\n * Translates a non-plural locale key.\n *\n * Substitutions are type-checked from the generated locale structure:\n * keys without placeholders do not accept substitutions, while keys with\n * placeholders require all declared substitution values.\n *\n * @example\n * ```ts\n * t(\"app.name\");\n * t(\"app.greeting\", {name: \"Alice\"});\n * ```\n *\n * @param key - The locale key to translate.\n * @param args\n * @returns The translated string.\n */\nexport const t = <K extends LocaleNonPluralKeys<LocaleNativeStructure>>(\n key: K,\n ...args: LocaleSubstitutionArgs<LocaleNativeStructure, K>\n): string => {\n return NativeLocale.getInstance().trans(key, ...args);\n};\n\n/**\n * Translates a plural locale key using the provided count.\n *\n * Substitutions are type-checked from the generated locale structure:\n * keys without placeholders do not accept substitutions, while keys with\n * placeholders require all declared substitution values.\n *\n * @example\n * ```ts\n * choice(\"cart.items\", count, {count});\n * ```\n *\n * @param key - The locale key to translate.\n * @param count - The count used to select the plural form.\n * @param args\n * @returns The translated string.\n */\nexport const choice = <K extends LocalePluralKeys<LocaleNativeStructure>>(\n key: K,\n count: number,\n ...args: LocaleSubstitutionArgs<LocaleNativeStructure, K>\n): string => {\n return NativeLocale.getInstance().choice(key, count, ...args);\n};\n\n/**\n * Converts a locale key to a browser message reference.\n *\n * This is useful for browser-managed extension fields that expect\n * `__MSG_name__` references instead of already translated text.\n *\n * A warning is logged when the key does not exist in the generated locale keys.\n *\n * @example\n * ```ts\n * key(\"app.name\"); // \"__MSG_app_name__\"\n * ```\n *\n * @param value - The locale key to convert.\n * @returns The browser message reference.\n */\nexport const key = (value: keyof LocaleNativeStructure & string): string => {\n const locale = NativeLocale.getInstance();\n\n if (!locale.keys().has(value)) {\n console.warn(`Locale key \"${value}\" not found in \"${locale.lang()}\" language.`);\n }\n\n return convertLocaleMessageKey(value);\n};\n\n/**\n * Resolves a string that may contain a locale marker.\n *\n * When the input contains a locale marker, the marker is extracted and translated.\n * Plain strings are returned unchanged.\n *\n * @example\n * ```ts\n * resolve(\"@app.name\");\n * resolve(\"Plain title\");\n * ```\n *\n * @param input - A plain string or a marked locale key string.\n * @returns The translated text when a marker is found, otherwise the original input.\n */\nexport const resolve = (input: string): string => {\n const localeKey = extractLocaleKey(input);\n\n if (localeKey) {\n return t(localeKey as LocaleNonPluralKeys<LocaleNativeStructure>);\n }\n\n return input;\n};\n"],"mappings":"AAAA,SAA+B,oBAAmB;AAClD,SAAQ,yBAAyB,wBAAuB;AAoBjD,MAAM,IAAI,CACbA,SACG,SACM;AACT,SAAO,aAAa,YAAY,EAAE,MAAMA,MAAK,GAAG,IAAI;AACxD;AAmBO,MAAM,SAAS,CAClBA,MACA,UACG,SACM;AACT,SAAO,aAAa,YAAY,EAAE,OAAOA,MAAK,OAAO,GAAG,IAAI;AAChE;AAkBO,MAAM,MAAM,CAAC,UAAwD;AACxE,QAAM,SAAS,aAAa,YAAY;AAExC,MAAI,CAAC,OAAO,KAAK,EAAE,IAAI,KAAK,GAAG;AAC3B,YAAQ,KAAK,eAAe,KAAK,mBAAmB,OAAO,KAAK,CAAC,aAAa;AAAA,EAClF;AAEA,SAAO,wBAAwB,KAAK;AACxC;AAiBO,MAAM,UAAU,CAAC,UAA0B;AAC9C,QAAM,YAAY,iBAAiB,KAAK;AAExC,MAAI,WAAW;AACX,WAAO,EAAE,SAAuD;AAAA,EACpE;AAEA,SAAO;AACX;","names":["key"]}
@@ -1,7 +1,3 @@
1
- export { default as AbstractLocale } from './providers/AbstractLocale.js';
2
- export { default as DynamicLocale } from './providers/DynamicLocale.js';
3
- export { LocaleNativeStructure, default as NativeLocale } from './providers/NativeLocale.js';
4
- export { _, __, __t, _c } from './helpers.js';
5
- export { Language, LanguageCodes, LocaleDir, LocaleDynamicProvider, LocaleKeys, LocaleNonPluralKeys, LocalePluralKeys, LocaleProvider, LocaleStructure, LocaleSubstitutionsFor } from '../types/locale.js';
6
- import '@addon-core/storage';
7
- import './providers/CustomLocale.js';
1
+ export * from "./providers/index.js";
2
+ export * from "./helpers.js";
3
+ export { Language, LanguageCodes, LocaleDir, type LocaleStructure, type LocaleProvider, type LocaleDynamicProvider, type LocaleKeys, type LocaleSubstitutionArgs, type LocaleSubstitutionKeys, type LocaleSubstitutionValue, type LocaleNonPluralKeys, type LocalePluralKeys, } from "../types/locale.js";
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/locale/index.ts"],"sourcesContent":["export * from \"./providers\";\nexport * from \"./helpers\";\n\nexport {\n Language,\n LanguageCodes,\n LocaleDir,\n type LocaleStructure,\n type LocaleProvider,\n type LocaleDynamicProvider,\n type LocaleKeys,\n type LocaleSubstitutionsFor,\n type LocaleNonPluralKeys,\n type LocalePluralKeys,\n} from \"@typing/locale\";\n"],"mappings":"AAAA,cAAc;AACd,cAAc;AAEd;AAAA,EACI;AAAA,EACA;AAAA,EACA;AAAA,OAQG;","names":[]}
1
+ {"version":3,"sources":["../../src/locale/index.ts"],"sourcesContent":["export * from \"./providers\";\nexport * from \"./helpers\";\n\nexport {\n Language,\n LanguageCodes,\n LocaleDir,\n type LocaleStructure,\n type LocaleProvider,\n type LocaleDynamicProvider,\n type LocaleKeys,\n type LocaleSubstitutionArgs,\n type LocaleSubstitutionKeys,\n type LocaleSubstitutionValue,\n type LocaleNonPluralKeys,\n type LocalePluralKeys,\n} from \"@typing/locale\";\n"],"mappings":"AAAA,cAAc;AACd,cAAc;AAEd;AAAA,EACI;AAAA,EACA;AAAA,EACA;AAAA,OAUG;","names":[]}