Docs@skmtc/core

Operations

TYPE

OasOperationIndexBaseConfig

@skmtc/core 0.63.4

Configuration for toOasOperationIndexBase.

The identity half is an operation projection's: toIdentifierName and toExportPath are pure functions of (operation, enrichments, variant), resolved before construction so the cache probe stays cheap. What differs is that they are expected to be functions of what the operations share - their tag, their file - so every operation that inserts into the Index resolves to one declaration. Nothing enforces that; an identity that varies per operation simply yields one Index per operation, visible in the output.

Enrichments are read exactly as an operation projection's are, from the operation inserting into the Index.

Signature

import type { OasOperationIndexBaseConfig } from '@skmtc/core'

type OasOperationIndexBaseConfig<EnrichmentType = undefined, IdType extends IdentifierType = IdentifierType> = { ... } & OasOperationFileOrIndex<EnrichmentType>

Properties

id, string required
toIdentifierName, (args: ToOasOperationIdentifierNameArgs<EnrichmentType>) => string required

Pure: the cache-key name, a function of what the operations share.

toIdentifierType, (operation: OasOperation, context: GenerateContextType) => IdType required

Runs only on cache-miss. Returns this language's identifier type.

accepts, (identifier: IdentifierBase) => boolean

The language's rule for which identifiers this Index holds - a Kotlin class body takes fun and val, never a typealias. Absent, it holds any. A definition it does not accept throws when it is added.