@voidhash/mimic 0.0.1 → 0.0.2

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.
@@ -1,4 +1,4 @@
1
- import { p as Transaction, r as AnyPrimitive, s as InferState, v as __export } from "../Primitive-CvFVxR8_.cjs";
1
+ import { $ as InferState, J as AnyPrimitive, pt as Transaction, vt as __export } from "../Primitive-awpEjnKL.cjs";
2
2
 
3
3
  //#region src/server/ServerDocument.d.ts
4
4
  declare namespace ServerDocument_d_exports {
@@ -1,4 +1,4 @@
1
- import { p as Transaction, r as AnyPrimitive, s as InferState } from "../Primitive-lEhQyGVL.mjs";
1
+ import { $ as InferState, J as AnyPrimitive, pt as Transaction } from "../Primitive-DqQFc3Gu.mjs";
2
2
 
3
3
  //#region src/server/ServerDocument.d.ts
4
4
  declare namespace ServerDocument_d_exports {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@voidhash/mimic",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",
@@ -31,7 +31,7 @@
31
31
  "typescript": "5.8.3",
32
32
  "vite-tsconfig-paths": "^5.1.4",
33
33
  "vitest": "^3.2.4",
34
- "@voidhash/tsconfig": "0.0.1"
34
+ "@voidhash/tsconfig": "0.0.2"
35
35
  },
36
36
  "peerDependencies": {
37
37
  "effect": "^3.19.12"
package/src/index.ts CHANGED
@@ -11,3 +11,5 @@ export * as ProxyEnvironment from "./ProxyEnvironment.js";
11
11
  export * as Transform from "./Transform.js";
12
12
  export * as Presence from "./Presence.js";
13
13
  export * as EffectSchema from "./EffectSchema.js";
14
+ export * as Types from "./types/index.js";
15
+ export * as TreeHelpers from "./utils/tree-helpers.js";
@@ -119,7 +119,13 @@ export interface Primitive<TState, TProxy, TRequired extends boolean = false, TH
119
119
  */
120
120
  export type IsDefined<T> = T extends Primitive<any, any, infer D, any> ? D : false;
121
121
 
122
-
122
+ /**
123
+ * Infer whether a primitive is required.
124
+ * Alias for IsDefined for clarity.
125
+ */
126
+ export type IsRequired<T> = IsDefined<T>;
127
+
128
+
123
129
  // =============================================================================
124
130
  // Validation Errors
125
131
  // =============================================================================
@@ -0,0 +1,137 @@
1
+ /**
2
+ * Consolidated type inference utilities for all primitives.
3
+ *
4
+ * This module re-exports all inference types from a single location
5
+ * for convenient access across the mimic package.
6
+ *
7
+ * @since 0.0.1
8
+ */
9
+
10
+ // =============================================================================
11
+ // Core Inference Types (from shared.ts)
12
+ // =============================================================================
13
+
14
+ export type {
15
+ // Core primitive types
16
+ Primitive,
17
+ AnyPrimitive,
18
+ PrimitiveInternal,
19
+
20
+ // State and proxy inference
21
+ InferState,
22
+ InferProxy,
23
+
24
+ // Input inference
25
+ InferSetInput,
26
+ InferUpdateInput,
27
+
28
+ // Snapshot inference
29
+ InferSnapshot,
30
+
31
+ // Required/default status inference
32
+ HasDefault,
33
+ IsDefined,
34
+ IsRequired,
35
+
36
+ // Utility types
37
+ MaybeUndefined,
38
+ NeedsValue,
39
+ Optional,
40
+
41
+ // Validator type
42
+ Validator,
43
+ } from "../primitives/shared.js";
44
+
45
+ // =============================================================================
46
+ // Struct Inference Types
47
+ // =============================================================================
48
+
49
+ export type {
50
+ InferStructState,
51
+ InferStructSnapshot,
52
+ StructSetInput,
53
+ StructUpdateValue,
54
+ StructProxy,
55
+ } from "../primitives/Struct.js";
56
+
57
+ // =============================================================================
58
+ // Array Inference Types
59
+ // =============================================================================
60
+
61
+ export type {
62
+ ArrayState,
63
+ ArraySnapshot,
64
+ ArrayEntrySnapshot,
65
+ ArrayEntry,
66
+ ArraySetInput,
67
+ ArrayUpdateInput,
68
+ ArrayElementSetInput,
69
+ ArrayProxy,
70
+ } from "../primitives/Array.js";
71
+
72
+ // =============================================================================
73
+ // Tree Inference Types
74
+ // =============================================================================
75
+
76
+ export type {
77
+ TreeState,
78
+ TreeNodeState,
79
+ TypedTreeNodeState,
80
+ TreeNodeSnapshot,
81
+ InferTreeSnapshot,
82
+ TreeSetInput,
83
+ TreeUpdateInput,
84
+ TreeNodeUpdateValue,
85
+ TreeNodeDataSetInput,
86
+ TreeProxy,
87
+ TypedNodeProxy,
88
+ TreeNodeProxyBase,
89
+ } from "../primitives/Tree.js";
90
+
91
+ // =============================================================================
92
+ // TreeNode Inference Types
93
+ // =============================================================================
94
+
95
+ export type {
96
+ AnyTreeNodePrimitive,
97
+ InferTreeNodeDataState,
98
+ InferTreeNodeType,
99
+ InferTreeNodeChildren,
100
+ TreeNodeSelfType,
101
+ TreeNodeConfig,
102
+ TreeNodeChildrenInput,
103
+ } from "../primitives/TreeNode.js";
104
+
105
+ export { TreeNodePrimitive, TreeNodeSelf } from "../primitives/TreeNode.js";
106
+
107
+ // =============================================================================
108
+ // Union Inference Types
109
+ // =============================================================================
110
+
111
+ export type {
112
+ InferUnionState,
113
+ InferUnionSnapshot,
114
+ UnionVariants,
115
+ } from "../primitives/Union.js";
116
+
117
+ // =============================================================================
118
+ // Either Inference Types
119
+ // =============================================================================
120
+
121
+ export type {
122
+ InferEitherState,
123
+ InferEitherSnapshot,
124
+ ScalarPrimitive,
125
+ } from "../primitives/Either.js";
126
+
127
+ // =============================================================================
128
+ // Lazy Inference Types
129
+ // =============================================================================
130
+
131
+ export type {
132
+ InferLazyState,
133
+ InferLazyProxy,
134
+ InferLazySnapshot,
135
+ InferLazySetInput,
136
+ InferLazyUpdateInput,
137
+ } from "../primitives/Lazy.js";
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Utility functions for mimic primitives.
3
+ *
4
+ * @since 0.0.1
5
+ */
6
+
7
+ export * from "./tree-helpers.js";