@voidhash/mimic-react 0.0.1 → 0.0.3
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/.turbo/turbo-build.log +60 -26
- package/dist/_virtual/_@oxc-project_runtime@0.103.0/helpers/defineProperty.cjs +14 -0
- package/dist/_virtual/_@oxc-project_runtime@0.103.0/helpers/defineProperty.mjs +14 -0
- package/dist/_virtual/_@oxc-project_runtime@0.103.0/helpers/objectSpread2.cjs +27 -0
- package/dist/_virtual/_@oxc-project_runtime@0.103.0/helpers/objectSpread2.mjs +27 -0
- package/dist/_virtual/_@oxc-project_runtime@0.103.0/helpers/toPrimitive.cjs +16 -0
- package/dist/_virtual/_@oxc-project_runtime@0.103.0/helpers/toPrimitive.mjs +16 -0
- package/dist/_virtual/_@oxc-project_runtime@0.103.0/helpers/toPropertyKey.cjs +11 -0
- package/dist/_virtual/_@oxc-project_runtime@0.103.0/helpers/toPropertyKey.mjs +11 -0
- package/dist/_virtual/_@oxc-project_runtime@0.103.0/helpers/typeof.cjs +18 -0
- package/dist/_virtual/_@oxc-project_runtime@0.103.0/helpers/typeof.mjs +12 -0
- package/dist/zustand/index.cjs +2 -94
- package/dist/zustand/index.d.cts +3 -115
- package/dist/zustand/index.d.mts +3 -115
- package/dist/zustand/index.mjs +2 -95
- package/dist/zustand/middleware.cjs +95 -0
- package/dist/zustand/middleware.d.cts +47 -0
- package/dist/zustand/middleware.d.cts.map +1 -0
- package/dist/zustand/middleware.d.mts +47 -0
- package/dist/zustand/middleware.d.mts.map +1 -0
- package/dist/zustand/middleware.mjs +96 -0
- package/dist/zustand/middleware.mjs.map +1 -0
- package/dist/zustand/types.d.cts +75 -0
- package/dist/zustand/types.d.cts.map +1 -0
- package/dist/zustand/types.d.mts +75 -0
- package/dist/zustand/types.d.mts.map +1 -0
- package/dist/zustand-commander/commander.cjs +187 -0
- package/dist/zustand-commander/commander.d.cts +52 -0
- package/dist/zustand-commander/commander.d.cts.map +1 -0
- package/dist/zustand-commander/commander.d.mts +52 -0
- package/dist/zustand-commander/commander.d.mts.map +1 -0
- package/dist/zustand-commander/commander.mjs +185 -0
- package/dist/zustand-commander/commander.mjs.map +1 -0
- package/dist/zustand-commander/hooks.cjs +145 -0
- package/dist/zustand-commander/hooks.d.cts +78 -0
- package/dist/zustand-commander/hooks.d.cts.map +1 -0
- package/dist/zustand-commander/hooks.d.mts +78 -0
- package/dist/zustand-commander/hooks.d.mts.map +1 -0
- package/dist/zustand-commander/hooks.mjs +144 -0
- package/dist/zustand-commander/hooks.mjs.map +1 -0
- package/dist/zustand-commander/index.cjs +15 -354
- package/dist/zustand-commander/index.d.cts +4 -313
- package/dist/zustand-commander/index.d.mts +4 -313
- package/dist/zustand-commander/index.mjs +4 -344
- package/dist/zustand-commander/types.cjs +28 -0
- package/dist/zustand-commander/types.d.cts +195 -0
- package/dist/zustand-commander/types.d.cts.map +1 -0
- package/dist/zustand-commander/types.d.mts +195 -0
- package/dist/zustand-commander/types.d.mts.map +1 -0
- package/dist/zustand-commander/types.mjs +25 -0
- package/dist/zustand-commander/types.mjs.map +1 -0
- package/package.json +3 -3
- package/tsdown.config.ts +1 -1
- package/dist/objectSpread2-CIP_6jda.cjs +0 -73
- package/dist/objectSpread2-CxTyNSYl.mjs +0 -67
- package/dist/zustand/index.d.cts.map +0 -1
- package/dist/zustand/index.d.mts.map +0 -1
- package/dist/zustand/index.mjs.map +0 -1
- package/dist/zustand-commander/index.d.cts.map +0 -1
- package/dist/zustand-commander/index.d.mts.map +0 -1
- package/dist/zustand-commander/index.mjs.map +0 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @voidhash/mimic-react@0.0.
|
|
2
|
+
> @voidhash/mimic-react@0.0.3 build /home/runner/work/mimic/mimic/packages/mimic-react
|
|
3
3
|
> tsdown
|
|
4
4
|
|
|
5
5
|
[34mℹ[39m tsdown [2mv0.18.2[22m powered by rolldown [2mv1.0.0-beta.55[22m
|
|
@@ -8,28 +8,62 @@
|
|
|
8
8
|
[34mℹ[39m target: [34mes2017[39m
|
|
9
9
|
[34mℹ[39m tsconfig: [34mtsconfig.json[39m
|
|
10
10
|
[34mℹ[39m Build start
|
|
11
|
-
[34mℹ[39m [33m[CJS][39m [2mdist/[22m[1mzustand-commander/index.cjs[22m
|
|
12
|
-
[34mℹ[39m [33m[CJS][39m [2mdist/[22m[1mzustand/index.cjs[22m
|
|
13
|
-
[34mℹ[39m [33m[CJS][39m [2mdist/[22m[1mindex.cjs[22m
|
|
14
|
-
[34mℹ[39m [33m[CJS][39m [2mdist/[
|
|
15
|
-
[34mℹ[39m [33m[CJS][39m
|
|
16
|
-
[34mℹ[39m [33m[CJS][39m [2mdist/[22mzustand
|
|
17
|
-
[34mℹ[39m [33m[CJS][39m [2mdist/[
|
|
18
|
-
[34mℹ[39m [33m[CJS][39m [2mdist/[
|
|
19
|
-
[34mℹ[39m [33m[CJS][39m [2mdist/[
|
|
20
|
-
[34mℹ[39m [33m[CJS][39m [2mdist/[
|
|
21
|
-
[34mℹ[39m [33m[CJS][39m
|
|
22
|
-
[
|
|
23
|
-
[34mℹ[39m [
|
|
24
|
-
[34mℹ[39m [
|
|
25
|
-
[34mℹ[39m [
|
|
26
|
-
[34mℹ[39m [
|
|
27
|
-
[34mℹ[39m [
|
|
28
|
-
[34mℹ[39m [
|
|
29
|
-
[34mℹ[39m [
|
|
30
|
-
[34mℹ[39m [
|
|
31
|
-
[34mℹ[39m [
|
|
32
|
-
[34mℹ[39m [
|
|
33
|
-
[34mℹ[39m [
|
|
34
|
-
[34mℹ[39m [
|
|
35
|
-
[
|
|
11
|
+
[34mℹ[39m [33m[CJS][39m [2mdist/[22m[1mzustand-commander/index.cjs[22m [2m0.78 kB[22m [2m│ gzip: 0.24 kB[22m
|
|
12
|
+
[34mℹ[39m [33m[CJS][39m [2mdist/[22m[1mzustand/index.cjs[22m [2m0.10 kB[22m [2m│ gzip: 0.08 kB[22m
|
|
13
|
+
[34mℹ[39m [33m[CJS][39m [2mdist/[22m[1mindex.cjs[22m [2m0.00 kB[22m [2m│ gzip: 0.02 kB[22m
|
|
14
|
+
[34mℹ[39m [33m[CJS][39m [2mdist/[22mzustand-commander/commander.cjs [2m5.39 kB[22m [2m│ gzip: 1.54 kB[22m
|
|
15
|
+
[34mℹ[39m [33m[CJS][39m [2mdist/[22mzustand-commander/hooks.cjs [2m4.18 kB[22m [2m│ gzip: 1.46 kB[22m
|
|
16
|
+
[34mℹ[39m [33m[CJS][39m [2mdist/[22mzustand/middleware.cjs [2m3.06 kB[22m [2m│ gzip: 1.12 kB[22m
|
|
17
|
+
[34mℹ[39m [33m[CJS][39m [2mdist/[22m_virtual/_@oxc-project_runtime@0.103.0/helpers/objectSpread2.cjs [2m0.95 kB[22m [2m│ gzip: 0.43 kB[22m
|
|
18
|
+
[34mℹ[39m [33m[CJS][39m [2mdist/[22mzustand-commander/types.cjs [2m0.91 kB[22m [2m│ gzip: 0.34 kB[22m
|
|
19
|
+
[34mℹ[39m [33m[CJS][39m [2mdist/[22m_virtual/_@oxc-project_runtime@0.103.0/helpers/typeof.cjs [2m0.53 kB[22m [2m│ gzip: 0.29 kB[22m
|
|
20
|
+
[34mℹ[39m [33m[CJS][39m [2mdist/[22m_virtual/_@oxc-project_runtime@0.103.0/helpers/toPrimitive.cjs [2m0.52 kB[22m [2m│ gzip: 0.32 kB[22m
|
|
21
|
+
[34mℹ[39m [33m[CJS][39m [2mdist/[22m_virtual/_@oxc-project_runtime@0.103.0/helpers/defineProperty.cjs [2m0.40 kB[22m [2m│ gzip: 0.24 kB[22m
|
|
22
|
+
[34mℹ[39m [33m[CJS][39m [2mdist/[22m_virtual/_@oxc-project_runtime@0.103.0/helpers/toPropertyKey.cjs [2m0.37 kB[22m [2m│ gzip: 0.23 kB[22m
|
|
23
|
+
[34mℹ[39m [33m[CJS][39m 12 files, total: 17.16 kB
|
|
24
|
+
[34mℹ[39m [33m[CJS][39m [2mdist/[22mzustand-commander/types.d.cts.map [2m2.75 kB[22m [2m│ gzip: 1.17 kB[22m
|
|
25
|
+
[34mℹ[39m [33m[CJS][39m [2mdist/[22mzustand/types.d.cts.map [2m1.24 kB[22m [2m│ gzip: 0.59 kB[22m
|
|
26
|
+
[34mℹ[39m [33m[CJS][39m [2mdist/[22mzustand-commander/hooks.d.cts.map [2m0.48 kB[22m [2m│ gzip: 0.30 kB[22m
|
|
27
|
+
[34mℹ[39m [33m[CJS][39m [2mdist/[22mzustand/middleware.d.cts.map [2m0.38 kB[22m [2m│ gzip: 0.23 kB[22m
|
|
28
|
+
[34mℹ[39m [33m[CJS][39m [2mdist/[22mzustand-commander/commander.d.cts.map [2m0.30 kB[22m [2m│ gzip: 0.20 kB[22m
|
|
29
|
+
[34mℹ[39m [33m[CJS][39m [2mdist/[22m[32m[1mzustand-commander/index.d.cts[22m[39m [2m1.14 kB[22m [2m│ gzip: 0.36 kB[22m
|
|
30
|
+
[34mℹ[39m [33m[CJS][39m [2mdist/[22m[32m[1mzustand/index.d.cts[22m[39m [2m0.24 kB[22m [2m│ gzip: 0.14 kB[22m
|
|
31
|
+
[34mℹ[39m [33m[CJS][39m [2mdist/[22m[32m[1mindex.d.cts[22m[39m [2m0.01 kB[22m [2m│ gzip: 0.03 kB[22m
|
|
32
|
+
[34mℹ[39m [33m[CJS][39m [2mdist/[22m[32mzustand-commander/types.d.cts[39m [2m7.04 kB[22m [2m│ gzip: 2.06 kB[22m
|
|
33
|
+
[34mℹ[39m [33m[CJS][39m [2mdist/[22m[32mzustand/types.d.cts[39m [2m3.15 kB[22m [2m│ gzip: 1.02 kB[22m
|
|
34
|
+
[34mℹ[39m [33m[CJS][39m [2mdist/[22m[32mzustand-commander/hooks.d.cts[39m [2m2.52 kB[22m [2m│ gzip: 0.89 kB[22m
|
|
35
|
+
[34mℹ[39m [33m[CJS][39m [2mdist/[22m[32mzustand/middleware.d.cts[39m [2m2.13 kB[22m [2m│ gzip: 0.85 kB[22m
|
|
36
|
+
[34mℹ[39m [33m[CJS][39m [2mdist/[22m[32mzustand-commander/commander.d.cts[39m [2m1.63 kB[22m [2m│ gzip: 0.64 kB[22m
|
|
37
|
+
[34mℹ[39m [33m[CJS][39m 13 files, total: 23.02 kB
|
|
38
|
+
[32m✔[39m Build complete in [32m3855ms[39m
|
|
39
|
+
[34mℹ[39m [34m[ESM][39m [2mdist/[22m[1mzustand-commander/index.mjs[22m [2m 0.47 kB[22m [2m│ gzip: 0.20 kB[22m
|
|
40
|
+
[34mℹ[39m [34m[ESM][39m [2mdist/[22m[1mzustand/index.mjs[22m [2m 0.06 kB[22m [2m│ gzip: 0.07 kB[22m
|
|
41
|
+
[34mℹ[39m [34m[ESM][39m [2mdist/[22m[1mindex.mjs[22m [2m 0.01 kB[22m [2m│ gzip: 0.03 kB[22m
|
|
42
|
+
[34mℹ[39m [34m[ESM][39m [2mdist/[22mzustand-commander/commander.mjs.map [2m11.46 kB[22m [2m│ gzip: 3.08 kB[22m
|
|
43
|
+
[34mℹ[39m [34m[ESM][39m [2mdist/[22mzustand-commander/types.mjs.map [2m10.16 kB[22m [2m│ gzip: 2.60 kB[22m
|
|
44
|
+
[34mℹ[39m [34m[ESM][39m [2mdist/[22mzustand-commander/hooks.mjs.map [2m 9.15 kB[22m [2m│ gzip: 2.82 kB[22m
|
|
45
|
+
[34mℹ[39m [34m[ESM][39m [2mdist/[22mzustand/middleware.mjs.map [2m 6.72 kB[22m [2m│ gzip: 2.09 kB[22m
|
|
46
|
+
[34mℹ[39m [34m[ESM][39m [2mdist/[22mzustand-commander/commander.mjs [2m 5.05 kB[22m [2m│ gzip: 1.54 kB[22m
|
|
47
|
+
[34mℹ[39m [34m[ESM][39m [2mdist/[22mzustand-commander/hooks.mjs [2m 3.95 kB[22m [2m│ gzip: 1.46 kB[22m
|
|
48
|
+
[34mℹ[39m [34m[ESM][39m [2mdist/[22mzustand/middleware.mjs [2m 3.00 kB[22m [2m│ gzip: 1.13 kB[22m
|
|
49
|
+
[34mℹ[39m [34m[ESM][39m [2mdist/[22mzustand-commander/types.d.mts.map [2m 2.75 kB[22m [2m│ gzip: 1.17 kB[22m
|
|
50
|
+
[34mℹ[39m [34m[ESM][39m [2mdist/[22mzustand/types.d.mts.map [2m 1.24 kB[22m [2m│ gzip: 0.59 kB[22m
|
|
51
|
+
[34mℹ[39m [34m[ESM][39m [2mdist/[22m_virtual/_@oxc-project_runtime@0.103.0/helpers/objectSpread2.mjs [2m 0.90 kB[22m [2m│ gzip: 0.42 kB[22m
|
|
52
|
+
[34mℹ[39m [34m[ESM][39m [2mdist/[22mzustand-commander/types.mjs [2m 0.84 kB[22m [2m│ gzip: 0.35 kB[22m
|
|
53
|
+
[34mℹ[39m [34m[ESM][39m [2mdist/[22mzustand-commander/hooks.d.mts.map [2m 0.48 kB[22m [2m│ gzip: 0.30 kB[22m
|
|
54
|
+
[34mℹ[39m [34m[ESM][39m [2mdist/[22m_virtual/_@oxc-project_runtime@0.103.0/helpers/toPrimitive.mjs [2m 0.47 kB[22m [2m│ gzip: 0.30 kB[22m
|
|
55
|
+
[34mℹ[39m [34m[ESM][39m [2mdist/[22m_virtual/_@oxc-project_runtime@0.103.0/helpers/typeof.mjs [2m 0.43 kB[22m [2m│ gzip: 0.24 kB[22m
|
|
56
|
+
[34mℹ[39m [34m[ESM][39m [2mdist/[22mzustand/middleware.d.mts.map [2m 0.38 kB[22m [2m│ gzip: 0.23 kB[22m
|
|
57
|
+
[34mℹ[39m [34m[ESM][39m [2mdist/[22m_virtual/_@oxc-project_runtime@0.103.0/helpers/defineProperty.mjs [2m 0.35 kB[22m [2m│ gzip: 0.23 kB[22m
|
|
58
|
+
[34mℹ[39m [34m[ESM][39m [2mdist/[22m_virtual/_@oxc-project_runtime@0.103.0/helpers/toPropertyKey.mjs [2m 0.30 kB[22m [2m│ gzip: 0.21 kB[22m
|
|
59
|
+
[34mℹ[39m [34m[ESM][39m [2mdist/[22mzustand-commander/commander.d.mts.map [2m 0.30 kB[22m [2m│ gzip: 0.20 kB[22m
|
|
60
|
+
[34mℹ[39m [34m[ESM][39m [2mdist/[22m[32m[1mzustand-commander/index.d.mts[22m[39m [2m 1.14 kB[22m [2m│ gzip: 0.36 kB[22m
|
|
61
|
+
[34mℹ[39m [34m[ESM][39m [2mdist/[22m[32m[1mzustand/index.d.mts[22m[39m [2m 0.24 kB[22m [2m│ gzip: 0.14 kB[22m
|
|
62
|
+
[34mℹ[39m [34m[ESM][39m [2mdist/[22m[32m[1mindex.d.mts[22m[39m [2m 0.01 kB[22m [2m│ gzip: 0.03 kB[22m
|
|
63
|
+
[34mℹ[39m [34m[ESM][39m [2mdist/[22m[32mzustand-commander/types.d.mts[39m [2m 7.04 kB[22m [2m│ gzip: 2.06 kB[22m
|
|
64
|
+
[34mℹ[39m [34m[ESM][39m [2mdist/[22m[32mzustand/types.d.mts[39m [2m 3.15 kB[22m [2m│ gzip: 1.02 kB[22m
|
|
65
|
+
[34mℹ[39m [34m[ESM][39m [2mdist/[22m[32mzustand-commander/hooks.d.mts[39m [2m 2.52 kB[22m [2m│ gzip: 0.89 kB[22m
|
|
66
|
+
[34mℹ[39m [34m[ESM][39m [2mdist/[22m[32mzustand/middleware.d.mts[39m [2m 2.13 kB[22m [2m│ gzip: 0.85 kB[22m
|
|
67
|
+
[34mℹ[39m [34m[ESM][39m [2mdist/[22m[32mzustand-commander/commander.d.mts[39m [2m 1.63 kB[22m [2m│ gzip: 0.64 kB[22m
|
|
68
|
+
[34mℹ[39m [34m[ESM][39m 29 files, total: 76.37 kB
|
|
69
|
+
[32m✔[39m Build complete in [32m3869ms[39m
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
const require_toPropertyKey = require('./toPropertyKey.cjs');
|
|
2
|
+
|
|
3
|
+
//#region \0@oxc-project+runtime@0.103.0/helpers/defineProperty.js
|
|
4
|
+
function _defineProperty(e, r, t) {
|
|
5
|
+
return (r = require_toPropertyKey.toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
6
|
+
value: t,
|
|
7
|
+
enumerable: !0,
|
|
8
|
+
configurable: !0,
|
|
9
|
+
writable: !0
|
|
10
|
+
}) : e[r] = t, e;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
//#endregion
|
|
14
|
+
exports._defineProperty = _defineProperty;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { toPropertyKey } from "./toPropertyKey.mjs";
|
|
2
|
+
|
|
3
|
+
//#region \0@oxc-project+runtime@0.103.0/helpers/defineProperty.js
|
|
4
|
+
function _defineProperty(e, r, t) {
|
|
5
|
+
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
6
|
+
value: t,
|
|
7
|
+
enumerable: !0,
|
|
8
|
+
configurable: !0,
|
|
9
|
+
writable: !0
|
|
10
|
+
}) : e[r] = t, e;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
//#endregion
|
|
14
|
+
export { _defineProperty };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
const require_defineProperty = require('./defineProperty.cjs');
|
|
2
|
+
|
|
3
|
+
//#region \0@oxc-project+runtime@0.103.0/helpers/objectSpread2.js
|
|
4
|
+
function ownKeys(e, r) {
|
|
5
|
+
var t = Object.keys(e);
|
|
6
|
+
if (Object.getOwnPropertySymbols) {
|
|
7
|
+
var o = Object.getOwnPropertySymbols(e);
|
|
8
|
+
r && (o = o.filter(function(r$1) {
|
|
9
|
+
return Object.getOwnPropertyDescriptor(e, r$1).enumerable;
|
|
10
|
+
})), t.push.apply(t, o);
|
|
11
|
+
}
|
|
12
|
+
return t;
|
|
13
|
+
}
|
|
14
|
+
function _objectSpread2(e) {
|
|
15
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
16
|
+
var t = null != arguments[r] ? arguments[r] : {};
|
|
17
|
+
r % 2 ? ownKeys(Object(t), !0).forEach(function(r$1) {
|
|
18
|
+
require_defineProperty._defineProperty(e, r$1, t[r$1]);
|
|
19
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r$1) {
|
|
20
|
+
Object.defineProperty(e, r$1, Object.getOwnPropertyDescriptor(t, r$1));
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
return e;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
//#endregion
|
|
27
|
+
exports._objectSpread2 = _objectSpread2;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { _defineProperty } from "./defineProperty.mjs";
|
|
2
|
+
|
|
3
|
+
//#region \0@oxc-project+runtime@0.103.0/helpers/objectSpread2.js
|
|
4
|
+
function ownKeys(e, r) {
|
|
5
|
+
var t = Object.keys(e);
|
|
6
|
+
if (Object.getOwnPropertySymbols) {
|
|
7
|
+
var o = Object.getOwnPropertySymbols(e);
|
|
8
|
+
r && (o = o.filter(function(r$1) {
|
|
9
|
+
return Object.getOwnPropertyDescriptor(e, r$1).enumerable;
|
|
10
|
+
})), t.push.apply(t, o);
|
|
11
|
+
}
|
|
12
|
+
return t;
|
|
13
|
+
}
|
|
14
|
+
function _objectSpread2(e) {
|
|
15
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
16
|
+
var t = null != arguments[r] ? arguments[r] : {};
|
|
17
|
+
r % 2 ? ownKeys(Object(t), !0).forEach(function(r$1) {
|
|
18
|
+
_defineProperty(e, r$1, t[r$1]);
|
|
19
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r$1) {
|
|
20
|
+
Object.defineProperty(e, r$1, Object.getOwnPropertyDescriptor(t, r$1));
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
return e;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
//#endregion
|
|
27
|
+
export { _objectSpread2 };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
const require_typeof = require('./typeof.cjs');
|
|
2
|
+
|
|
3
|
+
//#region \0@oxc-project+runtime@0.103.0/helpers/toPrimitive.js
|
|
4
|
+
function toPrimitive(t, r) {
|
|
5
|
+
if ("object" != require_typeof._typeof(t) || !t) return t;
|
|
6
|
+
var e = t[Symbol.toPrimitive];
|
|
7
|
+
if (void 0 !== e) {
|
|
8
|
+
var i = e.call(t, r || "default");
|
|
9
|
+
if ("object" != require_typeof._typeof(i)) return i;
|
|
10
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
11
|
+
}
|
|
12
|
+
return ("string" === r ? String : Number)(t);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
//#endregion
|
|
16
|
+
exports.toPrimitive = toPrimitive;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { _typeof } from "./typeof.mjs";
|
|
2
|
+
|
|
3
|
+
//#region \0@oxc-project+runtime@0.103.0/helpers/toPrimitive.js
|
|
4
|
+
function toPrimitive(t, r) {
|
|
5
|
+
if ("object" != _typeof(t) || !t) return t;
|
|
6
|
+
var e = t[Symbol.toPrimitive];
|
|
7
|
+
if (void 0 !== e) {
|
|
8
|
+
var i = e.call(t, r || "default");
|
|
9
|
+
if ("object" != _typeof(i)) return i;
|
|
10
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
11
|
+
}
|
|
12
|
+
return ("string" === r ? String : Number)(t);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
//#endregion
|
|
16
|
+
export { toPrimitive };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
const require_typeof = require('./typeof.cjs');
|
|
2
|
+
const require_toPrimitive = require('./toPrimitive.cjs');
|
|
3
|
+
|
|
4
|
+
//#region \0@oxc-project+runtime@0.103.0/helpers/toPropertyKey.js
|
|
5
|
+
function toPropertyKey(t) {
|
|
6
|
+
var i = require_toPrimitive.toPrimitive(t, "string");
|
|
7
|
+
return "symbol" == require_typeof._typeof(i) ? i : i + "";
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
//#endregion
|
|
11
|
+
exports.toPropertyKey = toPropertyKey;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { _typeof } from "./typeof.mjs";
|
|
2
|
+
import { toPrimitive } from "./toPrimitive.mjs";
|
|
3
|
+
|
|
4
|
+
//#region \0@oxc-project+runtime@0.103.0/helpers/toPropertyKey.js
|
|
5
|
+
function toPropertyKey(t) {
|
|
6
|
+
var i = toPrimitive(t, "string");
|
|
7
|
+
return "symbol" == _typeof(i) ? i : i + "";
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
//#endregion
|
|
11
|
+
export { toPropertyKey };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
|
|
2
|
+
//#region \0@oxc-project+runtime@0.103.0/helpers/typeof.js
|
|
3
|
+
function _typeof(o) {
|
|
4
|
+
"@babel/helpers - typeof";
|
|
5
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o$1) {
|
|
6
|
+
return typeof o$1;
|
|
7
|
+
} : function(o$1) {
|
|
8
|
+
return o$1 && "function" == typeof Symbol && o$1.constructor === Symbol && o$1 !== Symbol.prototype ? "symbol" : typeof o$1;
|
|
9
|
+
}, _typeof(o);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
//#endregion
|
|
13
|
+
Object.defineProperty(exports, '_typeof', {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
get: function () {
|
|
16
|
+
return _typeof;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
//#region \0@oxc-project+runtime@0.103.0/helpers/typeof.js
|
|
2
|
+
function _typeof(o) {
|
|
3
|
+
"@babel/helpers - typeof";
|
|
4
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o$1) {
|
|
5
|
+
return typeof o$1;
|
|
6
|
+
} : function(o$1) {
|
|
7
|
+
return o$1 && "function" == typeof Symbol && o$1.constructor === Symbol && o$1 !== Symbol.prototype ? "symbol" : typeof o$1;
|
|
8
|
+
}, _typeof(o);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
//#endregion
|
|
12
|
+
export { _typeof };
|
package/dist/zustand/index.cjs
CHANGED
|
@@ -1,95 +1,3 @@
|
|
|
1
|
-
const
|
|
1
|
+
const require_middleware = require('./middleware.cjs');
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Creates a MimicObject from the current document state.
|
|
6
|
-
*/
|
|
7
|
-
const createMimicObject = (document) => {
|
|
8
|
-
const presence = document.presence ? {
|
|
9
|
-
selfId: document.presence.selfId(),
|
|
10
|
-
self: document.presence.self(),
|
|
11
|
-
others: new Map(document.presence.others()),
|
|
12
|
-
all: new Map(document.presence.all())
|
|
13
|
-
} : void 0;
|
|
14
|
-
return {
|
|
15
|
-
document,
|
|
16
|
-
snapshot: document.root.toSnapshot(),
|
|
17
|
-
presence,
|
|
18
|
-
isConnected: document.isConnected(),
|
|
19
|
-
isReady: document.isReady(),
|
|
20
|
-
pendingCount: document.getPendingCount(),
|
|
21
|
-
hasPendingChanges: document.hasPendingChanges()
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
/**
|
|
25
|
-
* Implementation of the mimic middleware.
|
|
26
|
-
*/
|
|
27
|
-
const mimicImpl = (document, config, options = {}) => {
|
|
28
|
-
const { autoSubscribe = true, autoConnect = true } = options;
|
|
29
|
-
return (set, get, api) => {
|
|
30
|
-
const initialMimic = createMimicObject(document);
|
|
31
|
-
const updateMimicState = () => {
|
|
32
|
-
const newMimic = createMimicObject(document);
|
|
33
|
-
set((state) => require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, state), {}, { mimic: newMimic }), false);
|
|
34
|
-
};
|
|
35
|
-
if (autoSubscribe) {
|
|
36
|
-
var _document$presence;
|
|
37
|
-
document.subscribe({
|
|
38
|
-
onStateChange: () => {
|
|
39
|
-
updateMimicState();
|
|
40
|
-
},
|
|
41
|
-
onConnectionChange: () => {
|
|
42
|
-
updateMimicState();
|
|
43
|
-
},
|
|
44
|
-
onReady: () => {
|
|
45
|
-
updateMimicState();
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
(_document$presence = document.presence) === null || _document$presence === void 0 || _document$presence.subscribe({ onPresenceChange: () => {
|
|
49
|
-
updateMimicState();
|
|
50
|
-
} });
|
|
51
|
-
}
|
|
52
|
-
if (autoConnect) document.connect();
|
|
53
|
-
return require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, config(set, get, api)), {}, { mimic: initialMimic });
|
|
54
|
-
};
|
|
55
|
-
};
|
|
56
|
-
/**
|
|
57
|
-
* Zustand middleware that integrates a ClientDocument.
|
|
58
|
-
*
|
|
59
|
-
* Adds a `mimic` object to the store containing:
|
|
60
|
-
* - `document`: The ClientDocument instance for performing transactions
|
|
61
|
-
* - `snapshot`: Read-only snapshot of the document state (reactive)
|
|
62
|
-
* - `presence`: Reactive presence snapshot (self + others). Undefined if presence is not enabled on the ClientDocument.
|
|
63
|
-
* - `isConnected`: Connection status
|
|
64
|
-
* - `isReady`: Ready status
|
|
65
|
-
* - `pendingCount`: Number of pending transactions
|
|
66
|
-
* - `hasPendingChanges`: Whether there are pending changes
|
|
67
|
-
*
|
|
68
|
-
* @example
|
|
69
|
-
* ```ts
|
|
70
|
-
* import { create } from 'zustand'
|
|
71
|
-
* import { mimic } from '@voidhash/mimic-react/zustand'
|
|
72
|
-
*
|
|
73
|
-
* const useStore = create(
|
|
74
|
-
* mimic(clientDocument, (set, get) => ({
|
|
75
|
-
* // Your additional store state
|
|
76
|
-
* }))
|
|
77
|
-
* )
|
|
78
|
-
*
|
|
79
|
-
* // Read snapshot (reactive)
|
|
80
|
-
* const snapshot = useStore(state => state.mimic.snapshot)
|
|
81
|
-
*
|
|
82
|
-
* // Read presence (reactive, if enabled)
|
|
83
|
-
* const myPresence = useStore(state => state.mimic.presence?.self)
|
|
84
|
-
* const othersPresence = useStore(state => state.mimic.presence?.others)
|
|
85
|
-
*
|
|
86
|
-
* // Write via document
|
|
87
|
-
* store.getState().mimic.document.transaction(root => {
|
|
88
|
-
* root.name.set("New Name")
|
|
89
|
-
* })
|
|
90
|
-
* ```
|
|
91
|
-
*/
|
|
92
|
-
const mimic = mimicImpl;
|
|
93
|
-
|
|
94
|
-
//#endregion
|
|
95
|
-
exports.mimic = mimic;
|
|
3
|
+
exports.mimic = require_middleware.mimic;
|
package/dist/zustand/index.d.cts
CHANGED
|
@@ -1,115 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
//#region src/zustand/types.d.ts
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Presence data exposed on the zustand store (reactive snapshot).
|
|
9
|
-
*/
|
|
10
|
-
interface MimicPresence<TPresence extends Presence.AnyPresence> {
|
|
11
|
-
/**
|
|
12
|
-
* This client's connection ID (set after receiving presence snapshot).
|
|
13
|
-
* Undefined before the snapshot is received.
|
|
14
|
-
*/
|
|
15
|
-
readonly selfId: string | undefined;
|
|
16
|
-
/**
|
|
17
|
-
* This client's current presence data.
|
|
18
|
-
* Undefined if not set.
|
|
19
|
-
*/
|
|
20
|
-
readonly self: Presence.Infer<TPresence> | undefined;
|
|
21
|
-
/**
|
|
22
|
-
* Other clients' presence entries (connectionId -> entry).
|
|
23
|
-
*/
|
|
24
|
-
readonly others: ReadonlyMap<string, Presence.PresenceEntry<Presence.Infer<TPresence>>>;
|
|
25
|
-
/**
|
|
26
|
-
* All presence entries including self (connectionId -> entry).
|
|
27
|
-
*/
|
|
28
|
-
readonly all: ReadonlyMap<string, Presence.PresenceEntry<Presence.Infer<TPresence>>>;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* The mimic object containing the document and client state.
|
|
32
|
-
* This is added to the zustand store by the middleware.
|
|
33
|
-
*/
|
|
34
|
-
interface MimicObject<TSchema extends Primitive.AnyPrimitive, TPresence extends Presence.AnyPresence | undefined = undefined> {
|
|
35
|
-
/** The ClientDocument instance for performing transactions */
|
|
36
|
-
readonly document: ClientDocument.ClientDocument<TSchema, TPresence>;
|
|
37
|
-
/** Read-only snapshot of the document state */
|
|
38
|
-
readonly snapshot: Primitive.InferSnapshot<TSchema>;
|
|
39
|
-
/**
|
|
40
|
-
* Reactive presence snapshot (self + others).
|
|
41
|
-
* Undefined when the ClientDocument was created without a presence schema.
|
|
42
|
-
*/
|
|
43
|
-
readonly presence: TPresence extends Presence.AnyPresence ? MimicPresence<TPresence> : undefined;
|
|
44
|
-
/** Whether the client is connected to the server */
|
|
45
|
-
readonly isConnected: boolean;
|
|
46
|
-
/** Whether the client is fully initialized and ready */
|
|
47
|
-
readonly isReady: boolean;
|
|
48
|
-
/** Number of pending transactions */
|
|
49
|
-
readonly pendingCount: number;
|
|
50
|
-
/** Whether there are pending changes */
|
|
51
|
-
readonly hasPendingChanges: boolean;
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* The state slice added by the mimic middleware.
|
|
55
|
-
*/
|
|
56
|
-
interface MimicSlice<TSchema extends Primitive.AnyPrimitive, TPresence extends Presence.AnyPresence | undefined = undefined> {
|
|
57
|
-
/** The mimic object containing document and state */
|
|
58
|
-
readonly mimic: MimicObject<TSchema, TPresence>;
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* Type for state creator with mimic slice merged.
|
|
62
|
-
*/
|
|
63
|
-
type MimicStateCreator<TSchema extends Primitive.AnyPrimitive, TPresence extends Presence.AnyPresence | undefined, T, Mps extends [StoreMutatorIdentifier, unknown][] = [], Mcs extends [StoreMutatorIdentifier, unknown][] = []> = StateCreator<T & MimicSlice<TSchema, TPresence>, Mps, Mcs, T>;
|
|
64
|
-
/**
|
|
65
|
-
* Options for the mimic middleware.
|
|
66
|
-
*/
|
|
67
|
-
interface MimicMiddlewareOptions {
|
|
68
|
-
/** If true, automatically subscribe when store is created (default: true) */
|
|
69
|
-
readonly autoSubscribe?: boolean;
|
|
70
|
-
/** If true, automatically attempt to connect the document to the remote server */
|
|
71
|
-
readonly autoConnect?: boolean;
|
|
72
|
-
}
|
|
73
|
-
//#endregion
|
|
74
|
-
//#region src/zustand/middleware.d.ts
|
|
75
|
-
type MimicMiddleware = <TSchema extends Primitive.AnyPrimitive, TPresence extends Presence.AnyPresence | undefined = undefined, T extends object = object, Mps extends [StoreMutatorIdentifier, unknown][] = [], Mcs extends [StoreMutatorIdentifier, unknown][] = []>(document: ClientDocument.ClientDocument<TSchema, TPresence>, config: StateCreator<T & MimicSlice<TSchema, TPresence>, Mps, Mcs, T>, options?: MimicMiddlewareOptions) => StateCreator<T & MimicSlice<TSchema, TPresence>, Mps, Mcs, T & MimicSlice<TSchema, TPresence>>;
|
|
76
|
-
/**
|
|
77
|
-
* Zustand middleware that integrates a ClientDocument.
|
|
78
|
-
*
|
|
79
|
-
* Adds a `mimic` object to the store containing:
|
|
80
|
-
* - `document`: The ClientDocument instance for performing transactions
|
|
81
|
-
* - `snapshot`: Read-only snapshot of the document state (reactive)
|
|
82
|
-
* - `presence`: Reactive presence snapshot (self + others). Undefined if presence is not enabled on the ClientDocument.
|
|
83
|
-
* - `isConnected`: Connection status
|
|
84
|
-
* - `isReady`: Ready status
|
|
85
|
-
* - `pendingCount`: Number of pending transactions
|
|
86
|
-
* - `hasPendingChanges`: Whether there are pending changes
|
|
87
|
-
*
|
|
88
|
-
* @example
|
|
89
|
-
* ```ts
|
|
90
|
-
* import { create } from 'zustand'
|
|
91
|
-
* import { mimic } from '@voidhash/mimic-react/zustand'
|
|
92
|
-
*
|
|
93
|
-
* const useStore = create(
|
|
94
|
-
* mimic(clientDocument, (set, get) => ({
|
|
95
|
-
* // Your additional store state
|
|
96
|
-
* }))
|
|
97
|
-
* )
|
|
98
|
-
*
|
|
99
|
-
* // Read snapshot (reactive)
|
|
100
|
-
* const snapshot = useStore(state => state.mimic.snapshot)
|
|
101
|
-
*
|
|
102
|
-
* // Read presence (reactive, if enabled)
|
|
103
|
-
* const myPresence = useStore(state => state.mimic.presence?.self)
|
|
104
|
-
* const othersPresence = useStore(state => state.mimic.presence?.others)
|
|
105
|
-
*
|
|
106
|
-
* // Write via document
|
|
107
|
-
* store.getState().mimic.document.transaction(root => {
|
|
108
|
-
* root.name.set("New Name")
|
|
109
|
-
* })
|
|
110
|
-
* ```
|
|
111
|
-
*/
|
|
112
|
-
declare const mimic: MimicMiddleware;
|
|
113
|
-
//#endregion
|
|
114
|
-
export { type MimicMiddlewareOptions, type MimicObject, type MimicSlice, type MimicStateCreator, mimic };
|
|
115
|
-
//# sourceMappingURL=index.d.cts.map
|
|
1
|
+
import { MimicMiddlewareOptions, MimicObject, MimicSlice, MimicStateCreator } from "./types.cjs";
|
|
2
|
+
import { mimic } from "./middleware.cjs";
|
|
3
|
+
export { type MimicMiddlewareOptions, type MimicObject, type MimicSlice, type MimicStateCreator, mimic };
|
package/dist/zustand/index.d.mts
CHANGED
|
@@ -1,115 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
//#region src/zustand/types.d.ts
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Presence data exposed on the zustand store (reactive snapshot).
|
|
9
|
-
*/
|
|
10
|
-
interface MimicPresence<TPresence extends Presence.AnyPresence> {
|
|
11
|
-
/**
|
|
12
|
-
* This client's connection ID (set after receiving presence snapshot).
|
|
13
|
-
* Undefined before the snapshot is received.
|
|
14
|
-
*/
|
|
15
|
-
readonly selfId: string | undefined;
|
|
16
|
-
/**
|
|
17
|
-
* This client's current presence data.
|
|
18
|
-
* Undefined if not set.
|
|
19
|
-
*/
|
|
20
|
-
readonly self: Presence.Infer<TPresence> | undefined;
|
|
21
|
-
/**
|
|
22
|
-
* Other clients' presence entries (connectionId -> entry).
|
|
23
|
-
*/
|
|
24
|
-
readonly others: ReadonlyMap<string, Presence.PresenceEntry<Presence.Infer<TPresence>>>;
|
|
25
|
-
/**
|
|
26
|
-
* All presence entries including self (connectionId -> entry).
|
|
27
|
-
*/
|
|
28
|
-
readonly all: ReadonlyMap<string, Presence.PresenceEntry<Presence.Infer<TPresence>>>;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* The mimic object containing the document and client state.
|
|
32
|
-
* This is added to the zustand store by the middleware.
|
|
33
|
-
*/
|
|
34
|
-
interface MimicObject<TSchema extends Primitive.AnyPrimitive, TPresence extends Presence.AnyPresence | undefined = undefined> {
|
|
35
|
-
/** The ClientDocument instance for performing transactions */
|
|
36
|
-
readonly document: ClientDocument.ClientDocument<TSchema, TPresence>;
|
|
37
|
-
/** Read-only snapshot of the document state */
|
|
38
|
-
readonly snapshot: Primitive.InferSnapshot<TSchema>;
|
|
39
|
-
/**
|
|
40
|
-
* Reactive presence snapshot (self + others).
|
|
41
|
-
* Undefined when the ClientDocument was created without a presence schema.
|
|
42
|
-
*/
|
|
43
|
-
readonly presence: TPresence extends Presence.AnyPresence ? MimicPresence<TPresence> : undefined;
|
|
44
|
-
/** Whether the client is connected to the server */
|
|
45
|
-
readonly isConnected: boolean;
|
|
46
|
-
/** Whether the client is fully initialized and ready */
|
|
47
|
-
readonly isReady: boolean;
|
|
48
|
-
/** Number of pending transactions */
|
|
49
|
-
readonly pendingCount: number;
|
|
50
|
-
/** Whether there are pending changes */
|
|
51
|
-
readonly hasPendingChanges: boolean;
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* The state slice added by the mimic middleware.
|
|
55
|
-
*/
|
|
56
|
-
interface MimicSlice<TSchema extends Primitive.AnyPrimitive, TPresence extends Presence.AnyPresence | undefined = undefined> {
|
|
57
|
-
/** The mimic object containing document and state */
|
|
58
|
-
readonly mimic: MimicObject<TSchema, TPresence>;
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* Type for state creator with mimic slice merged.
|
|
62
|
-
*/
|
|
63
|
-
type MimicStateCreator<TSchema extends Primitive.AnyPrimitive, TPresence extends Presence.AnyPresence | undefined, T, Mps extends [StoreMutatorIdentifier, unknown][] = [], Mcs extends [StoreMutatorIdentifier, unknown][] = []> = StateCreator<T & MimicSlice<TSchema, TPresence>, Mps, Mcs, T>;
|
|
64
|
-
/**
|
|
65
|
-
* Options for the mimic middleware.
|
|
66
|
-
*/
|
|
67
|
-
interface MimicMiddlewareOptions {
|
|
68
|
-
/** If true, automatically subscribe when store is created (default: true) */
|
|
69
|
-
readonly autoSubscribe?: boolean;
|
|
70
|
-
/** If true, automatically attempt to connect the document to the remote server */
|
|
71
|
-
readonly autoConnect?: boolean;
|
|
72
|
-
}
|
|
73
|
-
//#endregion
|
|
74
|
-
//#region src/zustand/middleware.d.ts
|
|
75
|
-
type MimicMiddleware = <TSchema extends Primitive.AnyPrimitive, TPresence extends Presence.AnyPresence | undefined = undefined, T extends object = object, Mps extends [StoreMutatorIdentifier, unknown][] = [], Mcs extends [StoreMutatorIdentifier, unknown][] = []>(document: ClientDocument.ClientDocument<TSchema, TPresence>, config: StateCreator<T & MimicSlice<TSchema, TPresence>, Mps, Mcs, T>, options?: MimicMiddlewareOptions) => StateCreator<T & MimicSlice<TSchema, TPresence>, Mps, Mcs, T & MimicSlice<TSchema, TPresence>>;
|
|
76
|
-
/**
|
|
77
|
-
* Zustand middleware that integrates a ClientDocument.
|
|
78
|
-
*
|
|
79
|
-
* Adds a `mimic` object to the store containing:
|
|
80
|
-
* - `document`: The ClientDocument instance for performing transactions
|
|
81
|
-
* - `snapshot`: Read-only snapshot of the document state (reactive)
|
|
82
|
-
* - `presence`: Reactive presence snapshot (self + others). Undefined if presence is not enabled on the ClientDocument.
|
|
83
|
-
* - `isConnected`: Connection status
|
|
84
|
-
* - `isReady`: Ready status
|
|
85
|
-
* - `pendingCount`: Number of pending transactions
|
|
86
|
-
* - `hasPendingChanges`: Whether there are pending changes
|
|
87
|
-
*
|
|
88
|
-
* @example
|
|
89
|
-
* ```ts
|
|
90
|
-
* import { create } from 'zustand'
|
|
91
|
-
* import { mimic } from '@voidhash/mimic-react/zustand'
|
|
92
|
-
*
|
|
93
|
-
* const useStore = create(
|
|
94
|
-
* mimic(clientDocument, (set, get) => ({
|
|
95
|
-
* // Your additional store state
|
|
96
|
-
* }))
|
|
97
|
-
* )
|
|
98
|
-
*
|
|
99
|
-
* // Read snapshot (reactive)
|
|
100
|
-
* const snapshot = useStore(state => state.mimic.snapshot)
|
|
101
|
-
*
|
|
102
|
-
* // Read presence (reactive, if enabled)
|
|
103
|
-
* const myPresence = useStore(state => state.mimic.presence?.self)
|
|
104
|
-
* const othersPresence = useStore(state => state.mimic.presence?.others)
|
|
105
|
-
*
|
|
106
|
-
* // Write via document
|
|
107
|
-
* store.getState().mimic.document.transaction(root => {
|
|
108
|
-
* root.name.set("New Name")
|
|
109
|
-
* })
|
|
110
|
-
* ```
|
|
111
|
-
*/
|
|
112
|
-
declare const mimic: MimicMiddleware;
|
|
113
|
-
//#endregion
|
|
114
|
-
export { type MimicMiddlewareOptions, type MimicObject, type MimicSlice, type MimicStateCreator, mimic };
|
|
115
|
-
//# sourceMappingURL=index.d.mts.map
|
|
1
|
+
import { MimicMiddlewareOptions, MimicObject, MimicSlice, MimicStateCreator } from "./types.mjs";
|
|
2
|
+
import { mimic } from "./middleware.mjs";
|
|
3
|
+
export { type MimicMiddlewareOptions, type MimicObject, type MimicSlice, type MimicStateCreator, mimic };
|