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.
- package/dist/types.d.ts +11 -0
- 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 {};
|