@vonq/hapi-elements-types
v1.64.0
Published
This package contains Typescript definitions for HAPI Elements
Readme
This package contains type definitions for VONQ HAPI Elements project.
To get started using the types, install the package as a dev dependency (package is published on the npm registry):
yarn add -D @vonq/hapi-elements-typesAll the types have been exported in a single file so you can get started using the types as such:
import {CampaignCreateForm} from "@vonq/hapi-elements-types";
const campaignObject: CampaignCreateForm = {} //Typescript will warn about missing propertiesBrowser vs Node
The package exposes two entry shapes from the same scope:
Browser and bundlers (Vite, webpack, Next.js client, etc.) — import from the package root
@vonq/hapi-elements-types. Resolution uses thebrowserexport condition when the tool sets it; otherwise the genericimport/defaultentry points atdist/index.js, which includes the full barrel (including_window/window.hapiruntime typings).Node (scripts, tooling, CLIs) — still import from
@vonq/hapi-elements-types. Node applies thenodeexport condition and loadsdist/index.node.js, a bundled ESM file that matches the full barrel except that_windowis only re-exported as types (export type *) at the entry, not as runtime values. Types from_windowremain available to TypeScript; other modules may still pull_windowcode transitively when needed.Explicit Node subpath — you can also write
@vonq/hapi-elements-types/node, which resolves to the samedist/index.node.js/dist/index.node.d.tsas thenodecondition on".".
After regenerating the root barrel with yarn generate:index, keep index.node.ts in sync with index.ts (same module list; keep export type * for ./_window only in index.node.ts).
