@kitn.ai/ui
Version:
Framework-agnostic, Shadow-DOM web components for building AI chat interfaces — works in React, Vue, Angular, Svelte, or plain HTML. Authored in SolidJS.
23 lines (22 loc) • 662 B
TypeScript
export interface EntityRef {
kind: string;
id: string;
label: string;
icon?: string;
promptText?: string;
data?: Record<string, unknown>;
}
export type Segment = {
type: 'text';
text: string;
} | {
type: 'entity';
entity: EntityRef;
};
export type ComposerDoc = Segment[];
export declare function normalizeValue(value: string | ComposerDoc | null | undefined): ComposerDoc;
export declare function serializeToText(doc: ComposerDoc, opts?: {
entity?: (e: EntityRef) => string;
}): string;
export declare function entitiesOf(doc: ComposerDoc): EntityRef[];
export declare function docIsEmpty(doc: ComposerDoc): boolean;