vivth 1.4.10 → 1.5.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 +6060 -2037
- package/README.src.md +22 -14
- package/bun.lock +154 -194
- package/dev/auto/.src.ignore +25 -0
- package/dev/auto-doc.mjs +137 -0
- package/generated/types/generated/vivth/exports/all.d.mts +145 -0
- package/generated/types/generated/vivth/exports/neutral.d.mts +105 -0
- package/generated/types/generated/vivth/exports/node.d.mts +40 -0
- package/generated/types/src/bundler/CompileAS.d.mts +30 -0
- package/generated/types/src/bundler/CompileJS.d.mts +109 -0
- package/{types → generated/types}/src/bundler/CreateESPlugin.d.mts +1 -1
- package/{types → generated/types}/src/bundler/EsBundler.d.mts +9 -7
- package/generated/types/src/bundler/FSAnalyzer.d.mts +58 -0
- package/generated/types/src/bundler/FSasar.bundled.d.mts +28 -0
- package/generated/types/src/bundler/FSasar.d.mts +51 -0
- package/generated/types/src/bundler/FileSelfMapper.d.mts +137 -0
- package/generated/types/src/bundler/JSDirMapper.d.mts +128 -0
- package/generated/types/src/bundler/RunWatchThenCompileJSOnSafeExit.d.mts +63 -0
- package/generated/types/src/bundler/adds/BrowserExternals.d.mts +21 -0
- package/generated/types/src/bundler/adds/CreateTransform.d.mts +26 -0
- package/generated/types/src/bundler/adds/LastEditedUnix.d.mts +5 -0
- package/generated/types/src/bundler/adds/NodeModuleList.d.mts +15 -0
- package/generated/types/src/bundler/adds/PathFSBundles.bundled.d.mts +25 -0
- package/generated/types/src/bundler/adds/PathFSBundles.d.mts +48 -0
- package/generated/types/src/bundler/adds/PathFSDir.bundled.d.mts +30 -0
- package/generated/types/src/bundler/adds/PathFSDir.d.mts +48 -0
- package/generated/types/src/bundler/adds/PathFSFile.bundled.d.mts +25 -0
- package/generated/types/src/bundler/adds/PathFSFile.d.mts +40 -0
- package/{types → generated/types}/src/bundler/adds/ToBundledJSPlugin.d.mts +6 -6
- package/generated/types/src/bundler/adds/autoExternalize.d.mts +2 -0
- package/generated/types/src/bundler/adds/emptyBufferValue.d.mts +1 -0
- package/generated/types/src/bundler/adds/isModuleTheBundledVersion.d.mts +1 -0
- package/generated/types/src/bundler/adds/onEndEsBuildErrorLogger.d.mts +1 -0
- package/generated/types/src/bundler/adds/resolveJSDependencyPath.d.mts +1 -0
- package/generated/types/src/class/AwaitSignal.d.mts +48 -0
- package/generated/types/src/class/Console.d.mts +82 -0
- package/generated/types/src/class/DataLog.d.mts +25 -0
- package/generated/types/src/class/Derived.d.mts +74 -0
- package/generated/types/src/class/Effect.d.mts +213 -0
- package/{types → generated/types}/src/class/EnvSignal.d.mts +6 -2
- package/generated/types/src/class/EsWatcher.d.mts +36 -0
- package/{types → generated/types}/src/class/EventSignal.d.mts +39 -39
- package/generated/types/src/class/FSDirArchWatcher.d.mts +110 -0
- package/{types → generated/types}/src/class/FileSafe.d.mts +32 -16
- package/generated/types/src/class/ForEach.d.mts +57 -0
- package/generated/types/src/class/ForSignal.d.mts +63 -0
- package/generated/types/src/class/GetterSetter.d.mts +38 -0
- package/generated/types/src/class/JSONFileHandler.d.mts +50 -0
- package/{types → generated/types}/src/class/ListSignal.d.mts +49 -15
- package/{types → generated/types}/src/class/LitExp.d.mts +18 -18
- package/generated/types/src/class/ObjectSignal.d.mts +267 -0
- package/generated/types/src/class/Paths.d.mts +95 -0
- package/generated/types/src/class/Prettivy.d.mts +26 -0
- package/{types → generated/types}/src/class/QChannel.d.mts +24 -16
- package/generated/types/src/class/SafeExit.d.mts +69 -0
- package/{types → generated/types}/src/class/Setup.d.mts +29 -16
- package/{types → generated/types}/src/class/Signal.d.mts +29 -15
- package/generated/types/src/class/SignalCollection.d.mts +96 -0
- package/{types → generated/types}/src/class/WalkThrough.d.mts +4 -19
- package/generated/types/src/class/WorkerMainThread.bundled.d.mts +83 -0
- package/{types → generated/types}/src/class/WorkerMainThread.d.mts +33 -39
- package/{types → generated/types}/src/class/WorkerThread.d.mts +11 -5
- package/{types → generated/types}/src/common/Base64URL.d.mts +2 -1
- package/generated/types/src/common/Base64URLFromFile.d.mts +20 -0
- package/generated/types/src/common/BundledV.bundled.d.mts +3 -0
- package/generated/types/src/common/BundledV.d.mts +36 -0
- package/{types → generated/types}/src/common/CreateStringID.d.mts +5 -4
- package/generated/types/src/common/EnvMode.d.mts +79 -0
- package/generated/types/src/common/FactoryKey.d.mts +9 -0
- package/generated/types/src/common/Preferrence.d.mts +25 -0
- package/{types → generated/types}/src/common/Trace.d.mts +1 -1
- package/{types → generated/types}/src/common/TracePath.d.mts +1 -1
- package/generated/types/src/common/VivthUnBundledCodeBlock.d.mts +6 -0
- package/generated/types/src/doc/JSautoDOC.d.mts +172 -0
- package/generated/types/src/doc/cleanPreserveTypedef.d.mts +1 -0
- package/{types/src/doc/parsedFile.d.mts → generated/types/src/doc/parsedFileForDOC.d.mts} +56 -27
- package/generated/types/src/function/ClearRequireCache.d.mts +1 -0
- package/{types → generated/types}/src/function/CreateImmutable.d.mts +5 -4
- package/{types → generated/types}/src/function/EventCheck.d.mts +3 -1
- package/{types → generated/types}/src/function/EventObject.d.mts +2 -6
- package/generated/types/src/function/ForInAsync.d.mts +36 -0
- package/generated/types/src/function/ForInSync.d.mts +36 -0
- package/generated/types/src/function/ForOfAsync.d.mts +25 -0
- package/generated/types/src/function/ForOfSync.d.mts +36 -0
- package/generated/types/src/function/GetBufferFromRelativePath.d.mts +15 -0
- package/generated/types/src/function/GetFilesFromDir.d.mts +14 -0
- package/generated/types/src/function/GetMaxFilenameLength.d.mts +9 -0
- package/generated/types/src/function/GetModuleEsbuildPlatform.d.mts +13 -0
- package/{types → generated/types}/src/function/GetNamedImportAlias.d.mts +1 -1
- package/generated/types/src/function/GetRuntime.d.mts +2 -0
- package/generated/types/src/function/InstantiateAssemblyScript.d.mts +15 -0
- package/{types → generated/types}/src/function/IsAsync.d.mts +1 -1
- package/generated/types/src/function/IsInstanceOf.d.mts +25 -0
- package/generated/types/src/function/IsSameFile.d.mts +16 -0
- package/generated/types/src/function/IsStringLooksLikeAPath.d.mts +16 -0
- package/generated/types/src/function/IsTypeOf.d.mts +25 -0
- package/{types → generated/types}/src/function/LazyFactory.d.mts +9 -10
- package/generated/types/src/function/MonkeyPatch.d.mts +33 -0
- package/generated/types/src/function/NewAnimationTimeline.d.mts +24 -0
- package/generated/types/src/function/NewChainable.d.mts +35 -0
- package/generated/types/src/function/NewDynamicsExport.d.mts +49 -0
- package/generated/types/src/function/NewObjectWrapper.d.mts +10 -0
- package/generated/types/src/function/ObjectRegistrar.d.mts +17 -0
- package/generated/types/src/function/ParseSQLFile.d.mts +25 -0
- package/generated/types/src/function/PipeAsync.d.mts +19 -0
- package/generated/types/src/function/PipeSync.d.mts +17 -0
- package/generated/types/src/function/SafeImport.d.mts +21 -0
- package/generated/types/src/function/TemplateLiteral.d.mts +23 -0
- package/{types → generated/types}/src/function/Timeout.d.mts +1 -1
- package/{types → generated/types}/src/function/Tries.d.mts +4 -4
- package/{types → generated/types}/src/function/TryAsync.d.mts +2 -2
- package/{types → generated/types}/src/function/TryNew.d.mts +1 -1
- package/generated/types/src/function/TsToMjs.d.mts +27 -0
- package/generated/types/src/function/UniqueFSTempName.d.mts +9 -0
- package/generated/types/src/function/errorToMessage.d.mts +5 -0
- package/generated/types/src/neinth/VivthyNeinth.d.mts +202 -0
- package/generated/types/src/typehints/ArrayToKeys.d.mts +23 -0
- package/generated/types/src/typehints/AssemblyScriptExportsType.d.mts +4 -0
- package/generated/types/src/typehints/AssemblyScriptLoaderInstantiate.d.mts +4 -0
- package/generated/types/src/typehints/AutoDocASOptions.d.mts +15 -0
- package/generated/types/src/typehints/ChainableType.d.mts +3 -0
- package/generated/types/src/typehints/ComponentDecorator_Constructor.d.mts +3 -0
- package/generated/types/src/typehints/ConsoleAdditionalSettingType.d.mts +3 -0
- package/generated/types/src/typehints/Decorator.d.mts +11 -0
- package/generated/types/src/typehints/DecoratorMonkeyPatch.d.mts +15 -0
- package/{types/src/types → generated/types/src/typehints}/DevTestCB.d.mts +2 -2
- package/generated/types/src/typehints/EnvModeType.d.mts +4 -0
- package/generated/types/src/typehints/ListArg.d.mts +4 -0
- package/generated/types/src/typehints/MonkeyPatchedType.d.mts +1 -0
- package/generated/types/src/typehints/ParametersFollowingN.d.mts +13 -0
- package/generated/types/src/typehints/PrefixedKeysOf.d.mts +1 -0
- package/generated/types/src/typehints/Runtime.d.mts +4 -0
- package/generated/types/src/typehints/SafeImportReturnType.d.mts +1 -0
- package/generated/types/src/typehints/StylePropRefType.d.mts +2 -0
- package/generated/types/src/typehints/TemplateLiteralValueHandler.d.mts +10 -0
- package/generated/types/src/typehints/VLifecycleCallbacks.d.mts +6 -0
- package/generated/types/src/typehints/VivthCleanup.d.mts +12 -0
- package/generated/types/src/web/BrowserDirMapper.d.mts +70 -0
- package/generated/types/src/web/EnsureValidTag.d.mts +7 -0
- package/generated/types/src/web/ViteAddDynamics.d.mts +28 -0
- package/generated/types/src/web/ViteGetAllHTMLFile.d.mts +9 -0
- package/generated/types/src/web/WC_extendsA.d.mts +135 -0
- package/generated/types/src/web/WC_extendsB.d.mts +135 -0
- package/generated/types/src/web/bindings/WC_StyleProp_bind.d.mts +42 -0
- package/generated/types/src/web/bindings/WC_createElement_bind.d.mts +51 -0
- package/generated/types/src/web/bindings/WC_createNamedSlot.d.mts +26 -0
- package/generated/types/src/web/bindings/WC_litRender_bind.d.mts +20 -0
- package/generated/types/src/web/bindings/WC_litStyleMap.d.mts +7 -0
- package/generated/types/src/web/common/CSS.d.mts +23 -0
- package/generated/types/src/web/common/E.d.mts +41 -0
- package/generated/types/src/web/common/NewStyleSheetAsync.d.mts +15 -0
- package/generated/types/src/web/common/NewStyleSheetSync.d.mts +15 -0
- package/generated/types/src/web/common/WC_TagName_type.d.mts +15 -0
- package/generated/types/src/web/signals/IsInViewPortSignal.d.mts +52 -0
- package/generated/types/src/web/signals/ObserverSignal.d.mts +32 -0
- package/generated/types/src/web/signals/WC_litRef.d.mts +26 -0
- package/generated/types/src/web/signals/WC_loopedSiblingsRef.d.mts +44 -0
- package/generated/vivth/exports/all.mjs +233 -0
- package/generated/vivth/exports/neutral.mjs +193 -0
- package/generated/vivth/exports/node.mjs +46 -0
- package/package.json +50 -14
- package/src/bundler/CompileAS.mjs +36 -0
- package/src/bundler/CompileJS.mjs +98 -171
- package/src/bundler/CreateESPlugin.mjs +1 -1
- package/src/bundler/EsBundler.mjs +38 -13
- package/src/bundler/FSAnalyzer.mjs +253 -0
- package/src/bundler/FSasar.bundled.mjs +128 -0
- package/src/bundler/FSasar.mjs +96 -0
- package/src/bundler/FileSelfMapper.mjs +491 -0
- package/src/bundler/JSDirMapper.mjs +528 -0
- package/src/bundler/RunWatchThenCompileJSOnSafeExit.mjs +129 -0
- package/src/bundler/adds/BrowserExternals.mjs +37 -0
- package/src/bundler/adds/CreateTransform.mjs +36 -0
- package/src/bundler/adds/LastEditedUnix.mjs +12 -0
- package/src/bundler/adds/NodeModuleList.mjs +33 -0
- package/src/bundler/adds/PathFSBundles.bundled.mjs +41 -0
- package/src/bundler/adds/PathFSBundles.mjs +91 -0
- package/src/bundler/adds/PathFSDir.bundled.mjs +53 -0
- package/src/bundler/adds/PathFSDir.mjs +100 -0
- package/src/bundler/adds/PathFSFile.bundled.mjs +40 -0
- package/src/bundler/adds/PathFSFile.mjs +85 -0
- package/src/bundler/adds/ToBundledJSPlugin.mjs +116 -55
- package/src/bundler/adds/autoExternalize.mjs +81 -0
- package/src/bundler/adds/emptyBufferValue.mjs +5 -0
- package/src/bundler/adds/isModuleTheBundledVersion.mjs +10 -0
- package/src/bundler/adds/onEndEsBuildErrorLogger.mjs +34 -0
- package/src/bundler/adds/resolveJSDependencyPath.mjs +17 -0
- package/src/class/AwaitSignal.mjs +119 -0
- package/src/class/Console.mjs +36 -14
- package/src/class/DataLog.mjs +29 -0
- package/src/class/Derived.mjs +67 -55
- package/src/class/Effect.mjs +270 -84
- package/src/class/EnvSignal.mjs +11 -8
- package/src/class/EsWatcher.mjs +60 -0
- package/src/class/EventSignal.mjs +46 -58
- package/src/class/FSDirArchWatcher.mjs +246 -0
- package/src/class/FileSafe.mjs +72 -24
- package/src/class/ForEach.mjs +78 -0
- package/src/class/ForSignal.mjs +115 -0
- package/src/class/GetterSetter.mjs +40 -0
- package/src/class/JSONFileHandler.mjs +90 -0
- package/src/class/ListSignal.mjs +68 -26
- package/src/class/LitExp.mjs +59 -36
- package/src/class/ObjectSignal.mjs +225 -0
- package/src/class/Paths.mjs +56 -20
- package/src/class/Prettivy.mjs +51 -0
- package/src/class/QChannel.mjs +48 -26
- package/src/class/SafeExit.mjs +156 -99
- package/src/class/Setup.mjs +28 -16
- package/src/class/Signal.mjs +50 -27
- package/src/class/SignalCollection.mjs +130 -0
- package/src/class/WalkThrough.mjs +6 -23
- package/src/class/{WorkerMainThreadBundled.mjs → WorkerMainThread.bundled.mjs} +56 -77
- package/src/class/WorkerMainThread.mjs +98 -94
- package/src/class/WorkerThread.mjs +24 -17
- package/src/common/Base64URL.mjs +6 -3
- package/src/common/Base64URLFromFile.mjs +17 -4
- package/src/common/BundledV.bundled.mjs +7 -0
- package/src/common/BundledV.mjs +45 -0
- package/src/common/CreateStringID.mjs +8 -7
- package/src/common/EnvMode.mjs +172 -0
- package/src/common/FactoryKey.mjs +11 -0
- package/src/common/Preferrence.mjs +27 -0
- package/src/common/Trace.mjs +1 -1
- package/src/common/TracePath.mjs +53 -3
- package/src/common/VivthUnBundledCodeBlock.mjs +8 -0
- package/src/doc/JSautoDOC.mjs +673 -284
- package/src/doc/cleanPreserveTypedef.mjs +27 -0
- package/src/doc/correctBeforeParse.mjs +57 -48
- package/src/doc/{parsedFile.mjs → parsedFileForDOC.mjs} +133 -120
- package/src/function/ClearRequireCache.mjs +33 -0
- package/src/function/CreateImmutable.mjs +40 -37
- package/src/function/EventCheck.mjs +5 -2
- package/src/function/EventObject.mjs +2 -6
- package/src/function/ForInAsync.mjs +76 -0
- package/src/function/ForInSync.mjs +87 -0
- package/src/function/ForOfAsync.mjs +61 -0
- package/src/function/ForOfSync.mjs +70 -0
- package/src/function/GetBufferFromRelativePath.mjs +25 -0
- package/src/function/GetFilesFromDir.mjs +49 -0
- package/src/function/GetMaxFilenameLength.mjs +32 -0
- package/src/function/GetModuleEsbuildPlatform.mjs +118 -0
- package/src/function/GetNamedImportAlias.mjs +2 -2
- package/src/function/GetRuntime.mjs +10 -14
- package/src/function/InstantiateAssemblyScript.mjs +22 -0
- package/src/function/IsAsync.mjs +1 -1
- package/src/function/IsInstanceOf.mjs +29 -0
- package/src/function/IsSameFile.mjs +41 -0
- package/src/function/IsStringLooksLikeAPath.mjs +20 -0
- package/src/function/IsTypeOf.mjs +27 -0
- package/src/function/IsTypeOf.mts +31 -0
- package/src/function/LazyFactory.mjs +25 -23
- package/src/function/MonkeyPatch.mjs +38 -0
- package/src/function/NewAnimationTimeline.mjs +55 -0
- package/src/function/NewChainable.mjs +69 -0
- package/src/function/NewDynamicsExport.mjs +312 -0
- package/src/function/NewObjectWrapper.mjs +14 -0
- package/src/function/ObjectRegistrar.mjs +23 -0
- package/src/function/ParseSQLFile.mjs +129 -0
- package/src/function/PipeAsync.mjs +30 -0
- package/src/function/PipeSync.mjs +28 -0
- package/src/function/SafeImport.mjs +77 -0
- package/src/function/TemplateLiteral.mjs +42 -23
- package/src/function/Timeout.mjs +4 -4
- package/src/function/Tries.mjs +22 -16
- package/src/function/TryAsync.mjs +3 -2
- package/src/function/TryNew.mjs +1 -1
- package/src/function/TsToMjs.mjs +184 -21
- package/src/function/UniqueFSTempName.mjs +33 -0
- package/src/function/errorToMessage.mjs +21 -0
- package/src/function/resolveErrorArray.mjs +15 -1
- package/src/neinth/VivthyNeinth.mjs +487 -0
- package/src/typehints/ArrayToKeys.mjs +17 -0
- package/src/typehints/ArrayToKeys.mts +31 -0
- package/src/typehints/AssemblyScriptExportsType.mjs +7 -0
- package/src/typehints/AssemblyScriptLoaderInstantiate.mjs +7 -0
- package/src/typehints/AutoDocASOptions.mjs +14 -0
- package/src/typehints/ChainableType.mjs +11 -0
- package/src/typehints/ComponentDecorator_Constructor.mjs +10 -0
- package/src/typehints/ConsoleAdditionalSettingType.mjs +6 -0
- package/src/typehints/Decorator.mjs +9 -0
- package/src/typehints/Decorator.mts +31 -0
- package/src/typehints/DecoratorMonkeyPatch.mjs +10 -0
- package/src/typehints/DecoratorMonkeyPatch.mts +43 -0
- package/src/{types → typehints}/DevTestCB.mjs +2 -2
- package/src/typehints/EnvModeType.mjs +6 -0
- package/src/{types → typehints}/ListArg.mjs +1 -1
- package/src/{types → typehints}/LitExpResultType.mjs +1 -1
- package/src/typehints/MonkeyPatchedType.mjs +13 -0
- package/src/typehints/ParametersFollowingN.mjs +8 -0
- package/src/typehints/ParametersFollowingN.mts +17 -0
- package/src/typehints/PrefixedKeysOf.mjs +9 -0
- package/src/typehints/Runtime.mjs +6 -0
- package/src/typehints/SafeImportReturnType.mjs +6 -0
- package/src/typehints/StylePropRefType.mjs +12 -0
- package/src/typehints/TemplateLiteralValueHandler.mjs +14 -0
- package/src/typehints/VLifecycleCallbacks.mjs +10 -0
- package/src/typehints/VivthCleanup.mjs +14 -0
- package/src/web/BrowserDirMapper.mjs +255 -0
- package/src/web/EnsureValidTag.mjs +5 -0
- package/src/web/EnsureValidTag.mts +10 -0
- package/src/web/ViteAddDynamics.mjs +34 -0
- package/src/web/ViteGetAllHTMLFile.mjs +97 -0
- package/src/web/WC_extendsA.mjs +330 -0
- package/src/web/WC_extendsB.mjs +332 -0
- package/src/web/bindings/WC_StyleProp_bind.mjs +70 -0
- package/src/web/bindings/WC_createElement_bind.mjs +95 -0
- package/src/web/bindings/WC_createNamedSlot.mjs +29 -0
- package/src/web/bindings/WC_litRender_bind.mjs +26 -0
- package/src/web/bindings/WC_litStyleMap.mjs +14 -0
- package/src/web/common/CSS.mjs +35 -0
- package/src/web/common/E.mjs +126 -0
- package/src/web/common/NewStyleSheetAsync.mjs +21 -0
- package/src/web/common/NewStyleSheetSync.mjs +21 -0
- package/src/web/common/WC_TagName_type.mjs +10 -0
- package/src/web/common/WC_TagName_type.mts +36 -0
- package/src/web/signals/IsInViewPortSignal.mjs +140 -0
- package/src/web/signals/ObserverSignal.mjs +93 -0
- package/src/web/signals/WC_litRef.mjs +61 -0
- package/src/web/signals/WC_loopedSiblingsRef.mjs +100 -0
- package/tsconfig.json +44 -41
- package/index.mjs +0 -91
- package/src/bundler/FSInline.mjs +0 -67
- package/src/bundler/FSInlineAnalyzer.mjs +0 -228
- package/src/bundler/FSInlineBundled.mjs +0 -38
- package/src/bundler/adds/externals.mjs +0 -8
- package/src/class/ListDerived.mjs +0 -42
- package/src/common/Dev.mjs +0 -142
- package/src/common/DevBundled.mjs +0 -5
- package/src/common/lazie.mjs +0 -3
- package/src/types/IsListSignal.mjs +0 -6
- package/src/types/Runtime.mjs +0 -6
- package/src/types/VivthDevCodeBlockStringType.mjs +0 -6
- package/types/index.d.mts +0 -58
- package/types/src/bundler/CompileJS.d.mts +0 -119
- package/types/src/bundler/FSInline.d.mts +0 -50
- package/types/src/bundler/FSInlineAnalyzer.d.mts +0 -37
- package/types/src/bundler/FSInlineBundled.d.mts +0 -22
- package/types/src/bundler/adds/externals.d.mts +0 -1
- package/types/src/class/Console.d.mts +0 -71
- package/types/src/class/Derived.d.mts +0 -98
- package/types/src/class/Effect.d.mts +0 -216
- package/types/src/class/ListDerived.d.mts +0 -38
- package/types/src/class/Paths.d.mts +0 -69
- package/types/src/class/SafeExit.d.mts +0 -103
- package/types/src/class/WorkerMainThreadBundled.d.mts +0 -83
- package/types/src/common/Base64URLFromFile.d.mts +0 -16
- package/types/src/common/Dev.d.mts +0 -68
- package/types/src/common/DevBundled.d.mts +0 -3
- package/types/src/common/lazie.d.mts +0 -1
- package/types/src/doc/JSautoDOC.d.mts +0 -83
- package/types/src/function/GetRuntime.d.mts +0 -2
- package/types/src/function/TemplateLiteral.d.mts +0 -22
- package/types/src/function/TsToMjs.d.mts +0 -23
- package/types/src/types/IsListSignal.d.mts +0 -4
- package/types/src/types/ListArg.d.mts +0 -4
- package/types/src/types/Runtime.d.mts +0 -4
- package/types/src/types/VivthDevCodeBlockStringType.d.mts +0 -4
- /package/{types → generated/types}/src/bundler/adds/pluginVivthBundle.d.mts +0 -0
- /package/{types → generated/types}/src/class/WorkerResult.d.mts +0 -0
- /package/{types → generated/types}/src/common/EventNameSpace.d.mts +0 -0
- /package/{types → generated/types}/src/common/eventObjects.d.mts +0 -0
- /package/{types → generated/types}/src/common/keys.d.mts +0 -0
- /package/{types → generated/types}/src/doc/correctBeforeParse.d.mts +0 -0
- /package/{types → generated/types}/src/function/TrySync.d.mts +0 -0
- /package/{types → generated/types}/src/function/resolveErrorArray.d.mts +0 -0
- /package/{types/src/types → generated/types/src/typehints}/AnyButUndefined.d.mts +0 -0
- /package/{types/src/types → generated/types/src/typehints}/ExtnameType.d.mts +0 -0
- /package/{types/src/types → generated/types/src/typehints}/LitExpKeyType.d.mts +0 -0
- /package/{types/src/types → generated/types/src/typehints}/LitExpResultType.d.mts +0 -0
- /package/{types/src/types → generated/types/src/typehints}/MutationType.d.mts +0 -0
- /package/{types/src/types → generated/types/src/typehints}/QCBFIFOReturn.d.mts +0 -0
- /package/{types/src/types → generated/types/src/typehints}/QCBReturn.d.mts +0 -0
- /package/src/{types → typehints}/AnyButUndefined.mjs +0 -0
- /package/src/{types → typehints}/ExtnameType.mjs +0 -0
- /package/src/{types → typehints}/LitExpKeyType.mjs +0 -0
- /package/src/{types → typehints}/MutationType.mjs +0 -0
- /package/src/{types → typehints}/QCBFIFOReturn.mjs +0 -0
- /package/src/{types → typehints}/QCBReturn.mjs +0 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description
|
|
3
|
+
* - class helper to handle `.json` file;
|
|
4
|
+
* - this class assume, `Paths` already instantiated;
|
|
5
|
+
*/
|
|
6
|
+
export class JSONFileHandler {
|
|
7
|
+
/**
|
|
8
|
+
* @param {string} path
|
|
9
|
+
* - `relative`(to `Paths.root`) OR `absolute`, both are accepted;
|
|
10
|
+
*/
|
|
11
|
+
constructor(path: string);
|
|
12
|
+
/**
|
|
13
|
+
* @description
|
|
14
|
+
* @returns {ReturnType<typeof TryAsync<Object>>}
|
|
15
|
+
* @example
|
|
16
|
+
* import { JSONFileHandler } from "vivth/node";
|
|
17
|
+
*
|
|
18
|
+
* const packageJSONHandler = new JSONFileHandler('/package.json');
|
|
19
|
+
* const [content, error] = await packageJSONHandler.read();
|
|
20
|
+
*/
|
|
21
|
+
read: () => ReturnType<typeof TryAsync<Object>>;
|
|
22
|
+
/**
|
|
23
|
+
* @description
|
|
24
|
+
* @param {Object} newObj
|
|
25
|
+
* @return { ReturnType<typeof TryAsync<void>> }
|
|
26
|
+
* @example
|
|
27
|
+
* import { this.writeJSONFileHandler } from "vivth/node";
|
|
28
|
+
*
|
|
29
|
+
* const packageJSONHandler = new JSONFileHandler('/package.json');
|
|
30
|
+
* const [, error] = await packageJSONHandler.write({
|
|
31
|
+
* ...object,
|
|
32
|
+
* });
|
|
33
|
+
*/
|
|
34
|
+
write: (newObj: Object) => ReturnType<typeof TryAsync<void>>;
|
|
35
|
+
/**
|
|
36
|
+
* @description
|
|
37
|
+
* @param {Object} object
|
|
38
|
+
* @return { ReturnType<typeof TryAsync<void>> }
|
|
39
|
+
* @example
|
|
40
|
+
* import { JSONFileHandler } from "vivth/node";
|
|
41
|
+
*
|
|
42
|
+
* const packageJSONHandler = new JSONFileHandler('/package.json');
|
|
43
|
+
* const [, error] = await packageJSONHandler.assign({
|
|
44
|
+
* ...object,
|
|
45
|
+
* });
|
|
46
|
+
*/
|
|
47
|
+
assign: (object: Object) => ReturnType<typeof TryAsync<void>>;
|
|
48
|
+
#private;
|
|
49
|
+
}
|
|
50
|
+
import { TryAsync } from '../function/TryAsync.mjs';
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @typedef {import('../
|
|
3
|
-
* @typedef {import('../
|
|
2
|
+
* @typedef {import('../typehints/ListArg.mjs').ListArg} ListArg
|
|
3
|
+
* @typedef {import('../typehints/MutationType.mjs').MutationType} MutationType
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
6
|
* @description
|
|
7
7
|
* - class to create list that satisfy `Array<Record<string, string>>`.
|
|
8
|
-
* @template {import('../
|
|
8
|
+
* @template {import('../typehints/ListArg.mjs').ListArg} LISTARG
|
|
9
9
|
* @extends {Signal<LISTARG[]>}
|
|
10
10
|
*/
|
|
11
|
-
export class ListSignal<LISTARG extends import("../
|
|
11
|
+
export class ListSignal<LISTARG extends import("../typehints/ListArg.mjs").ListArg> extends Signal<LISTARG[]> {
|
|
12
12
|
/**
|
|
13
13
|
* @description
|
|
14
14
|
* - Checks if the input is an array whose first item (if present) is a plain object
|
|
@@ -21,15 +21,17 @@ export class ListSignal<LISTARG extends import("../types/ListArg.mjs").ListArg>
|
|
|
21
21
|
* @description
|
|
22
22
|
* - usefull for `loops`;
|
|
23
23
|
* @param {LISTARG[]} [value]
|
|
24
|
+
* @param {ConstructorParameters<typeof Signal<LISTARG[]>>[1]} [performanceChangesReport]
|
|
25
|
+
* - the argument passed are `structuredClone` of the array;
|
|
24
26
|
* @example
|
|
25
|
-
* import { ListSignal } from 'vivth';
|
|
27
|
+
* import { ListSignal } from 'vivth/neutral';
|
|
26
28
|
*
|
|
27
29
|
* const listExample = new ListSignal([
|
|
28
30
|
* {key1: "test1",},
|
|
29
31
|
* {key1: "test2",},
|
|
30
32
|
* ]);
|
|
31
33
|
*/
|
|
32
|
-
constructor(value?: LISTARG[]);
|
|
34
|
+
constructor(value?: LISTARG[], performanceChangesReport?: ConstructorParameters<typeof Signal<LISTARG[]>>[1]);
|
|
33
35
|
/**
|
|
34
36
|
* @description
|
|
35
37
|
* - methods collection that mimics `Array` API;
|
|
@@ -39,9 +41,25 @@ export class ListSignal<LISTARG extends import("../types/ListArg.mjs").ListArg>
|
|
|
39
41
|
/**
|
|
40
42
|
* @instance arrayMethods
|
|
41
43
|
* @description
|
|
42
|
-
* - reference to structuredClone elements of `value`;
|
|
44
|
+
* - reference to `structuredClone` elements of `value`;
|
|
43
45
|
* - calling doesn't notify for changes;
|
|
44
46
|
* @returns {Array<LISTARG>}
|
|
47
|
+
* - use this getter instead of subscribing the `ListSignal` value;
|
|
48
|
+
* >- as to not accidentally mutate the source value;
|
|
49
|
+
* @example
|
|
50
|
+
* import { ListSignal, Derived } from 'vivth/neutral';
|
|
51
|
+
*
|
|
52
|
+
* const myListSignal = new ListSignal([
|
|
53
|
+
* { key:'a', group:0 },
|
|
54
|
+
* { key:'b', group:1 },
|
|
55
|
+
* { key:'c', group:0 },
|
|
56
|
+
* ]);
|
|
57
|
+
*
|
|
58
|
+
* const myFilteredListSignal = new Derived(async ({ subscribe }) => {
|
|
59
|
+
* return subscribe(myListSignal).structuredClone.filter((val)=>{
|
|
60
|
+
* // return specific val
|
|
61
|
+
* })
|
|
62
|
+
* })
|
|
45
63
|
*/
|
|
46
64
|
readonly structuredClone: Array<LISTARG>;
|
|
47
65
|
/**
|
|
@@ -130,24 +148,40 @@ export class ListSignal<LISTARG extends import("../types/ListArg.mjs").ListArg>
|
|
|
130
148
|
* @instance arrayMethods
|
|
131
149
|
* @description
|
|
132
150
|
* - reverses the elements in an `List` in place.
|
|
133
|
-
* @
|
|
151
|
+
* @type {()=>void}
|
|
134
152
|
*/
|
|
135
153
|
reverse: () => void;
|
|
136
154
|
/**
|
|
137
155
|
* @instance arrayMethods
|
|
138
156
|
* @description
|
|
139
157
|
* - removes the last element;
|
|
140
|
-
* @
|
|
158
|
+
* @type {()=>void}
|
|
141
159
|
*/
|
|
142
160
|
pop: () => void;
|
|
143
161
|
} & {
|
|
144
|
-
|
|
162
|
+
[x: symbol]: {
|
|
145
163
|
/**
|
|
146
164
|
* @instance arrayMethods
|
|
147
165
|
* @description
|
|
148
|
-
* - reference to structuredClone elements of `value`;
|
|
166
|
+
* - reference to `structuredClone` elements of `value`;
|
|
149
167
|
* - calling doesn't notify for changes;
|
|
150
168
|
* @returns {Array<LISTARG>}
|
|
169
|
+
* - use this getter instead of subscribing the `ListSignal` value;
|
|
170
|
+
* >- as to not accidentally mutate the source value;
|
|
171
|
+
* @example
|
|
172
|
+
* import { ListSignal, Derived } from 'vivth/neutral';
|
|
173
|
+
*
|
|
174
|
+
* const myListSignal = new ListSignal([
|
|
175
|
+
* { key:'a', group:0 },
|
|
176
|
+
* { key:'b', group:1 },
|
|
177
|
+
* { key:'c', group:0 },
|
|
178
|
+
* ]);
|
|
179
|
+
*
|
|
180
|
+
* const myFilteredListSignal = new Derived(async ({ subscribe }) => {
|
|
181
|
+
* return subscribe(myListSignal).structuredClone.filter((val)=>{
|
|
182
|
+
* // return specific val
|
|
183
|
+
* })
|
|
184
|
+
* })
|
|
151
185
|
*/
|
|
152
186
|
readonly structuredClone: Array<LISTARG>;
|
|
153
187
|
/**
|
|
@@ -236,20 +270,20 @@ export class ListSignal<LISTARG extends import("../types/ListArg.mjs").ListArg>
|
|
|
236
270
|
* @instance arrayMethods
|
|
237
271
|
* @description
|
|
238
272
|
* - reverses the elements in an `List` in place.
|
|
239
|
-
* @
|
|
273
|
+
* @type {()=>void}
|
|
240
274
|
*/
|
|
241
275
|
reverse: () => void;
|
|
242
276
|
/**
|
|
243
277
|
* @instance arrayMethods
|
|
244
278
|
* @description
|
|
245
279
|
* - removes the last element;
|
|
246
|
-
* @
|
|
280
|
+
* @type {()=>void}
|
|
247
281
|
*/
|
|
248
282
|
pop: () => void;
|
|
249
283
|
};
|
|
250
284
|
};
|
|
251
285
|
#private;
|
|
252
286
|
}
|
|
253
|
-
export type ListArg = import("../
|
|
254
|
-
export type MutationType = import("../
|
|
287
|
+
export type ListArg = import("../typehints/ListArg.mjs").ListArg;
|
|
288
|
+
export type MutationType = import("../typehints/MutationType.mjs").MutationType;
|
|
255
289
|
import { Signal } from './Signal.mjs';
|
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
* - made primarily for generating string file, that are purely managed programatically;
|
|
11
11
|
* @template {LitExpKeyType} KEYS
|
|
12
12
|
*/
|
|
13
|
-
export class LitExp<KEYS extends import("../
|
|
13
|
+
export class LitExp<KEYS extends import("../typehints/LitExpKeyType.mjs").LitExpKeyType> {
|
|
14
14
|
/**
|
|
15
|
-
* @typedef {import("../
|
|
15
|
+
* @typedef {import("../typehints/LitExpKeyType.mjs").LitExpKeyType} LitExpKeyType
|
|
16
16
|
*/
|
|
17
17
|
/**
|
|
18
18
|
* @description
|
|
@@ -50,7 +50,7 @@ export class LitExp<KEYS extends import("../types/LitExpKeyType.mjs").LitExpKeyT
|
|
|
50
50
|
* - placement of `key` will determine the named capture group will be placed in the template literal;
|
|
51
51
|
* - it is recomended to not end template literal with any of the `key`s as the regex detection might failed to detects the boundary of the end of matched string of that capture group;
|
|
52
52
|
* @example
|
|
53
|
-
* import { LitExp } from 'vivth';
|
|
53
|
+
* import { LitExp } from 'vivth/neutral';
|
|
54
54
|
*
|
|
55
55
|
* (()=>{
|
|
56
56
|
* const [liteal, errorPrep] = LitExp.prepare({
|
|
@@ -66,7 +66,7 @@ export class LitExp<KEYS extends import("../types/LitExpKeyType.mjs").LitExpKeyT
|
|
|
66
66
|
* // recommended to end the template literal with any string but `key`;
|
|
67
67
|
* })()
|
|
68
68
|
*/
|
|
69
|
-
static prepare<KEYS_1 extends import("../
|
|
69
|
+
static prepare<KEYS_1 extends import("../typehints/LitExpKeyType.mjs").LitExpKeyType>(keysAndDefaultValuePair: KEYS_1): ReturnType<typeof TrySync<(templateStringArray: TemplateStringsArray, ...values: (keyof KEYS_1)[]) => LitExp<KEYS_1>>>;
|
|
70
70
|
/**
|
|
71
71
|
* @template {LitExpKeyType} KEYS
|
|
72
72
|
* @param {KEYS} instance_rules
|
|
@@ -75,14 +75,14 @@ export class LitExp<KEYS extends import("../types/LitExpKeyType.mjs").LitExpKeyT
|
|
|
75
75
|
* @param {TemplateStringsArray} strings
|
|
76
76
|
* @returns {ReturnType<typeof TrySync<string[]>>}
|
|
77
77
|
*/
|
|
78
|
-
static
|
|
78
|
+
static #processTemplate<KEYS_1 extends import("../typehints/LitExpKeyType.mjs").LitExpKeyType>(instance_rules: KEYS_1, intance_values: (keyof KEYS_1)[], valueHandler: (value: keyof KEYS_1, regex: RegExp | false) => ReturnType<typeof TrySync<string>>, strings: TemplateStringsArray): ReturnType<typeof TrySync<string[]>>;
|
|
79
79
|
/**
|
|
80
80
|
* @template {LitExpKeyType} KEYS
|
|
81
81
|
* @param {RegExp|false} regex
|
|
82
82
|
* @param {keyof KEYS} value
|
|
83
83
|
* @returns {ReturnType<typeof TrySync<string>>}
|
|
84
84
|
*/
|
|
85
|
-
static
|
|
85
|
+
static #namedChapture<KEYS_1 extends import("../typehints/LitExpKeyType.mjs").LitExpKeyType>(value: keyof KEYS_1, regex: RegExp | false): ReturnType<typeof TrySync<string>>;
|
|
86
86
|
/**
|
|
87
87
|
* @private
|
|
88
88
|
* @param {KEYS} keys
|
|
@@ -102,7 +102,7 @@ export class LitExp<KEYS extends import("../types/LitExpKeyType.mjs").LitExpKeyT
|
|
|
102
102
|
* @param {Partial<{ [K in keyof KEYS]?: string }>} overrides
|
|
103
103
|
* @returns {string|undefined}
|
|
104
104
|
* @example
|
|
105
|
-
* import { LitExp } from 'vivth';
|
|
105
|
+
* import { LitExp } from 'vivth/neutral';
|
|
106
106
|
*
|
|
107
107
|
* const [literal, errorPreparing] = LitExp.prepare({
|
|
108
108
|
* myKey: false,
|
|
@@ -119,7 +119,7 @@ export class LitExp<KEYS extends import("../types/LitExpKeyType.mjs").LitExpKeyT
|
|
|
119
119
|
*/
|
|
120
120
|
string: (overrides: Partial<{ [K in keyof KEYS]?: string; }>) => string | undefined;
|
|
121
121
|
} & {
|
|
122
|
-
|
|
122
|
+
[x: symbol]: {
|
|
123
123
|
/**
|
|
124
124
|
* @instance make
|
|
125
125
|
* @description
|
|
@@ -127,7 +127,7 @@ export class LitExp<KEYS extends import("../types/LitExpKeyType.mjs").LitExpKeyT
|
|
|
127
127
|
* @param {Partial<{ [K in keyof KEYS]?: string }>} overrides
|
|
128
128
|
* @returns {string|undefined}
|
|
129
129
|
* @example
|
|
130
|
-
* import { LitExp } from 'vivth';
|
|
130
|
+
* import { LitExp } from 'vivth/neutral';
|
|
131
131
|
*
|
|
132
132
|
* const [literal, errorPreparing] = LitExp.prepare({
|
|
133
133
|
* myKey: false,
|
|
@@ -169,7 +169,7 @@ export class LitExp<KEYS extends import("../types/LitExpKeyType.mjs").LitExpKeyT
|
|
|
169
169
|
* regexp:RegExp}>>
|
|
170
170
|
* }
|
|
171
171
|
* @example
|
|
172
|
-
* import { LitExp } from 'vivth';
|
|
172
|
+
* import { LitExp } from 'vivth/neutral';
|
|
173
173
|
*
|
|
174
174
|
* const [literal, errorPreparing] = LitExp.prepare({
|
|
175
175
|
* myKey: false,
|
|
@@ -210,10 +210,10 @@ export class LitExp<KEYS extends import("../types/LitExpKeyType.mjs").LitExpKeyT
|
|
|
210
210
|
* - to match all and grouped based on `key`;
|
|
211
211
|
* @param {Parameters<LitExp<KEYS>["evaluate"]["execGroups"]>[0]} string
|
|
212
212
|
* @param {Omit<Parameters<LitExp<KEYS>["evaluate"]["execGroups"]>[1], 'absoluteLeadAndFollowing'>} options
|
|
213
|
-
* @returns {ReturnType<typeof TrySync<import('../
|
|
213
|
+
* @returns {ReturnType<typeof TrySync<import('../typehints/LitExpResultType.mjs').LitExpResultType<KEYS>>>
|
|
214
214
|
* }
|
|
215
215
|
* @example
|
|
216
|
-
* import { LitExp, Console } from 'vivth';
|
|
216
|
+
* import { LitExp, Console } from 'vivth/neutral';
|
|
217
217
|
*
|
|
218
218
|
* const [literal, errorPreparing] = LitExp.prepare({
|
|
219
219
|
* myKey: false,
|
|
@@ -246,9 +246,9 @@ export class LitExp<KEYS extends import("../types/LitExpKeyType.mjs").LitExpKeyT
|
|
|
246
246
|
* })
|
|
247
247
|
* })()
|
|
248
248
|
*/
|
|
249
|
-
matchedAllAndGrouped: (string: Parameters<LitExp<KEYS>["evaluate"]["execGroups"]>[0], options: Omit<Parameters<LitExp<KEYS>["evaluate"]["execGroups"]>[1], "absoluteLeadAndFollowing">) => ReturnType<typeof TrySync<import("../
|
|
249
|
+
matchedAllAndGrouped: (string: Parameters<LitExp<KEYS>["evaluate"]["execGroups"]>[0], options: Omit<Parameters<LitExp<KEYS>["evaluate"]["execGroups"]>[1], "absoluteLeadAndFollowing">) => ReturnType<typeof TrySync<import("../typehints/LitExpResultType.mjs").LitExpResultType<KEYS>>>;
|
|
250
250
|
} & {
|
|
251
|
-
|
|
251
|
+
[x: symbol]: {
|
|
252
252
|
/**
|
|
253
253
|
* @instance evaluate
|
|
254
254
|
* @description
|
|
@@ -268,7 +268,7 @@ export class LitExp<KEYS extends import("../types/LitExpKeyType.mjs").LitExpKeyT
|
|
|
268
268
|
* regexp:RegExp}>>
|
|
269
269
|
* }
|
|
270
270
|
* @example
|
|
271
|
-
* import { LitExp } from 'vivth';
|
|
271
|
+
* import { LitExp } from 'vivth/neutral';
|
|
272
272
|
*
|
|
273
273
|
* const [literal, errorPreparing] = LitExp.prepare({
|
|
274
274
|
* myKey: false,
|
|
@@ -309,10 +309,10 @@ export class LitExp<KEYS extends import("../types/LitExpKeyType.mjs").LitExpKeyT
|
|
|
309
309
|
* - to match all and grouped based on `key`;
|
|
310
310
|
* @param {Parameters<LitExp<KEYS>["evaluate"]["execGroups"]>[0]} string
|
|
311
311
|
* @param {Omit<Parameters<LitExp<KEYS>["evaluate"]["execGroups"]>[1], 'absoluteLeadAndFollowing'>} options
|
|
312
|
-
* @returns {ReturnType<typeof TrySync<import('../
|
|
312
|
+
* @returns {ReturnType<typeof TrySync<import('../typehints/LitExpResultType.mjs').LitExpResultType<KEYS>>>
|
|
313
313
|
* }
|
|
314
314
|
* @example
|
|
315
|
-
* import { LitExp, Console } from 'vivth';
|
|
315
|
+
* import { LitExp, Console } from 'vivth/neutral';
|
|
316
316
|
*
|
|
317
317
|
* const [literal, errorPreparing] = LitExp.prepare({
|
|
318
318
|
* myKey: false,
|
|
@@ -345,7 +345,7 @@ export class LitExp<KEYS extends import("../types/LitExpKeyType.mjs").LitExpKeyT
|
|
|
345
345
|
* })
|
|
346
346
|
* })()
|
|
347
347
|
*/
|
|
348
|
-
matchedAllAndGrouped: (string: Parameters<LitExp<KEYS>["evaluate"]["execGroups"]>[0], options: Omit<Parameters<LitExp<KEYS>["evaluate"]["execGroups"]>[1], "absoluteLeadAndFollowing">) => ReturnType<typeof TrySync<import("../
|
|
348
|
+
matchedAllAndGrouped: (string: Parameters<LitExp<KEYS>["evaluate"]["execGroups"]>[0], options: Omit<Parameters<LitExp<KEYS>["evaluate"]["execGroups"]>[1], "absoluteLeadAndFollowing">) => ReturnType<typeof TrySync<import("../typehints/LitExpResultType.mjs").LitExpResultType<KEYS>>>;
|
|
349
349
|
};
|
|
350
350
|
};
|
|
351
351
|
#private;
|
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef { import('../typehints/VivthCleanup.mjs').VivthCleanup } VivthCleanup
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* @description
|
|
6
|
+
* - Signal based on shared/globally available `Object` as key;
|
|
7
|
+
* @template {any} SHAREDOBJECT
|
|
8
|
+
* @implements {VivthCleanup}
|
|
9
|
+
*/
|
|
10
|
+
export class ObjectSignal<SHAREDOBJECT extends unknown> implements VivthCleanup {
|
|
11
|
+
/**
|
|
12
|
+
* @type {QChannel<Object>}
|
|
13
|
+
*/
|
|
14
|
+
static #q: QChannel<Object>;
|
|
15
|
+
/**
|
|
16
|
+
* @type {WeakMap<Object, ObjectSignal<any>>}
|
|
17
|
+
*/
|
|
18
|
+
static #mappedSignal: WeakMap<Object, ObjectSignal<any>>;
|
|
19
|
+
/**
|
|
20
|
+
* @template {any} SHAREDOBJECT
|
|
21
|
+
* @param {Object} object
|
|
22
|
+
* @returns {Promise<ObjectSignal<SHAREDOBJECT>>}
|
|
23
|
+
*/
|
|
24
|
+
static get<SHAREDOBJECT_1 extends unknown>(object: Object): Promise<ObjectSignal<SHAREDOBJECT_1>>;
|
|
25
|
+
/**
|
|
26
|
+
* @description
|
|
27
|
+
* - methods of this static property is lazily created;
|
|
28
|
+
* - remove signal and effect subscription of the named `ObjectSignal_instance`;
|
|
29
|
+
*/
|
|
30
|
+
static remove: {
|
|
31
|
+
/**
|
|
32
|
+
* @static remove
|
|
33
|
+
* @description
|
|
34
|
+
* - remove subscriber from the named `ObjectSignal_instance`;
|
|
35
|
+
* @param {string} name
|
|
36
|
+
* @param {import('./Effect.mjs').Effect} effectInstance
|
|
37
|
+
* @returns {void}
|
|
38
|
+
* @example
|
|
39
|
+
* import { ObjectSignal } from 'vivth/neutral';
|
|
40
|
+
*
|
|
41
|
+
* ObjectSignal.remove.subscriber('yourObjectSignalName', myEffectInstance);
|
|
42
|
+
*/
|
|
43
|
+
subscriber: (name: string, effectInstance: import("./Effect.mjs").Effect) => void;
|
|
44
|
+
/**
|
|
45
|
+
* @static remove
|
|
46
|
+
* @description
|
|
47
|
+
* - remove all subscribers from the named `ObjectSignal_instance`;
|
|
48
|
+
* @param {string} name
|
|
49
|
+
* @returns {void}
|
|
50
|
+
* @example
|
|
51
|
+
* import { ObjectSignal } from 'vivth/neutral';
|
|
52
|
+
*
|
|
53
|
+
* ObjectSignal.remove.allSubscribers('yourObjectSignalName');
|
|
54
|
+
*/
|
|
55
|
+
allSubscribers: (name: string) => void;
|
|
56
|
+
/**
|
|
57
|
+
* @static remove
|
|
58
|
+
* @description
|
|
59
|
+
* - remove reference of the `proxySignals` of the named `ObjectSignal_instance`;
|
|
60
|
+
* @param {string} name
|
|
61
|
+
* @returns {void}
|
|
62
|
+
* @example
|
|
63
|
+
* import { ObjectSignal } from 'vivth/neutral';
|
|
64
|
+
*
|
|
65
|
+
* ObjectSignal.remove.refs('yourObjectSignalName');
|
|
66
|
+
*/
|
|
67
|
+
refs: (name: string) => void;
|
|
68
|
+
} & {
|
|
69
|
+
[x: symbol]: {
|
|
70
|
+
/**
|
|
71
|
+
* @static remove
|
|
72
|
+
* @description
|
|
73
|
+
* - remove subscriber from the named `ObjectSignal_instance`;
|
|
74
|
+
* @param {string} name
|
|
75
|
+
* @param {import('./Effect.mjs').Effect} effectInstance
|
|
76
|
+
* @returns {void}
|
|
77
|
+
* @example
|
|
78
|
+
* import { ObjectSignal } from 'vivth/neutral';
|
|
79
|
+
*
|
|
80
|
+
* ObjectSignal.remove.subscriber('yourObjectSignalName', myEffectInstance);
|
|
81
|
+
*/
|
|
82
|
+
subscriber: (name: string, effectInstance: import("./Effect.mjs").Effect) => void;
|
|
83
|
+
/**
|
|
84
|
+
* @static remove
|
|
85
|
+
* @description
|
|
86
|
+
* - remove all subscribers from the named `ObjectSignal_instance`;
|
|
87
|
+
* @param {string} name
|
|
88
|
+
* @returns {void}
|
|
89
|
+
* @example
|
|
90
|
+
* import { ObjectSignal } from 'vivth/neutral';
|
|
91
|
+
*
|
|
92
|
+
* ObjectSignal.remove.allSubscribers('yourObjectSignalName');
|
|
93
|
+
*/
|
|
94
|
+
allSubscribers: (name: string) => void;
|
|
95
|
+
/**
|
|
96
|
+
* @static remove
|
|
97
|
+
* @description
|
|
98
|
+
* - remove reference of the `proxySignals` of the named `ObjectSignal_instance`;
|
|
99
|
+
* @param {string} name
|
|
100
|
+
* @returns {void}
|
|
101
|
+
* @example
|
|
102
|
+
* import { ObjectSignal } from 'vivth/neutral';
|
|
103
|
+
*
|
|
104
|
+
* ObjectSignal.remove.refs('yourObjectSignalName');
|
|
105
|
+
*/
|
|
106
|
+
refs: (name: string) => void;
|
|
107
|
+
};
|
|
108
|
+
};
|
|
109
|
+
vivthCleanup: () => Promise<void>;
|
|
110
|
+
/**
|
|
111
|
+
* @description
|
|
112
|
+
* - is [Signal](#signal);
|
|
113
|
+
* - if needed to pass along the messages, it can be used as `dispatcher` and `listener` at the same time;
|
|
114
|
+
* - is `lazily` created;
|
|
115
|
+
* @type {Signal<SHAREDOBJECT|undefined>}
|
|
116
|
+
* @example
|
|
117
|
+
* import { ObjectSignal, Effect, Console } from 'vivth/neutral';
|
|
118
|
+
*
|
|
119
|
+
* const myObjectSignal = await ObjectSignal.get('dataEvent', false);
|
|
120
|
+
*
|
|
121
|
+
* new Effect(({ subscribe })=>{
|
|
122
|
+
* const listenValue = subscribe(myObjectSignal.dispatch).value;
|
|
123
|
+
* // dispatch can be used as two way communication;
|
|
124
|
+
* Console.log({ listenValue });
|
|
125
|
+
* })
|
|
126
|
+
* myObjectSignal.dispatch.value = 'hey';
|
|
127
|
+
*/
|
|
128
|
+
dispatcher: Signal<SHAREDOBJECT | undefined>;
|
|
129
|
+
/**
|
|
130
|
+
* @description
|
|
131
|
+
* - is [Derived](#derived);
|
|
132
|
+
* - can be used as listener when passed down value shouldn't be modified manually;
|
|
133
|
+
* - is `lazily` created along with `dispatch`, if `listen` is accessed first, then `dispatch` will also be created automatically;
|
|
134
|
+
* @type {Derived<SHAREDOBJECT|undefined>}
|
|
135
|
+
* @example
|
|
136
|
+
* import { ObjectSignal, Effect, Console } from 'vivth/neutral';
|
|
137
|
+
*
|
|
138
|
+
* const myObjectSignal = await ObjectSignal.get('dataEvent', false);
|
|
139
|
+
*
|
|
140
|
+
* new Effect(({ subscribe })=>{
|
|
141
|
+
* const listenValue = subscribe(myObjectSignal.listen).value;
|
|
142
|
+
* // listen can be used only as listener for one way communication;
|
|
143
|
+
* Console.log({ listenValue });
|
|
144
|
+
* })
|
|
145
|
+
* myObjectSignal.dispatch.value = 'hey';
|
|
146
|
+
*/
|
|
147
|
+
listener: Derived<SHAREDOBJECT | undefined>;
|
|
148
|
+
remove: {
|
|
149
|
+
/**
|
|
150
|
+
* @instance remove
|
|
151
|
+
* @description
|
|
152
|
+
* - remove subscriber from the `ObjectSignal_instance`;
|
|
153
|
+
* @param {import('./Effect.mjs').Effect} effectInstance
|
|
154
|
+
* @returns {void}
|
|
155
|
+
* @example
|
|
156
|
+
* import { ObjectSignal, Effect, Console } from 'vivth/neutral';
|
|
157
|
+
*
|
|
158
|
+
* const myObjectSignal = await ObjectSignal.get('dataEvent', false);
|
|
159
|
+
*
|
|
160
|
+
* const myEffectInstance = new Effect(({ subscribe })=>{
|
|
161
|
+
* const listenValue = subscribe(myObjectSignal.dispatch).value;
|
|
162
|
+
* Console.log({ listenValue });
|
|
163
|
+
* })
|
|
164
|
+
* myObjectSignal.dispatch.value = 'hey';
|
|
165
|
+
* objectSigObjectSignal_instance.remove.subscriber(myEffectInstance);
|
|
166
|
+
*/
|
|
167
|
+
subscriber: (effectInstance: import("./Effect.mjs").Effect) => void;
|
|
168
|
+
/**
|
|
169
|
+
* @instance remove
|
|
170
|
+
* @description
|
|
171
|
+
* - remove allSubscribers from the `ObjectSignal_instance`;
|
|
172
|
+
* @type {()=>void}
|
|
173
|
+
* @example
|
|
174
|
+
* import { ObjectSignal, Effect, Console } from 'vivth/neutral';
|
|
175
|
+
*
|
|
176
|
+
* const myObjectSignal = await ObjectSignal.get('dataEvent', false);
|
|
177
|
+
*
|
|
178
|
+
* const myEffectInstance = new Effect(({ subscribe })=>{
|
|
179
|
+
* const listenValue = subscribe(myObjectSignal.dispatch).value;
|
|
180
|
+
* Console.log({ listenValue });
|
|
181
|
+
* })
|
|
182
|
+
* myObjectSignal.dispatch.value = 'hey';
|
|
183
|
+
* objectSigObjectSignal_instance.remove.allSubscribers();
|
|
184
|
+
*/
|
|
185
|
+
allSubscribers: () => void;
|
|
186
|
+
/**
|
|
187
|
+
* @instance remove
|
|
188
|
+
* @description
|
|
189
|
+
* - remove reference of the `proxySignals` of the `ObjectSignal_instance`;
|
|
190
|
+
* @type {()=>void}
|
|
191
|
+
* @example
|
|
192
|
+
* import { ObjectSignal, Effect, Console } from 'vivth/neutral';
|
|
193
|
+
*
|
|
194
|
+
* const myObjectSignal = await ObjectSignal.get('dataEvent', false);
|
|
195
|
+
*
|
|
196
|
+
* const myEffectInstance = new Effect(({ subscribe })=>{
|
|
197
|
+
* const listenValue = subscribe(myObjectSignal.dispatch).value;
|
|
198
|
+
* Console.log({ listenValue });
|
|
199
|
+
* });
|
|
200
|
+
*
|
|
201
|
+
* objectSigObjectSignal_instance.remove.ref();
|
|
202
|
+
*/
|
|
203
|
+
ref: () => void;
|
|
204
|
+
} & {
|
|
205
|
+
[x: symbol]: {
|
|
206
|
+
/**
|
|
207
|
+
* @instance remove
|
|
208
|
+
* @description
|
|
209
|
+
* - remove subscriber from the `ObjectSignal_instance`;
|
|
210
|
+
* @param {import('./Effect.mjs').Effect} effectInstance
|
|
211
|
+
* @returns {void}
|
|
212
|
+
* @example
|
|
213
|
+
* import { ObjectSignal, Effect, Console } from 'vivth/neutral';
|
|
214
|
+
*
|
|
215
|
+
* const myObjectSignal = await ObjectSignal.get('dataEvent', false);
|
|
216
|
+
*
|
|
217
|
+
* const myEffectInstance = new Effect(({ subscribe })=>{
|
|
218
|
+
* const listenValue = subscribe(myObjectSignal.dispatch).value;
|
|
219
|
+
* Console.log({ listenValue });
|
|
220
|
+
* })
|
|
221
|
+
* myObjectSignal.dispatch.value = 'hey';
|
|
222
|
+
* objectSigObjectSignal_instance.remove.subscriber(myEffectInstance);
|
|
223
|
+
*/
|
|
224
|
+
subscriber: (effectInstance: import("./Effect.mjs").Effect) => void;
|
|
225
|
+
/**
|
|
226
|
+
* @instance remove
|
|
227
|
+
* @description
|
|
228
|
+
* - remove allSubscribers from the `ObjectSignal_instance`;
|
|
229
|
+
* @type {()=>void}
|
|
230
|
+
* @example
|
|
231
|
+
* import { ObjectSignal, Effect, Console } from 'vivth/neutral';
|
|
232
|
+
*
|
|
233
|
+
* const myObjectSignal = await ObjectSignal.get('dataEvent', false);
|
|
234
|
+
*
|
|
235
|
+
* const myEffectInstance = new Effect(({ subscribe })=>{
|
|
236
|
+
* const listenValue = subscribe(myObjectSignal.dispatch).value;
|
|
237
|
+
* Console.log({ listenValue });
|
|
238
|
+
* })
|
|
239
|
+
* myObjectSignal.dispatch.value = 'hey';
|
|
240
|
+
* objectSigObjectSignal_instance.remove.allSubscribers();
|
|
241
|
+
*/
|
|
242
|
+
allSubscribers: () => void;
|
|
243
|
+
/**
|
|
244
|
+
* @instance remove
|
|
245
|
+
* @description
|
|
246
|
+
* - remove reference of the `proxySignals` of the `ObjectSignal_instance`;
|
|
247
|
+
* @type {()=>void}
|
|
248
|
+
* @example
|
|
249
|
+
* import { ObjectSignal, Effect, Console } from 'vivth/neutral';
|
|
250
|
+
*
|
|
251
|
+
* const myObjectSignal = await ObjectSignal.get('dataEvent', false);
|
|
252
|
+
*
|
|
253
|
+
* const myEffectInstance = new Effect(({ subscribe })=>{
|
|
254
|
+
* const listenValue = subscribe(myObjectSignal.dispatch).value;
|
|
255
|
+
* Console.log({ listenValue });
|
|
256
|
+
* });
|
|
257
|
+
*
|
|
258
|
+
* objectSigObjectSignal_instance.remove.ref();
|
|
259
|
+
*/
|
|
260
|
+
ref: () => void;
|
|
261
|
+
};
|
|
262
|
+
};
|
|
263
|
+
}
|
|
264
|
+
export type VivthCleanup = import("../typehints/VivthCleanup.mjs").VivthCleanup;
|
|
265
|
+
import { Signal } from './Signal.mjs';
|
|
266
|
+
import { Derived } from './Derived.mjs';
|
|
267
|
+
import { QChannel } from './QChannel.mjs';
|