/** * aparté React wrapper * React 18/19 integration with hooks and segment support. */ export { AparteChat } from './components/AparteChat.js'; export type { AparteChatProps } from './components/AparteChat.js'; export type { AparteChatImperativeApi } from '@aparte/core'; export { useAparteChat } from './hooks/useAparteChat.js'; export type { UseAparteChat } from './hooks/useAparteChat.js'; export { useAparteClient } from './hooks/useAparteClient.js'; export type { UseAparteClient } from './hooks/useAparteClient.js'; export { useConversationManager } from './hooks/useConversationManager.js'; export type { UseConversationManager } from './hooks/useConversationManager.js'; export { AparteUi } from './components/AparteUi.js'; export type { AparteUiProps } from './components/AparteUi.js'; export type { AparteUiHandle } from '@aparte/core'; export type { AparteMessage, AparteSendEventDetail, AparteActionEventDetail, AparteSegment, AparteTextSegment, AparteCodeSegment, AparteThinkingSegment, } from './types.js'; import type { AparteElementAttributes, AparteElementTagName, AparteTemplateAttrs } from '@aparte/core'; import type * as React from 'react'; /** * One attribute, as React must write it. * * A presence attribute becomes `'' | undefined`, not `boolean`, and that is not * pedantry: React stringifies what it sets on a custom element, so `disabled={false}` * would render `disabled="false"` — and an element that tests `hasAttribute` reads * that as ON. The wrapper's own bubble rendering already uses this idiom * (`streaming={isAwaitingReply(m) ? '' : undefined}`); the type now enforces it. * * A numeric attribute accepts a number or the string it will become, because both * read naturally in JSX. */ /** * An aparté tag in JSX: the standard HTML props, plus the element's own attributes. * * `Omit` puts the ELEMENT's contract first where the two collide. The motivating * collision was `` — the message role on an * attribute React types as an `AriaRole` union, where intersecting the two left no * assignable value. The bubble now reads its message role from `data-role` only and * `role` is ARIA's again, but the rule stays: an element's own attribute type wins * over React's guess for it. */ type AparteTagProps = Omit, HTMLElement>, keyof T> & AparteTemplateAttrs; /** * Derived from `AparteElementAttributes` rather than listed, so the set cannot drift: * an element added to core is typed here the moment it is added to that registry, and * one removed from it stops being valid JSX. Listing them by hand is what let nine of * eighteen be the whole story. * * Events are not here on purpose. React has no prop form for a custom event, so a * consumer reaches them by ref — and `HTMLElementEventMap` is already augmented by * `@aparte/core`, so `el.addEventListener('aparte-select-change', e => e.detail.value)` * is typed with nothing further from this package. */ type AparteIntrinsicElements = { [K in AparteElementTagName]: AparteTagProps; }; declare global { namespace JSX { interface IntrinsicElements extends AparteIntrinsicElements { } } } declare module 'react' { namespace JSX { interface IntrinsicElements extends AparteIntrinsicElements { } } } //# sourceMappingURL=index.d.ts.map