Operations

TYPE

TsOasOperationIndexInstance

@skmtc/lang-typescript 0.19.1

What an Index projection gets from its TypeScript base class, on this.

Here, findDefinitions matches on name and on type. In core it can match on name only.

Signature

import type { TsOasOperationIndexInstance } from '@skmtc/lang-typescript'

interface TsOasOperationIndexInstance<EnrichmentType = undefined> extends OasOperationIndexInstance<EnrichmentType>, TsProjectionRegister

Properties

settings, ContentSettings<EnrichmentType> required

The projection's identifier, export path, variant and enrichments.

definitions, DefinitionBase[] required

The definitions inserted into this Index, in arrival order, which is the order the engine runs the operations in. It is the same in each run.

addDefinition, (definition: DefinitionBase) => void required

Add a definition. It throws when the definition breaks one of three rules: the Index holds only identifiers its language accepts, only definitions of the generator that owns it, and one definition per declaration key. Adding a definition again with the same generator key does nothing, so every subject may add what it needs without looking first.

findDefinitions, (query?: FindDefinitionsQuery) => DefinitionBase[] | undefined required

The definitions that match, or undefined when none does. With no query, every definition.

Core can match on name only, so a query with a type matches nothing. A declaration's type is the language's, in its own identifier class, which core cannot name. A language package that has such a class overrides this method to match both.

context, GenerateContextType required

The generation context providing access to OAS objects and utilities

skipped, boolean required

Whether this generator has been skipped

generatorKey, GeneratorKey | undefined required

Optional generator key - attribution input only

stackTrail, StackTrail required

Position of the schema fragment this snippet was built from, as a StackTrail. Callers pass a stable snapshot (a clone taken at the call site - StackTrail is mutable, so an un-cloned reference would alias a trail that later append/remove calls could mutate). The empty trail (StackTrail.empty()) means "no single originating node", in which case the resolver uses the generator-key-derived pointer. Converted to a JSON Pointer string only at the resolver - never carried as a string here.

register, (args: TsRegisterArgs) => void required

Register imports and definitions in this projection's own export file (this.settings.exportPath). For a different file use registerInto.

registerInto, (destinationPath: string, args: TsRegisterArgs) => void required

Register imports and definitions in the file you name. register always uses this projection's own export file.