Docs@skmtc/core

Schemas

CLASS

CustomValue

@skmtc/core 0.63.4

Represents a custom value in the SKMTC generation pipeline.

CustomValue allows generators to create arbitrary content that doesn't fit standard schema types. Used for injecting custom code, templates, or specialized content during the generation process.

Signature

import { CustomValue } from '@skmtc/core'

class CustomValue extends SnippetBase

Examples

Creating custom content
const customValue = new CustomValue({
  context: generateContext,
  value: 'const customCode = "generated";',
  generatorKey: 'my-generator'
});

console.log(customValue.toString()); // "const customCode = "generated";"

Constructor

constructor

constructor(args: CreateArgs)

Creates a new CustomValue instance.

args

Creation arguments including context, value, and optional generator key

Properties

type, 'custom'

Type identifier for this custom value

value, Stringable

The underlying value content that can be converted to string

Methods

isRef

isRef(): this is OasRef<'schema'>

Determines if this custom value is a reference.

Returns

Always false since custom values are concrete content, not references

isReadOnly

isReadOnly(): boolean

Always false: this value has no readOnly.

isWriteOnly

isWriteOnly(): boolean

Always false: this value has no writeOnly.

resolve

resolve(): CustomValue

Resolves this custom value.

Returns

The custom value itself since it's already resolved

resolveOnce

resolveOnce(): CustomValue

Resolves this custom value one level.

Returns

The custom value itself since it's already resolved

toString

toString(): string

Converts the custom value to its string representation.

Returns

String representation of the underlying value