From ce2bfe320bb2f795be4175c5b7abc0a9190069d1 Mon Sep 17 00:00:00 2001 From: Lorenzo Blasa Date: Mon, 3 Apr 2023 10:35:15 -0700 Subject: [PATCH] Payload and attribution for framework events Summary: ^ Reviewed By: LukeDefeo Differential Revision: D44496975 fbshipit-source-id: 4f633d0f00239cac16ee332d35755b343d46b124 --- desktop/plugins/public/ui-debugger/types.tsx | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/desktop/plugins/public/ui-debugger/types.tsx b/desktop/plugins/public/ui-debugger/types.tsx index 3bb079d41..7edb8ecd0 100644 --- a/desktop/plugins/public/ui-debugger/types.tsx +++ b/desktop/plugins/public/ui-debugger/types.tsx @@ -37,10 +37,25 @@ export type FrameworkEventMetadata = { documentation: string; }; +export type JSON = + | string + | number + | boolean + | null + | JSON[] + | {[key: string]: JSON}; + +type Stacktrace = {type: 'stacktrace'; stacktrace: string[]}; +type Reason = {type: 'reason'; reason: string}; +type UpstreamEvent = {type: 'upstreamEvent'; eventId: Id}; +type EventAttribution = Stacktrace | Reason | UpstreamEvent; + export type FrameworkEvent = { nodeId: Id; type: FrameworkEventType; timestamp: number; + payload?: JSON; + attribution?: EventAttribution; }; export type InitEvent = {