yummies 5.3.1 → 5.4.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/dist/async.cjs +70 -0
- package/dist/async.d.ts +28 -0
- package/dist/async.d.ts.map +1 -0
- package/dist/common.cjs +18 -0
- package/dist/common.d.cts +15 -0
- package/dist/common.d.cts.map +1 -0
- package/{common.d.ts → dist/common.d.ts} +1 -1
- package/dist/common.d.ts.map +1 -0
- package/dist/complex/counter.cjs +21 -0
- package/dist/complex/counter.d.ts +15 -0
- package/dist/complex/counter.d.ts.map +1 -0
- package/dist/complex/global-config.cjs +46 -0
- package/dist/complex/global-config.d.cts +11 -0
- package/dist/complex/global-config.d.cts.map +1 -0
- package/{complex → dist/complex}/global-config.d.ts +1 -1
- package/dist/complex/global-config.d.ts.map +1 -0
- package/dist/complex/index.cjs +19 -0
- package/dist/complex/index.d.cts +4 -0
- package/dist/complex/index.d.cts.map +1 -0
- package/dist/complex/index.d.ts +4 -0
- package/dist/complex/index.d.ts.map +1 -0
- package/dist/complex/index.js +3 -0
- package/dist/complex/modules-factory.cjs +50 -0
- package/dist/complex/modules-factory.d.cts +49 -0
- package/dist/complex/modules-factory.d.cts.map +1 -0
- package/{complex → dist/complex}/modules-factory.d.ts +1 -1
- package/dist/complex/modules-factory.d.ts.map +1 -0
- package/dist/cookie.cjs +13 -0
- package/dist/cookie.d.cts +3 -0
- package/dist/cookie.d.cts.map +1 -0
- package/dist/cookie.d.ts +3 -0
- package/{cookie.d.ts.map → dist/cookie.d.ts.map} +1 -1
- package/dist/data.cjs +58 -0
- package/dist/data.d.ts +4 -0
- package/dist/data.d.ts.map +1 -0
- package/dist/date-time.cjs +171 -0
- package/dist/date-time.d.cts +28 -0
- package/dist/date-time.d.cts.map +1 -0
- package/{date-time.d.ts → dist/date-time.d.ts} +1 -1
- package/dist/date-time.d.ts.map +1 -0
- package/{date-time.js → dist/date-time.js} +4 -4
- package/dist/device.cjs +28 -0
- package/dist/device.d.ts +8 -0
- package/dist/device.d.ts.map +1 -0
- package/dist/encodings.cjs +270 -0
- package/dist/encodings.d.ts +2 -0
- package/dist/encodings.d.ts.map +1 -0
- package/dist/errors.cjs +34 -0
- package/dist/errors.d.cts +19 -0
- package/dist/errors.d.cts.map +1 -0
- package/{errors.d.ts → dist/errors.d.ts} +1 -1
- package/dist/errors.d.ts.map +1 -0
- package/{errors.js → dist/errors.js} +1 -1
- package/dist/file.cjs +29 -0
- package/dist/file.d.ts +3 -0
- package/dist/file.d.ts.map +1 -0
- package/dist/format/_exports.cjs +20 -0
- package/dist/format/_exports.d.cts +5 -0
- package/dist/format/_exports.d.cts.map +1 -0
- package/dist/format/_exports.d.ts +5 -0
- package/dist/format/_exports.d.ts.map +1 -0
- package/dist/format/_exports.js +4 -0
- package/dist/format/constants.cjs +6 -0
- package/dist/format/constants.d.ts +4 -0
- package/dist/format/constants.d.ts.map +1 -0
- package/dist/format/index.cjs +40 -0
- package/dist/format/index.d.cts +3 -0
- package/dist/format/index.d.cts.map +1 -0
- package/dist/format/index.d.ts +3 -0
- package/{format → dist/format}/index.d.ts.map +1 -1
- package/{format → dist/format}/index.js +1 -1
- package/dist/format/number.cjs +48 -0
- package/dist/format/number.d.cts +36 -0
- package/dist/format/number.d.cts.map +1 -0
- package/{format → dist/format}/number.d.ts +1 -1
- package/dist/format/number.d.ts.map +1 -0
- package/{format → dist/format}/number.js +3 -3
- package/dist/format/percent.cjs +27 -0
- package/dist/format/percent.d.cts +15 -0
- package/dist/format/percent.d.cts.map +1 -0
- package/{format → dist/format}/percent.d.ts +2 -2
- package/dist/format/percent.d.ts.map +1 -0
- package/{format → dist/format}/percent.js +3 -3
- package/dist/format/skip-spaces.cjs +8 -0
- package/dist/format/skip-spaces.d.ts +5 -0
- package/dist/format/skip-spaces.d.ts.map +1 -0
- package/dist/html.cjs +202 -0
- package/dist/html.d.cts +44 -0
- package/dist/html.d.cts.map +1 -0
- package/{html.d.ts → dist/html.d.ts} +1 -1
- package/dist/html.d.ts.map +1 -0
- package/{html.js → dist/html.js} +1 -1
- package/dist/id.cjs +76 -0
- package/dist/id.d.ts +63 -0
- package/dist/id.d.ts.map +1 -0
- package/dist/imports.cjs +45 -0
- package/dist/imports.d.ts +15 -0
- package/dist/imports.d.ts.map +1 -0
- package/{imports.js → dist/imports.js} +1 -1
- package/dist/math.cjs +23 -0
- package/dist/math.d.cts +13 -0
- package/dist/math.d.cts.map +1 -0
- package/{math.d.ts → dist/math.d.ts} +1 -1
- package/dist/math.d.ts.map +1 -0
- package/dist/media.cjs +115 -0
- package/dist/media.d.ts +20 -0
- package/dist/media.d.ts.map +1 -0
- package/{media.js → dist/media.js} +1 -1
- package/dist/mobx/apply-observable.cjs +16 -0
- package/dist/mobx/apply-observable.d.cts +4 -0
- package/dist/mobx/apply-observable.d.cts.map +1 -0
- package/{mobx → dist/mobx}/apply-observable.d.ts +1 -1
- package/dist/mobx/apply-observable.d.ts.map +1 -0
- package/dist/mobx/create-enhanced-atom.cjs +16 -0
- package/dist/mobx/create-enhanced-atom.d.cts +11 -0
- package/dist/mobx/create-enhanced-atom.d.cts.map +1 -0
- package/{mobx → dist/mobx}/create-enhanced-atom.d.ts +1 -1
- package/dist/mobx/create-enhanced-atom.d.ts.map +1 -0
- package/{mobx → dist/mobx}/create-enhanced-atom.js +2 -2
- package/dist/mobx/deep-observable-struct.cjs +61 -0
- package/dist/mobx/deep-observable-struct.d.cts +7 -0
- package/dist/mobx/deep-observable-struct.d.cts.map +1 -0
- package/{mobx → dist/mobx}/deep-observable-struct.d.ts +1 -1
- package/dist/mobx/deep-observable-struct.d.ts.map +1 -0
- package/{mobx → dist/mobx}/deep-observable-struct.js +1 -1
- package/dist/mobx/get-mobx-administration.cjs +6 -0
- package/dist/mobx/get-mobx-administration.d.cts +6 -0
- package/dist/mobx/get-mobx-administration.d.cts.map +1 -0
- package/{mobx → dist/mobx}/get-mobx-administration.d.ts +1 -1
- package/dist/mobx/get-mobx-administration.d.ts.map +1 -0
- package/dist/mobx/index.cjs +21 -0
- package/dist/mobx/index.d.cts +6 -0
- package/dist/mobx/index.d.cts.map +1 -0
- package/dist/mobx/index.d.ts +6 -0
- package/dist/mobx/index.d.ts.map +1 -0
- package/dist/mobx/index.js +5 -0
- package/dist/mobx/lazy-observe.cjs +47 -0
- package/dist/mobx/lazy-observe.d.ts +8 -0
- package/dist/mobx/lazy-observe.d.ts.map +1 -0
- package/dist/ms.cjs +22 -0
- package/dist/ms.d.ts +19 -0
- package/dist/ms.d.ts.map +1 -0
- package/dist/number.cjs +16 -0
- package/dist/number.d.ts +8 -0
- package/dist/number.d.ts.map +1 -0
- package/dist/parser/_exports.cjs +19 -0
- package/dist/parser/_exports.d.cts +4 -0
- package/dist/parser/_exports.d.cts.map +1 -0
- package/dist/parser/_exports.d.ts +4 -0
- package/dist/parser/_exports.d.ts.map +1 -0
- package/dist/parser/_exports.js +3 -0
- package/dist/parser/index.cjs +40 -0
- package/dist/parser/index.d.cts +3 -0
- package/dist/parser/index.d.cts.map +1 -0
- package/dist/parser/index.d.ts +3 -0
- package/{parser → dist/parser}/index.d.ts.map +1 -1
- package/{parser → dist/parser}/index.js +1 -1
- package/dist/parser/number.cjs +48 -0
- package/dist/parser/number.d.cts +21 -0
- package/dist/parser/number.d.cts.map +1 -0
- package/{parser → dist/parser}/number.d.ts +1 -1
- package/dist/parser/number.d.ts.map +1 -0
- package/{parser → dist/parser}/number.js +2 -2
- package/dist/parser/percent.cjs +8 -0
- package/dist/parser/percent.d.cts +4 -0
- package/dist/parser/percent.d.cts.map +1 -0
- package/{parser → dist/parser}/percent.d.ts +2 -2
- package/dist/parser/percent.d.ts.map +1 -0
- package/{parser → dist/parser}/percent.js +1 -1
- package/dist/parser/string.cjs +18 -0
- package/dist/parser/string.d.cts +7 -0
- package/dist/parser/string.d.cts.map +1 -0
- package/{parser → dist/parser}/string.d.ts +1 -1
- package/dist/parser/string.d.ts.map +1 -0
- package/{parser → dist/parser}/string.js +1 -1
- package/dist/price.cjs +21 -0
- package/dist/price.d.ts +6 -0
- package/dist/price.d.ts.map +1 -0
- package/dist/random.cjs +25 -0
- package/dist/random.d.ts +9 -0
- package/dist/random.d.ts.map +1 -0
- package/dist/react/hooks/index.cjs +37 -0
- package/dist/react/hooks/index.d.cts +22 -0
- package/dist/react/hooks/index.d.cts.map +1 -0
- package/dist/react/hooks/index.d.ts +22 -0
- package/dist/react/hooks/index.d.ts.map +1 -0
- package/dist/react/hooks/index.js +21 -0
- package/dist/react/hooks/use-abort-controller.cjs +15 -0
- package/dist/react/hooks/use-abort-controller.d.ts +2 -0
- package/dist/react/hooks/use-abort-controller.d.ts.map +1 -0
- package/{react → dist/react}/hooks/use-abort-controller.js +1 -1
- package/dist/react/hooks/use-abort-signal.cjs +8 -0
- package/dist/react/hooks/use-abort-signal.d.ts +2 -0
- package/dist/react/hooks/use-abort-signal.d.ts.map +1 -0
- package/{react → dist/react}/hooks/use-abort-signal.js +1 -1
- package/dist/react/hooks/use-click-outside.cjs +17 -0
- package/dist/react/hooks/use-click-outside.d.ts +9 -0
- package/dist/react/hooks/use-click-outside.d.ts.map +1 -0
- package/{react → dist/react}/hooks/use-click-outside.js +1 -1
- package/dist/react/hooks/use-constant.cjs +19 -0
- package/dist/react/hooks/use-constant.d.ts +9 -0
- package/dist/react/hooks/use-constant.d.ts.map +1 -0
- package/dist/react/hooks/use-define-ref.cjs +19 -0
- package/dist/react/hooks/use-define-ref.d.ts +10 -0
- package/dist/react/hooks/use-define-ref.d.ts.map +1 -0
- package/dist/react/hooks/use-element-ref.cjs +12 -0
- package/dist/react/hooks/use-element-ref.d.ts +2 -0
- package/dist/react/hooks/use-element-ref.d.ts.map +1 -0
- package/dist/react/hooks/use-event-listener.cjs +17 -0
- package/dist/react/hooks/use-event-listener.d.ts +8 -0
- package/dist/react/hooks/use-event-listener.d.ts.map +1 -0
- package/{react → dist/react}/hooks/use-event-listener.js +1 -1
- package/dist/react/hooks/use-event.cjs +23 -0
- package/dist/react/hooks/use-event.d.cts +3 -0
- package/dist/react/hooks/use-event.d.cts.map +1 -0
- package/dist/react/hooks/use-event.d.ts +3 -0
- package/{react → dist/react}/hooks/use-event.d.ts.map +1 -1
- package/dist/react/hooks/use-flag.cjs +19 -0
- package/dist/react/hooks/use-flag.d.ts +8 -0
- package/dist/react/hooks/use-flag.d.ts.map +1 -0
- package/dist/react/hooks/use-force-update.cjs +11 -0
- package/dist/react/hooks/use-force-update.d.ts +2 -0
- package/dist/react/hooks/use-force-update.d.ts.map +1 -0
- package/dist/react/hooks/use-initial-height.cjs +15 -0
- package/dist/react/hooks/use-initial-height.d.ts +5 -0
- package/dist/react/hooks/use-initial-height.d.ts.map +1 -0
- package/dist/react/hooks/use-instance.cjs +31 -0
- package/dist/react/hooks/use-instance.d.ts +27 -0
- package/dist/react/hooks/use-instance.d.ts.map +1 -0
- package/{react → dist/react}/hooks/use-instance.js +2 -2
- package/dist/react/hooks/use-intersection-observer.cjs +14 -0
- package/dist/react/hooks/use-intersection-observer.d.ts +2 -0
- package/dist/react/hooks/use-intersection-observer.d.ts.map +1 -0
- package/dist/react/hooks/use-last-defined-value.cjs +12 -0
- package/dist/react/hooks/use-last-defined-value.d.ts +2 -0
- package/dist/react/hooks/use-last-defined-value.d.ts.map +1 -0
- package/dist/react/hooks/use-last-value-ref.cjs +12 -0
- package/dist/react/hooks/use-last-value-ref.d.ts +2 -0
- package/dist/react/hooks/use-last-value-ref.d.ts.map +1 -0
- package/dist/react/hooks/use-life-cycle.cjs +14 -0
- package/dist/react/hooks/use-life-cycle.d.ts +5 -0
- package/dist/react/hooks/use-life-cycle.d.ts.map +1 -0
- package/{react → dist/react}/hooks/use-life-cycle.js +1 -1
- package/dist/react/hooks/use-resize-observer.cjs +15 -0
- package/dist/react/hooks/use-resize-observer.d.ts +2 -0
- package/dist/react/hooks/use-resize-observer.d.ts.map +1 -0
- package/{react → dist/react}/hooks/use-resize-observer.js +1 -1
- package/dist/react/hooks/use-sync-ref.cjs +10 -0
- package/dist/react/hooks/use-sync-ref.d.ts +2 -0
- package/dist/react/hooks/use-sync-ref.d.ts.map +1 -0
- package/dist/react/hooks/use-toggle.cjs +10 -0
- package/dist/react/hooks/use-toggle.d.ts +2 -0
- package/dist/react/hooks/use-toggle.d.ts.map +1 -0
- package/dist/react/hooks/use-value.cjs +12 -0
- package/dist/react/hooks/use-value.d.ts +5 -0
- package/dist/react/hooks/use-value.d.ts.map +1 -0
- package/dist/react/hooks/use-visibility-state.cjs +18 -0
- package/dist/react/hooks/use-visibility-state.d.ts +2 -0
- package/dist/react/hooks/use-visibility-state.d.ts.map +1 -0
- package/dist/react/index.cjs +17 -0
- package/dist/react/index.d.cts +2 -0
- package/dist/react/index.d.cts.map +1 -0
- package/dist/react/index.d.ts +2 -0
- package/dist/react/index.d.ts.map +1 -0
- package/dist/react/index.js +1 -0
- package/dist/sound.cjs +16 -0
- package/dist/sound.d.ts +7 -0
- package/dist/sound.d.ts.map +1 -0
- package/dist/storage.cjs +48 -0
- package/dist/storage.d.ts +39 -0
- package/dist/storage.d.ts.map +1 -0
- package/dist/text.cjs +53 -0
- package/dist/text.d.ts +15 -0
- package/dist/text.d.ts.map +1 -0
- package/dist/type-guard/_exports.cjs +129 -0
- package/dist/type-guard/_exports.d.cts +86 -0
- package/dist/type-guard/_exports.d.cts.map +1 -0
- package/{type-guard → dist/type-guard}/_exports.d.ts +1 -1
- package/dist/type-guard/_exports.d.ts.map +1 -0
- package/dist/type-guard/index.cjs +40 -0
- package/dist/type-guard/index.d.cts +3 -0
- package/dist/type-guard/index.d.cts.map +1 -0
- package/dist/type-guard/index.d.ts +3 -0
- package/{type-guard → dist/type-guard}/index.d.ts.map +1 -1
- package/{type-guard → dist/type-guard}/index.js +1 -1
- package/dist/utils/types.cjs +2 -0
- package/dist/utils/types.d.ts +395 -0
- package/dist/utils/types.d.ts.map +1 -0
- package/dist/vibrate.cjs +12 -0
- package/dist/vibrate.d.ts +5 -0
- package/dist/vibrate.d.ts.map +1 -0
- package/package.json +149 -356
- package/assets/logo.png +0 -0
- package/assets/logo.pxz +0 -0
- package/common.d.ts.map +0 -1
- package/complex/global-config.d.ts.map +0 -1
- package/complex/index.d.ts +0 -4
- package/complex/index.d.ts.map +0 -1
- package/complex/index.js +0 -3
- package/complex/modules-factory.d.ts.map +0 -1
- package/cookie.d.ts +0 -3
- package/css.d.ts +0 -36
- package/css.d.ts.map +0 -1
- package/css.js +0 -20
- package/date-time.d.ts.map +0 -1
- package/errors.d.ts.map +0 -1
- package/format/_exports.d.ts +0 -5
- package/format/_exports.d.ts.map +0 -1
- package/format/_exports.js +0 -4
- package/format/index.d.ts +0 -3
- package/format/number.d.ts.map +0 -1
- package/format/percent.d.ts.map +0 -1
- package/html.d.ts.map +0 -1
- package/math.d.ts.map +0 -1
- package/mobx/apply-observable.d.ts.map +0 -1
- package/mobx/create-enhanced-atom.d.ts.map +0 -1
- package/mobx/deep-observable-struct.d.ts.map +0 -1
- package/mobx/get-mobx-administration.d.ts.map +0 -1
- package/mobx/index.d.ts +0 -6
- package/mobx/index.d.ts.map +0 -1
- package/mobx/index.js +0 -5
- package/parser/_exports.d.ts +0 -4
- package/parser/_exports.d.ts.map +0 -1
- package/parser/_exports.js +0 -3
- package/parser/index.d.ts +0 -3
- package/parser/number.d.ts.map +0 -1
- package/parser/percent.d.ts.map +0 -1
- package/parser/string.d.ts.map +0 -1
- package/react/hooks/index.d.ts +0 -22
- package/react/hooks/index.d.ts.map +0 -1
- package/react/hooks/index.js +0 -21
- package/react/hooks/use-event.d.ts +0 -3
- package/react/index.d.ts +0 -2
- package/react/index.d.ts.map +0 -1
- package/react/index.js +0 -1
- package/type-guard/_exports.d.ts.map +0 -1
- package/type-guard/index.d.ts +0 -3
- /package/{async.d.ts → dist/async.d.cts} +0 -0
- /package/{async.d.ts.map → dist/async.d.cts.map} +0 -0
- /package/{async.js → dist/async.js} +0 -0
- /package/{common.js → dist/common.js} +0 -0
- /package/{complex/counter.d.ts → dist/complex/counter.d.cts} +0 -0
- /package/{complex/counter.d.ts.map → dist/complex/counter.d.cts.map} +0 -0
- /package/{complex → dist/complex}/counter.js +0 -0
- /package/{complex → dist/complex}/global-config.js +0 -0
- /package/{complex → dist/complex}/modules-factory.js +0 -0
- /package/{cookie.js → dist/cookie.js} +0 -0
- /package/{data.d.ts → dist/data.d.cts} +0 -0
- /package/{data.d.ts.map → dist/data.d.cts.map} +0 -0
- /package/{data.js → dist/data.js} +0 -0
- /package/{device.d.ts → dist/device.d.cts} +0 -0
- /package/{device.d.ts.map → dist/device.d.cts.map} +0 -0
- /package/{device.js → dist/device.js} +0 -0
- /package/{encodings.d.ts → dist/encodings.d.cts} +0 -0
- /package/{encodings.d.ts.map → dist/encodings.d.cts.map} +0 -0
- /package/{encodings.js → dist/encodings.js} +0 -0
- /package/{file.d.ts → dist/file.d.cts} +0 -0
- /package/{file.d.ts.map → dist/file.d.cts.map} +0 -0
- /package/{file.js → dist/file.js} +0 -0
- /package/{format/constants.d.ts → dist/format/constants.d.cts} +0 -0
- /package/{format/constants.d.ts.map → dist/format/constants.d.cts.map} +0 -0
- /package/{format → dist/format}/constants.js +0 -0
- /package/{format/skip-spaces.d.ts → dist/format/skip-spaces.d.cts} +0 -0
- /package/{format/skip-spaces.d.ts.map → dist/format/skip-spaces.d.cts.map} +0 -0
- /package/{format → dist/format}/skip-spaces.js +0 -0
- /package/{id.d.ts → dist/id.d.cts} +0 -0
- /package/{id.d.ts.map → dist/id.d.cts.map} +0 -0
- /package/{id.js → dist/id.js} +0 -0
- /package/{imports.d.ts → dist/imports.d.cts} +0 -0
- /package/{imports.d.ts.map → dist/imports.d.cts.map} +0 -0
- /package/{math.js → dist/math.js} +0 -0
- /package/{media.d.ts → dist/media.d.cts} +0 -0
- /package/{media.d.ts.map → dist/media.d.cts.map} +0 -0
- /package/{mobx → dist/mobx}/apply-observable.js +0 -0
- /package/{mobx → dist/mobx}/get-mobx-administration.js +0 -0
- /package/{mobx/lazy-observe.d.ts → dist/mobx/lazy-observe.d.cts} +0 -0
- /package/{mobx/lazy-observe.d.ts.map → dist/mobx/lazy-observe.d.cts.map} +0 -0
- /package/{mobx → dist/mobx}/lazy-observe.js +0 -0
- /package/{ms.d.ts → dist/ms.d.cts} +0 -0
- /package/{ms.d.ts.map → dist/ms.d.cts.map} +0 -0
- /package/{ms.js → dist/ms.js} +0 -0
- /package/{number.d.ts → dist/number.d.cts} +0 -0
- /package/{number.d.ts.map → dist/number.d.cts.map} +0 -0
- /package/{number.js → dist/number.js} +0 -0
- /package/{price.d.ts → dist/price.d.cts} +0 -0
- /package/{price.d.ts.map → dist/price.d.cts.map} +0 -0
- /package/{price.js → dist/price.js} +0 -0
- /package/{random.d.ts → dist/random.d.cts} +0 -0
- /package/{random.d.ts.map → dist/random.d.cts.map} +0 -0
- /package/{random.js → dist/random.js} +0 -0
- /package/{react/hooks/use-abort-controller.d.ts → dist/react/hooks/use-abort-controller.d.cts} +0 -0
- /package/{react/hooks/use-abort-controller.d.ts.map → dist/react/hooks/use-abort-controller.d.cts.map} +0 -0
- /package/{react/hooks/use-abort-signal.d.ts → dist/react/hooks/use-abort-signal.d.cts} +0 -0
- /package/{react/hooks/use-abort-signal.d.ts.map → dist/react/hooks/use-abort-signal.d.cts.map} +0 -0
- /package/{react/hooks/use-click-outside.d.ts → dist/react/hooks/use-click-outside.d.cts} +0 -0
- /package/{react/hooks/use-click-outside.d.ts.map → dist/react/hooks/use-click-outside.d.cts.map} +0 -0
- /package/{react/hooks/use-constant.d.ts → dist/react/hooks/use-constant.d.cts} +0 -0
- /package/{react/hooks/use-constant.d.ts.map → dist/react/hooks/use-constant.d.cts.map} +0 -0
- /package/{react → dist/react}/hooks/use-constant.js +0 -0
- /package/{react/hooks/use-define-ref.d.ts → dist/react/hooks/use-define-ref.d.cts} +0 -0
- /package/{react/hooks/use-define-ref.d.ts.map → dist/react/hooks/use-define-ref.d.cts.map} +0 -0
- /package/{react → dist/react}/hooks/use-define-ref.js +0 -0
- /package/{react/hooks/use-element-ref.d.ts → dist/react/hooks/use-element-ref.d.cts} +0 -0
- /package/{react/hooks/use-element-ref.d.ts.map → dist/react/hooks/use-element-ref.d.cts.map} +0 -0
- /package/{react → dist/react}/hooks/use-element-ref.js +0 -0
- /package/{react/hooks/use-event-listener.d.ts → dist/react/hooks/use-event-listener.d.cts} +0 -0
- /package/{react/hooks/use-event-listener.d.ts.map → dist/react/hooks/use-event-listener.d.cts.map} +0 -0
- /package/{react → dist/react}/hooks/use-event.js +0 -0
- /package/{react/hooks/use-flag.d.ts → dist/react/hooks/use-flag.d.cts} +0 -0
- /package/{react/hooks/use-flag.d.ts.map → dist/react/hooks/use-flag.d.cts.map} +0 -0
- /package/{react → dist/react}/hooks/use-flag.js +0 -0
- /package/{react/hooks/use-force-update.d.ts → dist/react/hooks/use-force-update.d.cts} +0 -0
- /package/{react/hooks/use-force-update.d.ts.map → dist/react/hooks/use-force-update.d.cts.map} +0 -0
- /package/{react → dist/react}/hooks/use-force-update.js +0 -0
- /package/{react/hooks/use-initial-height.d.ts → dist/react/hooks/use-initial-height.d.cts} +0 -0
- /package/{react/hooks/use-initial-height.d.ts.map → dist/react/hooks/use-initial-height.d.cts.map} +0 -0
- /package/{react → dist/react}/hooks/use-initial-height.js +0 -0
- /package/{react/hooks/use-instance.d.ts → dist/react/hooks/use-instance.d.cts} +0 -0
- /package/{react/hooks/use-instance.d.ts.map → dist/react/hooks/use-instance.d.cts.map} +0 -0
- /package/{react/hooks/use-intersection-observer.d.ts → dist/react/hooks/use-intersection-observer.d.cts} +0 -0
- /package/{react/hooks/use-intersection-observer.d.ts.map → dist/react/hooks/use-intersection-observer.d.cts.map} +0 -0
- /package/{react → dist/react}/hooks/use-intersection-observer.js +0 -0
- /package/{react/hooks/use-last-defined-value.d.ts → dist/react/hooks/use-last-defined-value.d.cts} +0 -0
- /package/{react/hooks/use-last-defined-value.d.ts.map → dist/react/hooks/use-last-defined-value.d.cts.map} +0 -0
- /package/{react → dist/react}/hooks/use-last-defined-value.js +0 -0
- /package/{react/hooks/use-last-value-ref.d.ts → dist/react/hooks/use-last-value-ref.d.cts} +0 -0
- /package/{react/hooks/use-last-value-ref.d.ts.map → dist/react/hooks/use-last-value-ref.d.cts.map} +0 -0
- /package/{react → dist/react}/hooks/use-last-value-ref.js +0 -0
- /package/{react/hooks/use-life-cycle.d.ts → dist/react/hooks/use-life-cycle.d.cts} +0 -0
- /package/{react/hooks/use-life-cycle.d.ts.map → dist/react/hooks/use-life-cycle.d.cts.map} +0 -0
- /package/{react/hooks/use-resize-observer.d.ts → dist/react/hooks/use-resize-observer.d.cts} +0 -0
- /package/{react/hooks/use-resize-observer.d.ts.map → dist/react/hooks/use-resize-observer.d.cts.map} +0 -0
- /package/{react/hooks/use-sync-ref.d.ts → dist/react/hooks/use-sync-ref.d.cts} +0 -0
- /package/{react/hooks/use-sync-ref.d.ts.map → dist/react/hooks/use-sync-ref.d.cts.map} +0 -0
- /package/{react → dist/react}/hooks/use-sync-ref.js +0 -0
- /package/{react/hooks/use-toggle.d.ts → dist/react/hooks/use-toggle.d.cts} +0 -0
- /package/{react/hooks/use-toggle.d.ts.map → dist/react/hooks/use-toggle.d.cts.map} +0 -0
- /package/{react → dist/react}/hooks/use-toggle.js +0 -0
- /package/{react/hooks/use-value.d.ts → dist/react/hooks/use-value.d.cts} +0 -0
- /package/{react/hooks/use-value.d.ts.map → dist/react/hooks/use-value.d.cts.map} +0 -0
- /package/{react → dist/react}/hooks/use-value.js +0 -0
- /package/{react/hooks/use-visibility-state.d.ts → dist/react/hooks/use-visibility-state.d.cts} +0 -0
- /package/{react/hooks/use-visibility-state.d.ts.map → dist/react/hooks/use-visibility-state.d.cts.map} +0 -0
- /package/{react → dist/react}/hooks/use-visibility-state.js +0 -0
- /package/{sound.d.ts → dist/sound.d.cts} +0 -0
- /package/{sound.d.ts.map → dist/sound.d.cts.map} +0 -0
- /package/{sound.js → dist/sound.js} +0 -0
- /package/{storage.d.ts → dist/storage.d.cts} +0 -0
- /package/{storage.d.ts.map → dist/storage.d.cts.map} +0 -0
- /package/{storage.js → dist/storage.js} +0 -0
- /package/{text.d.ts → dist/text.d.cts} +0 -0
- /package/{text.d.ts.map → dist/text.d.cts.map} +0 -0
- /package/{text.js → dist/text.js} +0 -0
- /package/{type-guard → dist/type-guard}/_exports.js +0 -0
- /package/{utility-types.d.ts → dist/utility-types.d.ts} +0 -0
- /package/{utils/types.d.ts → dist/utils/types.d.cts} +0 -0
- /package/{utils/types.d.ts.map → dist/utils/types.d.cts.map} +0 -0
- /package/{utils → dist/utils}/types.js +0 -0
- /package/{vibrate.d.ts → dist/vibrate.d.cts} +0 -0
- /package/{vibrate.d.ts.map → dist/vibrate.d.cts.map} +0 -0
- /package/{vibrate.js → dist/vibrate.js} +0 -0
package/dist/async.cjs
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.endlessRAF = exports.waitAsync = exports.sleep = void 0;
|
|
4
|
+
exports.setAbortableTimeout = setAbortableTimeout;
|
|
5
|
+
exports.setAbortableInterval = setAbortableInterval;
|
|
6
|
+
/**
|
|
7
|
+
* Создает промис, который будет ждать указанное количество ms, чтобы выполниться
|
|
8
|
+
*
|
|
9
|
+
* @param ms значение в миллисекундах
|
|
10
|
+
* @returns Promise
|
|
11
|
+
*/
|
|
12
|
+
const sleep = (time = 0) => new Promise((resolve) => setTimeout(resolve, time));
|
|
13
|
+
exports.sleep = sleep;
|
|
14
|
+
/**
|
|
15
|
+
* Создает промис, который будет ждать указанное количество ms, чтобы выполниться
|
|
16
|
+
*
|
|
17
|
+
* @deprecated используй {sleep}
|
|
18
|
+
* @param ms значение в миллисекундах
|
|
19
|
+
* @returns Promise
|
|
20
|
+
*/
|
|
21
|
+
const waitAsync = async (ms = 1000) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
22
|
+
exports.waitAsync = waitAsync;
|
|
23
|
+
/**
|
|
24
|
+
* Создает вызов requestAnimationFrame, посылая туда фукнцию {quitFn}, если она возвращает true,
|
|
25
|
+
* тогда повторно не будет создан вызов requestAnimationFrame, иначе будут создаваться повторно
|
|
26
|
+
* вызовы requestAnimationFrame до тем пор, пока эта функция не вернёт true
|
|
27
|
+
*
|
|
28
|
+
* @param quitFn - сама фукнция которая исполнится в requestAnimationFrame
|
|
29
|
+
* @param asMicrotask - дополнительно оборачивает RAF в queueMicrotask
|
|
30
|
+
* @returns void
|
|
31
|
+
*/
|
|
32
|
+
const endlessRAF = (quitFunction, asMicrotask) => {
|
|
33
|
+
if (quitFunction())
|
|
34
|
+
return;
|
|
35
|
+
const raf = () => requestAnimationFrame(() => (0, exports.endlessRAF)(quitFunction, asMicrotask));
|
|
36
|
+
if (asMicrotask) {
|
|
37
|
+
queueMicrotask(raf);
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
raf();
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
exports.endlessRAF = endlessRAF;
|
|
44
|
+
function setAbortableTimeout(callback, delayInMs, signal) {
|
|
45
|
+
let internalTimer = null;
|
|
46
|
+
const handleAbort = () => {
|
|
47
|
+
if (internalTimer == null) {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
clearTimeout(internalTimer);
|
|
51
|
+
internalTimer = null;
|
|
52
|
+
};
|
|
53
|
+
signal?.addEventListener('abort', handleAbort, { once: true });
|
|
54
|
+
internalTimer = setTimeout(() => {
|
|
55
|
+
signal?.removeEventListener('abort', handleAbort);
|
|
56
|
+
callback();
|
|
57
|
+
}, delayInMs);
|
|
58
|
+
}
|
|
59
|
+
function setAbortableInterval(callback, delayInMs, signal) {
|
|
60
|
+
let timer = null;
|
|
61
|
+
const handleAbort = () => {
|
|
62
|
+
if (timer == null) {
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
clearInterval(timer);
|
|
66
|
+
timer = null;
|
|
67
|
+
};
|
|
68
|
+
signal?.addEventListener('abort', handleAbort, { once: true });
|
|
69
|
+
timer = setInterval(callback, delayInMs);
|
|
70
|
+
}
|
package/dist/async.d.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Создает промис, который будет ждать указанное количество ms, чтобы выполниться
|
|
3
|
+
*
|
|
4
|
+
* @param ms значение в миллисекундах
|
|
5
|
+
* @returns Promise
|
|
6
|
+
*/
|
|
7
|
+
export declare const sleep: (time?: number) => Promise<unknown>;
|
|
8
|
+
/**
|
|
9
|
+
* Создает промис, который будет ждать указанное количество ms, чтобы выполниться
|
|
10
|
+
*
|
|
11
|
+
* @deprecated используй {sleep}
|
|
12
|
+
* @param ms значение в миллисекундах
|
|
13
|
+
* @returns Promise
|
|
14
|
+
*/
|
|
15
|
+
export declare const waitAsync: (ms?: number) => Promise<unknown>;
|
|
16
|
+
/**
|
|
17
|
+
* Создает вызов requestAnimationFrame, посылая туда фукнцию {quitFn}, если она возвращает true,
|
|
18
|
+
* тогда повторно не будет создан вызов requestAnimationFrame, иначе будут создаваться повторно
|
|
19
|
+
* вызовы requestAnimationFrame до тем пор, пока эта функция не вернёт true
|
|
20
|
+
*
|
|
21
|
+
* @param quitFn - сама фукнция которая исполнится в requestAnimationFrame
|
|
22
|
+
* @param asMicrotask - дополнительно оборачивает RAF в queueMicrotask
|
|
23
|
+
* @returns void
|
|
24
|
+
*/
|
|
25
|
+
export declare const endlessRAF: (quitFunction: () => boolean | void, asMicrotask?: boolean) => void;
|
|
26
|
+
export declare function setAbortableTimeout(callback: VoidFunction, delayInMs?: number, signal?: AbortSignal): void;
|
|
27
|
+
export declare function setAbortableInterval(callback: VoidFunction, delayInMs?: number, signal?: AbortSignal): void;
|
|
28
|
+
//# sourceMappingURL=async.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"async.d.ts","sourceRoot":"","sources":["../src/async.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,KAAK,GAAI,OAAM,MAAU,qBACe,CAAC;AAEtD;;;;;;GAMG;AACH,eAAO,MAAM,SAAS,GAAU,WAAS,qBACU,CAAC;AAEpD;;;;;;;;GAQG;AACH,eAAO,MAAM,UAAU,GACrB,cAAc,MAAM,OAAO,GAAG,IAAI,EAClC,cAAc,OAAO,SAYtB,CAAC;AAEF,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,YAAY,EACtB,SAAS,CAAC,EAAE,MAAM,EAClB,MAAM,CAAC,EAAE,WAAW,QAkBrB;AAED,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,YAAY,EACtB,SAAS,CAAC,EAAE,MAAM,EAClB,MAAM,CAAC,EAAE,WAAW,QAerB"}
|
package/dist/common.cjs
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resolveFnValue = exports.callFunction = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Calls the provided function with the given arguments if it is a function;
|
|
6
|
+
* otherwise, returns the value directly.
|
|
7
|
+
*/
|
|
8
|
+
const callFunction = (fn, ...args) => {
|
|
9
|
+
if (typeof fn === 'function') {
|
|
10
|
+
return fn(...args);
|
|
11
|
+
}
|
|
12
|
+
return fn;
|
|
13
|
+
};
|
|
14
|
+
exports.callFunction = callFunction;
|
|
15
|
+
/**
|
|
16
|
+
* @deprecated use {callFunction}
|
|
17
|
+
*/
|
|
18
|
+
exports.resolveFnValue = exports.callFunction;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { MaybeFn } from "./utils/types.cjs";
|
|
2
|
+
/**
|
|
3
|
+
* @deprecated use {MaybeFn} type
|
|
4
|
+
*/
|
|
5
|
+
export type FnValue<TValue, TArgs extends any[] = []> = MaybeFn<TValue, TArgs>;
|
|
6
|
+
/**
|
|
7
|
+
* Calls the provided function with the given arguments if it is a function;
|
|
8
|
+
* otherwise, returns the value directly.
|
|
9
|
+
*/
|
|
10
|
+
export declare const callFunction: <TValue, TArgs extends any[] = []>(fn: MaybeFn<TValue, TArgs>, ...args: TArgs) => TValue;
|
|
11
|
+
/**
|
|
12
|
+
* @deprecated use {callFunction}
|
|
13
|
+
*/
|
|
14
|
+
export declare const resolveFnValue: <TValue, TArgs extends any[] = []>(fn: MaybeFn<TValue, TArgs>, ...args: TArgs) => TValue;
|
|
15
|
+
//# sourceMappingURL=common.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../src/common.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,0BAAyB;AAEhD;;GAEG;AACH,MAAM,MAAM,OAAO,CAAC,MAAM,EAAE,KAAK,SAAS,GAAG,EAAE,GAAG,EAAE,IAAI,OAAO,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AAE/E;;;GAGG;AACH,eAAO,MAAM,YAAY,GAAI,MAAM,EAAE,KAAK,SAAS,GAAG,EAAE,GAAG,EAAE,EAC3D,IAAI,OAAO,CAAC,MAAM,EAAE,KAAK,CAAC,EAC1B,GAAG,MAAM,KAAK,WAOf,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,cAAc,GAdE,MAAM,EAAE,KAAK,SAAS,GAAG,EAAE,WAClD,OAAO,CAAC,MAAM,EAAE,KAAK,CAAC,WACjB,KAAK,WAY0B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../src/common.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,yBAAyB;AAEhD;;GAEG;AACH,MAAM,MAAM,OAAO,CAAC,MAAM,EAAE,KAAK,SAAS,GAAG,EAAE,GAAG,EAAE,IAAI,OAAO,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AAE/E;;;GAGG;AACH,eAAO,MAAM,YAAY,GAAI,MAAM,EAAE,KAAK,SAAS,GAAG,EAAE,GAAG,EAAE,EAC3D,IAAI,OAAO,CAAC,MAAM,EAAE,KAAK,CAAC,EAC1B,GAAG,MAAM,KAAK,WAOf,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,cAAc,GAdE,MAAM,EAAE,KAAK,SAAS,GAAG,EAAE,WAClD,OAAO,CAAC,MAAM,EAAE,KAAK,CAAC,WACjB,KAAK,WAY0B,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createCounter = void 0;
|
|
4
|
+
const createCounter = (processValue, initial = 0) => {
|
|
5
|
+
const update = (counter) => {
|
|
6
|
+
fn.value = processValue?.(counter) ?? counter;
|
|
7
|
+
return fn.value;
|
|
8
|
+
};
|
|
9
|
+
const increment = () => update(++fn.counter);
|
|
10
|
+
const decrement = () => update(--fn.counter);
|
|
11
|
+
const fn = increment;
|
|
12
|
+
fn.increment = increment;
|
|
13
|
+
fn.decrement = decrement;
|
|
14
|
+
fn.reset = () => {
|
|
15
|
+
fn.counter = initial;
|
|
16
|
+
fn.value = processValue?.(initial) ?? initial;
|
|
17
|
+
};
|
|
18
|
+
fn.reset();
|
|
19
|
+
return fn;
|
|
20
|
+
};
|
|
21
|
+
exports.createCounter = createCounter;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface Counter<TValue = number> {
|
|
2
|
+
(): TValue;
|
|
3
|
+
counter: number;
|
|
4
|
+
value: TValue;
|
|
5
|
+
increment(): TValue;
|
|
6
|
+
decrement(): TValue;
|
|
7
|
+
reset(): void;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* @deprecated use {`Counter`}. Will be removed in next major release
|
|
11
|
+
*/
|
|
12
|
+
export interface CounterFn<TValue = number> extends Counter<TValue> {
|
|
13
|
+
}
|
|
14
|
+
export declare const createCounter: <TValue = number>(processValue?: (value: number) => TValue, initial?: number) => Counter<TValue>;
|
|
15
|
+
//# sourceMappingURL=counter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"counter.d.ts","sourceRoot":"","sources":["../../src/complex/counter.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,OAAO,CAAC,MAAM,GAAG,MAAM;IACtC,IAAI,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,IAAI,MAAM,CAAC;IACpB,SAAS,IAAI,MAAM,CAAC;IACpB,KAAK,IAAI,IAAI,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,SAAS,CAAC,MAAM,GAAG,MAAM,CAAE,SAAQ,OAAO,CAAC,MAAM,CAAC;CAAG;AAEtE,eAAO,MAAM,aAAa,GAAI,MAAM,GAAG,MAAM,EAC3C,eAAe,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,EACxC,UAAS,MAAU,KAClB,OAAO,CAAC,MAAM,CAsBhB,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createGlobalDynamicConfig = exports.createGlobalConfig = void 0;
|
|
4
|
+
const createGlobalPoint = (accessSymbol) => {
|
|
5
|
+
if (accessSymbol == null) {
|
|
6
|
+
let storedValue;
|
|
7
|
+
return {
|
|
8
|
+
get: () => storedValue,
|
|
9
|
+
set: (value) => {
|
|
10
|
+
storedValue = value;
|
|
11
|
+
return value;
|
|
12
|
+
},
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
const _globalThis = globalThis;
|
|
16
|
+
return {
|
|
17
|
+
get: () => _globalThis[accessSymbol],
|
|
18
|
+
set: (value) => {
|
|
19
|
+
_globalThis[accessSymbol] = value;
|
|
20
|
+
return value;
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Создает глобальный конфиг, который может быть доступен в любой точке в коде
|
|
26
|
+
*/
|
|
27
|
+
const createGlobalConfig = (defaultValue, accessSymbol) => {
|
|
28
|
+
const globalPoint = createGlobalPoint(accessSymbol);
|
|
29
|
+
return globalPoint.get() || globalPoint.set(defaultValue);
|
|
30
|
+
};
|
|
31
|
+
exports.createGlobalConfig = createGlobalConfig;
|
|
32
|
+
const createGlobalDynamicConfig = (processFn, accessSymbol) => {
|
|
33
|
+
const globalPoint = createGlobalPoint(accessSymbol);
|
|
34
|
+
const getValue = () => {
|
|
35
|
+
return globalPoint.get() ?? globalPoint.set(processFn(null, null));
|
|
36
|
+
};
|
|
37
|
+
return {
|
|
38
|
+
get: getValue,
|
|
39
|
+
set: globalPoint.set,
|
|
40
|
+
update: (value) => {
|
|
41
|
+
const currentValue = getValue();
|
|
42
|
+
Object.assign(currentValue, processFn(value, currentValue));
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
exports.createGlobalDynamicConfig = createGlobalDynamicConfig;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { AnyObject, Maybe } from "../utils/types.cjs";
|
|
2
|
+
/**
|
|
3
|
+
* Создает глобальный конфиг, который может быть доступен в любой точке в коде
|
|
4
|
+
*/
|
|
5
|
+
export declare const createGlobalConfig: <T extends AnyObject>(defaultValue: T, accessSymbol?: keyof any) => T;
|
|
6
|
+
export declare const createGlobalDynamicConfig: <T extends AnyObject>(processFn: (change: Maybe<Partial<T>>, current: Maybe<T>) => T, accessSymbol?: keyof any) => {
|
|
7
|
+
get: () => T;
|
|
8
|
+
set: (value: T | null | undefined) => T | null | undefined;
|
|
9
|
+
update: (value: Partial<T>) => void;
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=global-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"global-config.d.ts","sourceRoot":"","sources":["../../src/complex/global-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,2BAA0B;AAyB1D;;GAEG;AACH,eAAO,MAAM,kBAAkB,GAAI,CAAC,SAAS,SAAS,EACpD,cAAc,CAAC,EACf,eAAe,MAAM,GAAG,MAIzB,CAAC;AAEF,eAAO,MAAM,yBAAyB,GAAI,CAAC,SAAS,SAAS,EAC3D,WAAW,CAAC,MAAM,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,EAC9D,eAAe,MAAM,GAAG;;;oBAWN,OAAO,CAAC,CAAC,CAAC;CAK7B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"global-config.d.ts","sourceRoot":"","sources":["../../src/complex/global-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,0BAA0B;AAyB1D;;GAEG;AACH,eAAO,MAAM,kBAAkB,GAAI,CAAC,SAAS,SAAS,EACpD,cAAc,CAAC,EACf,eAAe,MAAM,GAAG,MAIzB,CAAC;AAEF,eAAO,MAAM,yBAAyB,GAAI,CAAC,SAAS,SAAS,EAC3D,WAAW,CAAC,MAAM,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,EAC9D,eAAe,MAAM,GAAG;;;oBAWN,OAAO,CAAC,CAAC,CAAC;CAK7B,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./counter.cjs"), exports);
|
|
18
|
+
__exportStar(require("./global-config.cjs"), exports);
|
|
19
|
+
__exportStar(require("./modules-factory.cjs"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/complex/index.ts"],"names":[],"mappings":"AAAA,8BAA6B;AAC7B,oCAAmC;AACnC,sCAAqC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/complex/index.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,mCAAmC;AACnC,qCAAqC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ModulesFactory = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Класс `ModulesFactory` является универсальной фабрикой для создания экземпляров указанного класса с зависимостями.
|
|
6
|
+
* Он использует объект конфигурации для определения того, как эти экземпляры создаются.
|
|
7
|
+
*
|
|
8
|
+
* Важное примечание - эта сущность работает только с классами конструктор которых имеет один параметр
|
|
9
|
+
*
|
|
10
|
+
* @template TPredefinedDeps - Тип, расширяющий `AnyObject`, представляющий предопределенные зависимости, которые использует фабрика.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```
|
|
14
|
+
* const factory = new ModulesFactory({
|
|
15
|
+
* factory: (MyClass, deps) => new MyClass(deps),
|
|
16
|
+
* deps: { someDependency: new Dependency() }
|
|
17
|
+
* });
|
|
18
|
+
*
|
|
19
|
+
* const instance = factory.create(MyClass, { extraDependency: new ExtraDependency() });
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
class ModulesFactory {
|
|
23
|
+
config;
|
|
24
|
+
/**
|
|
25
|
+
* Создает новый экземпляр `ModulesFactory`.
|
|
26
|
+
*
|
|
27
|
+
* @param config - Объект конфигурации для фабрики, включающий функцию фабрики и необязательные зависимости.
|
|
28
|
+
*/
|
|
29
|
+
constructor(config) {
|
|
30
|
+
this.config = config;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Создает экземпляр указанного класса, внедряя необходимые зависимости.
|
|
34
|
+
*
|
|
35
|
+
* @template TInstance - Тип создаваемого экземпляра.
|
|
36
|
+
* @template TDeps - Тип зависимостей, необходимых для экземпляра.
|
|
37
|
+
*
|
|
38
|
+
* @param Constructor - Конструктор класса для создаваемого экземпляра.
|
|
39
|
+
* @param args - Необязательные дополнительные зависимости для объединения с предопределенными зависимостями.
|
|
40
|
+
*
|
|
41
|
+
* @returns Экземпляр указанного класса с внедренными зависимостями.
|
|
42
|
+
*/
|
|
43
|
+
create(Constructor, ...args) {
|
|
44
|
+
return this.config.factory(Constructor, {
|
|
45
|
+
...this.config.deps,
|
|
46
|
+
...args[0],
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
exports.ModulesFactory = ModulesFactory;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { AnyObject, Class, EmptyObject, IsPartial } from "../utils/types.cjs";
|
|
2
|
+
type ModuleLoaderConfig<TPredefinedDeps extends AnyObject = EmptyObject> = {
|
|
3
|
+
factory<TInstance, TDeps extends TPredefinedDeps>(moduleClass: Class<TInstance, [TDeps]>, deps: TDeps): TInstance;
|
|
4
|
+
} & (TPredefinedDeps extends EmptyObject ? {
|
|
5
|
+
deps?: TPredefinedDeps;
|
|
6
|
+
} : {
|
|
7
|
+
deps: TPredefinedDeps;
|
|
8
|
+
});
|
|
9
|
+
/**
|
|
10
|
+
* Класс `ModulesFactory` является универсальной фабрикой для создания экземпляров указанного класса с зависимостями.
|
|
11
|
+
* Он использует объект конфигурации для определения того, как эти экземпляры создаются.
|
|
12
|
+
*
|
|
13
|
+
* Важное примечание - эта сущность работает только с классами конструктор которых имеет один параметр
|
|
14
|
+
*
|
|
15
|
+
* @template TPredefinedDeps - Тип, расширяющий `AnyObject`, представляющий предопределенные зависимости, которые использует фабрика.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```
|
|
19
|
+
* const factory = new ModulesFactory({
|
|
20
|
+
* factory: (MyClass, deps) => new MyClass(deps),
|
|
21
|
+
* deps: { someDependency: new Dependency() }
|
|
22
|
+
* });
|
|
23
|
+
*
|
|
24
|
+
* const instance = factory.create(MyClass, { extraDependency: new ExtraDependency() });
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
export declare class ModulesFactory<TPredefinedDeps extends AnyObject = EmptyObject> {
|
|
28
|
+
private config;
|
|
29
|
+
/**
|
|
30
|
+
* Создает новый экземпляр `ModulesFactory`.
|
|
31
|
+
*
|
|
32
|
+
* @param config - Объект конфигурации для фабрики, включающий функцию фабрики и необязательные зависимости.
|
|
33
|
+
*/
|
|
34
|
+
constructor(config: ModuleLoaderConfig<TPredefinedDeps>);
|
|
35
|
+
/**
|
|
36
|
+
* Создает экземпляр указанного класса, внедряя необходимые зависимости.
|
|
37
|
+
*
|
|
38
|
+
* @template TInstance - Тип создаваемого экземпляра.
|
|
39
|
+
* @template TDeps - Тип зависимостей, необходимых для экземпляра.
|
|
40
|
+
*
|
|
41
|
+
* @param Constructor - Конструктор класса для создаваемого экземпляра.
|
|
42
|
+
* @param args - Необязательные дополнительные зависимости для объединения с предопределенными зависимостями.
|
|
43
|
+
*
|
|
44
|
+
* @returns Экземпляр указанного класса с внедренными зависимостями.
|
|
45
|
+
*/
|
|
46
|
+
create<TInstance, TDeps extends TPredefinedDeps = TPredefinedDeps>(Constructor: Class<TInstance, [TDeps]>, ...args: IsPartial<Omit<TDeps, keyof TPredefinedDeps>> extends true ? [extraDeps?: Omit<TDeps, keyof TPredefinedDeps>] : [extraDeps: Omit<TDeps, keyof TPredefinedDeps>]): TInstance;
|
|
47
|
+
}
|
|
48
|
+
export {};
|
|
49
|
+
//# sourceMappingURL=modules-factory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modules-factory.d.ts","sourceRoot":"","sources":["../../src/complex/modules-factory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,SAAS,EACT,KAAK,EACL,WAAW,EACX,SAAS,EACV,2BAA0B;AAE3B,KAAK,kBAAkB,CAAC,eAAe,SAAS,SAAS,GAAG,WAAW,IAAI;IACzE,OAAO,CAAC,SAAS,EAAE,KAAK,SAAS,eAAe,EAC9C,WAAW,EAAE,KAAK,CAAC,SAAS,EAAE,CAAC,KAAK,CAAC,CAAC,EACtC,IAAI,EAAE,KAAK,GACV,SAAS,CAAC;CACd,GAAG,CAAC,eAAe,SAAS,WAAW,GACpC;IAAE,IAAI,CAAC,EAAE,eAAe,CAAA;CAAE,GAC1B;IAAE,IAAI,EAAE,eAAe,CAAA;CAAE,CAAC,CAAC;AAE/B;;;;;;;;;;;;;;;;;GAiBG;AACH,qBAAa,cAAc,CAAC,eAAe,SAAS,SAAS,GAAG,WAAW;IAM7D,OAAO,CAAC,MAAM;IAL1B;;;;OAIG;gBACiB,MAAM,EAAE,kBAAkB,CAAC,eAAe,CAAC;IAE/D;;;;;;;;;;OAUG;IACH,MAAM,CAAC,SAAS,EAAE,KAAK,SAAS,eAAe,GAAG,eAAe,EAC/D,WAAW,EAAE,KAAK,CAAC,SAAS,EAAE,CAAC,KAAK,CAAC,CAAC,EACtC,GAAG,IAAI,EAAE,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,MAAM,eAAe,CAAC,CAAC,SAAS,IAAI,GAC/D,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC,KAAK,EAAE,MAAM,eAAe,CAAC,CAAC,GAChD,CAAC,SAAS,EAAE,IAAI,CAAC,KAAK,EAAE,MAAM,eAAe,CAAC,CAAC;CAOtD"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AnyObject, Class, EmptyObject, IsPartial } from
|
|
1
|
+
import type { AnyObject, Class, EmptyObject, IsPartial } from "../utils/types.js";
|
|
2
2
|
type ModuleLoaderConfig<TPredefinedDeps extends AnyObject = EmptyObject> = {
|
|
3
3
|
factory<TInstance, TDeps extends TPredefinedDeps>(moduleClass: Class<TInstance, [TDeps]>, deps: TDeps): TInstance;
|
|
4
4
|
} & (TPredefinedDeps extends EmptyObject ? {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modules-factory.d.ts","sourceRoot":"","sources":["../../src/complex/modules-factory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,SAAS,EACT,KAAK,EACL,WAAW,EACX,SAAS,EACV,0BAA0B;AAE3B,KAAK,kBAAkB,CAAC,eAAe,SAAS,SAAS,GAAG,WAAW,IAAI;IACzE,OAAO,CAAC,SAAS,EAAE,KAAK,SAAS,eAAe,EAC9C,WAAW,EAAE,KAAK,CAAC,SAAS,EAAE,CAAC,KAAK,CAAC,CAAC,EACtC,IAAI,EAAE,KAAK,GACV,SAAS,CAAC;CACd,GAAG,CAAC,eAAe,SAAS,WAAW,GACpC;IAAE,IAAI,CAAC,EAAE,eAAe,CAAA;CAAE,GAC1B;IAAE,IAAI,EAAE,eAAe,CAAA;CAAE,CAAC,CAAC;AAE/B;;;;;;;;;;;;;;;;;GAiBG;AACH,qBAAa,cAAc,CAAC,eAAe,SAAS,SAAS,GAAG,WAAW;IAM7D,OAAO,CAAC,MAAM;IAL1B;;;;OAIG;gBACiB,MAAM,EAAE,kBAAkB,CAAC,eAAe,CAAC;IAE/D;;;;;;;;;;OAUG;IACH,MAAM,CAAC,SAAS,EAAE,KAAK,SAAS,eAAe,GAAG,eAAe,EAC/D,WAAW,EAAE,KAAK,CAAC,SAAS,EAAE,CAAC,KAAK,CAAC,CAAC,EACtC,GAAG,IAAI,EAAE,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,MAAM,eAAe,CAAC,CAAC,SAAS,IAAI,GAC/D,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC,KAAK,EAAE,MAAM,eAAe,CAAC,CAAC,GAChD,CAAC,SAAS,EAAE,IAAI,CAAC,KAAK,EAAE,MAAM,eAAe,CAAC,CAAC;CAOtD"}
|
package/dist/cookie.cjs
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseCookie = void 0;
|
|
4
|
+
const parseCookie = (cookiesString = document.cookie) => {
|
|
5
|
+
return cookiesString
|
|
6
|
+
.split(';')
|
|
7
|
+
.map((cookieString) => cookieString.trim().split('='))
|
|
8
|
+
.reduce((acc, current) => {
|
|
9
|
+
acc[current[0]] = current[1];
|
|
10
|
+
return acc;
|
|
11
|
+
}, {});
|
|
12
|
+
};
|
|
13
|
+
exports.parseCookie = parseCookie;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cookie.d.ts","sourceRoot":"","sources":["../src/cookie.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,0BAAyB;AAElD,eAAO,MAAM,WAAW,GAAI,sBAA+B,cAQ1D,CAAC"}
|
package/dist/cookie.d.ts
ADDED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cookie.d.ts","sourceRoot":"","sources":["../src/cookie.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"cookie.d.ts","sourceRoot":"","sources":["../src/cookie.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,yBAAyB;AAElD,eAAO,MAAM,WAAW,GAAI,sBAA+B,cAQ1D,CAAC"}
|
package/dist/data.cjs
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.safeJsonParse = exports.flatMapDeep = exports.isShallowEqual = void 0;
|
|
4
|
+
const isShallowEqual = (a, b) => {
|
|
5
|
+
if (a === b)
|
|
6
|
+
return true;
|
|
7
|
+
if (typeof a !== 'object' ||
|
|
8
|
+
typeof b !== 'object' ||
|
|
9
|
+
a === null ||
|
|
10
|
+
b === null) {
|
|
11
|
+
return false;
|
|
12
|
+
}
|
|
13
|
+
if (a.constructor !== b.constructor)
|
|
14
|
+
return false;
|
|
15
|
+
const isArrayA = Array.isArray(a);
|
|
16
|
+
if (isArrayA !== Array.isArray(b))
|
|
17
|
+
return false;
|
|
18
|
+
if (isArrayA) {
|
|
19
|
+
const arrA = a;
|
|
20
|
+
const arrB = b;
|
|
21
|
+
if (arrA.length !== arrB.length)
|
|
22
|
+
return false;
|
|
23
|
+
for (const [i, element] of arrA.entries()) {
|
|
24
|
+
if (element !== arrB[i])
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
return true;
|
|
28
|
+
}
|
|
29
|
+
if (a instanceof Date)
|
|
30
|
+
return a.getTime() === b.getTime();
|
|
31
|
+
if (a instanceof RegExp)
|
|
32
|
+
return a.toString() === b.toString();
|
|
33
|
+
const aKeys = Object.keys(a);
|
|
34
|
+
const bKeys = Object.keys(b);
|
|
35
|
+
if (aKeys.length !== bKeys.length)
|
|
36
|
+
return false;
|
|
37
|
+
const bObj = b;
|
|
38
|
+
for (const key of aKeys) {
|
|
39
|
+
if (!Object.hasOwn(bObj, key) || a[key] !== bObj[key]) {
|
|
40
|
+
return false;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return true;
|
|
44
|
+
};
|
|
45
|
+
exports.isShallowEqual = isShallowEqual;
|
|
46
|
+
const flatMapDeep = (arr, fn) => Array.isArray(arr)
|
|
47
|
+
? arr.flatMap((c) => (0, exports.flatMapDeep)(c, fn))
|
|
48
|
+
: [fn(arr, 0, [arr])];
|
|
49
|
+
exports.flatMapDeep = flatMapDeep;
|
|
50
|
+
const safeJsonParse = (json) => {
|
|
51
|
+
try {
|
|
52
|
+
return JSON.parse(json);
|
|
53
|
+
}
|
|
54
|
+
catch {
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
exports.safeJsonParse = safeJsonParse;
|
package/dist/data.d.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const isShallowEqual: (a: unknown, b: unknown) => boolean;
|
|
2
|
+
export declare const flatMapDeep: <TSource, TNewValue>(arr: TSource | TSource[], fn: (value: TSource, i: number, arr: TSource[]) => TNewValue) => TNewValue[];
|
|
3
|
+
export declare const safeJsonParse: (json: string) => any;
|
|
4
|
+
//# sourceMappingURL=data.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../src/data.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,cAAc,GAAI,GAAG,OAAO,EAAE,GAAG,OAAO,KAAG,OA8CvD,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,OAAO,EAAE,SAAS,EAC5C,KAAK,OAAO,GAAG,OAAO,EAAE,EACxB,IAAI,CAAC,KAAK,EAAE,OAAO,EAAE,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,KAAK,SAAS,KAC3D,SAAS,EAGa,CAAC;AAE1B,eAAO,MAAM,aAAa,GAAI,MAAM,MAAM,QAMzC,CAAC"}
|