@mhmo91/schmancy 0.2.139 → 0.2.142
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/{animated-text-D5Ki7KHu.js → animated-text-CWRnkzJa.js} +3 -3
- package/dist/{animated-text-D5Ki7KHu.js.map → animated-text-CWRnkzJa.js.map} +1 -1
- package/dist/{animated-text-BNbldkLi.cjs → animated-text-UjA34w-f.cjs} +2 -2
- package/dist/{animated-text-BNbldkLi.cjs.map → animated-text-UjA34w-f.cjs.map} +1 -1
- package/dist/animated-text.cjs +1 -1
- package/dist/animated-text.js +1 -1
- package/dist/area.cjs +1 -1
- package/dist/{area.component-Bm6rP9MT.cjs → area.component-BEDtgjNb.cjs} +2 -2
- package/dist/{area.component-Bm6rP9MT.cjs.map → area.component-BEDtgjNb.cjs.map} +1 -1
- package/dist/{area.component-D8b2RJic.js → area.component-BzuHoeHG.js} +3 -3
- package/dist/{area.component-D8b2RJic.js.map → area.component-BzuHoeHG.js.map} +1 -1
- package/dist/area.js +1 -1
- package/dist/{autocomplete-BAvxzIpj.js → autocomplete-B3W-MX_R.js} +3 -3
- package/dist/{autocomplete-BAvxzIpj.js.map → autocomplete-B3W-MX_R.js.map} +1 -1
- package/dist/{autocomplete-nZaZaU-s.cjs → autocomplete-CtqM8VN6.cjs} +2 -2
- package/dist/{autocomplete-nZaZaU-s.cjs.map → autocomplete-CtqM8VN6.cjs.map} +1 -1
- package/dist/autocomplete.cjs +1 -1
- package/dist/autocomplete.js +1 -1
- package/dist/busy.cjs +1 -1
- package/dist/busy.js +1 -1
- package/dist/button.cjs +1 -1
- package/dist/button.js +1 -1
- package/dist/card.cjs +1 -1
- package/dist/card.js +1 -1
- package/dist/{checkbox-yuvdefd4.cjs → checkbox-CGAbsupz.cjs} +2 -2
- package/dist/{checkbox-yuvdefd4.cjs.map → checkbox-CGAbsupz.cjs.map} +1 -1
- package/dist/{checkbox-BPXqV2sc.js → checkbox-gDmmaU-i.js} +2 -2
- package/dist/{checkbox-BPXqV2sc.js.map → checkbox-gDmmaU-i.js.map} +1 -1
- package/dist/checkbox.cjs +1 -1
- package/dist/checkbox.js +1 -1
- package/dist/{chips-B8bgmplU.js → chips-DtYGQiRe.js} +12 -12
- package/dist/{chips-B8bgmplU.js.map → chips-DtYGQiRe.js.map} +1 -1
- package/dist/{chips-CPmmFVGK.cjs → chips-FOChglMy.cjs} +2 -2
- package/dist/{chips-CPmmFVGK.cjs.map → chips-FOChglMy.cjs.map} +1 -1
- package/dist/chips.cjs +1 -1
- package/dist/chips.js +1 -1
- package/dist/components.cjs +1 -1
- package/dist/components.js +1 -1
- package/dist/content-drawer.cjs +1 -1
- package/dist/content-drawer.js +1 -1
- package/dist/context-array-BrljBA5R.cjs +2 -0
- package/dist/context-array-BrljBA5R.cjs.map +1 -0
- package/dist/context-array-CSGdoQ1W.js +923 -0
- package/dist/context-array-CSGdoQ1W.js.map +1 -0
- package/dist/{date-range-Mh7mi060.cjs → date-range-CCBukS6w.cjs} +2 -2
- package/dist/{date-range-Mh7mi060.cjs.map → date-range-CCBukS6w.cjs.map} +1 -1
- package/dist/{date-range-XD3eHmKe.js → date-range-CKocQ00P.js} +3 -3
- package/dist/{date-range-XD3eHmKe.js.map → date-range-CKocQ00P.js.map} +1 -1
- package/dist/date-range.cjs +1 -1
- package/dist/date-range.js +1 -1
- package/dist/{delay-BEh5HtKm.js → delay-Byk3BNTS.js} +11 -11
- package/dist/{delay-BEh5HtKm.js.map → delay-Byk3BNTS.js.map} +1 -1
- package/dist/{delay-Bz8DPPRF.cjs → delay-DoQ_jIcq.cjs} +2 -2
- package/dist/{delay-Bz8DPPRF.cjs.map → delay-DoQ_jIcq.cjs.map} +1 -1
- package/dist/delay.cjs +1 -1
- package/dist/delay.js +1 -1
- package/dist/{divider-BBy32B6r.js → divider-DW1XYPUt.js} +3 -3
- package/dist/{divider-BBy32B6r.js.map → divider-DW1XYPUt.js.map} +1 -1
- package/dist/{divider-Dxmbn2j0.cjs → divider-Wh-OY6OR.cjs} +2 -2
- package/dist/{divider-Dxmbn2j0.cjs.map → divider-Wh-OY6OR.cjs.map} +1 -1
- package/dist/divider.cjs +1 -1
- package/dist/divider.js +1 -1
- package/dist/extra.cjs +1 -1
- package/dist/extra.js +1 -1
- package/dist/{flex-BbafQvop.js → flex-BCcCTIEB.js} +2 -2
- package/dist/{flex-BbafQvop.js.map → flex-BCcCTIEB.js.map} +1 -1
- package/dist/{flex-C64fxWPl.cjs → flex-BaRE9ffF.cjs} +2 -2
- package/dist/{flex-C64fxWPl.cjs.map → flex-BaRE9ffF.cjs.map} +1 -1
- package/dist/{form-WOoGhjQx.cjs → form-B0CyaQwH.cjs} +2 -2
- package/dist/{form-WOoGhjQx.cjs.map → form-B0CyaQwH.cjs.map} +1 -1
- package/dist/{form-CjB8ReAw.js → form-DvQXRrGJ.js} +2 -2
- package/dist/{form-CjB8ReAw.js.map → form-DvQXRrGJ.js.map} +1 -1
- package/dist/form.cjs +1 -1
- package/dist/form.js +1 -1
- package/dist/{icon-D3FyfFuy.cjs → icon-BqQnZfcC.cjs} +2 -2
- package/dist/{icon-D3FyfFuy.cjs.map → icon-BqQnZfcC.cjs.map} +1 -1
- package/dist/{icon-1L_noI_n.js → icon-CoTwcGO7.js} +3 -3
- package/dist/{icon-1L_noI_n.js.map → icon-CoTwcGO7.js.map} +1 -1
- package/dist/{icon-button-Bfd0mfs9.cjs → icon-button-B3LSOKYP.cjs} +2 -2
- package/dist/{icon-button-Bfd0mfs9.cjs.map → icon-button-B3LSOKYP.cjs.map} +1 -1
- package/dist/{icon-button-Dji1Ck9p.js → icon-button-BMkOl7zP.js} +3 -3
- package/dist/{icon-button-Dji1Ck9p.js.map → icon-button-BMkOl7zP.js.map} +1 -1
- package/dist/icons.cjs +1 -1
- package/dist/icons.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +136 -123
- package/dist/index.js.map +1 -1
- package/dist/{input-leV-sK9y.cjs → input-A8mZ7r9Z.cjs} +2 -2
- package/dist/{input-leV-sK9y.cjs.map → input-A8mZ7r9Z.cjs.map} +1 -1
- package/dist/{input-DIgPPDf4.js → input-FLgsuB5g.js} +2 -2
- package/dist/{input-DIgPPDf4.js.map → input-FLgsuB5g.js.map} +1 -1
- package/dist/input.cjs +1 -1
- package/dist/input.js +1 -1
- package/dist/layout.cjs +1 -1
- package/dist/layout.js +1 -1
- package/dist/{list-8U7mFDmR.cjs → list-4_krEg2r.cjs} +2 -2
- package/dist/{list-8U7mFDmR.cjs.map → list-4_krEg2r.cjs.map} +1 -1
- package/dist/{list-DiARM4rT.js → list-DxHWsB3z.js} +2 -2
- package/dist/{list-DiARM4rT.js.map → list-DxHWsB3z.js.map} +1 -1
- package/dist/list.cjs +1 -1
- package/dist/list.js +1 -1
- package/dist/{litElement.mixin-DBsn92pk.cjs → litElement.mixin-CssoQifr.cjs} +2 -2
- package/dist/{litElement.mixin-DBsn92pk.cjs.map → litElement.mixin-CssoQifr.cjs.map} +1 -1
- package/dist/{litElement.mixin-BOOn7U5Z.js → litElement.mixin-fACDhe7J.js} +2 -2
- package/dist/{litElement.mixin-BOOn7U5Z.js.map → litElement.mixin-fACDhe7J.js.map} +1 -1
- package/dist/{menu-Br6X3wmF.cjs → menu-fEUIZGXJ.cjs} +2 -2
- package/dist/{menu-Br6X3wmF.cjs.map → menu-fEUIZGXJ.cjs.map} +1 -1
- package/dist/{menu-xQx6N8LO.js → menu-rWt1jKex.js} +3 -3
- package/dist/{menu-xQx6N8LO.js.map → menu-rWt1jKex.js.map} +1 -1
- package/dist/menu.cjs +1 -1
- package/dist/menu.js +1 -1
- package/dist/mixins/tailwind.css +5 -0
- package/dist/nav-drawer.cjs +1 -1
- package/dist/nav-drawer.js +1 -1
- package/dist/notification-container-DKLh7Vt2.js +447 -0
- package/dist/notification-container-DKLh7Vt2.js.map +1 -0
- package/dist/notification-container-DdUjZ0bi.cjs +124 -0
- package/dist/notification-container-DdUjZ0bi.cjs.map +1 -0
- package/dist/notification-service-DWeUoHi2.js +29 -0
- package/dist/notification-service-DWeUoHi2.js.map +1 -0
- package/dist/notification-service-DXXrRCmK.cjs +2 -0
- package/dist/notification-service-DXXrRCmK.cjs.map +1 -0
- package/dist/notification.cjs +1 -1
- package/dist/notification.js +7 -4
- package/dist/notification.js.map +1 -1
- package/dist/{option-C1ZeDVrC.cjs → option-CpmK20dy.cjs} +2 -2
- package/dist/{option-C1ZeDVrC.cjs.map → option-CpmK20dy.cjs.map} +1 -1
- package/dist/{option-Dx2AWiaj.js → option-ztBnKZ_w.js} +2 -2
- package/dist/{option-Dx2AWiaj.js.map → option-ztBnKZ_w.js.map} +1 -1
- package/dist/option.cjs +1 -1
- package/dist/option.js +1 -1
- package/dist/{payment-card-form-CJ4YDbUJ.js → payment-card-form-CUgTRvBS.js} +3 -3
- package/dist/{payment-card-form-CJ4YDbUJ.js.map → payment-card-form-CUgTRvBS.js.map} +1 -1
- package/dist/{payment-card-form-liiHN2py.cjs → payment-card-form-DmHX_20B.cjs} +2 -2
- package/dist/{payment-card-form-liiHN2py.cjs.map → payment-card-form-DmHX_20B.cjs.map} +1 -1
- package/dist/{radio-group-C067Z6Sx.js → radio-group-BZMhEi5P.js} +2 -2
- package/dist/{radio-group-C067Z6Sx.js.map → radio-group-BZMhEi5P.js.map} +1 -1
- package/dist/{radio-group-9pg4qU4Q.cjs → radio-group-DOpJu0Pc.cjs} +2 -2
- package/dist/{radio-group-9pg4qU4Q.cjs.map → radio-group-DOpJu0Pc.cjs.map} +1 -1
- package/dist/radio-group.cjs +1 -1
- package/dist/radio-group.js +1 -1
- package/dist/rxjs-utils.js +4 -4
- package/dist/{schmancy-steps-container-W8iUrjjQ.cjs → schmancy-steps-container-B5UOYQG8.cjs} +2 -2
- package/dist/{schmancy-steps-container-W8iUrjjQ.cjs.map → schmancy-steps-container-B5UOYQG8.cjs.map} +1 -1
- package/dist/{schmancy-steps-container-CXOh8tn7.js → schmancy-steps-container-srToeIjV.js} +2 -2
- package/dist/{schmancy-steps-container-CXOh8tn7.js.map → schmancy-steps-container-srToeIjV.js.map} +1 -1
- package/dist/{select-Ebp9Y6T_.cjs → select-0NLmJErW.cjs} +2 -2
- package/dist/{select-Ebp9Y6T_.cjs.map → select-0NLmJErW.cjs.map} +1 -1
- package/dist/{select-CbiLYVGN.js → select-Dx6IF984.js} +3 -3
- package/dist/{select-CbiLYVGN.js.map → select-Dx6IF984.js.map} +1 -1
- package/dist/select.cjs +1 -1
- package/dist/select.js +1 -1
- package/dist/selector-hook-0691Losv.js +323 -0
- package/dist/selector-hook-0691Losv.js.map +1 -0
- package/dist/selector-hook-SzNTYQII.cjs +2 -0
- package/dist/selector-hook-SzNTYQII.cjs.map +1 -0
- package/dist/{sheet-BZ4d5wLR.js → sheet-Bl64wfBe.js} +3 -3
- package/dist/{sheet-BZ4d5wLR.js.map → sheet-Bl64wfBe.js.map} +1 -1
- package/dist/{sheet-DoWympTj.cjs → sheet-BwsspKto.cjs} +2 -2
- package/dist/{sheet-DoWympTj.cjs.map → sheet-BwsspKto.cjs.map} +1 -1
- package/dist/sheet.cjs +1 -1
- package/dist/sheet.js +1 -1
- package/dist/{slider-BGzs57Nd.cjs → slider-9zdabbA2.cjs} +2 -2
- package/dist/{slider-BGzs57Nd.cjs.map → slider-9zdabbA2.cjs.map} +1 -1
- package/dist/{slider-Bwt5zt67.js → slider-nyTR0hyw.js} +3 -3
- package/dist/{slider-Bwt5zt67.js.map → slider-nyTR0hyw.js.map} +1 -1
- package/dist/slider.cjs +1 -1
- package/dist/slider.js +1 -1
- package/dist/{spinner-B6Yx9jX1.js → spinner-37Y-o4jr.js} +3 -3
- package/dist/{spinner-B6Yx9jX1.js.map → spinner-37Y-o4jr.js.map} +1 -1
- package/dist/{spinner-vlXVxDki.cjs → spinner-D46_Vbxf.cjs} +2 -2
- package/dist/{spinner-vlXVxDki.cjs.map → spinner-D46_Vbxf.cjs.map} +1 -1
- package/dist/steps.cjs +1 -1
- package/dist/steps.js +1 -1
- package/dist/store.cjs +1 -1
- package/dist/store.js +33 -23
- package/dist/{surface-CXwP49Mi.cjs → surface-DFXFQBBC.cjs} +2 -2
- package/dist/{surface-CXwP49Mi.cjs.map → surface-DFXFQBBC.cjs.map} +1 -1
- package/dist/{surface-C2lcwsKJ.js → surface-RtVWZEdq.js} +2 -2
- package/dist/{surface-C2lcwsKJ.js.map → surface-RtVWZEdq.js.map} +1 -1
- package/dist/surface.cjs +1 -1
- package/dist/surface.js +1 -1
- package/dist/{table-2-DnKwRo.cjs → table-BG1_ofOE.cjs} +2 -2
- package/dist/{table-2-DnKwRo.cjs.map → table-BG1_ofOE.cjs.map} +1 -1
- package/dist/{table-CWfF0shQ.js → table-CGdNPIeN.js} +2 -2
- package/dist/{table-CWfF0shQ.js.map → table-CGdNPIeN.js.map} +1 -1
- package/dist/table.cjs +1 -1
- package/dist/table.js +1 -1
- package/dist/{tabs-group-CPUDkhJ_.cjs → tabs-group-BVsNqqN1.cjs} +2 -2
- package/dist/{tabs-group-CPUDkhJ_.cjs.map → tabs-group-BVsNqqN1.cjs.map} +1 -1
- package/dist/{tabs-group-DXMbbWuO.js → tabs-group-CvHe90C_.js} +2 -2
- package/dist/{tabs-group-DXMbbWuO.js.map → tabs-group-CvHe90C_.js.map} +1 -1
- package/dist/tabs.cjs +1 -1
- package/dist/tabs.js +1 -1
- package/dist/tailwind.mixin-1drvGQKC.cjs +2 -0
- package/dist/{tailwind.mixin-CWsvBayE.cjs.map → tailwind.mixin-1drvGQKC.cjs.map} +1 -1
- package/dist/tailwind.mixin-C7U3gr3P.js +43 -0
- package/dist/{tailwind.mixin-C8nuH8uq.js.map → tailwind.mixin-C7U3gr3P.js.map} +1 -1
- package/dist/teleport.cjs +1 -1
- package/dist/{teleport.component-tDzioCA7.js → teleport.component-Du14Yyxz.js} +63 -63
- package/dist/{teleport.component-tDzioCA7.js.map → teleport.component-Du14Yyxz.js.map} +1 -1
- package/dist/{teleport.component-BMTMnjJi.cjs → teleport.component-Vicu2fPa.cjs} +2 -2
- package/dist/{teleport.component-BMTMnjJi.cjs.map → teleport.component-Vicu2fPa.cjs.map} +1 -1
- package/dist/teleport.js +1 -1
- package/dist/{textarea-08VY-gi0.cjs → textarea-D1nov2H8.cjs} +2 -2
- package/dist/{textarea-08VY-gi0.cjs.map → textarea-D1nov2H8.cjs.map} +1 -1
- package/dist/{textarea-KY-H0XE9.js → textarea-Ddi7wWLs.js} +2 -2
- package/dist/{textarea-KY-H0XE9.js.map → textarea-Ddi7wWLs.js.map} +1 -1
- package/dist/textarea.cjs +1 -1
- package/dist/textarea.js +1 -1
- package/dist/{theme-button-Cp3y37Mz.js → theme-button-84n-IAL1.js} +2 -2
- package/dist/{theme-button-Cp3y37Mz.js.map → theme-button-84n-IAL1.js.map} +1 -1
- package/dist/{theme-button-TChFwWi6.cjs → theme-button-C-g9a2ZF.cjs} +2 -2
- package/dist/{theme-button-TChFwWi6.cjs.map → theme-button-C-g9a2ZF.cjs.map} +1 -1
- package/dist/theme-button.cjs +1 -1
- package/dist/theme-button.js +1 -1
- package/dist/theme.cjs +1 -1
- package/dist/{theme.component-Bgh-j4WN.cjs → theme.component-C61DdKLT.cjs} +2 -2
- package/dist/{theme.component-Bgh-j4WN.cjs.map → theme.component-C61DdKLT.cjs.map} +1 -1
- package/dist/{theme.component-tcsmGB6n.js → theme.component-Dk0d_7Og.js} +47 -47
- package/dist/{theme.component-tcsmGB6n.js.map → theme.component-Dk0d_7Og.js.map} +1 -1
- package/dist/theme.js +1 -1
- package/dist/{timezone-DwTl04Fb.cjs → timezone-2Eb26kSx.cjs} +2 -4
- package/dist/timezone-2Eb26kSx.cjs.map +1 -0
- package/dist/{timezone-Cob3Zs1V.js → timezone-C8cbkh7P.js} +3 -5
- package/dist/timezone-C8cbkh7P.js.map +1 -0
- package/dist/{tree-CBYb1k5W.cjs → tree-CsKV00BK.cjs} +2 -2
- package/dist/{tree-CBYb1k5W.cjs.map → tree-CsKV00BK.cjs.map} +1 -1
- package/dist/{tree-DR5qkGYr.js → tree-_dvGG1Dk.js} +2 -2
- package/dist/{tree-DR5qkGYr.js.map → tree-_dvGG1Dk.js.map} +1 -1
- package/dist/tree.cjs +1 -1
- package/dist/tree.js +1 -1
- package/dist/{typewriter-DKXGVYPg.cjs → typewriter-BTKJ8mPR.cjs} +2 -2
- package/dist/{typewriter-DKXGVYPg.cjs.map → typewriter-BTKJ8mPR.cjs.map} +1 -1
- package/dist/{typewriter-BJk9hiPU.js → typewriter-D1rGUZyO.js} +4 -4
- package/dist/{typewriter-BJk9hiPU.js.map → typewriter-D1rGUZyO.js.map} +1 -1
- package/dist/typewriter.cjs +1 -1
- package/dist/typewriter.js +1 -1
- package/dist/{typography-Czz5ZTwN.cjs → typography-BJzp77zk.cjs} +2 -2
- package/dist/{typography-Czz5ZTwN.cjs.map → typography-BJzp77zk.cjs.map} +1 -1
- package/dist/{typography-B3-y3gWb.js → typography-C3AU6NFt.js} +2 -2
- package/dist/{typography-B3-y3gWb.js.map → typography-C3AU6NFt.js.map} +1 -1
- package/dist/typography.cjs +1 -1
- package/dist/typography.js +1 -1
- package/package.json +2 -1
- package/types/src/notification/index.d.ts +6 -3
- package/types/src/notification/notification-audio-generator.d.ts +45 -0
- package/types/src/notification/notification-audio.d.ts +70 -0
- package/types/src/notification/notification-container.d.ts +44 -0
- package/types/src/notification/notification-service.d.ts +60 -0
- package/types/src/notification/notification.d.ts +33 -4
- package/types/src/store/context-array.d.ts +83 -0
- package/types/src/store/context-collection.d.ts +20 -41
- package/types/src/store/context-create.d.ts +31 -9
- package/types/src/store/context-object.d.ts +14 -43
- package/types/src/store/filter-directive.d.ts +62 -5
- package/types/src/store/immer-integration.d.ts +60 -0
- package/types/src/store/selector-hook.d.ts +4 -0
- package/types/src/store/selectors.d.ts +29 -20
- package/types/src/store/store.class.d.ts +67 -0
- package/types/src/store/types.d.ts +102 -0
- package/dist/context-object-BDXZ5EKJ.js +0 -306
- package/dist/context-object-BDXZ5EKJ.js.map +0 -1
- package/dist/context-object-BIywslrO.cjs +0 -2
- package/dist/context-object-BIywslrO.cjs.map +0 -1
- package/dist/outlet-CI05jyjr.cjs +0 -61
- package/dist/outlet-CI05jyjr.cjs.map +0 -1
- package/dist/outlet-CScugbm9.js +0 -128
- package/dist/outlet-CScugbm9.js.map +0 -1
- package/dist/selector-hook-C6VCezv7.js +0 -273
- package/dist/selector-hook-C6VCezv7.js.map +0 -1
- package/dist/selector-hook-DDaYMsHs.cjs +0 -2
- package/dist/selector-hook-DDaYMsHs.cjs.map +0 -1
- package/dist/tailwind.mixin-C8nuH8uq.js +0 -43
- package/dist/tailwind.mixin-CWsvBayE.cjs +0 -2
- package/dist/timezone-Cob3Zs1V.js.map +0 -1
- package/dist/timezone-DwTl04Fb.cjs.map +0 -1
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { NotificationType } from './notification';
|
|
2
|
+
/**
|
|
3
|
+
* Audio service for playing notification sounds.
|
|
4
|
+
* Uses Web Audio API with fallback to HTML5 Audio.
|
|
5
|
+
*/
|
|
6
|
+
export declare class NotificationAudioService {
|
|
7
|
+
private audioContext;
|
|
8
|
+
private soundBuffers;
|
|
9
|
+
private volume;
|
|
10
|
+
private muted;
|
|
11
|
+
private soundGenerator;
|
|
12
|
+
private soundUrls;
|
|
13
|
+
constructor();
|
|
14
|
+
/**
|
|
15
|
+
* Initialize audio files - generate programmatically if needed
|
|
16
|
+
*/
|
|
17
|
+
private initializeAudioFiles;
|
|
18
|
+
/**
|
|
19
|
+
* Lazy-initialize the audio context
|
|
20
|
+
*/
|
|
21
|
+
private getAudioContext;
|
|
22
|
+
/**
|
|
23
|
+
* Preload all notification sounds
|
|
24
|
+
*/
|
|
25
|
+
private preloadSounds;
|
|
26
|
+
/**
|
|
27
|
+
* Load a sound file and decode it
|
|
28
|
+
*/
|
|
29
|
+
private loadSound;
|
|
30
|
+
/**
|
|
31
|
+
* Play a notification sound
|
|
32
|
+
*/
|
|
33
|
+
playSound(type: NotificationType): Promise<void>;
|
|
34
|
+
/**
|
|
35
|
+
* Play a directly generated sound when other methods fail
|
|
36
|
+
*/
|
|
37
|
+
private playDirectGeneratedSound;
|
|
38
|
+
/**
|
|
39
|
+
* Play sound using HTML5 Audio as a fallback
|
|
40
|
+
*/
|
|
41
|
+
private playFallbackSound;
|
|
42
|
+
/**
|
|
43
|
+
* Set volume for notification sounds (0.0 to 1.0)
|
|
44
|
+
*/
|
|
45
|
+
setVolume(volume: number): void;
|
|
46
|
+
/**
|
|
47
|
+
* Get current volume level
|
|
48
|
+
*/
|
|
49
|
+
getVolume(): number;
|
|
50
|
+
/**
|
|
51
|
+
* Mute notification sounds
|
|
52
|
+
*/
|
|
53
|
+
mute(): void;
|
|
54
|
+
/**
|
|
55
|
+
* Unmute notification sounds
|
|
56
|
+
*/
|
|
57
|
+
unmute(): void;
|
|
58
|
+
/**
|
|
59
|
+
* Check if notification sounds are muted
|
|
60
|
+
*/
|
|
61
|
+
isMuted(): boolean;
|
|
62
|
+
/**
|
|
63
|
+
* Set custom sound URL for a notification type
|
|
64
|
+
*/
|
|
65
|
+
setSoundUrl(type: NotificationType, url: string): void;
|
|
66
|
+
/**
|
|
67
|
+
* Get the current sound URL for a notification type
|
|
68
|
+
*/
|
|
69
|
+
getSoundUrl(type: NotificationType): string;
|
|
70
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { NotificationType } from './notification';
|
|
2
|
+
export interface NotificationItem {
|
|
3
|
+
id: string;
|
|
4
|
+
title: string;
|
|
5
|
+
message: string;
|
|
6
|
+
type: NotificationType;
|
|
7
|
+
duration: number;
|
|
8
|
+
closable: boolean;
|
|
9
|
+
playSound: boolean;
|
|
10
|
+
}
|
|
11
|
+
export interface NotificationOptions {
|
|
12
|
+
id?: string;
|
|
13
|
+
title?: string;
|
|
14
|
+
message: string;
|
|
15
|
+
type?: NotificationType;
|
|
16
|
+
duration?: number;
|
|
17
|
+
closable?: boolean;
|
|
18
|
+
playSound?: boolean;
|
|
19
|
+
}
|
|
20
|
+
declare const SchmancyNotificationContainer_base: CustomElementConstructor & import("@mixins/index").Constructor<import("lit").LitElement> & import("@mixins/index").Constructor<import("@mixins/index").IBaseMixin>;
|
|
21
|
+
/**
|
|
22
|
+
* Container component for displaying stacked notifications.
|
|
23
|
+
*
|
|
24
|
+
* @element sch-notification-container
|
|
25
|
+
*/
|
|
26
|
+
export default class SchmancyNotificationContainer extends SchmancyNotificationContainer_base {
|
|
27
|
+
position: 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left' | 'top-center' | 'bottom-center';
|
|
28
|
+
maxVisibleNotifications: number;
|
|
29
|
+
playSound: boolean;
|
|
30
|
+
audioVolume: number;
|
|
31
|
+
private _notifications;
|
|
32
|
+
private _audioService;
|
|
33
|
+
connectedCallback(): void;
|
|
34
|
+
addNotification(options: NotificationOptions): string;
|
|
35
|
+
removeNotification(id: string): void;
|
|
36
|
+
private _handleClose;
|
|
37
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
38
|
+
}
|
|
39
|
+
declare global {
|
|
40
|
+
interface HTMLElementTagNameMap {
|
|
41
|
+
'sch-notification-container': SchmancyNotificationContainer;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
export {};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { NotificationOptions } from './notification-container';
|
|
2
|
+
/**
|
|
3
|
+
* Notification service for centralized notification management.
|
|
4
|
+
* Provides a simple API for showing notifications.
|
|
5
|
+
*/
|
|
6
|
+
export declare class NotificationService {
|
|
7
|
+
private static instance;
|
|
8
|
+
private constructor();
|
|
9
|
+
/**
|
|
10
|
+
* Get the singleton instance
|
|
11
|
+
*/
|
|
12
|
+
static getInstance(): NotificationService;
|
|
13
|
+
/**
|
|
14
|
+
* Show a notification
|
|
15
|
+
* @returns The ID of the created notification
|
|
16
|
+
*/
|
|
17
|
+
notify(options: NotificationOptions): string;
|
|
18
|
+
/**
|
|
19
|
+
* Show an info notification
|
|
20
|
+
*/
|
|
21
|
+
info(message: string, options?: Partial<Omit<NotificationOptions, 'message' | 'type'>>): string;
|
|
22
|
+
/**
|
|
23
|
+
* Show a success notification
|
|
24
|
+
*/
|
|
25
|
+
success(message: string, options?: Partial<Omit<NotificationOptions, 'message' | 'type'>>): string;
|
|
26
|
+
/**
|
|
27
|
+
* Show a warning notification
|
|
28
|
+
*/
|
|
29
|
+
warning(message: string, options?: Partial<Omit<NotificationOptions, 'message' | 'type'>>): string;
|
|
30
|
+
/**
|
|
31
|
+
* Show an error notification
|
|
32
|
+
*/
|
|
33
|
+
error(message: string, options?: Partial<Omit<NotificationOptions, 'message' | 'type'>>): string;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Global notification utility - provides a quick way to show notifications
|
|
37
|
+
*/
|
|
38
|
+
export declare const $notify: {
|
|
39
|
+
/**
|
|
40
|
+
* Show a notification
|
|
41
|
+
*/
|
|
42
|
+
show: (options: NotificationOptions) => string;
|
|
43
|
+
/**
|
|
44
|
+
* Show an info notification
|
|
45
|
+
*/
|
|
46
|
+
info: (message: string, options?: Partial<Omit<NotificationOptions, "message" | "type">>) => string;
|
|
47
|
+
/**
|
|
48
|
+
* Show a success notification
|
|
49
|
+
*/
|
|
50
|
+
success: (message: string, options?: Partial<Omit<NotificationOptions, "message" | "type">>) => string;
|
|
51
|
+
/**
|
|
52
|
+
* Show a warning notification
|
|
53
|
+
*/
|
|
54
|
+
warning: (message: string, options?: Partial<Omit<NotificationOptions, "message" | "type">>) => string;
|
|
55
|
+
/**
|
|
56
|
+
* Show an error notification
|
|
57
|
+
*/
|
|
58
|
+
error: (message: string, options?: Partial<Omit<NotificationOptions, "message" | "type">>) => string;
|
|
59
|
+
};
|
|
60
|
+
export default NotificationService;
|
|
@@ -1,11 +1,40 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
|
|
1
|
+
import { PropertyValues } from 'lit';
|
|
2
|
+
export type NotificationType = 'info' | 'success' | 'warning' | 'error';
|
|
3
|
+
declare const SchmancyNotification_base: CustomElementConstructor & import("@mixins/index").Constructor<import("lit").LitElement> & import("@mixins/index").Constructor<import("@mixins/index").IBaseMixin>;
|
|
4
|
+
/**
|
|
5
|
+
* @fires close - When notification is closed
|
|
6
|
+
*/
|
|
7
|
+
export default class SchmancyNotification extends SchmancyNotification_base {
|
|
8
|
+
title: string;
|
|
9
|
+
message: string;
|
|
10
|
+
type: NotificationType;
|
|
11
|
+
closable: boolean;
|
|
12
|
+
duration: number;
|
|
13
|
+
id: string;
|
|
14
|
+
playSound: boolean;
|
|
15
|
+
private _visible;
|
|
16
|
+
private _progress;
|
|
17
|
+
private _hovered;
|
|
18
|
+
private _closing;
|
|
19
|
+
private _autoCloseTimer?;
|
|
20
|
+
private _progressTimer?;
|
|
21
|
+
connectedCallback(): void;
|
|
22
|
+
disconnectedCallback(): void;
|
|
23
|
+
updated(changedProps: PropertyValues): void;
|
|
24
|
+
private _startAutoCloseTimer;
|
|
25
|
+
private _clearTimers;
|
|
26
|
+
private _pauseTimers;
|
|
27
|
+
private _resumeTimers;
|
|
28
|
+
private _playSound;
|
|
29
|
+
private _handleMouseEnter;
|
|
30
|
+
private _handleMouseLeave;
|
|
31
|
+
close(): void;
|
|
4
32
|
render(): import("lit-html").TemplateResult<1>;
|
|
33
|
+
private _getTypeStyles;
|
|
5
34
|
}
|
|
6
35
|
declare global {
|
|
7
36
|
interface HTMLElementTagNameMap {
|
|
8
|
-
'
|
|
37
|
+
'sch-notification': SchmancyNotification;
|
|
9
38
|
}
|
|
10
39
|
}
|
|
11
40
|
export {};
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { Draft } from 'immer';
|
|
2
|
+
import { BaseStore } from './store.class';
|
|
3
|
+
import { IArrayStore, StorageType } from './types';
|
|
4
|
+
/**
|
|
5
|
+
* Enhanced array store with TypeScript support and immutability
|
|
6
|
+
* Extends BaseStore for common functionality
|
|
7
|
+
*/
|
|
8
|
+
export declare class SchmancyArrayStore<T = any> extends BaseStore<T[]> implements IArrayStore<T> {
|
|
9
|
+
static type: string;
|
|
10
|
+
private static instances;
|
|
11
|
+
/**
|
|
12
|
+
* Static method to get or create an instance with proper typing
|
|
13
|
+
*/
|
|
14
|
+
static getInstance<T = any>(storage: StorageType, key: string, defaultValue?: T[]): SchmancyArrayStore<T>;
|
|
15
|
+
/**
|
|
16
|
+
* Constructor extension to set up persistence
|
|
17
|
+
*/
|
|
18
|
+
constructor(storageType: StorageType, key: string, defaultValue?: T[]);
|
|
19
|
+
/**
|
|
20
|
+
* Set up persistence to storage with throttling
|
|
21
|
+
*/
|
|
22
|
+
private setupPersistence;
|
|
23
|
+
/**
|
|
24
|
+
* Add an item to the end of the array
|
|
25
|
+
*/
|
|
26
|
+
push(...items: T[]): void;
|
|
27
|
+
/**
|
|
28
|
+
* Remove and return the last item from the array
|
|
29
|
+
*/
|
|
30
|
+
pop(): T | undefined;
|
|
31
|
+
/**
|
|
32
|
+
* Add item(s) to the beginning of the array
|
|
33
|
+
*/
|
|
34
|
+
unshift(...items: T[]): void;
|
|
35
|
+
/**
|
|
36
|
+
* Remove and return the first item from the array
|
|
37
|
+
*/
|
|
38
|
+
shift(): T | undefined;
|
|
39
|
+
/**
|
|
40
|
+
* Update an item at a specific index
|
|
41
|
+
*/
|
|
42
|
+
set(index: number, value: T): void;
|
|
43
|
+
/**
|
|
44
|
+
* Get item at a specific index
|
|
45
|
+
*/
|
|
46
|
+
get(index: number): T | undefined;
|
|
47
|
+
/**
|
|
48
|
+
* Remove items from the array
|
|
49
|
+
*/
|
|
50
|
+
splice(start: number, deleteCount?: number, ...items: T[]): T[];
|
|
51
|
+
/**
|
|
52
|
+
* Remove an item by value (first occurrence)
|
|
53
|
+
*/
|
|
54
|
+
remove(item: T, compareFn?: (a: T, b: T) => boolean): boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Replace entire array
|
|
57
|
+
*/
|
|
58
|
+
replace(newArray: T[]): void;
|
|
59
|
+
/**
|
|
60
|
+
* Filter items in the array
|
|
61
|
+
*/
|
|
62
|
+
filter(predicate: (value: T, index: number, array: T[]) => boolean): void;
|
|
63
|
+
/**
|
|
64
|
+
* Map over the array and transform items
|
|
65
|
+
*/
|
|
66
|
+
map<U>(mapper: (value: T, index: number, array: T[]) => U): U[];
|
|
67
|
+
/**
|
|
68
|
+
* Sort the array in place
|
|
69
|
+
*/
|
|
70
|
+
sort(compareFn?: (a: T, b: T) => number): void;
|
|
71
|
+
/**
|
|
72
|
+
* Update a specific item using a callback function
|
|
73
|
+
*/
|
|
74
|
+
update(index: number, updater: (item: Draft<T>) => void): void;
|
|
75
|
+
/**
|
|
76
|
+
* Clear the array
|
|
77
|
+
*/
|
|
78
|
+
clear(): void;
|
|
79
|
+
/**
|
|
80
|
+
* Setup development tools for debugging
|
|
81
|
+
*/
|
|
82
|
+
protected setupDevTools(): void;
|
|
83
|
+
}
|
|
@@ -1,71 +1,50 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ICollectionStore, StorageType
|
|
1
|
+
import { BaseStore } from './store.class';
|
|
2
|
+
import { ICollectionStore, StorageType } from './types';
|
|
3
|
+
import { Draft } from 'immer';
|
|
3
4
|
/**
|
|
4
|
-
* Enhanced collection store with better TypeScript support
|
|
5
|
+
* Enhanced collection store with better TypeScript support and immutability
|
|
6
|
+
* Now extends BaseStore for common functionality
|
|
5
7
|
*/
|
|
6
|
-
export default class SchmancyCollectionStore<V = any> implements ICollectionStore<V> {
|
|
7
|
-
private storageType;
|
|
8
|
-
private key;
|
|
8
|
+
export default class SchmancyCollectionStore<V = any> extends BaseStore<Map<string, V>> implements ICollectionStore<V> {
|
|
9
9
|
static type: string;
|
|
10
10
|
private static instances;
|
|
11
|
-
private _ready;
|
|
12
|
-
private _destroy$;
|
|
13
|
-
$: BehaviorSubject<Map<string, V>>;
|
|
14
|
-
error$: BehaviorSubject<StoreError<unknown>>;
|
|
15
|
-
readonly defaultValue: Map<string, V>;
|
|
16
|
-
private storage;
|
|
17
|
-
/**
|
|
18
|
-
* Get ready state
|
|
19
|
-
*/
|
|
20
|
-
get ready(): boolean;
|
|
21
|
-
/**
|
|
22
|
-
* Set ready state
|
|
23
|
-
*/
|
|
24
|
-
set ready(value: boolean);
|
|
25
|
-
private constructor();
|
|
26
11
|
/**
|
|
27
12
|
* Static method to get or create an instance with proper typing
|
|
28
13
|
*/
|
|
29
14
|
static getInstance<V = any>(storage: StorageType, key: string, defaultValue: Map<string, V>): SchmancyCollectionStore<V>;
|
|
30
15
|
/**
|
|
31
|
-
*
|
|
32
|
-
*/
|
|
33
|
-
get value(): Map<string, V>;
|
|
34
|
-
/**
|
|
35
|
-
* Set a value in the collection with proper typing
|
|
16
|
+
* Set a value in the collection with proper typing and immutability
|
|
36
17
|
*/
|
|
37
18
|
set<T = V>(key: string, value: T): void;
|
|
38
19
|
/**
|
|
39
|
-
* Delete a value from the collection
|
|
20
|
+
* Delete a value from the collection immutably
|
|
40
21
|
*/
|
|
41
22
|
delete(key: string): void;
|
|
42
23
|
/**
|
|
43
|
-
* Clear the collection
|
|
24
|
+
* Clear the collection immutably
|
|
44
25
|
*/
|
|
45
26
|
clear(): void;
|
|
46
|
-
replace(newValue: Map<string, V>): void;
|
|
47
27
|
/**
|
|
48
|
-
*
|
|
28
|
+
* Batch update multiple items in the collection
|
|
29
|
+
* @param updates Object with keys and values to update
|
|
49
30
|
*/
|
|
50
|
-
|
|
31
|
+
batchUpdate(updates: Record<string, V>): void;
|
|
51
32
|
/**
|
|
52
|
-
*
|
|
33
|
+
* Update an existing item in the collection using an updater function
|
|
34
|
+
* @param key Key of the item to update
|
|
35
|
+
* @param updater Function that receives the current value and returns the new value
|
|
53
36
|
*/
|
|
54
|
-
|
|
37
|
+
update(key: string, updater: (currentValue: Draft<V>) => void): void;
|
|
55
38
|
/**
|
|
56
|
-
*
|
|
39
|
+
* Constructor extension to set up persistence
|
|
57
40
|
*/
|
|
58
|
-
|
|
41
|
+
constructor(storageType: StorageType, key: string, defaultValue: Map<string, V>);
|
|
59
42
|
/**
|
|
60
|
-
* Set up persistence to storage
|
|
43
|
+
* Set up persistence to storage with throttling
|
|
61
44
|
*/
|
|
62
45
|
private setupPersistence;
|
|
63
46
|
/**
|
|
64
47
|
* Setup development tools for debugging
|
|
65
48
|
*/
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* Clean up resources
|
|
69
|
-
*/
|
|
70
|
-
destroy(): void;
|
|
49
|
+
protected setupDevTools(): void;
|
|
71
50
|
}
|
|
@@ -1,21 +1,43 @@
|
|
|
1
1
|
import SchmancyCollectionStore from './context-collection';
|
|
2
2
|
import { SchmancyStoreObject } from './context-object';
|
|
3
|
-
import {
|
|
3
|
+
import { SchmancyArrayStore } from './context-array';
|
|
4
|
+
import { ICollectionStore, IStore, IArrayStore, StorageType } from './types';
|
|
4
5
|
/**
|
|
5
|
-
* Creates a context for managing state
|
|
6
|
-
*
|
|
6
|
+
* Creates a context for managing object state
|
|
7
|
+
* @param initialData The initial object data
|
|
8
|
+
* @param storage Storage type to use
|
|
9
|
+
* @param key Unique key for the store
|
|
10
|
+
* @returns A store instance for the object
|
|
7
11
|
*/
|
|
8
12
|
export declare function createContext<T extends Record<string, any>>(initialData: T, storage: StorageType, key: string): IStore<T> & SchmancyStoreObject<T>;
|
|
9
13
|
/**
|
|
10
|
-
* Creates a context for managing state
|
|
11
|
-
*
|
|
14
|
+
* Creates a context for managing collection state
|
|
15
|
+
* @param initialData The initial Map collection
|
|
16
|
+
* @param storage Storage type to use
|
|
17
|
+
* @param key Unique key for the store
|
|
18
|
+
* @returns A collection store instance
|
|
12
19
|
*/
|
|
13
20
|
export declare function createContext<V>(initialData: Map<string, V>, storage: StorageType, key: string): ICollectionStore<V> & SchmancyCollectionStore<V>;
|
|
14
21
|
/**
|
|
15
|
-
* Creates a context
|
|
22
|
+
* Creates a context for managing array state
|
|
23
|
+
* @param initialData The initial array
|
|
24
|
+
* @param storage Storage type to use
|
|
25
|
+
* @param key Unique key for the store
|
|
26
|
+
* @returns An array store instance
|
|
16
27
|
*/
|
|
17
|
-
export declare function
|
|
28
|
+
export declare function createContext<T>(initialData: T[], storage: StorageType, key: string): IArrayStore<T> & SchmancyArrayStore<T>;
|
|
18
29
|
/**
|
|
19
|
-
* Creates
|
|
30
|
+
* Creates an array context with simplified API and type inference
|
|
31
|
+
* @param initialData The initial array data
|
|
32
|
+
* @param key Unique key for the store
|
|
33
|
+
* @param storage Storage type to use (defaults to 'local')
|
|
34
|
+
* @returns An array store instance
|
|
20
35
|
*/
|
|
21
|
-
export declare function
|
|
36
|
+
export declare function createArrayContext<T>(initialData: T[], key: string, storage?: StorageType): IArrayStore<T> & SchmancyArrayStore<T>;
|
|
37
|
+
/**
|
|
38
|
+
* Creates a testable array context
|
|
39
|
+
* @param initialData The initial array data
|
|
40
|
+
* @param key Unique key for the store
|
|
41
|
+
* @returns An array store that uses memory storage
|
|
42
|
+
*/
|
|
43
|
+
export declare function createTestArrayContext<T>(initialData?: T[], key?: string): IArrayStore<T> & SchmancyArrayStore<T>;
|
|
@@ -1,41 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { IStore, StorageType
|
|
1
|
+
import { BaseStore } from './store.class';
|
|
2
|
+
import { IStore, StorageType } from './types';
|
|
3
3
|
/**
|
|
4
|
-
* Enhanced store object with better TypeScript support
|
|
4
|
+
* Enhanced store object with better TypeScript support and immutability
|
|
5
|
+
* Now extends BaseStore for common functionality and uses Immer
|
|
5
6
|
*/
|
|
6
|
-
export declare class SchmancyStoreObject<T extends Record<string, any>> implements IStore<T> {
|
|
7
|
-
private storageType;
|
|
8
|
-
private key;
|
|
7
|
+
export declare class SchmancyStoreObject<T extends Record<string, any>> extends BaseStore<T> implements IStore<T> {
|
|
9
8
|
static type: string;
|
|
10
9
|
private static instances;
|
|
11
|
-
private _ready;
|
|
12
|
-
private _destroy$;
|
|
13
|
-
$: BehaviorSubject<T>;
|
|
14
|
-
error$: BehaviorSubject<StoreError<unknown>>;
|
|
15
|
-
readonly defaultValue: T;
|
|
16
|
-
private storage;
|
|
17
|
-
/**
|
|
18
|
-
* Get store ready state
|
|
19
|
-
*/
|
|
20
|
-
get ready(): boolean;
|
|
21
|
-
/**
|
|
22
|
-
* Set store ready state
|
|
23
|
-
*/
|
|
24
|
-
set ready(value: boolean);
|
|
25
|
-
/**
|
|
26
|
-
* Private constructor to enforce singleton pattern
|
|
27
|
-
*/
|
|
28
|
-
private constructor();
|
|
29
10
|
/**
|
|
30
11
|
* Static method to get or create an instance with strong typing
|
|
31
12
|
*/
|
|
32
13
|
static getInstance<T extends Record<string, any>>(storage: StorageType, key: string, defaultValue: T): SchmancyStoreObject<T>;
|
|
33
14
|
/**
|
|
34
|
-
*
|
|
35
|
-
*/
|
|
36
|
-
get value(): T;
|
|
37
|
-
/**
|
|
38
|
-
* Set state with proper typing
|
|
15
|
+
* Set state with proper typing and immutability using Immer
|
|
39
16
|
*/
|
|
40
17
|
set(value: Partial<T>, merge?: boolean): void;
|
|
41
18
|
/**
|
|
@@ -43,27 +20,21 @@ export declare class SchmancyStoreObject<T extends Record<string, any>> implemen
|
|
|
43
20
|
*/
|
|
44
21
|
clear(): void;
|
|
45
22
|
/**
|
|
46
|
-
*
|
|
47
|
-
*/
|
|
48
|
-
replace(newValue: T): void;
|
|
49
|
-
/**
|
|
50
|
-
* Delete a specific key from the store with type checking
|
|
23
|
+
* Delete a specific key from the store with type checking and immutability
|
|
51
24
|
*/
|
|
52
25
|
delete<K extends keyof T>(key: K): void;
|
|
53
26
|
/**
|
|
54
|
-
* Update
|
|
27
|
+
* Update a nested property at a specific path
|
|
28
|
+
* @param path Dot-separated path to the property (e.g., 'user.profile.name')
|
|
29
|
+
* @param value New value to set
|
|
55
30
|
*/
|
|
56
|
-
|
|
31
|
+
setPath(path: string, value: any): void;
|
|
57
32
|
/**
|
|
58
|
-
*
|
|
33
|
+
* Process stored value by merging with default value
|
|
59
34
|
*/
|
|
60
|
-
|
|
35
|
+
protected processStoredValue(storedValue: T): T;
|
|
61
36
|
/**
|
|
62
37
|
* Setup development tools for debugging
|
|
63
38
|
*/
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* Clean up resources
|
|
67
|
-
*/
|
|
68
|
-
destroy(): void;
|
|
39
|
+
protected setupDevTools(): void;
|
|
69
40
|
}
|
|
@@ -29,11 +29,6 @@ export interface ScoredItem<T> {
|
|
|
29
29
|
* Checks explicitly for null/undefined so falsy values like 0 or false are preserved.
|
|
30
30
|
*/
|
|
31
31
|
export declare const getFieldValue: <T = any>(item: Record<string, any>, path: string) => T;
|
|
32
|
-
/**
|
|
33
|
-
* Compare two values based on a comparison operator.
|
|
34
|
-
* For non-fuzzy operators, this returns a boolean.
|
|
35
|
-
*/
|
|
36
|
-
export declare function compareValues(op: ComparisonOperator, actual: unknown, expected: unknown): boolean;
|
|
37
32
|
/**
|
|
38
33
|
* Filter a Map of items given an array of query conditions.
|
|
39
34
|
* For each query condition:
|
|
@@ -55,5 +50,67 @@ export declare function filterMapItems<T extends Record<string, any>>(items: Map
|
|
|
55
50
|
* Filter an array of items using query conditions
|
|
56
51
|
*/
|
|
57
52
|
export declare function filterArrayItems<T extends Record<string, any>>(items: T[], queries?: QueryCondition[], fuzzyThreshold?: number): T[];
|
|
53
|
+
/**
|
|
54
|
+
* Type guard for checking if a value is an array with better type inference
|
|
55
|
+
* @param value Value to check
|
|
56
|
+
* @returns True if the value is an array
|
|
57
|
+
*/
|
|
58
|
+
export declare function isArray<T = unknown>(value: unknown): value is Array<T>;
|
|
59
|
+
/**
|
|
60
|
+
* Type guard for checking if a value is a string
|
|
61
|
+
* @param value Value to check
|
|
62
|
+
* @returns True if the value is a string
|
|
63
|
+
*/
|
|
64
|
+
export declare function isString(value: unknown): value is string;
|
|
65
|
+
/**
|
|
66
|
+
* Type guard for checking if a value is a number
|
|
67
|
+
* @param value Value to check
|
|
68
|
+
* @returns True if the value is a number and not NaN
|
|
69
|
+
*/
|
|
70
|
+
export declare function isNumber(value: unknown): value is number;
|
|
71
|
+
/**
|
|
72
|
+
* Type guard for checking if a value is a date
|
|
73
|
+
* @param value Value to check
|
|
74
|
+
* @returns True if the value is a valid Date object
|
|
75
|
+
*/
|
|
76
|
+
export declare function isDate(value: unknown): value is Date;
|
|
77
|
+
/**
|
|
78
|
+
* Type guard for checking if a value is an iterable collection
|
|
79
|
+
* @param value Value to check
|
|
80
|
+
* @returns True if the value implements the iterable protocol
|
|
81
|
+
*/
|
|
82
|
+
export declare function isIterable<T = unknown>(value: unknown): value is Iterable<T>;
|
|
83
|
+
/**
|
|
84
|
+
* Type guard for checking if a value is a Map
|
|
85
|
+
* @param value Value to check
|
|
86
|
+
* @returns True if the value is a Map
|
|
87
|
+
*/
|
|
88
|
+
export declare function isMap<K = unknown, V = unknown>(value: unknown): value is Map<K, V>;
|
|
89
|
+
/**
|
|
90
|
+
* Type guard for checking if a value is a Set
|
|
91
|
+
* @param value Value to check
|
|
92
|
+
* @returns True if the value is a Set
|
|
93
|
+
*/
|
|
94
|
+
export declare function isSet<T = unknown>(value: unknown): value is Set<T>;
|
|
95
|
+
/**
|
|
96
|
+
* Type guard for checking if a value is a plain object (not an array, Map, etc.)
|
|
97
|
+
* @param value Value to check
|
|
98
|
+
* @returns True if the value is a plain object
|
|
99
|
+
*/
|
|
100
|
+
export declare function isPlainObject(value: unknown): value is Record<string, unknown>;
|
|
101
|
+
/**
|
|
102
|
+
* Type guard for checking if a value is undefined or null
|
|
103
|
+
* @param value Value to check
|
|
104
|
+
* @returns True if the value is undefined or null
|
|
105
|
+
*/
|
|
106
|
+
export declare function isNil(value: unknown): value is undefined | null;
|
|
107
|
+
/**
|
|
108
|
+
* Improved type-safe comparison function that uses appropriate type guards
|
|
109
|
+
* @param op Comparison operator
|
|
110
|
+
* @param actual Actual value
|
|
111
|
+
* @param expected Expected value
|
|
112
|
+
* @returns Result of the comparison
|
|
113
|
+
*/
|
|
114
|
+
export declare function compareValues(op: ComparisonOperator, actual: unknown, expected: unknown): boolean;
|
|
58
115
|
export declare const filterMap: typeof filterMapItems;
|
|
59
116
|
export declare const filterArray: typeof filterArrayItems;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { Draft, castDraft, castImmutable, Immutable } from 'immer';
|
|
2
|
+
/**
|
|
3
|
+
* Type-safe wrapper functions for immutable operations with Immer
|
|
4
|
+
*
|
|
5
|
+
* Re-export useful Immer types and utilities
|
|
6
|
+
*/
|
|
7
|
+
export { Draft, castDraft, castImmutable, Immutable };
|
|
8
|
+
/**
|
|
9
|
+
* Create an immutable update for Maps
|
|
10
|
+
* @param map Original Map to update
|
|
11
|
+
* @param updater Function that can make "mutable" changes to the draft
|
|
12
|
+
* @returns A new Map with the changes applied
|
|
13
|
+
*/
|
|
14
|
+
export declare function updateMap<K, V>(map: Immutable<Map<K, V>>, updater: (draft: Draft<Map<K, V>>) => void): Map<K, V>;
|
|
15
|
+
/**
|
|
16
|
+
* Create an immutable update for a specific item in a Map
|
|
17
|
+
* @param map Original Map to update
|
|
18
|
+
* @param key Key of the item to update
|
|
19
|
+
* @param updater Function that can make "mutable" changes to the item
|
|
20
|
+
* @returns A new Map with the item updated
|
|
21
|
+
*/
|
|
22
|
+
export declare function updateItem<K, V>(map: Immutable<Map<K, V>>, key: K, updater: (item: Draft<V>) => void): Map<K, V>;
|
|
23
|
+
/**
|
|
24
|
+
* Immutably filter a Map
|
|
25
|
+
* @param map Original Map to filter
|
|
26
|
+
* @param predicate Function that returns true for items to keep
|
|
27
|
+
* @returns A new Map with only the matching items
|
|
28
|
+
*/
|
|
29
|
+
export declare function filterMap<K, V>(map: Immutable<Map<K, V>>, predicate: (value: Immutable<V>, key: Immutable<K>) => boolean): Map<K, V>;
|
|
30
|
+
/**
|
|
31
|
+
* Create an immutable update for an object
|
|
32
|
+
* @param obj Original object to update
|
|
33
|
+
* @param updater Function that can make "mutable" changes to the draft
|
|
34
|
+
* @returns A new object with the changes applied
|
|
35
|
+
*/
|
|
36
|
+
export declare function updateObject<T extends Record<string, any>>(obj: Immutable<T>, updater: (draft: Draft<T>) => void): T;
|
|
37
|
+
/**
|
|
38
|
+
* Merge objects immutably
|
|
39
|
+
* @param target Original object
|
|
40
|
+
* @param source Source object to merge in
|
|
41
|
+
* @returns A new object with properties merged
|
|
42
|
+
*/
|
|
43
|
+
export declare function mergeObjects<T extends Record<string, any>>(target: Immutable<T>, source: Partial<T>): T;
|
|
44
|
+
/**
|
|
45
|
+
* Type guard to check if an object is a Map
|
|
46
|
+
*/
|
|
47
|
+
export declare function isMap<K = unknown, V = unknown>(value: unknown): value is Map<K, V>;
|
|
48
|
+
/**
|
|
49
|
+
* Creates a readonly version of a type
|
|
50
|
+
* This is a utility that uses Immer's Immutable type to make a type readonly
|
|
51
|
+
* @param value The value to cast as immutable
|
|
52
|
+
* @returns The same value but typed as immutable
|
|
53
|
+
*/
|
|
54
|
+
export declare function asReadonly<T>(value: T): Immutable<T>;
|
|
55
|
+
/**
|
|
56
|
+
* Makes an object or Map deeply immutable at runtime by freezing
|
|
57
|
+
* @param value The value to freeze
|
|
58
|
+
* @returns The frozen value
|
|
59
|
+
*/
|
|
60
|
+
export declare function freeze<T>(value: T): Immutable<T>;
|