Skip to main content

@barocss/schema

Version in this checkout: 1.0.1. npm · Source

Document schemas, content expressions, validation, and shared Office node definitions.

Purpose

Use this package to describe which nodes, attributes, marks, and children a document accepts. Product packages provide their own schema presets.

Install

npm install @barocss/schema

The published package provides ES modules and TypeScript declarations. Use a bundler that supports package exports.

Public entry points

ImportRole
@barocss/schemaPublic JavaScript and TypeScript API

Import only these public paths. Source paths such as @barocss/schema/src/... are not part of the published API.

Usage

import { createSchema, getMinimalSchemaDefinition } from '@barocss/schema';

const schema = createSchema('my-document', getMinimalSchemaDefinition());
console.log(schema.definition.topNode); // document
console.log(schema.definition.nodes.paragraph.content); // inline*

Integration notes

Schema definitions describe a document contract. They do not render a document or install editing commands.

Documentation

License

MIT. The published archive includes the license in dist/LICENSE.