Skip to content

@idfkit/schemas

EnergyPlus epJSON schemas for all 17 supported versions, content-addressed so that the whole set is around 1 MB gzipped rather than 11.9 MB. See Content-addressed schemas for why, and Slim schema format for what a definition contains.

npm install @idfkit/schemas

@idfkit/core re-exports Schema, SchemaBundle, httpSource, and the slim type definitions, so most applications never import this package directly.

Portable surface

Classes

BlobStore

Shared, deduplicated store of object-type definitions.

One instance is shared by every Schema loaded from the same bundle, which is what makes multi-version documents in a single process cheap.

Constructors

constructor

BlobStore

Accessors

size

Methods

hydrate


Schema

A single EnergyPlus version's schema, backed by a shared blob store.

Type definitions are hydrated lazily and cached in the store, so loading a second version only pays for the definitions that version does not already share with one in memory. In practice that is a couple hundred out of 858.

Constructors

constructor

Schema

Properties

version

Accessors

typeNames

Methods

changedFrom


Object type names whose definition hash differs from other.

Because definitions are content-addressed this is a manifest comparison, not a deep diff of two 10 MB documents, which is what makes cross-version work (migration planning, "what changed in 25.2") cheap.

field


Field definition for a type, or undefined.

get


Definition for an object type, or undefined if this version lacks it.

has


Whether this version defines the given object type. Case-insensitive.

require


Definition for an object type, throwing if absent.

resolve


Resolve a possibly mis-cased type name to its canonical spelling.

IDF is case-insensitive on type names and real files are inconsistent (ZONE, Zone, zone all appear in the wild), so every lookup path goes through here rather than trusting the input.

SchemaBundle

Loads schemas from a bundle, sharing one blob store across every version.

Hold one of these for the lifetime of the process. Loading 26.1.0 and then 9.4.0 costs far less than twice one version, because most definitions are byte-identical and already hydrated.

Constructors

constructor

SchemaBundle

Methods

latest

async latest(): Promise<string> 

The newest version in the bundle.

load

async load(version: string): Promise<Schema> 

Load one version's schema.

Repeat calls return the same instance; concurrent calls share one fetch.

loaded

loaded(version: string): Schema | undefined 

A version already loaded, or undefined. Synchronous by design.

versions

async versions(): Promise<readonly string[]> 

Versions this bundle can serve, oldest first.

Interfaces

BundleIndex

Properties

manifests

Per-version manifest file names, keyed by version string.

versions

Versions present, as "26.1.0" strings, sorted oldest first.

BundleSource

Where bundle files come from.

The only runtime-specific part of this package. Node reads from disk, the browser fetches over HTTP, and a bundler-driven app can supply its own resolver backed by import(). Everything above this interface is portable.

Methods

read

read(fileName: string): Promise<unknown>;

SchemaDelta

Properties

added

Types present in this version but not the other.

changed

Types present in both, with a differing definition.

removed

Types present in the other version but not this one.

SlimExtensible

Properties

fields

Field names inside each repeat group, in IDF order.

key

epJSON key holding the array, e.g. vertices.

p

Definitions for the inner fields, from the array's items.

SlimField

Properties

auto

Field accepts Autosize / Autocalculate in addition to a number.

d

Schema default, applied on write when the field is absent.

e

Permitted values for a choice field.

max

min

ol

Names of reference lists this field points into (i.e. it is a foreign key).

rc

Value is case-sensitive and must not be normalized.

ref

Names of reference lists this field contributes to (i.e. it is a key).

t

Storage class.

u

SI units, used by the unit-conversion helpers.

xmax

Exclusive maximum.

xmin

Exclusive minimum.

SlimType

Properties

anon

Object has no name field at all, e.g. Version, GlobalGeometryRules.

f

All field names in IDF positional order, from legacy_idd.fields.

g

IDD group, e.g. Thermal Zones and Surfaces.

nref

Reference lists the object's name contributes to.

nreq

Object's name is required.

p

Field definitions, keyed by epJSON field name.

r

Required field names.

s

Object is a singleton (maxProperties: 1), e.g. Version, Building.

x

Extensible group definition, if the object has one.

Type Aliases

FieldKind

Field storage class, mirroring how the IDF writer must format the value.

Manifest

A manifest maps object type name to a blob hash in the shared store.

Functions

httpSource

Node

Functions

localBundle

nodeSource

readBundleFileSync