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

@enonic/ui-types

v0.4.0

Published

Shared TypeScript types and behavioural contracts for Enonic UIs

Readme

@enonic/ui-types

Types and nothing else: no runtime, no dependencies, no imports.

Two kinds of thing belong here — the base domain types more than one package or application shares (content, principals, schema shapes), and the behavioural contracts between programs that are released separately, where both sides have to agree on a shape they cannot import from each other. A prop type read by one component is not one of those.

pnpm add -D @enonic/ui-types

The mount contract

The contract between a shell and a module it mounts into its page: a screen or a panel shipped by another application, discovered at runtime and rendered into a container the shell owns. The shell creates an open shadow root, hands the module a container inside it and a Host, and calls mount; the module owns everything inside the container, the shell owns the page around it.

| Type | What it is | | ----------------- | -------------------------------------------------------------------------------------- | | Readable<T> | get() for the current value, listen for changes — it never calls back on subscribe | | ToastTone | info, success, warning, error — as @enonic/ui's Toast names them | | NotifyOptions | autoHide, lifetimeMs | | Host | what every mount gets: baseUrl, extension, locale, theme, visible, notify | | Routed | what a mount with a url segment adds: path, navigate with NavigateOptions | | RoutedHost | Host & Routed — what an interface whose mounts own a segment hands over | | MountOptions<H> | the argument of mount: container and host; H defaults to Host | | Unmount | what mount returns, synchronously; idempotent and must not throw | | Mount<H> | the function a module's entry exports — annotate it with this | | Module<H> | what a module's entry exports as a whole |

A host declares which type its interface hands over; XP Settings' settings.section hands a RoutedHost. A host whose mounts own no segment hands a Host extended with its own capability, and a module written against RoutedHost is unaffected. The rules the types cannot express are in the TSDoc, where a provider reads them: a module never touches the page outside its container, every string crossing the boundary is localized, one module instance may serve several mounts and Host.extension says which one this is, and a revoked host answers every call with a no-op.

The declarations reference the DOM lib for HTMLElement; a consumer's tsconfig has to include it, which a browser project's does.

The form and property contracts

What XP's own JS libraries serialize a form and a property tree to — lib-content for a content type, lib-schema for a content type, mixin or form fragment, and an application's server for a form it reads from a descriptor, such as an id provider's configuration — and what @enonic/input-types reads them back from. The same dialect @enonic-types/core declares as FormItem, so a server typed against XP's types produces these without a cast; here every field XP omits is optional, inputType is any string and a config value is unknown, because that is what arrives.

| Type | What it is | | --------------------- | ------------------------------------------------------------------------------------------------------------- | | FormJson | a form: its items in order | | FormItemJson | one item — InputJson, ItemSetJson, OptionSetJson, LayoutJson or FormFragmentJson, by formItemType | | FormItemType | the discriminant: Input, ItemSet, OptionSet, Layout, FormFragment | | OccurrencesJson | minimum and maximum; a maximum of 0 is unbounded | | InputConfigJson | an input type's config as XP's libraries emit it — a scalar, a list or an object under each property | | OptionSetOptionJson | one option: name, label, default, its items | | PropertyTreeJson | a property tree: its arrays | | PropertyArrayJson | a named array of one ValueTypeName, its values | | PropertyValueJson | a scalar under v or a nested tree under set | | ValueTypeName | the value types XP knows, as ValueTypes names them | | PrincipalType | user, group, role — a principal key's own prefix |

The { Input: { … } } dialect with one wrapper key per item is Content Studio's REST talking to Content Studio's client, and is not here.

How the Settings shell behaves behind these types — keep-alive, what a hidden mount hears, revocation — is documented with the shell, in app-settings' docs/extensions/.

Part of the Enonic UI Toolkit.