DEVTOOLS_EVENT
The event kinds of the devtools protocol (version 1), numbered as EVENT in @shadow-js/devtools numbers them.
The event kinds of the devtools protocol (version 1), numbered as EVENT in @shadow-js/devtools
numbers them. Pass one to devtoolsReport when a custom primitive shows up in devtools; the
meaning of the other arguments of each kind is in the protocol table of the devtools README.
Kinds 16 and 17 are the transition events, reported by internal/concurrency.ts: TRANSITION_START
(16) after a transition() callback has run, with no arguments; TRANSITION_END (17) when the
transition lane is idle, with the number of transitions it resolved. The devtools agent does not use
them yet.
Import#
ts
import { DEVTOOLS_EVENT } from "@shadow-js/core/extend";
Signature#
ts
const DEVTOOLS_EVENT: { readonly OWNER_CREATED: 1; readonly OWNER_DISPOSED: 2; readonly SIGNAL_CREATED: 3; readonly SIGNAL_WRITTEN: 4; readonly COMPUTATION_CREATED: 5; readonly COMPUTATION_RUN: 6; readonly COMPUTATION_DISPOSED: 7; readonly COMPONENT_MOUNTED: 8; readonly COMPONENT_UNMOUNTED: 9; readonly RESOURCE_STATE: 10; readonly ERROR: 11; readonly HYDRATION_MISMATCH: 12; readonly FLUSH_START: 13; readonly FLUSH_END: 14; readonly STORE_CREATED: 15; readonly TRANSITION_START: 16; readonly TRANSITION_END: 17; }
Examples#
ts
import { DEVTOOLS_EVENT } from "@shadow-js/core/extend";
function describe(kind: number): string {
if (kind === DEVTOOLS_EVENT.SIGNAL_WRITTEN) return "signal written";
if (kind === DEVTOOLS_EVENT.ERROR) return "error";
return `event ${kind}`;
}