arvo-core 1.1.3 → 1.1.5

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.
Files changed (2) hide show
  1. package/dist/types.d.ts +11 -0
  2. package/package.json +1 -1
package/dist/types.d.ts CHANGED
@@ -62,10 +62,21 @@ type InferZodSchema<T> = T extends z.ZodTypeAny ? z.infer<T> : never;
62
62
  * // MyContractType will have properties uri, accepts, and emits
63
63
  */
64
64
  export type InferArvoContract<T extends ArvoContract<string, string, z.ZodTypeAny, Record<string, z.ZodTypeAny>>> = T extends ArvoContract<infer TUri, infer TType, infer TAcceptSchema, infer TEmits> ? {
65
+ /** The URI of the contract */
65
66
  uri: TUri;
67
+ /** The event type that this contract accepts */
66
68
  accepts: InferArvoEvent<ArvoEvent<InferZodSchema<TAcceptSchema>, {}, TType>>;
69
+ /** The event types that this contract can emit */
67
70
  emits: {
68
71
  [K in keyof TEmits]: InferArvoEvent<ArvoEvent<InferZodSchema<TEmits[K]>, {}, K & string>>;
69
72
  };
73
+ /** The system error event type for this contract */
74
+ systemError: InferArvoEvent<ArvoEvent<InferZodSchema<T['systemError']['schema']>, {}, T['systemError']['type']>>;
75
+ /** Union type of all emittable events, including regular events and system error */
76
+ emittableEvents: ({
77
+ [K in keyof TEmits]: InferArvoEvent<ArvoEvent<InferZodSchema<TEmits[K]>, {}, K & string>>;
78
+ } & {
79
+ [K in `sys.${TType}.error`]: InferArvoEvent<ArvoEvent<InferZodSchema<T['systemError']['schema']>, {}, T['systemError']['type']>>;
80
+ })[keyof TEmits | `sys.${TType}.error`];
70
81
  } : never;
71
82
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "arvo-core",
3
- "version": "1.1.3",
3
+ "version": "1.1.5",
4
4
  "description": "This core package contains all the core classes and components of the Arvo Event Driven System",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {