Projections and snippets
TsSnippet
The TypeScript snippet base - where the TypeScript language enters the SKMTC DSL class hierarchy.
@skmtc/core's SnippetBase is language-blind and needs no generatorKey to register - the key stays an optional constructor arg used for attribution (gen-maps) only. TsSnippet extends it and carries the TypeScript Lang as a static only: Drivers read it off the projection class (projection.lang), pre-construction, inherited through every class built on this base (including projection classes from this package's toTsModelProjectionBase). No instance slot - the register methods delegate to this package's register functions, which name the TypeScript classes directly.
destinationPath is always explicit on snippets: a snippet has no file or settings of its own, so the parent passes the target path through the constructor. Own-file defaulting exists only on projections, in the projection-base veneers.
Signature
import { TsSnippet } from '@skmtc/lang-typescript'
class TsSnippet extends SnippetBaseProperties
Methods
register
register(args: TsRegisterArgs & { destinationPath: string }): voidRegister imports / definitions into the file at destinationPath, typed by TypeScript's concise vocabulary - keyless: no generatorId resolution, no generatorKey requirement.
defineAndRegister
defineAndRegister<Value extends GeneratedValue>(
args: TsDefineAndRegisterArgs<Value>
): TsDefinition<Value>Build a TsDefinition from value and register it at destinationPath.