@lunora/replica 1.0.0-alpha.100 → 1.0.0-alpha.102
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/index.d.mts +13 -12
- package/dist/index.d.ts +13 -12
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -105,18 +105,7 @@ type EventsDefinition<TDefinition extends Record<string, Record<string, unknown>
|
|
|
105
105
|
/** Type-level map of event type → payload shape. Useful for generic code. */
|
|
106
106
|
readonly _types: EventTypeMap<TDefinition>;
|
|
107
107
|
};
|
|
108
|
-
/**
|
|
109
|
-
* Declare typed event types for event sourcing.
|
|
110
|
-
*
|
|
111
|
-
* Each key under a namespace becomes a factory function that produces
|
|
112
|
-
* an {@link InputEvent} — an optimistic / command event that the event
|
|
113
|
-
* log will assign a sequence number to on append.
|
|
114
|
-
* @param definition A nested object where the outer keys are namespaces
|
|
115
|
-
* and the inner keys are event names mapped to their
|
|
116
|
-
* payload schemas (or simple type-descriptor objects).
|
|
117
|
-
* @returns An object with the same nesting structure, where each leaf is
|
|
118
|
-
* a factory function plus a `.type` property.
|
|
119
|
-
*/
|
|
108
|
+
/** Options accepted by {@link defineEvents}. */
|
|
120
109
|
interface DefineEventsOptions {
|
|
121
110
|
/**
|
|
122
111
|
* Optional version prefix for all event types.
|
|
@@ -130,7 +119,19 @@ interface DefineEventsOptions {
|
|
|
130
119
|
readonly version?: string;
|
|
131
120
|
}
|
|
132
121
|
/**
|
|
122
|
+
* Declare typed event types for event sourcing.
|
|
123
|
+
*
|
|
124
|
+
* Each key under a namespace becomes a factory function that produces
|
|
125
|
+
* an {@link InputEvent} — an optimistic / command event that the event
|
|
126
|
+
* log will assign a sequence number to on append.
|
|
127
|
+
*
|
|
133
128
|
* `defineEvents` is part of the experimental `@lunora/replica` API and may change without a major version bump.
|
|
129
|
+
* @param definition A nested object where the outer keys are namespaces
|
|
130
|
+
* and the inner keys are event names mapped to their
|
|
131
|
+
* payload schemas (or simple type-descriptor objects).
|
|
132
|
+
* @param options Optional {@link DefineEventsOptions} — currently a `version` prefix.
|
|
133
|
+
* @returns An object with the same nesting structure, where each leaf is
|
|
134
|
+
* a factory function plus a `.type` property.
|
|
134
135
|
* @experimental
|
|
135
136
|
*/
|
|
136
137
|
declare const defineEvents: <TDefinition extends Record<string, Record<string, unknown>>>(definition: TDefinition, options?: DefineEventsOptions) => EventsDefinition<TDefinition>;
|
package/dist/index.d.ts
CHANGED
|
@@ -105,18 +105,7 @@ type EventsDefinition<TDefinition extends Record<string, Record<string, unknown>
|
|
|
105
105
|
/** Type-level map of event type → payload shape. Useful for generic code. */
|
|
106
106
|
readonly _types: EventTypeMap<TDefinition>;
|
|
107
107
|
};
|
|
108
|
-
/**
|
|
109
|
-
* Declare typed event types for event sourcing.
|
|
110
|
-
*
|
|
111
|
-
* Each key under a namespace becomes a factory function that produces
|
|
112
|
-
* an {@link InputEvent} — an optimistic / command event that the event
|
|
113
|
-
* log will assign a sequence number to on append.
|
|
114
|
-
* @param definition A nested object where the outer keys are namespaces
|
|
115
|
-
* and the inner keys are event names mapped to their
|
|
116
|
-
* payload schemas (or simple type-descriptor objects).
|
|
117
|
-
* @returns An object with the same nesting structure, where each leaf is
|
|
118
|
-
* a factory function plus a `.type` property.
|
|
119
|
-
*/
|
|
108
|
+
/** Options accepted by {@link defineEvents}. */
|
|
120
109
|
interface DefineEventsOptions {
|
|
121
110
|
/**
|
|
122
111
|
* Optional version prefix for all event types.
|
|
@@ -130,7 +119,19 @@ interface DefineEventsOptions {
|
|
|
130
119
|
readonly version?: string;
|
|
131
120
|
}
|
|
132
121
|
/**
|
|
122
|
+
* Declare typed event types for event sourcing.
|
|
123
|
+
*
|
|
124
|
+
* Each key under a namespace becomes a factory function that produces
|
|
125
|
+
* an {@link InputEvent} — an optimistic / command event that the event
|
|
126
|
+
* log will assign a sequence number to on append.
|
|
127
|
+
*
|
|
133
128
|
* `defineEvents` is part of the experimental `@lunora/replica` API and may change without a major version bump.
|
|
129
|
+
* @param definition A nested object where the outer keys are namespaces
|
|
130
|
+
* and the inner keys are event names mapped to their
|
|
131
|
+
* payload schemas (or simple type-descriptor objects).
|
|
132
|
+
* @param options Optional {@link DefineEventsOptions} — currently a `version` prefix.
|
|
133
|
+
* @returns An object with the same nesting structure, where each leaf is
|
|
134
|
+
* a factory function plus a `.type` property.
|
|
134
135
|
* @experimental
|
|
135
136
|
*/
|
|
136
137
|
declare const defineEvents: <TDefinition extends Record<string, Record<string, unknown>>>(definition: TDefinition, options?: DefineEventsOptions) => EventsDefinition<TDefinition>;
|