From 69b6141652bcdb90013611febfd5fbeb551f6208 Mon Sep 17 00:00:00 2001 From: Eric Schultz Date: Thu, 21 Jan 2021 11:30:12 -0600 Subject: [PATCH] Allow a string id for HoudiniObjects --- docs/event_definitions/common.ts | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/docs/event_definitions/common.ts b/docs/event_definitions/common.ts index 7469d3da..c4b2edcc 100644 --- a/docs/event_definitions/common.ts +++ b/docs/event_definitions/common.ts @@ -6,6 +6,11 @@ */ export type IdType = number; +/** + * an identifier for HoudiniObjects which is unique among all HoudiniObjects. + */ +export type UuidType = string; + /** * Describes a monetary value in the minimum unit for this current. Corresponds to Money class in * Ruby and Typescript @@ -55,18 +60,20 @@ export type RecurrenceRule = { * Every object controlled by the Houdini event publisher must meet this standard interface * and will inherit from it. */ -export interface HoudiniObject { +export interface HoudiniObject { /** * An IdType which unique which uniquely identifies this object * from all other similar objects */ - id: IdType; + id: Id; /** * the type of object. Roughly corresponds to the object's class in Rails */ object: string; } + +type HoudiniObjectOfAllIds = HoudiniObject | HoudiniObject; /** * An event published by Houdini * @@ -76,7 +83,7 @@ export interface HoudiniObject { * * DataObject: the interface representing the actual object which the event occurred on. An object of that type is * on the 'data' attribute */ -export interface HoudiniEvent { +export interface HoudiniEvent { /** data for the event. We wrap the object inside becuase we might want to provide some sort of */ data: { /** the object after the event has occurred */