Skip to content

API Reference - @litert/decorator

Overview

@litert/decorator is a TypeScript utility library for building ECMAScript decorators. It provides separate APIs for modern Stage 3 decorators, legacy Stage 2 decorators, and compatibility helpers that dispatch between both generated argument shapes.

Start here

PagePurpose
Quick StartInstall the package and create the first modern, legacy, or compatible decorator.
FAQChoose the right entrypoint and understand decorator-mode differences.
TutorialsLearn the recommended workflows for composing and sharing decorators.
API OverviewBrowse every public import path and namespace.

Entrypoints

Import pathUse it for
@litert/decoratorModern Stage 3 decorators and metadata helpers.
@litert/decorator/modernExplicit alias of the modern Stage 3 entrypoint.
@litert/decorator/legacyLegacy Stage 2 decorators emitted by TypeScript with experimentalDecorators.
@litert/decorator/compatibleDecorators shared by legacy and modern TypeScript builds.

Requirements

RequirementVersion
Node.js>=22.0.0
TypeScript>=5.0, with current development on TypeScript 6
ECMAScript targetES2022 or newer