Docs@skmtc/core

Files and imports

CLASS

DefinitionBase

@skmtc/core 0.63.4

The language-neutral coordination surface of a registered, named definition.

The cross-generator cache reads only this surface - the definition's identifier (the (name, exportPath) cache key), its value, and the generatorKey (via SnippetBase) for the integrity check. How a definition renders - the export const X = … wrapper, JSDoc, the export/visibility keyword - is the concrete subclass's concern, so toString() is abstract here.

Concrete rendering subclasses live in the language packages (TsDefinition in @skmtc/lang-typescript); Drivers construct them through the Lang factories (lang.toDefinition).

Signature

import { DefinitionBase } from '@skmtc/core'

abstract class DefinitionBase<V extends GeneratedValue = GeneratedValue> extends SnippetBase

Constructor

constructor

constructor(args: DefinitionBaseArgs<V>)

Properties

identifier, IdentifierBase

The identifier for this definition

value, V

The generated value content

leadsTo, PendingDefinition | undefined

The model lowest on the pending stack that this Definition's model led back to while its projection was being constructed (PendingDefinition.leadsTo). A reference to this model is inside a cycle for as long as that cycle is open (toOpenEnd). Set by the ModelDriver; undefined for a model that led back to none, and for a Definition the Driver did not construct.

Methods

toString

toString(): string

Renders the definition's code. Implemented by the concrete subclass.