Skip to main content
Version: 0.1.0-beta.9

Variable: SchemaOps

const SchemaOps: object

Defined in: schema/operations/SchemaOps.ts:15

Operations for managing MorphioSchema instances. These operations replace the previous class-based methods with pure functions.

Type declaration

addProperty()

Adds a property to the schema

Parameters

schema

MorphioSchema

The schema to modify

key

string

The property key

meta

PropertyMetadata

The property metadata

Returns

void

create()

Creates a new MorphioSchema instance

Parameters

name

string

The name of the schema (usually the class or interface name)

options?

Optional schema configuration

isInterface?

boolean

Returns

MorphioSchema

A new MorphioSchema instance

getProperties()

Gets all properties for a schema, including inherited ones. Properties from parent schemas are included first, then overridden by own properties.

Parameters

schema

MorphioSchema

The schema to get properties for

Returns

Map<string, PropertyMetadata>

Map of all property names to their metadata

setName()

Sets the name of a schema

Parameters

schema

MorphioSchema

The schema to modify

name

string

The new name to set

Returns

void