ScopeTracker
Defined in: packages/app-report/src/util/scope-tracker.ts:46
Reconstructs the scope tree from a stream of ReportEvents.
Shared by every sink that needs the tree (indentation, dotted paths, JUnit nesting, GitHub group nesting, duration roll-ups) so each one doesn’t re-derive it from the raw event stream independently.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new ScopeTracker():
ScopeTracker
Returns
Section titled “Returns”ScopeTracker
Methods
Section titled “Methods”all(): readonly
ScopeRecord[]
Defined in: packages/app-report/src/util/scope-tracker.ts:140
Every scope observed so far, in scope-start order.
Returns
Section titled “Returns”readonly ScopeRecord[]
children()
Section titled “children()”children(
id): readonlyScopeRecord[]
Defined in: packages/app-report/src/util/scope-tracker.ts:145
Direct children of id, in the order their scope-start was observed.
Parameters
Section titled “Parameters”string | null
Returns
Section titled “Returns”readonly ScopeRecord[]
depth()
Section titled “depth()”depth(
id):number
Defined in: packages/app-report/src/util/scope-tracker.ts:180
Depth of id below the root scopes (a root scope has depth 0).
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”number
get(
id):ScopeRecord|undefined
Defined in: packages/app-report/src/util/scope-tracker.ts:135
The scope record for id, or undefined if no scope-start declared it.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”ScopeRecord | undefined
observe()
Section titled “observe()”observe(
event):void
Defined in: packages/app-report/src/util/scope-tracker.ts:51
Feed one event into the tracker, updating its internal state.
Parameters
Section titled “Parameters”ReportEvent<unknown>
Returns
Section titled “Returns”void
open()
Section titled “open()”open(): readonly
ScopeRecord[]
Defined in: packages/app-report/src/util/scope-tracker.ts:156
Scopes with no scope-end observed yet.
Returns
Section titled “Returns”readonly ScopeRecord[]
path()
Section titled “path()”path(
id): readonlyScopeRecord[]
Defined in: packages/app-report/src/util/scope-tracker.ts:163
The chain from the root to id, inclusive, root first.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”readonly ScopeRecord[]
roots()
Section titled “roots()”roots(): readonly
ScopeRecord[]
Defined in: packages/app-report/src/util/scope-tracker.ts:151
Top-level scopes (parentId === null).
Returns
Section titled “Returns”readonly ScopeRecord[]