@ienlab/react-library 0.5.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/image.d.ts.map +1 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/constant/firestore.d.ts.map +1 -1
- package/dist/constant/index.d.ts.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/locales/index.d.ts.map +1 -1
- package/dist/my-library.cjs.js +1 -1
- package/dist/my-library.es.js +59 -35
- package/dist/types/firestore.d.ts.map +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/shadcn.d.ts.map +1 -1
- package/dist/utils/firestore.d.ts +2 -2
- package/dist/utils/firestore.d.ts.map +1 -1
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/zustand.d.ts +12 -0
- package/dist/utils/zustand.d.ts.map +1 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../../src/components/image.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAuB,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../../src/components/image.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAuB,MAAM,OAAO,CAAA;AAC9D,OAAO,EAA2B,KAAK,eAAe,EAAE,MAAM,cAAc,CAAA;AAE5E,UAAU,mBAAoB,SAAQ,eAAe,CAAC,KAAK,CAAC;IAC1D,WAAW,CAAC,EAAE,YAAY,CAAA;IAC1B,GAAG,EAAE,MAAM,CAAA;IACX,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,KAAK,IAAI,CAAA;CAC9C;AAED,wBAAgB,cAAc,CAAC,EAAC,WAAW,EAAE,GAAG,EAAE,WAAW,EAAE,GAAG,QAAQ,EAAC,EAAE,mBAAmB,2CAgE/F"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"firestore.d.ts","sourceRoot":"","sources":["../../src/constant/firestore.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,UAAU;;;CAGrB,
|
|
1
|
+
{"version":3,"file":"firestore.d.ts","sourceRoot":"","sources":["../../src/constant/firestore.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,UAAU;;;CAGrB,CAAA;AAEF,eAAO,MAAM,YAAY;;;CAGvB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/constant/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/constant/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA"}
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,SAAS,CAAA;AACvB,cAAc,SAAS,CAAA;AACvB,cAAc,SAAS,CAAA;AACvB,cAAc,YAAY,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/locales/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,QAAQ,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/locales/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAA"}
|
package/dist/my-library.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require(`react`),t=require(`motion/react`),n=require(`react/jsx-runtime`),r=require(`firebase/firestore`);function
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require(`react`),t=require(`motion/react`),n=require(`react/jsx-runtime`),r=require(`firebase/firestore`),i=require(`zustand/react`);function a({placeholder:r,src:i,onLoadError:a,...o}){let[s,c]=(0,e.useState)(()=>{if(typeof window>`u`||!i)return!1;let e=new Image;return e.src=i,e.complete&&e.naturalWidth>0}),[l,u]=(0,e.useState)(i);return l!==i&&(u(i),c(!1)),(0,e.useEffect)(()=>{if(!i)return;let e=new Image;return e.src=i,e.onload=()=>c(!0),e.onerror=e=>{a?a(e):console.error(`CrossfadeImage: Failed to load image`,i)},e.complete&&e.naturalWidth>0&&e.onload(new Event(`load`)),()=>{e.onload=null,e.onerror=null}},[i,a]),(0,n.jsx)(t.AnimatePresence,{children:s&&i?(0,n.jsx)(t.motion.img,{src:i,...o,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},style:{...o.style}},`loaded-image`):(0,n.jsx)(t.motion.div,{initial:{opacity:1},transition:{duration:.3},style:{...o.style},children:r??(0,n.jsx)(`div`,{className:`w-full h-full bg-sidebar`})},`placeholder`)})}function o(e){return{...e.data(),id:e.id}}async function s(e,t,n,i){let a=i.filter(e=>!!(e&&!n.has(e.path)));for(let i=0;i<a.length;i+=30){let o=a.slice(i,i+30);(await(0,r.getDocs)((0,r.query)(e,(0,r.where)((0,r.documentId)(),`in`,o.map(e=>e.id))))).forEach(e=>{let r=t(e);n.set(e.ref.path,r)})}}async function c(e,t,n){let i=n.filter(e=>!!(e&&!t.has(e.path)));await Promise.all(i.map(async n=>{let i=e(await(0,r.getDoc)(n));t.set(n.path,i)}))}function l(e,t,n={}){let{cache:i=!0,onError:a}=n;return(0,r.onSnapshot)(e,{includeMetadataChanges:!i},e=>{(i||!e.metadata.fromCache)&&t(e)},a)}Array.prototype.mapNotNull=function(e){return this.flatMap((t,n)=>{let r=e(t,n);return r==null?[]:[r]})};function u(){if(typeof window>`u`)return`pc`;let e=navigator.userAgent,t=navigator.platform,n=/Android/i.test(e),r=/iPhone|iPad|iPod/i.test(e)||t===`MacIntel`&&navigator.maxTouchPoints>1;return n?`android`:r?`ios`:`pc`}function d(t){let r=(0,e.createContext)(null);function a({children:i,...a}){let[o]=(0,e.useState)(()=>t(a));return(0,n.jsx)(r.Provider,{value:o,children:i})}function o(t){let n=(0,e.useContext)(r);if(!n)throw Error(`Provider가 필요합니다.`);return(0,i.useStore)(n,t)}let s=new Map;return{Provider:a,useStore:o,use:new Proxy({},{get:(e,t)=>(s.has(t)||s.set(t,()=>o(e=>e[t])),s.get(t))})}}var f=()=>({updateAt:(0,r.serverTimestamp)(),delete:!0}),p=()=>({updateAt:(0,r.serverTimestamp)(),delete:!1});exports.CrossfadeImage=a,exports.createZustandContext=d,exports.deleteItem=f,exports.fetchItems=s,exports.fetchItemsByOne=c,exports.getPlatformType=u,exports.getSnapshots=l,exports.snapshotToData=o,exports.undeleteItem=p;
|
package/dist/my-library.es.js
CHANGED
|
@@ -1,64 +1,65 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { AnimatePresence as
|
|
3
|
-
import { jsx as
|
|
4
|
-
import {
|
|
1
|
+
import { createContext as e, useContext as t, useEffect as n, useState as r } from "react";
|
|
2
|
+
import { AnimatePresence as i, motion as a } from "motion/react";
|
|
3
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
4
|
+
import { documentId as s, getDoc as c, getDocs as l, onSnapshot as u, query as d, serverTimestamp as f, where as p } from "firebase/firestore";
|
|
5
|
+
import { useStore as m } from "zustand/react";
|
|
5
6
|
//#region src/components/image.tsx
|
|
6
|
-
function
|
|
7
|
-
let [l, u] =
|
|
8
|
-
if (typeof window > "u" || !
|
|
7
|
+
function h({ placeholder: e, src: t, onLoadError: s, ...c }) {
|
|
8
|
+
let [l, u] = r(() => {
|
|
9
|
+
if (typeof window > "u" || !t) return !1;
|
|
9
10
|
let e = new Image();
|
|
10
|
-
return e.src =
|
|
11
|
-
}), [d, f] = t
|
|
12
|
-
return d !==
|
|
13
|
-
if (!
|
|
11
|
+
return e.src = t, e.complete && e.naturalWidth > 0;
|
|
12
|
+
}), [d, f] = r(t);
|
|
13
|
+
return d !== t && (f(t), u(!1)), n(() => {
|
|
14
|
+
if (!t) return;
|
|
14
15
|
let e = new Image();
|
|
15
|
-
return e.src =
|
|
16
|
-
s ? s(e) : console.error("CrossfadeImage: Failed to load image",
|
|
16
|
+
return e.src = t, e.onload = () => u(!0), e.onerror = (e) => {
|
|
17
|
+
s ? s(e) : console.error("CrossfadeImage: Failed to load image", t);
|
|
17
18
|
}, e.complete && e.naturalWidth > 0 && e.onload(new Event("load")), () => {
|
|
18
19
|
e.onload = null, e.onerror = null;
|
|
19
20
|
};
|
|
20
|
-
}, [
|
|
21
|
-
src:
|
|
21
|
+
}, [t, s]), /* @__PURE__ */ o(i, { children: l && t ? /* @__PURE__ */ o(a.img, {
|
|
22
|
+
src: t,
|
|
22
23
|
...c,
|
|
23
24
|
initial: { opacity: 0 },
|
|
24
25
|
animate: { opacity: 1 },
|
|
25
26
|
exit: { opacity: 0 },
|
|
26
27
|
style: { ...c.style }
|
|
27
|
-
}, "loaded-image") : /* @__PURE__ */
|
|
28
|
+
}, "loaded-image") : /* @__PURE__ */ o(a.div, {
|
|
28
29
|
initial: { opacity: 1 },
|
|
29
30
|
transition: { duration: .3 },
|
|
30
31
|
style: { ...c.style },
|
|
31
|
-
children:
|
|
32
|
+
children: e ?? /* @__PURE__ */ o("div", { className: "w-full h-full bg-sidebar" })
|
|
32
33
|
}, "placeholder") });
|
|
33
34
|
}
|
|
34
35
|
//#endregion
|
|
35
36
|
//#region src/utils/firestore.ts
|
|
36
|
-
function
|
|
37
|
+
function g(e) {
|
|
37
38
|
return {
|
|
38
39
|
...e.data(),
|
|
39
40
|
id: e.id
|
|
40
41
|
};
|
|
41
42
|
}
|
|
42
|
-
async function
|
|
43
|
-
let
|
|
44
|
-
for (let
|
|
45
|
-
let
|
|
46
|
-
(await
|
|
47
|
-
let
|
|
48
|
-
|
|
43
|
+
async function _(e, t, n, r) {
|
|
44
|
+
let i = r.filter((e) => !!(e && !n.has(e.path)));
|
|
45
|
+
for (let r = 0; r < i.length; r += 30) {
|
|
46
|
+
let a = i.slice(r, r + 30);
|
|
47
|
+
(await l(d(e, p(s(), "in", a.map((e) => e.id))))).forEach((e) => {
|
|
48
|
+
let r = t(e);
|
|
49
|
+
n.set(e.ref.path, r);
|
|
49
50
|
});
|
|
50
51
|
}
|
|
51
52
|
}
|
|
52
|
-
async function
|
|
53
|
+
async function v(e, t, n) {
|
|
53
54
|
let r = n.filter((e) => !!(e && !t.has(e.path)));
|
|
54
55
|
await Promise.all(r.map(async (n) => {
|
|
55
|
-
let r = e(await
|
|
56
|
+
let r = e(await c(n));
|
|
56
57
|
t.set(n.path, r);
|
|
57
58
|
}));
|
|
58
59
|
}
|
|
59
|
-
function
|
|
60
|
+
function y(e, t, n = {}) {
|
|
60
61
|
let { cache: r = !0, onError: i } = n;
|
|
61
|
-
return
|
|
62
|
+
return u(e, { includeMetadataChanges: !r }, (e) => {
|
|
62
63
|
(r || !e.metadata.fromCache) && t(e);
|
|
63
64
|
}, i);
|
|
64
65
|
}
|
|
@@ -72,19 +73,42 @@ Array.prototype.mapNotNull = function(e) {
|
|
|
72
73
|
};
|
|
73
74
|
//#endregion
|
|
74
75
|
//#region src/utils/platform.ts
|
|
75
|
-
function
|
|
76
|
+
function b() {
|
|
76
77
|
if (typeof window > "u") return "pc";
|
|
77
78
|
let e = navigator.userAgent, t = navigator.platform, n = /Android/i.test(e), r = /iPhone|iPad|iPod/i.test(e) || t === "MacIntel" && navigator.maxTouchPoints > 1;
|
|
78
79
|
return n ? "android" : r ? "ios" : "pc";
|
|
79
80
|
}
|
|
80
81
|
//#endregion
|
|
82
|
+
//#region src/utils/zustand.tsx
|
|
83
|
+
function x(n) {
|
|
84
|
+
let i = e(null);
|
|
85
|
+
function a({ children: e, ...t }) {
|
|
86
|
+
let [a] = r(() => n(t));
|
|
87
|
+
return /* @__PURE__ */ o(i.Provider, {
|
|
88
|
+
value: a,
|
|
89
|
+
children: e
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
function s(e) {
|
|
93
|
+
let n = t(i);
|
|
94
|
+
if (!n) throw Error("Provider가 필요합니다.");
|
|
95
|
+
return m(n, e);
|
|
96
|
+
}
|
|
97
|
+
let c = /* @__PURE__ */ new Map();
|
|
98
|
+
return {
|
|
99
|
+
Provider: a,
|
|
100
|
+
useStore: s,
|
|
101
|
+
use: new Proxy({}, { get: (e, t) => (c.has(t) || c.set(t, () => s((e) => e[t])), c.get(t)) })
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
//#endregion
|
|
81
105
|
//#region src/constant/firestore.ts
|
|
82
|
-
var
|
|
83
|
-
updateAt:
|
|
106
|
+
var S = () => ({
|
|
107
|
+
updateAt: f(),
|
|
84
108
|
delete: !0
|
|
85
|
-
}),
|
|
86
|
-
updateAt:
|
|
109
|
+
}), C = () => ({
|
|
110
|
+
updateAt: f(),
|
|
87
111
|
delete: !1
|
|
88
112
|
});
|
|
89
113
|
//#endregion
|
|
90
|
-
export {
|
|
114
|
+
export { h as CrossfadeImage, x as createZustandContext, S as deleteItem, _ as fetchItems, v as fetchItemsByOne, b as getPlatformType, y as getSnapshots, g as snapshotToData, C as undeleteItem };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"firestore.d.ts","sourceRoot":"","sources":["../../src/types/firestore.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,oBAAoB,
|
|
1
|
+
{"version":3,"file":"firestore.d.ts","sourceRoot":"","sources":["../../src/types/firestore.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAExF,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,iBAAiB,GAAG,IAAI,CAAC;IAC9B,QAAQ,EAAE,SAAS,CAAC;IACpB,QAAQ,EAAE,SAAS,CAAC;IACpB,MAAM,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,kBAAkB,CAAC,CAAC;IACnC,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC,CAAA;IACxB,mBAAmB,EAAE,gBAAgB,GAAG,IAAI,CAAA;IAC5C,aAAa,EAAE,OAAO,CAAA;IACtB,SAAS,EAAE,OAAO,CAAA;IAClB,OAAO,EAAE,OAAO,CAAA;CACjB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,UAAU,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shadcn.d.ts","sourceRoot":"","sources":["../../src/types/shadcn.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,SAAS,GAAG,WAAW,GAAG,aAAa,
|
|
1
|
+
{"version":3,"file":"shadcn.d.ts","sourceRoot":"","sources":["../../src/types/shadcn.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,SAAS,GAAG,WAAW,GAAG,aAAa,CAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { DocumentData, DocumentReference, DocumentSnapshot, QueryDocumentSnapshot,
|
|
1
|
+
import { CollectionReference, DocumentData, DocumentReference, DocumentSnapshot, QueryDocumentSnapshot, Unsubscribe, FirestoreError } from 'firebase/firestore';
|
|
2
2
|
import { FirestoreItem } from '../types';
|
|
3
3
|
export declare function snapshotToData(snapshot: QueryDocumentSnapshot | DocumentSnapshot): DocumentData;
|
|
4
|
-
export declare function fetchItems<T extends FirestoreItem>(
|
|
4
|
+
export declare function fetchItems<T extends FirestoreItem>(collection: CollectionReference, changeMethod: ((snapshot: QueryDocumentSnapshot | DocumentSnapshot) => T), cache: Map<string, T>, referenceArray: (DocumentReference | undefined | null)[]): Promise<void>;
|
|
5
5
|
export declare function fetchItemsByOne<T extends FirestoreItem>(changeMethod: ((snapshot: QueryDocumentSnapshot | DocumentSnapshot) => T), cache: Map<string, T>, referenceArray: (DocumentReference | undefined | null)[]): Promise<void>;
|
|
6
6
|
export declare function getSnapshots(ref: DocumentReference, callback: (snapshot: DocumentSnapshot) => void, options?: {
|
|
7
7
|
cache?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"firestore.d.ts","sourceRoot":"","sources":["../../src/utils/firestore.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"firestore.d.ts","sourceRoot":"","sources":["../../src/utils/firestore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqC,KAAK,mBAAmB,EAC3D,KAAK,YAAY,EAAE,KAAK,iBAAiB,EAAE,KAAK,gBAAgB,EAAE,KAAK,qBAAqB,EACnG,KAAK,WAAW,EAEhB,KAAK,cAAc,EACpB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,UAAU,CAAA;AAE3C,wBAAgB,cAAc,CAAC,QAAQ,EAAE,qBAAqB,GAAG,gBAAgB,GAAG,YAAY,CAK/F;AAED,wBAAsB,UAAU,CAAC,CAAC,SAAS,aAAa,EACtD,UAAU,EAAE,mBAAmB,EAC/B,YAAY,EAAE,CAAC,CAAC,QAAQ,EAAE,qBAAqB,GAAG,gBAAgB,KAAK,CAAC,CAAC,EACzE,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC,EACrB,cAAc,EAAE,CAAC,iBAAiB,GAAG,SAAS,GAAG,IAAI,CAAC,EAAE,iBAgBzD;AAED,wBAAsB,eAAe,CAAC,CAAC,SAAS,aAAa,EAC3D,YAAY,EAAE,CAAC,CAAC,QAAQ,EAAE,qBAAqB,GAAG,gBAAgB,KAAK,CAAC,CAAC,EACzE,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC,EACrB,cAAc,EAAE,CAAC,iBAAiB,GAAG,SAAS,GAAG,IAAI,CAAC,EAAE,iBAQzD;AAED,wBAAgB,YAAY,CAC1B,GAAG,EAAE,iBAAiB,EACtB,QAAQ,EAAE,CAAC,QAAQ,EAAE,gBAAgB,KAAK,IAAI,EAC9C,OAAO,GAAE;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,CAAA;CAAO,GAC3E,WAAW,CAYb"}
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,SAAS,CAAA;AACvB,cAAc,YAAY,CAAA;AAC1B,cAAc,WAAW,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { StoreApi } from 'zustand/vanilla';
|
|
2
|
+
import { PropsWithChildren } from 'react';
|
|
3
|
+
type AutoSelectors<TState extends object> = {
|
|
4
|
+
[K in keyof TState]: () => TState[K];
|
|
5
|
+
};
|
|
6
|
+
export declare function createZustandContext<TState extends object, TProps extends object>(createLocalStore: (props: TProps) => StoreApi<TState>): {
|
|
7
|
+
Provider: ({ children, ...props }: PropsWithChildren<TProps>) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
useStore: <T>(selector: (state: TState) => T) => T;
|
|
9
|
+
use: AutoSelectors<TState>;
|
|
10
|
+
};
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=zustand.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zustand.d.ts","sourceRoot":"","sources":["../../src/utils/zustand.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,EAAiB,KAAK,iBAAiB,EAAwB,MAAM,OAAO,CAAA;AAGnF,KAAK,aAAa,CAAC,MAAM,SAAS,MAAM,IAAI;KACzC,CAAC,IAAI,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,CAAC,CAAC;CACrC,CAAA;AAED,wBAAgB,oBAAoB,CAAC,MAAM,SAAS,MAAM,EAAE,MAAM,SAAS,MAAM,EAC/E,gBAAgB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,QAAQ,CAAC,MAAM,CAAC;uCAIX,iBAAiB,CAAC,MAAM,CAAC;eAU5C,CAAC,YAAY,CAAC,KAAK,EAAE,MAAM,KAAK,CAAC;;EAyBzD"}
|