Skip to content

toolmark-monorepo / @toolmark/core / Scope

Interface: Scope ​

Defined in: packages/core/src/scope.ts:16

A group of tools; its path prefixes every tool name registered into it (a transparent scope adds no segment of its own).

Properties ​

disposed ​

readonly disposed: boolean

Defined in: packages/core/src/scope.ts:31

Whether the scope has been disposed.


path ​

readonly path: string

Defined in: packages/core/src/scope.ts:18

Dot path (the root scope, and a transparent scope directly under it, is "").

Methods ​

dispose() ​

dispose(): void

Defined in: packages/core/src/scope.ts:29

Disposes the scope, its descendants and every tool registered in them.

Returns ​

void


scope() ​

scope(name, opts?): Scope

Defined in: packages/core/src/scope.ts:25

Creates a child scope.

Parameters ​

name ​

string

Child name; the child's path is <path>.<name> (or <path> when transparent).

opts? ​

ScopeOptions

when: false hides the child's tools until setWhen(true); transparent: true adds no name segment.

Returns ​

Scope


setWhen() ​

setWhen(v): void

Defined in: packages/core/src/scope.ts:27

Shows (true) or hides (false) this scope's tools, including descendants'.

Parameters ​

v ​

boolean

Returns ​

void