npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@formspec-org/types

v0.1.0

Published

TypeScript type definitions generated from Formspec JSON schemas

Downloads

42

Readme

formspec-types

TypeScript types generated from the Formspec JSON schemas. Zero runtime dependencies.

This package is the shared type vocabulary for all Formspec packages. Types map directly to their source schema in schemas/.

Install

npm install formspec-types

Usage

import type { FormDefinition, FormItem, ValidationReport } from 'formspec-types';

Packages that depend on formspec-core or formspec-studio-core receive these types as re-exports. Import directly from formspec-types only when you need the schema types without pulling in runtime code.

Exported types

Definition (schemas/definition.schema.json)

| Type | Description | |------|-------------| | FormDefinition | Top-level form definition document | | FormItem | A single form item — field, group, or display element — with all conditional properties typed | | FormBind | Field bind constraints (required, calculate, readonly, constraint, etc.) | | FormShape | A cross-field validation shape rule | | FormVariable | A computed variable with a FEL expression | | FormInstance | An external data source instance | | FormOption | A single choice option { value, label } | | FormScreener | Pre-form screener with fields and routing rules |

The augmented types above (FormItem, FormBind, FormDefinition, FormScreener) extend the generated schema types with properties that the JSON Schema expresses conditionally (via if/then) and that code-generation cannot fully represent. Raw generated types are also available as Item, Bind, FormDefinition (generated), Screener, Shape, Variable, Instance, OptionEntry, Route, Presentation, FELExpression.

Component (schemas/component.schema.json)

ComponentDocument, AnyComponent, Page, Stack, Grid, Card, Panel, Wizard, Tabs, Columns, Accordion, Collapsible, ConditionalGroup, TextInput, NumberInput, DatePicker, Select, CheckboxGroup, RadioGroup, Toggle, MoneyInput, Slider, Rating, FileUpload, Signature, Heading, Text, Divider, Alert, Badge, ProgressBar, Summary, ValidationSummary, DataTable, SubmitButton, Modal, Popover, Spacer, CustomComponentDef, CustomComponentRef, ComponentBase, StyleMap, AccessibilityBlock, ResponsiveOverrides, Breakpoints, Tokens, TargetDefinition, ChildrenArray

Theme (schemas/theme.schema.json)

ThemeDocument, Selector, SelectorMatch, PresentationBlock, PageLayout, Region

Response (schemas/response.schema.json)

FormResponse — a completed or in-progress form submission, pinned to a specific definition version.

Validation (schemas/validationReport.schema.json, schemas/validationResult.schema.json)

ValidationReport — aggregated validation output with valid, results, and counts. ValidationResult / FormspecValidationResult — a single validation finding with path, severity, and constraint kind.

Mapping (schemas/mapping.schema.json)

MappingDocument, FieldRule, InnerRule, Coerce, ValueMap, ReverseOverride, ArrayDescriptor, JsonAdapter, XmlAdapter, CsvAdapter, TargetSchema

Registry (schemas/registry.schema.json)

RegistryDocument, RegistryEntry, Publisher

FEL functions (schemas/fel-functions.schema.json)

FELFunctionCatalog, FunctionEntry, Parameter, FELType

Design notes

  • Schema-accurateFormItem.dataType accepts any string, not a narrow literal union. Extension registries add data types beyond the 14 core built-ins, so the type must stay open.
  • Zero dependencies — pure type declarations, no runtime code.
  • Single source of truthformspec-core and formspec-studio-core both re-export from here, so all packages share identical definitions with no boundary casts.

Regenerating types

Types are generated from JSON schemas by scripts/generate-types.mjs.

npm run build        # generate types, then tsc
npm run types:generate   # generate only, no tsc

Do not edit files under src/generated/. Edit the source schemas in schemas/ instead.