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,7 +1,195 @@
1
- import 'react';
2
- import 'utility-types';
3
- export { 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 } from '../manifest-DKvERQ4d.js';
4
- import './helpers.js';
5
- import './app.js';
6
- import './browser.js';
7
- import './locale.js';
1
+ import type { FC, ReactNode } from "react";
2
+ import { Optional } from "utility-types";
3
+ import { EntrypointBuilder, EntrypointOptions } from "./entrypoint.js";
4
+ import { Awaiter, PickNonFunctionProperties } from "./helpers.js";
5
+ type ExecutionWorld = chrome.scripting.ExecutionWorld;
6
+ type RunAt = chrome.extensionTypes.RunAt;
7
+ export declare const ContentScriptMatches: string[];
8
+ export declare enum ContentScriptDeclarative {
9
+ Required = "required",
10
+ Optional = "optional"
11
+ }
12
+ export interface ContentScriptConfig {
13
+ matches?: string[];
14
+ /**
15
+ * See https://developer.chrome.com/docs/extensions/mv3/content_scripts/
16
+ * @default []
17
+ */
18
+ excludeMatches?: string[];
19
+ /**
20
+ * See https://developer.chrome.com/docs/extensions/mv3/content_scripts/
21
+ * @default []
22
+ */
23
+ includeGlobs?: string[];
24
+ /**
25
+ * See https://developer.chrome.com/docs/extensions/mv3/content_scripts/
26
+ * @default []
27
+ */
28
+ excludeGlobs?: string[];
29
+ /**
30
+ * See https://developer.chrome.com/docs/extensions/mv3/content_scripts/
31
+ * @default false
32
+ */
33
+ allFrames?: boolean;
34
+ /**
35
+ * See https://developer.chrome.com/docs/extensions/mv3/content_scripts/
36
+ * @default "documentIdle"
37
+ */
38
+ runAt?: RunAt;
39
+ /**
40
+ * See https://developer.chrome.com/docs/extensions/develop/concepts/content-scripts#isolated_world
41
+ */
42
+ world?: ExecutionWorld;
43
+ /**
44
+ * See https://developer.chrome.com/docs/extensions/mv3/content_scripts/
45
+ * @default false
46
+ */
47
+ matchAboutBlank?: boolean;
48
+ /**
49
+ * See https://developer.chrome.com/docs/extensions/mv3/content_scripts/
50
+ * @default false
51
+ */
52
+ matchOriginAsFallback?: boolean;
53
+ /**
54
+ * Whether this content script requires explicit host permission declaration in the extension manifest.
55
+ *
56
+ * Accepted values:
57
+ * - ContentScriptDeclarative.Required — adds the corresponding host patterns to manifest.host_permissions.
58
+ * - ContentScriptDeclarative.Optional — adds the corresponding host patterns to manifest.optional_host_permissions.
59
+ *
60
+ * Backward compatibility:
61
+ * - true ≡ ContentScriptDeclarative.Required
62
+ * - false ≡ undefined (as if the value is not set)
63
+ *
64
+ * @see https://developer.chrome.com/docs/extensions/mv3/declare_permissions/
65
+ *
66
+ * @default undefined
67
+ */
68
+ declarative?: boolean | `${ContentScriptDeclarative}` | ContentScriptDeclarative;
69
+ }
70
+ export type ContentScriptOptions = ContentScriptConfig & EntrypointOptions;
71
+ export type ContentScriptEntrypointOptions = Partial<ContentScriptOptions>;
72
+ export declare enum ContentScriptAppend {
73
+ Last = "last",
74
+ First = "first",
75
+ Replace = "replace",
76
+ Before = "before",
77
+ After = "after"
78
+ }
79
+ export type ContentScriptMountFunction = (anchor: Element, container: Element) => void | (() => void);
80
+ export interface ContentScriptMount {
81
+ mount(): boolean | undefined | void;
82
+ unmount(): boolean | undefined | void;
83
+ }
84
+ export interface ContentScriptProps extends ContentScriptEntrypointOptions {
85
+ anchor: Element;
86
+ }
87
+ export type ContentScriptAnchor = string | Element | null | undefined;
88
+ export type ContentScriptAnchorGetter = () => Awaiter<ContentScriptAnchor>;
89
+ export declare enum ContentScriptMarker {
90
+ /** In-memory marking (no DOM mutations). */
91
+ Weak = "weak",
92
+ /** DOM attribute-based marking. */
93
+ Attribute = "attribute"
94
+ }
95
+ export declare enum ContentScriptMarkerValue {
96
+ Mounted = "1",
97
+ Unmounted = "0"
98
+ }
99
+ export interface ContentScriptMarkerContract {
100
+ for(anchor: ContentScriptAnchor): ContentScriptMarkerContract;
101
+ /**
102
+ * Returns elements that are not tracked yet (no marker attribute present).
103
+ * MUST NOT mutate marker state.
104
+ */
105
+ unmarked(): Element[];
106
+ marked(): Element[];
107
+ mark(element: Element, value: ContentScriptMarkerValue): boolean;
108
+ unmark(element: Element): boolean;
109
+ isMarked(element: Element): boolean;
110
+ value(element: Element): ContentScriptMarkerValue | undefined;
111
+ mount(element: Element): boolean;
112
+ unmount(element: Element): boolean;
113
+ reset(): ContentScriptMarkerContract;
114
+ }
115
+ export type ContentScriptMarkerType = ContentScriptMarker | `${ContentScriptMarker}` | ContentScriptMarkerContract | undefined;
116
+ export type ContentScriptMarkerGetter = (options: ContentScriptOptions) => Awaiter<ContentScriptMarkerType>;
117
+ export type ContentScriptMarkerResolver = (options: ContentScriptOptions) => Awaiter<ContentScriptMarkerContract>;
118
+ export type ContentScriptRenderReactComponent = FC<ContentScriptProps>;
119
+ export type ContentScriptRenderValue = Element | ReactNode | ContentScriptRenderReactComponent;
120
+ export type ContentScriptRenderHandler = (props: ContentScriptProps) => Awaiter<undefined | ContentScriptRenderValue>;
121
+ export type ContentScriptContainerTag = Exclude<keyof HTMLElementTagNameMap, "html" | "body">;
122
+ export type ContentScriptContainerOptions = {
123
+ [Tag in ContentScriptContainerTag]: {
124
+ tagName: Tag;
125
+ } & Exclude<Optional<PickNonFunctionProperties<HTMLElementTagNameMap[Tag]>>, "id">;
126
+ }[ContentScriptContainerTag];
127
+ export type ContentScriptContainerFactory = (props: ContentScriptProps) => Awaiter<Element | ContentScriptContainerTag | ContentScriptContainerOptions>;
128
+ export type ContentScriptContainerCreator = (props: ContentScriptProps) => Awaiter<Element>;
129
+ export type ContentScriptWatchStrategy = (update: () => void, context: ContentScriptContext) => () => void;
130
+ export declare enum ContentScriptEvent {
131
+ Mount = "mount",
132
+ Unmount = "unmount",
133
+ Add = "add",
134
+ Remove = "remove"
135
+ }
136
+ export type ContentScriptEventCallback = (event: ContentScriptEvent, node: ContentScriptNode) => void;
137
+ export interface ContentScriptEventEmitter {
138
+ on(callback: ContentScriptEventCallback): void;
139
+ off(callback: ContentScriptEventCallback): void;
140
+ emit(event: ContentScriptEvent, node: ContentScriptNode): void;
141
+ emitMount(node: ContentScriptNode): void;
142
+ emitUnmount(node: ContentScriptNode): void;
143
+ emitAdd(node: ContentScriptNode): void;
144
+ emitRemove(node: ContentScriptNode): void;
145
+ removeAllListeners(): void;
146
+ listenerCount(): number;
147
+ hasListeners(): boolean;
148
+ }
149
+ export interface ContentScriptContext extends ContentScriptMount {
150
+ nodes: ReadonlySet<ContentScriptNode>;
151
+ /**
152
+ * Registers a callback function that will be invoked when a specific content script context event occurs.
153
+ *
154
+ * @param {ContentScriptEventCallback} callback - The function to be executed when the event is triggered. Receives event-related data as its argument.
155
+ * @return {Function} A function that can be called to unsubscribe the callback from the event.
156
+ */
157
+ watch(callback: ContentScriptEventCallback): () => void;
158
+ /**
159
+ * Stops watching for changes or events that were previously being observed.
160
+ * Unsubscribes from all event listeners that were registered through the watch method.
161
+ *
162
+ * @return {void} No return value.
163
+ */
164
+ unwatch(): void;
165
+ }
166
+ export type ContentScriptMainFunction = (context: ContentScriptContext, options: ContentScriptOptions) => Awaiter<void>;
167
+ export interface ContentScriptNode extends ContentScriptMount {
168
+ anchor: Element;
169
+ container?: Element;
170
+ }
171
+ export type ContentScriptNodeSet = Set<ContentScriptNode>;
172
+ export interface ContentScriptDefinition extends ContentScriptEntrypointOptions {
173
+ marker?: ContentScriptMarkerType | ContentScriptMarkerGetter;
174
+ anchor?: ContentScriptAnchor | ContentScriptAnchorGetter;
175
+ mount?: ContentScriptMountFunction;
176
+ render?: ContentScriptRenderValue | ContentScriptRenderHandler;
177
+ container?: ContentScriptContainerTag | ContentScriptContainerOptions | ContentScriptContainerFactory;
178
+ watch?: true | ContentScriptWatchStrategy;
179
+ main?: ContentScriptMainFunction;
180
+ }
181
+ export interface ContentScriptResolvedDefinition extends Omit<ContentScriptDefinition, "anchor" | "marker" | "mount" | "container" | "render" | "watch"> {
182
+ marker: ContentScriptMarkerResolver;
183
+ anchor: ContentScriptAnchorGetter;
184
+ mount: ContentScriptMountFunction;
185
+ render?: ContentScriptRenderHandler;
186
+ container: ContentScriptContainerCreator;
187
+ watch: ContentScriptWatchStrategy;
188
+ }
189
+ export interface ContentScriptAppendDefinition extends Omit<ContentScriptDefinition, "mount"> {
190
+ append?: ContentScriptAppend;
191
+ }
192
+ export interface ContentScriptBuilder extends EntrypointBuilder {
193
+ getContext(): ContentScriptContext;
194
+ }
195
+ export {};
@@ -1,7 +1,106 @@
1
- import './app.js';
2
- import './browser.js';
3
- export { aa as EntrypointBuilder, ab as EntrypointConstructorParameter, _ as EntrypointEntries, Z as EntrypointFile, aA as EntrypointFileExtensions, $ as EntrypointFinder, a1 as EntrypointNameGenerator, Y as EntrypointOptions, a0 as EntrypointOptionsFinder, a2 as EntrypointParser, a3 as EntrypointType } from '../manifest-DKvERQ4d.js';
4
- import 'react';
5
- import 'utility-types';
6
- import './helpers.js';
7
- import './locale.js';
1
+ import { Mode } from "./app.js";
2
+ import { Browser } from "./browser.js";
3
+ import { ManifestVersion } from "./manifest.js";
4
+ export declare const EntrypointFileExtensions: ReadonlySet<string>;
5
+ export declare enum EntrypointType {
6
+ Background = "background",
7
+ Command = "command",
8
+ ContentScript = "content",
9
+ Page = "page",
10
+ Service = "service",
11
+ Relay = "relay",
12
+ Options = "options",
13
+ Popup = "popup",
14
+ Sidebar = "sidebar",
15
+ Offscreen = "offscreen"
16
+ }
17
+ export interface EntrypointOptions {
18
+ /**
19
+ * List of target browsers to include this entrypoint in. Defaults to being included in all
20
+ * builds.
21
+ *
22
+ * @default undefined
23
+ */
24
+ includeBrowser?: `${Browser}`[] | Browser[];
25
+ /**
26
+ * List of target browsers to exclude this entrypoint from.
27
+ *
28
+ * @default undefined
29
+ */
30
+ excludeBrowser?: `${Browser}`[] | Browser[];
31
+ /**
32
+ * List of target apps to include this entrypoint in. Defaults to being included in all builds.
33
+ *
34
+ * @default undefined
35
+ */
36
+ excludeApp?: string[];
37
+ /**
38
+ * List of target apps to exclude this entrypoint from.
39
+ *
40
+ * @default undefined
41
+ */
42
+ includeApp?: string[];
43
+ /**
44
+ * Build mode for filtering entry points. Entry point will be included only
45
+ * if it matches the current build mode (Production or Development).
46
+ *
47
+ * @default undefined
48
+ */
49
+ mode?: `${Exclude<Mode, Mode.None>}` | Exclude<Mode, Mode.None>;
50
+ /**
51
+ * Manifest version constraint for this entry point. Entry point will be included
52
+ * only if it matches the target manifest version.
53
+ *
54
+ * @default undefined
55
+ */
56
+ manifestVersion?: ManifestVersion;
57
+ /**
58
+ * Debug mode flag. If true, entry point will be included only when building
59
+ * with DEBUG flag enabled.
60
+ *
61
+ * @default undefined
62
+ */
63
+ debug?: boolean;
64
+ }
65
+ export interface EntrypointFile {
66
+ file: string;
67
+ import: string;
68
+ external?: string;
69
+ }
70
+ /**
71
+ * Dictionary of entrypoint for the build configuration.
72
+ *
73
+ * @key {string} - The name of the entrypoint that will be used in the bundler configuration.
74
+ * @value {EntrypointFile[]} - Array of files that will be included in this entrypoint.
75
+ * These files will be compiled and bundled together as part of the specified entrypoint.
76
+ */
77
+ export type EntrypointEntries = Map<string, Set<EntrypointFile>>;
78
+ export interface EntrypointParser<O extends EntrypointOptions> {
79
+ options(file: EntrypointFile): O;
80
+ contract(file: EntrypointFile): string | undefined;
81
+ }
82
+ export interface EntrypointFinder {
83
+ files(): Promise<Set<EntrypointFile>>;
84
+ empty(): Promise<boolean>;
85
+ exists(): Promise<boolean>;
86
+ clear(): this;
87
+ holds(file: EntrypointFile): boolean;
88
+ }
89
+ export interface EntrypointOptionsFinder<O extends EntrypointOptions> extends EntrypointFinder {
90
+ type(): EntrypointType;
91
+ options(): Promise<Map<EntrypointFile, O>>;
92
+ contracts(): Promise<Map<EntrypointFile, string | undefined>>;
93
+ }
94
+ export interface EntrypointNameGenerator {
95
+ reserve(name: string): this;
96
+ name(name: string): string;
97
+ file(file: EntrypointFile): string;
98
+ likely(name?: string): boolean;
99
+ has(name: string): boolean;
100
+ reset(): this;
101
+ }
102
+ export interface EntrypointBuilder {
103
+ build(): Promise<void>;
104
+ destroy(): Promise<void>;
105
+ }
106
+ export type EntrypointConstructorParameter<T> = T extends new (arg: infer P) => any ? P : never;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/types/entrypoint.ts"],"sourcesContent":["import {Mode} from \"@typing/app\";\nimport {Browser} from \"@typing/browser\";\nimport {ManifestVersion} from \"@typing/manifest\";\n\nexport const EntrypointFileExtensions: ReadonlySet<string> = new Set([\"ts\", \"tsx\", \"js\", \"jsx\", \"vue\", \"svelte\"]);\n\nexport enum EntrypointType {\n Background = \"background\",\n Command = \"command\",\n ContentScript = \"content\",\n Page = \"page\",\n Service = \"service\",\n Relay = \"relay\",\n Options = \"options\",\n Popup = \"popup\",\n Sidebar = \"sidebar\",\n Offscreen = \"offscreen\",\n}\n\nexport interface EntrypointOptions {\n /**\n * List of target browsers to include this entrypoint in. Defaults to being included in all\n * builds. Cannot be used with `exclude`. You must choose one of the two options.\n *\n * @default undefined\n */\n includeBrowser?: `${Browser}`[] | Browser[];\n\n /**\n * List of target browsers to exclude this entrypoint from. Cannot be used with `include`. You\n * must choose one of the two options.\n *\n * @default undefined\n */\n excludeBrowser?: `${Browser}`[] | Browser[];\n\n /**\n * List of target apps to include this entrypoint in. Defaults to being included in all builds.\n * Cannot be used with `excludeApp`. You must choose one of the two options.\n *\n * @default undefined\n */\n excludeApp?: string[];\n\n /**\n * List of target apps to exclude this entrypoint from. Cannot be used with `includeApp`. You\n * must choose one of the two options.\n *\n * @default undefined\n */\n includeApp?: string[];\n\n /**\n * Build mode for filtering entry points. Entry point will be included only\n * if it matches the current build mode (Production or Development).\n *\n * @default undefined\n */\n mode?: `${Exclude<Mode, Mode.None>}` | Exclude<Mode, Mode.None>;\n\n /**\n * Manifest version constraint for this entry point. Entry point will be included\n * only if it matches the target manifest version.\n *\n * @default undefined\n */\n manifestVersion?: ManifestVersion;\n\n /**\n * Debug mode flag. If true, entry point will be included only when building\n * with DEBUG flag enabled.\n *\n * @default undefined\n */\n debug?: boolean;\n}\n\nexport interface EntrypointFile {\n file: string;\n import: string;\n external?: string;\n}\n\n/**\n * Dictionary of entrypoint for the build configuration.\n *\n * @key {string} - The name of the entrypoint that will be used in the bundler configuration.\n * @value {EntrypointFile[]} - Array of files that will be included in this entrypoint.\n * These files will be compiled and bundled together as part of the specified entrypoint.\n */\nexport type EntrypointEntries = Map<string, Set<EntrypointFile>>;\n\nexport interface EntrypointParser<O extends EntrypointOptions> {\n options(file: EntrypointFile): O;\n\n contract(file: EntrypointFile): string | undefined;\n}\n\nexport interface EntrypointFinder {\n files(): Promise<Set<EntrypointFile>>;\n\n empty(): Promise<boolean>;\n\n exists(): Promise<boolean>;\n\n clear(): this;\n\n holds(file: EntrypointFile): boolean;\n}\n\nexport interface EntrypointOptionsFinder<O extends EntrypointOptions> extends EntrypointFinder {\n type(): EntrypointType;\n\n options(): Promise<Map<EntrypointFile, O>>;\n\n contracts(): Promise<Map<EntrypointFile, string | undefined>>;\n}\n\nexport interface EntrypointNameGenerator {\n reserve(name: string): this;\n\n name(name: string): string;\n\n file(file: EntrypointFile): string;\n\n likely(name?: string): boolean;\n\n has(name: string): boolean;\n\n reset(): this;\n}\n\nexport interface EntrypointBuilder {\n build(): Promise<void>;\n\n destroy(): Promise<void>;\n}\n\nexport type EntrypointConstructorParameter<T> = T extends new (arg: infer P) => any ? P : never;\n"],"mappings":"AAIO,MAAM,2BAAgD,oBAAI,IAAI,CAAC,MAAM,OAAO,MAAM,OAAO,OAAO,QAAQ,CAAC;AAEzG,IAAK,iBAAL,kBAAKA,oBAAL;AACH,EAAAA,gBAAA,gBAAa;AACb,EAAAA,gBAAA,aAAU;AACV,EAAAA,gBAAA,mBAAgB;AAChB,EAAAA,gBAAA,UAAO;AACP,EAAAA,gBAAA,aAAU;AACV,EAAAA,gBAAA,WAAQ;AACR,EAAAA,gBAAA,aAAU;AACV,EAAAA,gBAAA,WAAQ;AACR,EAAAA,gBAAA,aAAU;AACV,EAAAA,gBAAA,eAAY;AAVJ,SAAAA;AAAA,GAAA;","names":["EntrypointType"]}
1
+ {"version":3,"sources":["../../src/types/entrypoint.ts"],"sourcesContent":["import {Mode} from \"@typing/app\";\nimport {Browser} from \"@typing/browser\";\nimport {ManifestVersion} from \"@typing/manifest\";\n\nexport const EntrypointFileExtensions: ReadonlySet<string> = new Set([\"ts\", \"tsx\", \"js\", \"jsx\", \"vue\", \"svelte\"]);\n\nexport enum EntrypointType {\n Background = \"background\",\n Command = \"command\",\n ContentScript = \"content\",\n Page = \"page\",\n Service = \"service\",\n Relay = \"relay\",\n Options = \"options\",\n Popup = \"popup\",\n Sidebar = \"sidebar\",\n Offscreen = \"offscreen\",\n}\n\nexport interface EntrypointOptions {\n /**\n * List of target browsers to include this entrypoint in. Defaults to being included in all\n * builds.\n *\n * @default undefined\n */\n includeBrowser?: `${Browser}`[] | Browser[];\n\n /**\n * List of target browsers to exclude this entrypoint from.\n *\n * @default undefined\n */\n excludeBrowser?: `${Browser}`[] | Browser[];\n\n /**\n * List of target apps to include this entrypoint in. Defaults to being included in all builds.\n *\n * @default undefined\n */\n excludeApp?: string[];\n\n /**\n * List of target apps to exclude this entrypoint from.\n *\n * @default undefined\n */\n includeApp?: string[];\n\n /**\n * Build mode for filtering entry points. Entry point will be included only\n * if it matches the current build mode (Production or Development).\n *\n * @default undefined\n */\n mode?: `${Exclude<Mode, Mode.None>}` | Exclude<Mode, Mode.None>;\n\n /**\n * Manifest version constraint for this entry point. Entry point will be included\n * only if it matches the target manifest version.\n *\n * @default undefined\n */\n manifestVersion?: ManifestVersion;\n\n /**\n * Debug mode flag. If true, entry point will be included only when building\n * with DEBUG flag enabled.\n *\n * @default undefined\n */\n debug?: boolean;\n}\n\nexport interface EntrypointFile {\n file: string;\n import: string;\n external?: string;\n}\n\n/**\n * Dictionary of entrypoint for the build configuration.\n *\n * @key {string} - The name of the entrypoint that will be used in the bundler configuration.\n * @value {EntrypointFile[]} - Array of files that will be included in this entrypoint.\n * These files will be compiled and bundled together as part of the specified entrypoint.\n */\nexport type EntrypointEntries = Map<string, Set<EntrypointFile>>;\n\nexport interface EntrypointParser<O extends EntrypointOptions> {\n options(file: EntrypointFile): O;\n\n contract(file: EntrypointFile): string | undefined;\n}\n\nexport interface EntrypointFinder {\n files(): Promise<Set<EntrypointFile>>;\n\n empty(): Promise<boolean>;\n\n exists(): Promise<boolean>;\n\n clear(): this;\n\n holds(file: EntrypointFile): boolean;\n}\n\nexport interface EntrypointOptionsFinder<O extends EntrypointOptions> extends EntrypointFinder {\n type(): EntrypointType;\n\n options(): Promise<Map<EntrypointFile, O>>;\n\n contracts(): Promise<Map<EntrypointFile, string | undefined>>;\n}\n\nexport interface EntrypointNameGenerator {\n reserve(name: string): this;\n\n name(name: string): string;\n\n file(file: EntrypointFile): string;\n\n likely(name?: string): boolean;\n\n has(name: string): boolean;\n\n reset(): this;\n}\n\nexport interface EntrypointBuilder {\n build(): Promise<void>;\n\n destroy(): Promise<void>;\n}\n\nexport type EntrypointConstructorParameter<T> = T extends new (arg: infer P) => any ? P : never;\n"],"mappings":"AAIO,MAAM,2BAAgD,oBAAI,IAAI,CAAC,MAAM,OAAO,MAAM,OAAO,OAAO,QAAQ,CAAC;AAEzG,IAAK,iBAAL,kBAAKA,oBAAL;AACH,EAAAA,gBAAA,gBAAa;AACb,EAAAA,gBAAA,aAAU;AACV,EAAAA,gBAAA,mBAAgB;AAChB,EAAAA,gBAAA,UAAO;AACP,EAAAA,gBAAA,aAAU;AACV,EAAAA,gBAAA,WAAQ;AACR,EAAAA,gBAAA,aAAU;AACV,EAAAA,gBAAA,WAAQ;AACR,EAAAA,gBAAA,aAAU;AACV,EAAAA,gBAAA,eAAY;AAVJ,SAAAA;AAAA,GAAA;","names":["EntrypointType"]}
@@ -1,8 +1,6 @@
1
- declare const EnvReservedKeys: Set<string>;
2
- type EnvFilterFunction = (value: string) => boolean;
3
- type EnvFilterVariant = string | EnvFilterFunction;
4
- type EnvFilterOptions = {
1
+ export declare const EnvReservedKeys: Set<string>;
2
+ export type EnvFilterFunction = (value: string) => boolean;
3
+ export type EnvFilterVariant = string | EnvFilterFunction;
4
+ export type EnvFilterOptions = {
5
5
  filter: EnvFilterVariant;
6
6
  };
7
-
8
- export { type EnvFilterFunction, type EnvFilterOptions, type EnvFilterVariant, EnvReservedKeys };
@@ -1,6 +1,4 @@
1
- declare enum Framework {
1
+ export declare enum Framework {
2
2
  React = "react",
3
3
  Vanilla = "vanilla"
4
4
  }
5
-
6
- export { Framework };
@@ -1,14 +1,13 @@
1
1
  type ExcludeFunction<T> = T extends Function ? never : T;
2
- type Awaiter<T> = T | Promise<T>;
3
- type PickNonFunctionProperties<T> = {
2
+ export type Awaiter<T> = T | Promise<T>;
3
+ export type PickNonFunctionProperties<T> = {
4
4
  [K in keyof T as T[K] extends Function ? never : K]: T[K];
5
5
  };
6
- type ExcludeFunctionsFromProperties<T> = {
6
+ export type ExcludeFunctionsFromProperties<T> = {
7
7
  [K in keyof T]: ExcludeFunction<T[K]>;
8
8
  };
9
- type DeepAsyncProxy<T> = {
9
+ export type DeepAsyncProxy<T> = {
10
10
  [K in keyof T]: T[K] extends (...args: any[]) => any ? (...args: Parameters<T[K]>) => Promise<Awaited<ReturnType<T[K]>>> : T[K] extends object ? DeepAsyncProxyObject<T[K]> : () => Promise<Awaited<T[K]>>;
11
11
  };
12
- type DeepAsyncProxyObject<T> = (() => Promise<DeepAsyncProxy<T>>) & DeepAsyncProxy<T>;
13
-
14
- export type { Awaiter, DeepAsyncProxy, DeepAsyncProxyObject, ExcludeFunctionsFromProperties, PickNonFunctionProperties };
12
+ export type DeepAsyncProxyObject<T> = (() => Promise<DeepAsyncProxy<T>>) & DeepAsyncProxy<T>;
13
+ export {};
@@ -1,5 +1,3 @@
1
- declare const DefaultIconGroupName = "default";
2
- declare const IconFileExtensions: ReadonlySet<string>;
3
- declare const IconSizes: ReadonlySet<number>;
4
-
5
- export { DefaultIconGroupName, IconFileExtensions, IconSizes };
1
+ export declare const DefaultIconGroupName = "default";
2
+ export declare const IconFileExtensions: ReadonlySet<string>;
3
+ export declare const IconSizes: ReadonlySet<number>;
@@ -1,4 +1,4 @@
1
- declare enum Language {
1
+ export declare enum Language {
2
2
  Arabic = "ar",
3
3
  Amharic = "am",
4
4
  Bulgarian = "bg",
@@ -55,30 +55,30 @@ declare enum Language {
55
55
  ChineseChina = "zh_CN",
56
56
  ChineseTaiwan = "zh_TW"
57
57
  }
58
- declare enum LocaleDir {
58
+ export declare enum LocaleDir {
59
59
  RightToLeft = "rtl",
60
60
  LeftToRight = "ltr"
61
61
  }
62
- declare const RtlLanguages: ReadonlySet<Language>;
63
- declare const LocaleNestedKeysSeparator = ".";
64
- declare const LocaleKeysSeparator = "_";
65
- declare const LocaleValuesSeparator = "|";
66
- declare const LocaleCustomKeyForLanguage = "locale";
67
- declare const LocaleKeyMarker = "@";
68
- declare const LanguageCodes: ReadonlySet<string>;
69
- declare const LocaleFileExtensions: ReadonlySet<string>;
70
- type LocaleValue = string | number | string[] | number[];
71
- type LocaleData = {
62
+ export declare const RtlLanguages: ReadonlySet<Language>;
63
+ export declare const LocaleNestedKeysSeparator = ".";
64
+ export declare const LocaleKeysSeparator = "_";
65
+ export declare const LocaleValuesSeparator = "|";
66
+ export declare const LocaleCustomKeyForLanguage = "locale";
67
+ export declare const LocaleKeyMarker = "@";
68
+ export declare const LanguageCodes: ReadonlySet<string>;
69
+ export declare const LocaleFileExtensions: ReadonlySet<string>;
70
+ export type LocaleValue = string | number | Array<string | number>;
71
+ export type LocaleData = {
72
72
  [key: string]: LocaleValue | LocaleData;
73
73
  };
74
- type LocaleItems = Map<string, string>;
75
- type LocaleKeys = ReadonlySet<string>;
76
- type LocaleMessages = {
74
+ export type LocaleItems = Map<string, string>;
75
+ export type LocaleKeys = ReadonlySet<string>;
76
+ export type LocaleMessages = {
77
77
  [key: string]: {
78
78
  message: string;
79
79
  };
80
80
  };
81
- interface LocaleBuilder {
81
+ export interface LocaleBuilder {
82
82
  lang(): Language;
83
83
  merge(data: LocaleData): this;
84
84
  build(): LocaleMessages;
@@ -88,39 +88,45 @@ interface LocaleBuilder {
88
88
  isValid(): boolean;
89
89
  validate(): this;
90
90
  }
91
- interface LocaleValidator {
91
+ export type LocaleBuilders = Map<Language, LocaleBuilder>;
92
+ export interface LocaleValidator {
92
93
  isValid(locale: LocaleBuilder): boolean;
93
94
  validate(locale: LocaleBuilder): this;
94
95
  }
95
- interface LocaleFutures {
96
+ export interface LocaleContractValidator {
97
+ isValid(builders: LocaleBuilders): boolean;
98
+ validate(builders: LocaleBuilders): this;
99
+ }
100
+ export interface LocaleFutures {
96
101
  plural: boolean;
97
102
  substitutions: readonly string[];
98
103
  }
99
- interface LocaleStructure {
104
+ export interface LocaleStructure {
100
105
  [key: string]: LocaleFutures;
101
106
  }
102
- type LocaleNonPluralKeys<T extends LocaleStructure> = {
107
+ export type LocaleNonPluralKeys<T> = {
103
108
  [K in keyof T]: T[K] extends {
104
109
  plural: false;
105
110
  } ? K : never;
106
111
  }[keyof T] & string;
107
- type LocalePluralKeys<T extends LocaleStructure> = {
112
+ export type LocalePluralKeys<T> = {
108
113
  [K in keyof T]: T[K] extends {
109
114
  plural: true;
110
115
  } ? K : never;
111
116
  }[keyof T] & string;
112
- type LocaleSubstitutionsFor<T extends LocaleStructure, K extends keyof T> = T[K] extends {
117
+ export type LocaleSubstitutionValue = string | number;
118
+ export type LocaleSubstitutionKeys<T, K extends keyof T> = T[K] extends {
113
119
  substitutions: readonly (infer U)[];
114
- } ? Partial<Record<U & string, string | number>> : never;
115
- interface LocaleProvider<S extends LocaleStructure> {
120
+ } ? U & string : never;
121
+ export type LocaleSubstitutionsFor<T, K extends keyof T> = [LocaleSubstitutionKeys<T, K>] extends [never] ? never : Record<LocaleSubstitutionKeys<T, K>, LocaleSubstitutionValue>;
122
+ export type LocaleSubstitutionArgs<T, K extends keyof T> = string extends keyof T ? [substitutions?: Record<string, LocaleSubstitutionValue>] : [LocaleSubstitutionKeys<T, K>] extends [never] ? [] : [substitutions: LocaleSubstitutionsFor<T, K>];
123
+ export interface LocaleProvider<S> {
116
124
  lang(): Language;
117
125
  languages(): Set<Language>;
118
126
  keys(): ReadonlySet<keyof S>;
119
- trans<K extends LocaleNonPluralKeys<S>>(key: K, substitutions?: LocaleSubstitutionsFor<S, K>): string;
120
- choice<K extends LocalePluralKeys<S>>(key: K, count: number, substitutions?: LocaleSubstitutionsFor<S, K>): string;
127
+ trans<K extends LocaleNonPluralKeys<S>>(key: K, ...args: LocaleSubstitutionArgs<S, K>): string;
128
+ choice<K extends LocalePluralKeys<S>>(key: K, count: number, ...args: LocaleSubstitutionArgs<S, K>): string;
121
129
  }
122
- interface LocaleDynamicProvider<S extends LocaleStructure> extends LocaleProvider<S> {
130
+ export interface LocaleDynamicProvider<S> extends LocaleProvider<S> {
123
131
  change(lang: Language): Promise<Language>;
124
132
  }
125
-
126
- export { Language, LanguageCodes, type LocaleBuilder, LocaleCustomKeyForLanguage, type LocaleData, LocaleDir, type LocaleDynamicProvider, LocaleFileExtensions, type LocaleFutures, type LocaleItems, LocaleKeyMarker, type LocaleKeys, LocaleKeysSeparator, type LocaleMessages, LocaleNestedKeysSeparator, type LocaleNonPluralKeys, type LocalePluralKeys, type LocaleProvider, type LocaleStructure, type LocaleSubstitutionsFor, type LocaleValidator, type LocaleValue, LocaleValuesSeparator, RtlLanguages };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/types/locale.ts"],"sourcesContent":["export enum Language {\n Arabic = \"ar\",\n Amharic = \"am\",\n Bulgarian = \"bg\",\n Bengali = \"bn\",\n Catalan = \"ca\",\n Czech = \"cs\",\n Danish = \"da\",\n German = \"de\",\n Greek = \"el\",\n English = \"en\",\n EnglishAustralia = \"en_AU\",\n EnglishGreatBritain = \"en_GB\",\n EnglishUSA = \"en_US\",\n Spanish = \"es\",\n SpanishLatinAmericaAndCaribbean = \"es_419\",\n Estonian = \"et\",\n Persian = \"fa\",\n Finnish = \"fi\",\n Filipino = \"fil\",\n French = \"fr\",\n Gujarati = \"gu\",\n Hebrew = \"he\",\n Hindi = \"hi\",\n Croatian = \"hr\",\n Hungarian = \"hu\",\n Indonesian = \"id\",\n Italian = \"it\",\n Japanese = \"ja\",\n Kannada = \"kn\",\n Korean = \"ko\",\n Lithuanian = \"lt\",\n Latvian = \"lv\",\n Malayalam = \"ml\",\n Marathi = \"mr\",\n Malay = \"ms\",\n Dutch = \"nl\",\n Norwegian = \"no\",\n Polish = \"pl\",\n PortugueseBrazil = \"pt_BR\",\n PortuguesePortugal = \"pt_PT\",\n Romanian = \"ro\",\n Russian = \"ru\",\n Slovak = \"sk\",\n Slovenian = \"sl\",\n Serbian = \"sr\",\n Swedish = \"sv\",\n Swahili = \"sw\",\n Tamil = \"ta\",\n Telugu = \"te\",\n Thai = \"th\",\n Turkish = \"tr\",\n Ukrainian = \"uk\",\n Vietnamese = \"vi\",\n ChineseChina = \"zh_CN\",\n ChineseTaiwan = \"zh_TW\",\n}\n\nexport enum LocaleDir {\n RightToLeft = \"rtl\",\n LeftToRight = \"ltr\",\n}\n\nexport const RtlLanguages: ReadonlySet<Language> = new Set([Language.Arabic, Language.Persian, Language.Hebrew]);\n\nexport const LocaleNestedKeysSeparator = \".\";\n\nexport const LocaleKeysSeparator = \"_\";\n\nexport const LocaleValuesSeparator = \"|\";\n\nexport const LocaleCustomKeyForLanguage = \"locale\";\n\nexport const LocaleKeyMarker = \"@\";\n\nexport const LanguageCodes: ReadonlySet<string> = new Set(Object.values(Language));\n\nexport const LocaleFileExtensions: ReadonlySet<string> = new Set([\"yaml\", \"yml\", \"json\"]);\n\nexport type LocaleValue = string | number | string[] | number[];\n\nexport type LocaleData = {\n [key: string]: LocaleValue | LocaleData;\n};\n\nexport type LocaleItems = Map<string, string>;\n\nexport type LocaleKeys = ReadonlySet<string>;\n\nexport type LocaleMessages = {\n [key: string]: {\n message: string;\n };\n};\n\nexport interface LocaleBuilder {\n lang(): Language;\n\n merge(data: LocaleData): this;\n\n build(): LocaleMessages;\n\n get(): LocaleItems;\n\n keys(): LocaleKeys;\n\n structure(): LocaleStructure;\n\n isValid(): boolean;\n\n validate(): this;\n}\n\nexport interface LocaleValidator {\n isValid(locale: LocaleBuilder): boolean;\n\n validate(locale: LocaleBuilder): this;\n}\n\nexport interface LocaleFutures {\n plural: boolean;\n substitutions: readonly string[];\n}\n\nexport interface LocaleStructure {\n [key: string]: LocaleFutures;\n}\n\nexport type LocaleNonPluralKeys<T extends LocaleStructure> = {\n [K in keyof T]: T[K] extends {plural: false} ? K : never;\n}[keyof T] &\n string;\n\nexport type LocalePluralKeys<T extends LocaleStructure> = {\n [K in keyof T]: T[K] extends {plural: true} ? K : never;\n}[keyof T] &\n string;\n\nexport type LocaleSubstitutionsFor<T extends LocaleStructure, K extends keyof T> = T[K] extends {\n substitutions: readonly (infer U)[];\n}\n ? Partial<Record<U & string, string | number>>\n : never;\n\nexport interface LocaleProvider<S extends LocaleStructure> {\n lang(): Language;\n\n languages(): Set<Language>;\n\n keys(): ReadonlySet<keyof S>;\n\n // non-plural keys\n trans<K extends LocaleNonPluralKeys<S>>(key: K, substitutions?: LocaleSubstitutionsFor<S, K>): string;\n\n // plural keys\n choice<K extends LocalePluralKeys<S>>(key: K, count: number, substitutions?: LocaleSubstitutionsFor<S, K>): string;\n}\n\nexport interface LocaleDynamicProvider<S extends LocaleStructure> extends LocaleProvider<S> {\n change(lang: Language): Promise<Language>;\n}\n"],"mappings":"AAAO,IAAK,WAAL,kBAAKA,cAAL;AACH,EAAAA,UAAA,YAAS;AACT,EAAAA,UAAA,aAAU;AACV,EAAAA,UAAA,eAAY;AACZ,EAAAA,UAAA,aAAU;AACV,EAAAA,UAAA,aAAU;AACV,EAAAA,UAAA,WAAQ;AACR,EAAAA,UAAA,YAAS;AACT,EAAAA,UAAA,YAAS;AACT,EAAAA,UAAA,WAAQ;AACR,EAAAA,UAAA,aAAU;AACV,EAAAA,UAAA,sBAAmB;AACnB,EAAAA,UAAA,yBAAsB;AACtB,EAAAA,UAAA,gBAAa;AACb,EAAAA,UAAA,aAAU;AACV,EAAAA,UAAA,qCAAkC;AAClC,EAAAA,UAAA,cAAW;AACX,EAAAA,UAAA,aAAU;AACV,EAAAA,UAAA,aAAU;AACV,EAAAA,UAAA,cAAW;AACX,EAAAA,UAAA,YAAS;AACT,EAAAA,UAAA,cAAW;AACX,EAAAA,UAAA,YAAS;AACT,EAAAA,UAAA,WAAQ;AACR,EAAAA,UAAA,cAAW;AACX,EAAAA,UAAA,eAAY;AACZ,EAAAA,UAAA,gBAAa;AACb,EAAAA,UAAA,aAAU;AACV,EAAAA,UAAA,cAAW;AACX,EAAAA,UAAA,aAAU;AACV,EAAAA,UAAA,YAAS;AACT,EAAAA,UAAA,gBAAa;AACb,EAAAA,UAAA,aAAU;AACV,EAAAA,UAAA,eAAY;AACZ,EAAAA,UAAA,aAAU;AACV,EAAAA,UAAA,WAAQ;AACR,EAAAA,UAAA,WAAQ;AACR,EAAAA,UAAA,eAAY;AACZ,EAAAA,UAAA,YAAS;AACT,EAAAA,UAAA,sBAAmB;AACnB,EAAAA,UAAA,wBAAqB;AACrB,EAAAA,UAAA,cAAW;AACX,EAAAA,UAAA,aAAU;AACV,EAAAA,UAAA,YAAS;AACT,EAAAA,UAAA,eAAY;AACZ,EAAAA,UAAA,aAAU;AACV,EAAAA,UAAA,aAAU;AACV,EAAAA,UAAA,aAAU;AACV,EAAAA,UAAA,WAAQ;AACR,EAAAA,UAAA,YAAS;AACT,EAAAA,UAAA,UAAO;AACP,EAAAA,UAAA,aAAU;AACV,EAAAA,UAAA,eAAY;AACZ,EAAAA,UAAA,gBAAa;AACb,EAAAA,UAAA,kBAAe;AACf,EAAAA,UAAA,mBAAgB;AAvDR,SAAAA;AAAA,GAAA;AA0DL,IAAK,YAAL,kBAAKC,eAAL;AACH,EAAAA,WAAA,iBAAc;AACd,EAAAA,WAAA,iBAAc;AAFN,SAAAA;AAAA,GAAA;AAKL,MAAM,eAAsC,oBAAI,IAAI,CAAC,mBAAiB,oBAAkB,iBAAe,CAAC;AAExG,MAAM,4BAA4B;AAElC,MAAM,sBAAsB;AAE5B,MAAM,wBAAwB;AAE9B,MAAM,6BAA6B;AAEnC,MAAM,kBAAkB;AAExB,MAAM,gBAAqC,IAAI,IAAI,OAAO,OAAO,QAAQ,CAAC;AAE1E,MAAM,uBAA4C,oBAAI,IAAI,CAAC,QAAQ,OAAO,MAAM,CAAC;","names":["Language","LocaleDir"]}
1
+ {"version":3,"sources":["../../src/types/locale.ts"],"sourcesContent":["export enum Language {\n Arabic = \"ar\",\n Amharic = \"am\",\n Bulgarian = \"bg\",\n Bengali = \"bn\",\n Catalan = \"ca\",\n Czech = \"cs\",\n Danish = \"da\",\n German = \"de\",\n Greek = \"el\",\n English = \"en\",\n EnglishAustralia = \"en_AU\",\n EnglishGreatBritain = \"en_GB\",\n EnglishUSA = \"en_US\",\n Spanish = \"es\",\n SpanishLatinAmericaAndCaribbean = \"es_419\",\n Estonian = \"et\",\n Persian = \"fa\",\n Finnish = \"fi\",\n Filipino = \"fil\",\n French = \"fr\",\n Gujarati = \"gu\",\n Hebrew = \"he\",\n Hindi = \"hi\",\n Croatian = \"hr\",\n Hungarian = \"hu\",\n Indonesian = \"id\",\n Italian = \"it\",\n Japanese = \"ja\",\n Kannada = \"kn\",\n Korean = \"ko\",\n Lithuanian = \"lt\",\n Latvian = \"lv\",\n Malayalam = \"ml\",\n Marathi = \"mr\",\n Malay = \"ms\",\n Dutch = \"nl\",\n Norwegian = \"no\",\n Polish = \"pl\",\n PortugueseBrazil = \"pt_BR\",\n PortuguesePortugal = \"pt_PT\",\n Romanian = \"ro\",\n Russian = \"ru\",\n Slovak = \"sk\",\n Slovenian = \"sl\",\n Serbian = \"sr\",\n Swedish = \"sv\",\n Swahili = \"sw\",\n Tamil = \"ta\",\n Telugu = \"te\",\n Thai = \"th\",\n Turkish = \"tr\",\n Ukrainian = \"uk\",\n Vietnamese = \"vi\",\n ChineseChina = \"zh_CN\",\n ChineseTaiwan = \"zh_TW\",\n}\n\nexport enum LocaleDir {\n RightToLeft = \"rtl\",\n LeftToRight = \"ltr\",\n}\n\nexport const RtlLanguages: ReadonlySet<Language> = new Set([Language.Arabic, Language.Persian, Language.Hebrew]);\n\nexport const LocaleNestedKeysSeparator = \".\";\n\nexport const LocaleKeysSeparator = \"_\";\n\nexport const LocaleValuesSeparator = \"|\";\n\nexport const LocaleCustomKeyForLanguage = \"locale\";\n\nexport const LocaleKeyMarker = \"@\";\n\nexport const LanguageCodes: ReadonlySet<string> = new Set(Object.values(Language));\n\nexport const LocaleFileExtensions: ReadonlySet<string> = new Set([\"yaml\", \"yml\", \"json\"]);\n\nexport type LocaleValue = string | number | Array<string | number>;\n\nexport type LocaleData = {\n [key: string]: LocaleValue | LocaleData;\n};\n\nexport type LocaleItems = Map<string, string>;\n\nexport type LocaleKeys = ReadonlySet<string>;\n\nexport type LocaleMessages = {\n [key: string]: {\n message: string;\n };\n};\n\nexport interface LocaleBuilder {\n lang(): Language;\n\n merge(data: LocaleData): this;\n\n build(): LocaleMessages;\n\n get(): LocaleItems;\n\n keys(): LocaleKeys;\n\n structure(): LocaleStructure;\n\n isValid(): boolean;\n\n validate(): this;\n}\n\nexport type LocaleBuilders = Map<Language, LocaleBuilder>;\n\nexport interface LocaleValidator {\n isValid(locale: LocaleBuilder): boolean;\n\n validate(locale: LocaleBuilder): this;\n}\n\nexport interface LocaleContractValidator {\n isValid(builders: LocaleBuilders): boolean;\n\n validate(builders: LocaleBuilders): this;\n}\n\nexport interface LocaleFutures {\n plural: boolean;\n substitutions: readonly string[];\n}\n\nexport interface LocaleStructure {\n [key: string]: LocaleFutures;\n}\n\nexport type LocaleNonPluralKeys<T> = {\n [K in keyof T]: T[K] extends {plural: false} ? K : never;\n}[keyof T] &\n string;\n\nexport type LocalePluralKeys<T> = {\n [K in keyof T]: T[K] extends {plural: true} ? K : never;\n}[keyof T] &\n string;\n\nexport type LocaleSubstitutionValue = string | number;\n\nexport type LocaleSubstitutionKeys<T, K extends keyof T> = T[K] extends {substitutions: readonly (infer U)[]}\n ? U & string\n : never;\n\nexport type LocaleSubstitutionsFor<T, K extends keyof T> = [LocaleSubstitutionKeys<T, K>] extends [never]\n ? never\n : Record<LocaleSubstitutionKeys<T, K>, LocaleSubstitutionValue>;\n\nexport type LocaleSubstitutionArgs<T, K extends keyof T> = string extends keyof T\n ? [substitutions?: Record<string, LocaleSubstitutionValue>]\n : [LocaleSubstitutionKeys<T, K>] extends [never]\n ? []\n : [substitutions: LocaleSubstitutionsFor<T, K>];\n\nexport interface LocaleProvider<S> {\n lang(): Language;\n\n languages(): Set<Language>;\n\n keys(): ReadonlySet<keyof S>;\n\n // non-plural keys\n trans<K extends LocaleNonPluralKeys<S>>(key: K, ...args: LocaleSubstitutionArgs<S, K>): string;\n\n // plural keys\n choice<K extends LocalePluralKeys<S>>(key: K, count: number, ...args: LocaleSubstitutionArgs<S, K>): string;\n}\n\nexport interface LocaleDynamicProvider<S> extends LocaleProvider<S> {\n change(lang: Language): Promise<Language>;\n}\n"],"mappings":"AAAO,IAAK,WAAL,kBAAKA,cAAL;AACH,EAAAA,UAAA,YAAS;AACT,EAAAA,UAAA,aAAU;AACV,EAAAA,UAAA,eAAY;AACZ,EAAAA,UAAA,aAAU;AACV,EAAAA,UAAA,aAAU;AACV,EAAAA,UAAA,WAAQ;AACR,EAAAA,UAAA,YAAS;AACT,EAAAA,UAAA,YAAS;AACT,EAAAA,UAAA,WAAQ;AACR,EAAAA,UAAA,aAAU;AACV,EAAAA,UAAA,sBAAmB;AACnB,EAAAA,UAAA,yBAAsB;AACtB,EAAAA,UAAA,gBAAa;AACb,EAAAA,UAAA,aAAU;AACV,EAAAA,UAAA,qCAAkC;AAClC,EAAAA,UAAA,cAAW;AACX,EAAAA,UAAA,aAAU;AACV,EAAAA,UAAA,aAAU;AACV,EAAAA,UAAA,cAAW;AACX,EAAAA,UAAA,YAAS;AACT,EAAAA,UAAA,cAAW;AACX,EAAAA,UAAA,YAAS;AACT,EAAAA,UAAA,WAAQ;AACR,EAAAA,UAAA,cAAW;AACX,EAAAA,UAAA,eAAY;AACZ,EAAAA,UAAA,gBAAa;AACb,EAAAA,UAAA,aAAU;AACV,EAAAA,UAAA,cAAW;AACX,EAAAA,UAAA,aAAU;AACV,EAAAA,UAAA,YAAS;AACT,EAAAA,UAAA,gBAAa;AACb,EAAAA,UAAA,aAAU;AACV,EAAAA,UAAA,eAAY;AACZ,EAAAA,UAAA,aAAU;AACV,EAAAA,UAAA,WAAQ;AACR,EAAAA,UAAA,WAAQ;AACR,EAAAA,UAAA,eAAY;AACZ,EAAAA,UAAA,YAAS;AACT,EAAAA,UAAA,sBAAmB;AACnB,EAAAA,UAAA,wBAAqB;AACrB,EAAAA,UAAA,cAAW;AACX,EAAAA,UAAA,aAAU;AACV,EAAAA,UAAA,YAAS;AACT,EAAAA,UAAA,eAAY;AACZ,EAAAA,UAAA,aAAU;AACV,EAAAA,UAAA,aAAU;AACV,EAAAA,UAAA,aAAU;AACV,EAAAA,UAAA,WAAQ;AACR,EAAAA,UAAA,YAAS;AACT,EAAAA,UAAA,UAAO;AACP,EAAAA,UAAA,aAAU;AACV,EAAAA,UAAA,eAAY;AACZ,EAAAA,UAAA,gBAAa;AACb,EAAAA,UAAA,kBAAe;AACf,EAAAA,UAAA,mBAAgB;AAvDR,SAAAA;AAAA,GAAA;AA0DL,IAAK,YAAL,kBAAKC,eAAL;AACH,EAAAA,WAAA,iBAAc;AACd,EAAAA,WAAA,iBAAc;AAFN,SAAAA;AAAA,GAAA;AAKL,MAAM,eAAsC,oBAAI,IAAI,CAAC,mBAAiB,oBAAkB,iBAAe,CAAC;AAExG,MAAM,4BAA4B;AAElC,MAAM,sBAAsB;AAE5B,MAAM,wBAAwB;AAE9B,MAAM,6BAA6B;AAEnC,MAAM,kBAAkB;AAExB,MAAM,gBAAqC,IAAI,IAAI,OAAO,OAAO,QAAQ,CAAC;AAE1E,MAAM,uBAA4C,oBAAI,IAAI,CAAC,QAAQ,OAAO,MAAM,CAAC;","names":["Language","LocaleDir"]}