@saolabs/client 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +221 -0
- package/dist/index.d.ts +46 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +38 -0
- package/dist/index.js.map +1 -0
- package/dist/plugins.d.ts +38 -0
- package/dist/plugins.d.ts.map +1 -0
- package/dist/plugins.js +61 -0
- package/dist/plugins.js.map +1 -0
- package/dist/src/core/app/Application.d.ts +159 -0
- package/dist/src/core/app/Application.d.ts.map +1 -0
- package/dist/src/core/app/Application.js +338 -0
- package/dist/src/core/app/Application.js.map +1 -0
- package/dist/src/core/bootstrap/app.d.ts +4 -0
- package/dist/src/core/bootstrap/app.d.ts.map +1 -0
- package/dist/src/core/bootstrap/app.js +49 -0
- package/dist/src/core/bootstrap/app.js.map +1 -0
- package/dist/src/core/bootstrap/providers/ApiServiceProvider.d.ts +9 -0
- package/dist/src/core/bootstrap/providers/ApiServiceProvider.d.ts.map +1 -0
- package/dist/src/core/bootstrap/providers/ApiServiceProvider.js +18 -0
- package/dist/src/core/bootstrap/providers/ApiServiceProvider.js.map +1 -0
- package/dist/src/core/bootstrap/providers/CoreServiceProvider.d.ts +6 -0
- package/dist/src/core/bootstrap/providers/CoreServiceProvider.d.ts.map +1 -0
- package/dist/src/core/bootstrap/providers/CoreServiceProvider.js +21 -0
- package/dist/src/core/bootstrap/providers/CoreServiceProvider.js.map +1 -0
- package/dist/src/core/bootstrap/providers/HelperServiceProvider.d.ts +7 -0
- package/dist/src/core/bootstrap/providers/HelperServiceProvider.d.ts.map +1 -0
- package/dist/src/core/bootstrap/providers/HelperServiceProvider.js +14 -0
- package/dist/src/core/bootstrap/providers/HelperServiceProvider.js.map +1 -0
- package/dist/src/core/bootstrap/providers/RouteServiceProvider.d.ts +9 -0
- package/dist/src/core/bootstrap/providers/RouteServiceProvider.d.ts.map +1 -0
- package/dist/src/core/bootstrap/providers/RouteServiceProvider.js +18 -0
- package/dist/src/core/bootstrap/providers/RouteServiceProvider.js.map +1 -0
- package/dist/src/core/bootstrap/providers/ServiceProvider.d.ts +38 -0
- package/dist/src/core/bootstrap/providers/ServiceProvider.d.ts.map +1 -0
- package/dist/src/core/bootstrap/providers/ServiceProvider.js +41 -0
- package/dist/src/core/bootstrap/providers/ServiceProvider.js.map +1 -0
- package/dist/src/core/bootstrap/providers/ViewServiceProvider.d.ts +9 -0
- package/dist/src/core/bootstrap/providers/ViewServiceProvider.d.ts.map +1 -0
- package/dist/src/core/bootstrap/providers/ViewServiceProvider.js +18 -0
- package/dist/src/core/bootstrap/providers/ViewServiceProvider.js.map +1 -0
- package/dist/src/core/bootstrap/providers/default-providers.d.ts +14 -0
- package/dist/src/core/bootstrap/providers/default-providers.d.ts.map +1 -0
- package/dist/src/core/bootstrap/providers/default-providers.js +79 -0
- package/dist/src/core/bootstrap/providers/default-providers.js.map +1 -0
- package/dist/src/core/bootstrap/providers/index.d.ts +10 -0
- package/dist/src/core/bootstrap/providers/index.d.ts.map +1 -0
- package/dist/src/core/bootstrap/providers/index.js +9 -0
- package/dist/src/core/bootstrap/providers/index.js.map +1 -0
- package/dist/src/core/bootstrap/providers/provider-order.d.ts +19 -0
- package/dist/src/core/bootstrap/providers/provider-order.d.ts.map +1 -0
- package/dist/src/core/bootstrap/providers/provider-order.js +51 -0
- package/dist/src/core/bootstrap/providers/provider-order.js.map +1 -0
- package/dist/src/core/cache/ViewCache.d.ts +46 -0
- package/dist/src/core/cache/ViewCache.d.ts.map +1 -0
- package/dist/src/core/cache/ViewCache.js +85 -0
- package/dist/src/core/cache/ViewCache.js.map +1 -0
- package/dist/src/core/cache/index.d.ts +2 -0
- package/dist/src/core/cache/index.d.ts.map +1 -0
- package/dist/src/core/cache/index.js +2 -0
- package/dist/src/core/cache/index.js.map +1 -0
- package/dist/src/core/contracts/ApiInterface.d.ts +11 -0
- package/dist/src/core/contracts/ApiInterface.d.ts.map +1 -0
- package/dist/src/core/contracts/ApiInterface.js +2 -0
- package/dist/src/core/contracts/ApiInterface.js.map +1 -0
- package/dist/src/core/contracts/ApplicationInterface.d.ts +66 -0
- package/dist/src/core/contracts/ApplicationInterface.d.ts.map +1 -0
- package/dist/src/core/contracts/ApplicationInterface.js +3 -0
- package/dist/src/core/contracts/ApplicationInterface.js.map +1 -0
- package/dist/src/core/contracts/BlockInterface.d.ts +67 -0
- package/dist/src/core/contracts/BlockInterface.d.ts.map +1 -0
- package/dist/src/core/contracts/BlockInterface.js +2 -0
- package/dist/src/core/contracts/BlockInterface.js.map +1 -0
- package/dist/src/core/contracts/ComponentInterface.d.ts +24 -0
- package/dist/src/core/contracts/ComponentInterface.d.ts.map +1 -0
- package/dist/src/core/contracts/ComponentInterface.js +2 -0
- package/dist/src/core/contracts/ComponentInterface.js.map +1 -0
- package/dist/src/core/contracts/ElementInterface.d.ts +117 -0
- package/dist/src/core/contracts/ElementInterface.d.ts.map +1 -0
- package/dist/src/core/contracts/ElementInterface.js +2 -0
- package/dist/src/core/contracts/ElementInterface.js.map +1 -0
- package/dist/src/core/contracts/EventServiceInterface.d.ts +37 -0
- package/dist/src/core/contracts/EventServiceInterface.d.ts.map +1 -0
- package/dist/src/core/contracts/EventServiceInterface.js +3 -0
- package/dist/src/core/contracts/EventServiceInterface.js.map +1 -0
- package/dist/src/core/contracts/HelperInterface.d.ts +231 -0
- package/dist/src/core/contracts/HelperInterface.d.ts.map +1 -0
- package/dist/src/core/contracts/HelperInterface.js +3 -0
- package/dist/src/core/contracts/HelperInterface.js.map +1 -0
- package/dist/src/core/contracts/HttpServiceInterface.d.ts +38 -0
- package/dist/src/core/contracts/HttpServiceInterface.d.ts.map +1 -0
- package/dist/src/core/contracts/HttpServiceInterface.js +3 -0
- package/dist/src/core/contracts/HttpServiceInterface.js.map +1 -0
- package/dist/src/core/contracts/LoggerServiceInterface.d.ts +37 -0
- package/dist/src/core/contracts/LoggerServiceInterface.d.ts.map +1 -0
- package/dist/src/core/contracts/LoggerServiceInterface.js +3 -0
- package/dist/src/core/contracts/LoggerServiceInterface.js.map +1 -0
- package/dist/src/core/contracts/LoopContextInterface.d.ts +14 -0
- package/dist/src/core/contracts/LoopContextInterface.d.ts.map +1 -0
- package/dist/src/core/contracts/LoopContextInterface.js +3 -0
- package/dist/src/core/contracts/LoopContextInterface.js.map +1 -0
- package/dist/src/core/contracts/MarkerInterface.d.ts +55 -0
- package/dist/src/core/contracts/MarkerInterface.d.ts.map +1 -0
- package/dist/src/core/contracts/MarkerInterface.js +2 -0
- package/dist/src/core/contracts/MarkerInterface.js.map +1 -0
- package/dist/src/core/contracts/ReactiveInterface.d.ts +38 -0
- package/dist/src/core/contracts/ReactiveInterface.d.ts.map +1 -0
- package/dist/src/core/contracts/ReactiveInterface.js +2 -0
- package/dist/src/core/contracts/ReactiveInterface.js.map +1 -0
- package/dist/src/core/contracts/RouterInterface.d.ts +58 -0
- package/dist/src/core/contracts/RouterInterface.d.ts.map +1 -0
- package/dist/src/core/contracts/RouterInterface.js +2 -0
- package/dist/src/core/contracts/RouterInterface.js.map +1 -0
- package/dist/src/core/contracts/ServiceProviderInterface.d.ts +12 -0
- package/dist/src/core/contracts/ServiceProviderInterface.d.ts.map +1 -0
- package/dist/src/core/contracts/ServiceProviderInterface.js +2 -0
- package/dist/src/core/contracts/ServiceProviderInterface.js.map +1 -0
- package/dist/src/core/contracts/StorageServiceInterface.d.ts +43 -0
- package/dist/src/core/contracts/StorageServiceInterface.d.ts.map +1 -0
- package/dist/src/core/contracts/StorageServiceInterface.js +3 -0
- package/dist/src/core/contracts/StorageServiceInterface.js.map +1 -0
- package/dist/src/core/contracts/StoreServiceInterface.d.ts +45 -0
- package/dist/src/core/contracts/StoreServiceInterface.d.ts.map +1 -0
- package/dist/src/core/contracts/StoreServiceInterface.js +3 -0
- package/dist/src/core/contracts/StoreServiceInterface.js.map +1 -0
- package/dist/src/core/contracts/ViewCacheInterface.d.ts +13 -0
- package/dist/src/core/contracts/ViewCacheInterface.d.ts.map +1 -0
- package/dist/src/core/contracts/ViewCacheInterface.js +3 -0
- package/dist/src/core/contracts/ViewCacheInterface.js.map +1 -0
- package/dist/src/core/contracts/ViewControllerInterface.d.ts +115 -0
- package/dist/src/core/contracts/ViewControllerInterface.d.ts.map +1 -0
- package/dist/src/core/contracts/ViewControllerInterface.js +2 -0
- package/dist/src/core/contracts/ViewControllerInterface.js.map +1 -0
- package/dist/src/core/contracts/ViewInterface.d.ts +24 -0
- package/dist/src/core/contracts/ViewInterface.d.ts.map +1 -0
- package/dist/src/core/contracts/ViewInterface.js +2 -0
- package/dist/src/core/contracts/ViewInterface.js.map +1 -0
- package/dist/src/core/contracts/ViewManagerInterface.d.ts +44 -0
- package/dist/src/core/contracts/ViewManagerInterface.d.ts.map +1 -0
- package/dist/src/core/contracts/ViewManagerInterface.js +2 -0
- package/dist/src/core/contracts/ViewManagerInterface.js.map +1 -0
- package/dist/src/core/contracts/ViewStateInterface.d.ts +40 -0
- package/dist/src/core/contracts/ViewStateInterface.d.ts.map +1 -0
- package/dist/src/core/contracts/ViewStateInterface.js +3 -0
- package/dist/src/core/contracts/ViewStateInterface.js.map +1 -0
- package/dist/src/core/contracts/common.d.ts +28 -0
- package/dist/src/core/contracts/common.d.ts.map +1 -0
- package/dist/src/core/contracts/common.js +29 -0
- package/dist/src/core/contracts/common.js.map +1 -0
- package/dist/src/core/contracts/utils.d.ts +20 -0
- package/dist/src/core/contracts/utils.d.ts.map +1 -0
- package/dist/src/core/contracts/utils.js +4 -0
- package/dist/src/core/contracts/utils.js.map +1 -0
- package/dist/src/core/contracts/views.d.ts +23 -0
- package/dist/src/core/contracts/views.d.ts.map +1 -0
- package/dist/src/core/contracts/views.js +2 -0
- package/dist/src/core/contracts/views.js.map +1 -0
- package/dist/src/core/elements/Block.d.ts +58 -0
- package/dist/src/core/elements/Block.d.ts.map +1 -0
- package/dist/src/core/elements/Block.js +77 -0
- package/dist/src/core/elements/Block.js.map +1 -0
- package/dist/src/core/elements/BlockOutlet.d.ts +34 -0
- package/dist/src/core/elements/BlockOutlet.d.ts.map +1 -0
- package/dist/src/core/elements/BlockOutlet.js +59 -0
- package/dist/src/core/elements/BlockOutlet.js.map +1 -0
- package/dist/src/core/elements/Component.d.ts +62 -0
- package/dist/src/core/elements/Component.d.ts.map +1 -0
- package/dist/src/core/elements/Component.js +72 -0
- package/dist/src/core/elements/Component.js.map +1 -0
- package/dist/src/core/elements/ElementManager.d.ts +23 -0
- package/dist/src/core/elements/ElementManager.d.ts.map +1 -0
- package/dist/src/core/elements/ElementManager.js +33 -0
- package/dist/src/core/elements/ElementManager.js.map +1 -0
- package/dist/src/core/elements/Fragment.d.ts +51 -0
- package/dist/src/core/elements/Fragment.d.ts.map +1 -0
- package/dist/src/core/elements/Fragment.js +133 -0
- package/dist/src/core/elements/Fragment.js.map +1 -0
- package/dist/src/core/elements/Html.d.ts +52 -0
- package/dist/src/core/elements/Html.d.ts.map +1 -0
- package/dist/src/core/elements/Html.js +299 -0
- package/dist/src/core/elements/Html.js.map +1 -0
- package/dist/src/core/elements/Output.d.ts +69 -0
- package/dist/src/core/elements/Output.d.ts.map +1 -0
- package/dist/src/core/elements/Output.js +121 -0
- package/dist/src/core/elements/Output.js.map +1 -0
- package/dist/src/core/elements/Reactive.d.ts +77 -0
- package/dist/src/core/elements/Reactive.d.ts.map +1 -0
- package/dist/src/core/elements/Reactive.js +199 -0
- package/dist/src/core/elements/Reactive.js.map +1 -0
- package/dist/src/core/elements/TextElement.d.ts +46 -0
- package/dist/src/core/elements/TextElement.d.ts.map +1 -0
- package/dist/src/core/elements/TextElement.js +94 -0
- package/dist/src/core/elements/TextElement.js.map +1 -0
- package/dist/src/core/elements/Wrapper.d.ts +50 -0
- package/dist/src/core/elements/Wrapper.d.ts.map +1 -0
- package/dist/src/core/elements/Wrapper.js +96 -0
- package/dist/src/core/elements/Wrapper.js.map +1 -0
- package/dist/src/core/elements/Yield.d.ts +34 -0
- package/dist/src/core/elements/Yield.d.ts.map +1 -0
- package/dist/src/core/elements/Yield.js +56 -0
- package/dist/src/core/elements/Yield.js.map +1 -0
- package/dist/src/core/elements/helpers.d.ts +8 -0
- package/dist/src/core/elements/helpers.d.ts.map +1 -0
- package/dist/src/core/elements/helpers.js +40 -0
- package/dist/src/core/elements/helpers.js.map +1 -0
- package/dist/src/core/elements/index.d.ts +12 -0
- package/dist/src/core/elements/index.d.ts.map +1 -0
- package/dist/src/core/elements/index.js +12 -0
- package/dist/src/core/elements/index.js.map +1 -0
- package/dist/src/core/hellpers/ApiClient.d.ts +58 -0
- package/dist/src/core/hellpers/ApiClient.d.ts.map +1 -0
- package/dist/src/core/hellpers/ApiClient.js +122 -0
- package/dist/src/core/hellpers/ApiClient.js.map +1 -0
- package/dist/src/core/hellpers/app.d.ts +3 -0
- package/dist/src/core/hellpers/app.d.ts.map +1 -0
- package/dist/src/core/hellpers/app.js +53 -0
- package/dist/src/core/hellpers/app.js.map +1 -0
- package/dist/src/core/hellpers/utils.d.ts +26 -0
- package/dist/src/core/hellpers/utils.d.ts.map +1 -0
- package/dist/src/core/hellpers/utils.js +96 -0
- package/dist/src/core/hellpers/utils.js.map +1 -0
- package/dist/src/core/routers/Router.d.ts +212 -0
- package/dist/src/core/routers/Router.d.ts.map +1 -0
- package/dist/src/core/routers/Router.js +623 -0
- package/dist/src/core/routers/Router.js.map +1 -0
- package/dist/src/core/routers/index.d.ts +3 -0
- package/dist/src/core/routers/index.d.ts.map +1 -0
- package/dist/src/core/routers/index.js +2 -0
- package/dist/src/core/routers/index.js.map +1 -0
- package/dist/src/core/services/BlockManager.d.ts +63 -0
- package/dist/src/core/services/BlockManager.d.ts.map +1 -0
- package/dist/src/core/services/BlockManager.js +191 -0
- package/dist/src/core/services/BlockManager.js.map +1 -0
- package/dist/src/core/services/DomService.d.ts +9 -0
- package/dist/src/core/services/DomService.d.ts.map +1 -0
- package/dist/src/core/services/DomService.js +18 -0
- package/dist/src/core/services/DomService.js.map +1 -0
- package/dist/src/core/services/EventService.d.ts +58 -0
- package/dist/src/core/services/EventService.d.ts.map +1 -0
- package/dist/src/core/services/EventService.js +212 -0
- package/dist/src/core/services/EventService.js.map +1 -0
- package/dist/src/core/services/HelperService.d.ts +443 -0
- package/dist/src/core/services/HelperService.d.ts.map +1 -0
- package/dist/src/core/services/HelperService.js +1650 -0
- package/dist/src/core/services/HelperService.js.map +1 -0
- package/dist/src/core/services/HttpService.d.ts +63 -0
- package/dist/src/core/services/HttpService.d.ts.map +1 -0
- package/dist/src/core/services/HttpService.js +182 -0
- package/dist/src/core/services/HttpService.js.map +1 -0
- package/dist/src/core/services/LoggerService.d.ts +56 -0
- package/dist/src/core/services/LoggerService.d.ts.map +1 -0
- package/dist/src/core/services/LoggerService.js +94 -0
- package/dist/src/core/services/LoggerService.js.map +1 -0
- package/dist/src/core/services/MarkerRegistry.d.ts +94 -0
- package/dist/src/core/services/MarkerRegistry.d.ts.map +1 -0
- package/dist/src/core/services/MarkerRegistry.js +199 -0
- package/dist/src/core/services/MarkerRegistry.js.map +1 -0
- package/dist/src/core/services/MarkerService.d.ts +299 -0
- package/dist/src/core/services/MarkerService.d.ts.map +1 -0
- package/dist/src/core/services/MarkerService.js +723 -0
- package/dist/src/core/services/MarkerService.js.map +1 -0
- package/dist/src/core/services/StorageService.d.ts +69 -0
- package/dist/src/core/services/StorageService.d.ts.map +1 -0
- package/dist/src/core/services/StorageService.js +243 -0
- package/dist/src/core/services/StorageService.js.map +1 -0
- package/dist/src/core/services/StoreService.d.ts +80 -0
- package/dist/src/core/services/StoreService.d.ts.map +1 -0
- package/dist/src/core/services/StoreService.js +301 -0
- package/dist/src/core/services/StoreService.js.map +1 -0
- package/dist/src/core/services/index.d.ts +9 -0
- package/dist/src/core/services/index.d.ts.map +1 -0
- package/dist/src/core/services/index.js +9 -0
- package/dist/src/core/services/index.js.map +1 -0
- package/dist/src/core/types/utils.d.ts +29 -0
- package/dist/src/core/types/utils.d.ts.map +1 -0
- package/dist/src/core/types/utils.js +22 -0
- package/dist/src/core/types/utils.js.map +1 -0
- package/dist/src/core/view/LoopContext.d.ts +38 -0
- package/dist/src/core/view/LoopContext.d.ts.map +1 -0
- package/dist/src/core/view/LoopContext.js +100 -0
- package/dist/src/core/view/LoopContext.js.map +1 -0
- package/dist/src/core/view/Section.d.ts +41 -0
- package/dist/src/core/view/Section.d.ts.map +1 -0
- package/dist/src/core/view/Section.js +67 -0
- package/dist/src/core/view/Section.js.map +1 -0
- package/dist/src/core/view/View.d.ts +63 -0
- package/dist/src/core/view/View.d.ts.map +1 -0
- package/dist/src/core/view/View.js +85 -0
- package/dist/src/core/view/View.js.map +1 -0
- package/dist/src/core/view/ViewController.d.ts +277 -0
- package/dist/src/core/view/ViewController.d.ts.map +1 -0
- package/dist/src/core/view/ViewController.js +862 -0
- package/dist/src/core/view/ViewController.js.map +1 -0
- package/dist/src/core/view/ViewManager.d.ts +141 -0
- package/dist/src/core/view/ViewManager.d.ts.map +1 -0
- package/dist/src/core/view/ViewManager.js +565 -0
- package/dist/src/core/view/ViewManager.js.map +1 -0
- package/dist/src/core/view/ViewState.d.ts +117 -0
- package/dist/src/core/view/ViewState.d.ts.map +1 -0
- package/dist/src/core/view/ViewState.js +410 -0
- package/dist/src/core/view/ViewState.js.map +1 -0
- package/dist/src/core/view/index.d.ts +6 -0
- package/dist/src/core/view/index.d.ts.map +1 -0
- package/dist/src/core/view/index.js +6 -0
- package/dist/src/core/view/index.js.map +1 -0
- package/index.ts +62 -0
- package/package.json +70 -0
- package/plugins.ts +77 -0
- package/src/core/app/Application.ts +410 -0
- package/src/core/bootstrap/app.ts +58 -0
- package/src/core/bootstrap/providers/ApiServiceProvider.ts +18 -0
- package/src/core/bootstrap/providers/CoreServiceProvider.ts +19 -0
- package/src/core/bootstrap/providers/HelperServiceProvider.ts +12 -0
- package/src/core/bootstrap/providers/RouteServiceProvider.ts +17 -0
- package/src/core/bootstrap/providers/ServiceProvider.ts +51 -0
- package/src/core/bootstrap/providers/ViewServiceProvider.ts +17 -0
- package/src/core/bootstrap/providers/default-providers.ts +94 -0
- package/src/core/bootstrap/providers/index.ts +9 -0
- package/src/core/bootstrap/providers/provider-order.test.ts +67 -0
- package/src/core/bootstrap/providers/provider-order.ts +66 -0
- package/src/core/cache/ViewCache.ts +102 -0
- package/src/core/cache/index.ts +1 -0
- package/src/core/contracts/ApiInterface.ts +11 -0
- package/src/core/contracts/ApplicationInterface.ts +79 -0
- package/src/core/contracts/BlockInterface.ts +76 -0
- package/src/core/contracts/ComponentInterface.ts +26 -0
- package/src/core/contracts/ElementInterface.ts +140 -0
- package/src/core/contracts/EventServiceInterface.ts +47 -0
- package/src/core/contracts/HelperInterface.ts +256 -0
- package/src/core/contracts/HttpServiceInterface.ts +51 -0
- package/src/core/contracts/LoggerServiceInterface.ts +48 -0
- package/src/core/contracts/LoopContextInterface.ts +15 -0
- package/src/core/contracts/MarkerInterface.ts +77 -0
- package/src/core/contracts/ReactiveInterface.ts +45 -0
- package/src/core/contracts/RouterInterface.ts +65 -0
- package/src/core/contracts/ServiceProviderInterface.ts +12 -0
- package/src/core/contracts/StorageServiceInterface.ts +48 -0
- package/src/core/contracts/StoreServiceInterface.ts +50 -0
- package/src/core/contracts/ViewCacheInterface.ts +14 -0
- package/src/core/contracts/ViewControllerInterface.ts +135 -0
- package/src/core/contracts/ViewInterface.ts +31 -0
- package/src/core/contracts/ViewManagerInterface.ts +45 -0
- package/src/core/contracts/ViewStateInterface.ts +47 -0
- package/src/core/contracts/common.ts +27 -0
- package/src/core/contracts/utils.ts +23 -0
- package/src/core/contracts/views.ts +23 -0
- package/src/core/elements/Block.ts +113 -0
- package/src/core/elements/BlockOutlet.ts +83 -0
- package/src/core/elements/Component.ts +114 -0
- package/src/core/elements/ElementManager.ts +48 -0
- package/src/core/elements/Fragment.ts +168 -0
- package/src/core/elements/Html.ts +364 -0
- package/src/core/elements/Output.ts +167 -0
- package/src/core/elements/Reactive.ts +253 -0
- package/src/core/elements/TextElement.ts +110 -0
- package/src/core/elements/Wrapper.ts +131 -0
- package/src/core/elements/Yield.ts +70 -0
- package/src/core/elements/helpers.ts +56 -0
- package/src/core/elements/index.ts +26 -0
- package/src/core/hellpers/ApiClient.ts +145 -0
- package/src/core/hellpers/app.ts +57 -0
- package/src/core/hellpers/utils.ts +109 -0
- package/src/core/routers/Router.ts +765 -0
- package/src/core/routers/index.ts +2 -0
- package/src/core/services/BlockManager.ts +210 -0
- package/src/core/services/DomService.ts +26 -0
- package/src/core/services/EventService.ts +266 -0
- package/src/core/services/HelperService.ts +1653 -0
- package/src/core/services/HttpService.ts +235 -0
- package/src/core/services/LoggerService.ts +139 -0
- package/src/core/services/MarkerRegistry.ts +239 -0
- package/src/core/services/MarkerService.ts +923 -0
- package/src/core/services/StorageService.ts +268 -0
- package/src/core/services/StoreService.ts +338 -0
- package/src/core/services/index.ts +8 -0
- package/src/core/types/utils.ts +30 -0
- package/src/core/view/LoopContext.ts +109 -0
- package/src/core/view/Section.ts +86 -0
- package/src/core/view/View.ts +109 -0
- package/src/core/view/ViewController.ts +1002 -0
- package/src/core/view/ViewManager.ts +700 -0
- package/src/core/view/ViewState.ts +453 -0
- package/src/core/view/index.ts +5 -0
|
@@ -0,0 +1,453 @@
|
|
|
1
|
+
import type { ViewControllerInterface } from "../contracts/ViewControllerInterface";
|
|
2
|
+
import type { StateManagerInterface, ViewStateInterface, StateItem, StateListener, MultiKeyStateListener } from "../contracts/ViewStateInterface";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* StateManager — manages reactive state for a ViewController.
|
|
6
|
+
*
|
|
7
|
+
* Core reactive primitive — when a state value changes:
|
|
8
|
+
* 1. Batch the change (add to pendingChanges)
|
|
9
|
+
* 2. Schedule a flush via requestAnimationFrame
|
|
10
|
+
* 3. On flush: notify all subscribed listeners
|
|
11
|
+
* 4. Listeners can trigger Reactive.update() → DOM re-render
|
|
12
|
+
*
|
|
13
|
+
* This replaces the old string-based re-render:
|
|
14
|
+
* OLD: state changes → re-render entire template string → diff/scan DOM
|
|
15
|
+
* NEW: state changes → notify only affected Reactive regions → targeted DOM update
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* const [count, setCount] = viewState.__.useState(0, 'count');
|
|
19
|
+
* viewState.__.subscribe('count', (val) => myReactive.update());
|
|
20
|
+
* setCount(1); // → triggers listener → Reactive re-renders its region only
|
|
21
|
+
*/
|
|
22
|
+
export class StateManager implements StateManagerInterface {
|
|
23
|
+
private states: Record<string | number, StateItem> = {};
|
|
24
|
+
private listeners = new Map<string | number, StateListener[]>();
|
|
25
|
+
private multiKeyListeners: MultiKeyStateListener[] = [];
|
|
26
|
+
private pendingChanges = new Set<string | number>();
|
|
27
|
+
private stateIndex = 0;
|
|
28
|
+
private flushRAF: number | null = null;
|
|
29
|
+
private hasPendingFlush = false;
|
|
30
|
+
private isFlushing = false;
|
|
31
|
+
private _isDestroyed = false;
|
|
32
|
+
|
|
33
|
+
/** Flag — cho phép update state qua update$xxx chỉ trước lock */
|
|
34
|
+
private _canUpdateStateByKey: boolean = true;
|
|
35
|
+
|
|
36
|
+
/** Setter functions exposed for direct property assignment on ViewState */
|
|
37
|
+
setters: Record<string | number, (value: any) => void> = {};
|
|
38
|
+
|
|
39
|
+
/** Reference to owning ViewController */
|
|
40
|
+
controller: ViewControllerInterface | null = null;
|
|
41
|
+
|
|
42
|
+
/** Reference to owning ViewState wrapper */
|
|
43
|
+
private stateInstance: ViewState;
|
|
44
|
+
|
|
45
|
+
/** Properties that should NOT become state keys */
|
|
46
|
+
private ownProperties: string[] = ['__', 'on', 'off', 'unsubscribe'];
|
|
47
|
+
|
|
48
|
+
constructor(stateInstance: ViewState, controller?: ViewControllerInterface | null) {
|
|
49
|
+
this.stateInstance = stateInstance;
|
|
50
|
+
this.controller = controller ?? null;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// ─── canUpdateStateByKey ─────────────────────────────────────
|
|
54
|
+
|
|
55
|
+
/** Public getter — compiled output checks this before updateStateByKey */
|
|
56
|
+
get canUpdateStateByKey(): boolean {
|
|
57
|
+
return this._canUpdateStateByKey;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Lock — ngăn update$xxx() hoạt động sau initialization.
|
|
62
|
+
* Gọi cuối commitConstructorData().
|
|
63
|
+
*/
|
|
64
|
+
lockUpdateRealState(): void {
|
|
65
|
+
this._canUpdateStateByKey = false;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Unlock — cho phép updateVariableData gọi update$xxx lại.
|
|
70
|
+
* Gọi trước updateVariableData(), lock lại khi xong.
|
|
71
|
+
*/
|
|
72
|
+
unlockUpdateRealState(): void {
|
|
73
|
+
this._canUpdateStateByKey = true;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Bulk state update — set nhiều state keys QUIETLY (không trigger listeners).
|
|
78
|
+
* Dùng trong initialization — set initial values trước khi lock.
|
|
79
|
+
*/
|
|
80
|
+
updateRealState(stateMap: Record<string | number, any>): void {
|
|
81
|
+
if (!this._canUpdateStateByKey) return;
|
|
82
|
+
for (const key in stateMap) {
|
|
83
|
+
if (stateMap.hasOwnProperty(key) && this.states[key]) {
|
|
84
|
+
this.states[key].value = stateMap[key];
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// ─── useState ───────────────────────────────────────────────
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Create a reactive state — similar to React's useState.
|
|
93
|
+
*
|
|
94
|
+
* @returns [currentValue, setValue, stateKey]
|
|
95
|
+
*
|
|
96
|
+
* Also defines a getter/setter on the ViewState instance so that
|
|
97
|
+
* `viewState.count` reads/writes the state reactively.
|
|
98
|
+
*/
|
|
99
|
+
useState(value: any, key?: string | number): [any, (newValue: any) => void, string | number] {
|
|
100
|
+
// If key already exists, return existing state
|
|
101
|
+
if (key !== undefined && key !== null && this.states[key]) {
|
|
102
|
+
return [this.states[key].value, this.states[key].setValue, key];
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
const stateKey = String(key ?? this.stateIndex++);
|
|
106
|
+
|
|
107
|
+
const setValue = (newValue: any) => {
|
|
108
|
+
const oldValue = this.states[stateKey].value;
|
|
109
|
+
this.states[stateKey].value = newValue;
|
|
110
|
+
this.commitStateChange(stateKey, oldValue);
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
this.states[stateKey] = { value, setValue, key: stateKey };
|
|
114
|
+
this.setters[stateKey] = setValue;
|
|
115
|
+
|
|
116
|
+
// Define reactive property on ViewState if not a reserved name
|
|
117
|
+
if (!this.ownProperties.includes(stateKey)) {
|
|
118
|
+
const self = this;
|
|
119
|
+
Object.defineProperty(this.stateInstance, stateKey, {
|
|
120
|
+
get: () => self.states[stateKey].value,
|
|
121
|
+
set: (val) => {
|
|
122
|
+
if (typeof self.setters[stateKey] === 'function') {
|
|
123
|
+
self.setters[stateKey](val);
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
configurable: false,
|
|
127
|
+
enumerable: true,
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
return [value, setValue, stateKey];
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
// ─── State Access ───────────────────────────────────────────
|
|
135
|
+
|
|
136
|
+
/** Register shorthand — just returns the setter */
|
|
137
|
+
register(key: string | number, value: any): (newValue: any) => void {
|
|
138
|
+
return this.useState(value, key)[1];
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/** Update state by key */
|
|
142
|
+
updateStateByKey(key: string | number, value: any): any {
|
|
143
|
+
if (!this.states[key]) return undefined;
|
|
144
|
+
const oldValue = this.states[key].value;
|
|
145
|
+
this.states[key].value = value;
|
|
146
|
+
this.commitStateChange(key, oldValue);
|
|
147
|
+
return value;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Get state value by key — supports nested paths: 'user.name', 'items.0.id'
|
|
152
|
+
*/
|
|
153
|
+
getStateByKey(key: string | number): any {
|
|
154
|
+
const keyStr = String(key);
|
|
155
|
+
|
|
156
|
+
if (!keyStr.includes('.')) {
|
|
157
|
+
return this.states[keyStr]?.value ?? null;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
const paths = keyStr.split('.');
|
|
161
|
+
const rootKey = paths[0];
|
|
162
|
+
if (!this.states[rootKey]) return null;
|
|
163
|
+
|
|
164
|
+
let current = this.states[rootKey].value;
|
|
165
|
+
for (let i = 1; i < paths.length; i++) {
|
|
166
|
+
if (typeof current !== 'object' || current === null) return null;
|
|
167
|
+
current = current[paths[i]];
|
|
168
|
+
if (current === undefined) return null;
|
|
169
|
+
}
|
|
170
|
+
return current;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* Update nested state by dot-path key: 'user.name' → clones root, sets nested, triggers change
|
|
175
|
+
*/
|
|
176
|
+
updateStateAddressKey(key: string | number, value: any): void {
|
|
177
|
+
const keyStr = String(key);
|
|
178
|
+
const keyPaths = keyStr.split('.');
|
|
179
|
+
const rootKey = keyPaths.shift();
|
|
180
|
+
if (!rootKey || !this.states[rootKey]) return;
|
|
181
|
+
|
|
182
|
+
const stateValue = this.states[rootKey].value;
|
|
183
|
+
if (keyPaths.length === 0 || typeof stateValue !== 'object' || stateValue === null) {
|
|
184
|
+
return this.setters[rootKey]?.(value);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
// Clone to create a new reference for reactivity detection
|
|
188
|
+
let clonedValue = Array.isArray(stateValue) ? [...stateValue] : { ...stateValue };
|
|
189
|
+
let current: any = clonedValue;
|
|
190
|
+
|
|
191
|
+
for (let i = 0; i < keyPaths.length - 1; i++) {
|
|
192
|
+
const path = keyPaths[i];
|
|
193
|
+
if (typeof current[path] !== 'object' || current[path] === null) {
|
|
194
|
+
current[path] = {};
|
|
195
|
+
} else {
|
|
196
|
+
current[path] = Array.isArray(current[path]) ? [...current[path]] : { ...current[path] };
|
|
197
|
+
}
|
|
198
|
+
current = current[path];
|
|
199
|
+
}
|
|
200
|
+
current[keyPaths[keyPaths.length - 1]] = value;
|
|
201
|
+
this.setters[rootKey]?.(clonedValue);
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
// ─── Subscribe / Unsubscribe ────────────────────────────────
|
|
205
|
+
|
|
206
|
+
subscribe(
|
|
207
|
+
key: string | number | string[] | Record<string, StateListener>,
|
|
208
|
+
callback?: StateListener
|
|
209
|
+
): () => void {
|
|
210
|
+
// Array of keys
|
|
211
|
+
if (Array.isArray(key)) {
|
|
212
|
+
if (key.length === 0) return () => {};
|
|
213
|
+
if (key.length === 1 && callback) return this.subscribe(key[0], callback);
|
|
214
|
+
if (typeof callback !== 'function') return () => {};
|
|
215
|
+
|
|
216
|
+
const keys = new Set<string | number>();
|
|
217
|
+
for (const k of key) {
|
|
218
|
+
if (this.states[k]) keys.add(k);
|
|
219
|
+
}
|
|
220
|
+
if (keys.size === 0) return () => {};
|
|
221
|
+
|
|
222
|
+
const listener: MultiKeyStateListener = { keys, callback, called: false };
|
|
223
|
+
this.multiKeyListeners.push(listener);
|
|
224
|
+
|
|
225
|
+
return () => {
|
|
226
|
+
const idx = this.multiKeyListeners.indexOf(listener);
|
|
227
|
+
if (idx !== -1) this.multiKeyListeners.splice(idx, 1);
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
// Object map of keys → callbacks
|
|
232
|
+
if (typeof key === 'object' && key !== null) {
|
|
233
|
+
const unsubs: Record<string, () => void> = {};
|
|
234
|
+
for (const k in key) {
|
|
235
|
+
unsubs[k] = this.subscribe(k, key[k]);
|
|
236
|
+
}
|
|
237
|
+
return () => { for (const k in unsubs) unsubs[k](); };
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
// Single key
|
|
241
|
+
if (typeof callback !== 'function') return () => {};
|
|
242
|
+
if (!this.listeners.has(key)) this.listeners.set(key, []);
|
|
243
|
+
this.listeners.get(key)!.push(callback);
|
|
244
|
+
const index = this.listeners.get(key)!.length - 1;
|
|
245
|
+
|
|
246
|
+
return () => {
|
|
247
|
+
const listeners = this.listeners.get(key);
|
|
248
|
+
if (listeners) {
|
|
249
|
+
listeners.splice(index, 1);
|
|
250
|
+
if (listeners.length === 0) this.listeners.delete(key);
|
|
251
|
+
}
|
|
252
|
+
};
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
unsubscribe(
|
|
256
|
+
key: string | number | string[] | Record<string, StateListener>,
|
|
257
|
+
callback?: StateListener
|
|
258
|
+
): void {
|
|
259
|
+
if (Array.isArray(key)) {
|
|
260
|
+
if (key.length === 0) return;
|
|
261
|
+
if (key.length === 1) { this.unsubscribe(key[0], callback); return; }
|
|
262
|
+
|
|
263
|
+
const keySet = new Set(key);
|
|
264
|
+
if (!callback) {
|
|
265
|
+
for (let i = this.multiKeyListeners.length - 1; i >= 0; i--) {
|
|
266
|
+
if (this.setsEqual(this.multiKeyListeners[i].keys, keySet)) {
|
|
267
|
+
this.multiKeyListeners.splice(i, 1);
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
return;
|
|
271
|
+
}
|
|
272
|
+
const idx = this.multiKeyListeners.findIndex(l =>
|
|
273
|
+
l.callback === callback && this.setsEqual(l.keys, keySet)
|
|
274
|
+
);
|
|
275
|
+
if (idx !== -1) this.multiKeyListeners.splice(idx, 1);
|
|
276
|
+
return;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
if (typeof key === 'object' && key !== null) {
|
|
280
|
+
for (const k in key) this.unsubscribe(k, key[k]);
|
|
281
|
+
return;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
if (callback) {
|
|
285
|
+
const listeners = this.listeners.get(key);
|
|
286
|
+
if (listeners) {
|
|
287
|
+
const idx = listeners.indexOf(callback);
|
|
288
|
+
if (idx !== -1) {
|
|
289
|
+
listeners.splice(idx, 1);
|
|
290
|
+
if (listeners.length === 0) this.listeners.delete(key);
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
} else {
|
|
294
|
+
this.listeners.delete(key);
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
// ─── Batch Flush System ─────────────────────────────────────
|
|
299
|
+
|
|
300
|
+
private commitStateChange(key: string | number, _oldValue: any): void {
|
|
301
|
+
if (this._isDestroyed) return;
|
|
302
|
+
const newValue = this.states[key]?.value;
|
|
303
|
+
if (_oldValue === newValue) return;
|
|
304
|
+
|
|
305
|
+
this.pendingChanges.add(key);
|
|
306
|
+
|
|
307
|
+
if (!this.hasPendingFlush) {
|
|
308
|
+
this.hasPendingFlush = true;
|
|
309
|
+
this.flushRAF = requestAnimationFrame(() => this.executeFlush());
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
private executeFlush(): void {
|
|
314
|
+
if (this._isDestroyed || this.isFlushing) return;
|
|
315
|
+
try {
|
|
316
|
+
this.isFlushing = true;
|
|
317
|
+
this.flushChanges();
|
|
318
|
+
} finally {
|
|
319
|
+
this.isFlushing = false;
|
|
320
|
+
this.hasPendingFlush = false;
|
|
321
|
+
this.flushRAF = null;
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
private flushChanges(): void {
|
|
326
|
+
if (this.pendingChanges.size === 0) return;
|
|
327
|
+
|
|
328
|
+
const changed = Array.from(this.pendingChanges);
|
|
329
|
+
this.pendingChanges.clear();
|
|
330
|
+
|
|
331
|
+
// Reset multi-key listener flags
|
|
332
|
+
for (const listener of this.multiKeyListeners) {
|
|
333
|
+
listener.called = false;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
// Notify single-key listeners
|
|
337
|
+
for (const changedKey of changed) {
|
|
338
|
+
const listeners = this.listeners.get(changedKey);
|
|
339
|
+
if (listeners) {
|
|
340
|
+
const currentValue = this.states[changedKey]?.value;
|
|
341
|
+
for (const listener of listeners) {
|
|
342
|
+
try { listener(currentValue); }
|
|
343
|
+
catch (e) { console.error('[ViewState] Listener error:', e); }
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
// Notify multi-key listeners
|
|
348
|
+
for (const mkl of this.multiKeyListeners) {
|
|
349
|
+
if (!mkl.called && mkl.keys.has(changedKey)) {
|
|
350
|
+
mkl.called = true;
|
|
351
|
+
const values: Record<string, any> = {};
|
|
352
|
+
for (const k of mkl.keys) {
|
|
353
|
+
if (changed.includes(k as any)) {
|
|
354
|
+
values[String(k)] = this.states[k]?.value;
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
try { mkl.callback(values); }
|
|
358
|
+
catch (e) { console.error('[ViewState] Multi-key listener error:', e); }
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
// ─── Cleanup ────────────────────────────────────────────────
|
|
365
|
+
|
|
366
|
+
destroy(): void {
|
|
367
|
+
this._isDestroyed = true;
|
|
368
|
+
if (this.flushRAF !== null) {
|
|
369
|
+
cancelAnimationFrame(this.flushRAF);
|
|
370
|
+
this.flushRAF = null;
|
|
371
|
+
}
|
|
372
|
+
this.listeners.clear();
|
|
373
|
+
this.multiKeyListeners = [];
|
|
374
|
+
this.pendingChanges.clear();
|
|
375
|
+
this.states = {};
|
|
376
|
+
this.setters = {};
|
|
377
|
+
this.controller = null;
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
// ─── Helpers ────────────────────────────────────────────────
|
|
381
|
+
|
|
382
|
+
private setsEqual(a: Set<any>, b: Set<any>): boolean {
|
|
383
|
+
if (a.size !== b.size) return false;
|
|
384
|
+
for (const item of a) if (!b.has(item)) return false;
|
|
385
|
+
return true;
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
/** Debug: get all state data as plain object */
|
|
389
|
+
toJSON(): Record<string | number, any> {
|
|
390
|
+
const data: Record<string | number, any> = {};
|
|
391
|
+
for (const key in this.states) data[key] = this.states[key].value;
|
|
392
|
+
return data;
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
/**
|
|
397
|
+
* ViewState — thin wrapper around StateManager.
|
|
398
|
+
*
|
|
399
|
+
* Provides a clean API surface for view code:
|
|
400
|
+
* - viewState.count → getter reads state value
|
|
401
|
+
* - viewState.count = 5 → setter triggers reactive update
|
|
402
|
+
* - viewState.__ → access StateManager directly
|
|
403
|
+
* - viewState.on('count', cb) → subscribe shorthand
|
|
404
|
+
*
|
|
405
|
+
* The StateManager is stored as a non-enumerable `__` property
|
|
406
|
+
* to keep it hidden from serialization/iteration.
|
|
407
|
+
*/
|
|
408
|
+
export class ViewState implements ViewStateInterface {
|
|
409
|
+
__!: StateManager;
|
|
410
|
+
[key: string]: any;
|
|
411
|
+
|
|
412
|
+
constructor(controller?: ViewControllerInterface | null) {
|
|
413
|
+
const manager = new StateManager(this, controller);
|
|
414
|
+
Object.defineProperty(this, '__', {
|
|
415
|
+
value: manager,
|
|
416
|
+
writable: false,
|
|
417
|
+
configurable: false,
|
|
418
|
+
enumerable: false,
|
|
419
|
+
});
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
on(
|
|
423
|
+
key: string | number | string[] | Record<string, (value: any) => void>,
|
|
424
|
+
callback?: (value: any) => void
|
|
425
|
+
): () => void {
|
|
426
|
+
return this.__.subscribe(key, callback);
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
off(
|
|
430
|
+
key: string | number | string[] | Record<string, (value: any) => void>,
|
|
431
|
+
callback?: (value: any) => void
|
|
432
|
+
): void {
|
|
433
|
+
this.__.unsubscribe(key, callback);
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
unsubscribe(
|
|
437
|
+
key: string | number | string[] | Record<string, (value: any) => void>,
|
|
438
|
+
callback?: (value: any) => void
|
|
439
|
+
): void {
|
|
440
|
+
this.__.unsubscribe(key, callback);
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
/**
|
|
444
|
+
* __useState — wrapper API cho compiled output.
|
|
445
|
+
* Tương tự React useState, return [value, setter].
|
|
446
|
+
*
|
|
447
|
+
* Compiled output: const useState = (value) => __STATE__.__useState(value);
|
|
448
|
+
*/
|
|
449
|
+
__useState(value: any, key?: string | number): [any, (newValue: any) => void] {
|
|
450
|
+
const [val, setter] = this.__.useState(value, key);
|
|
451
|
+
return [val, setter];
|
|
452
|
+
}
|
|
453
|
+
}
|