llm-ui-objects
Version:
Interactive object components for LLM-powered writing interfaces
46 lines (45 loc) • 2.12 kB
TypeScript
import React from "react";
import { CellProps } from "../components/Cell/Cell.types";
import { GeneratorProps } from "../components/Generator/Generator.types";
import { LensProps, GenerationProps } from "../components/Lens/Lens.types";
export interface IObjectsContext {
cells: CellProps[];
addCell: (text: string, data?: any) => string;
removeCell: (cellId: string) => void;
updateCell: (cellId: string, text: string) => void;
toggleCell: (cellId: string, property: string) => void;
linkCells: (childId: string, parentId: string) => void;
unlinkCell: (id: string) => void;
generators: GeneratorProps[];
addGenerator: (generator: GeneratorProps) => string;
removeGenerator: (generatorId: string) => void;
updateGenerator: (generatorId: string, parameters: any) => void;
toggleGenerator: (generatorId: string, property: string) => void;
onGenerate: (generatorId: string) => void;
generations: GenerationProps[];
updateGenerationsData: (ids: string[], data: any[]) => void;
linkCellToGenerator: (cellId: string, generatorId: string) => void;
unlinkCellFromGenerator: (generatorId: string) => void;
linkGeneratorToLens: (generatorId: string, lensId: string) => void;
unlinkGeneratorFromLens: (generatorId: string) => void;
lenses: LensProps[];
addLens: (lens: LensProps) => string;
removeLens: (id: string) => void;
changeLensType: (id: string, type: string) => void;
linkLenses: (fromId: string, toId: string) => void;
unlinkLens: (id: string) => void;
resetLens: (id: string) => void;
hoveredId: string | null;
setHoveredId: (id: string | null) => void;
}
export declare const ObjectsContext: React.Context<IObjectsContext>;
interface Props {
children: React.ReactElement | React.ReactElement[];
cells?: CellProps[];
generators?: GeneratorProps[];
lenses?: LensProps[];
generateHandler: (input: string | string[], parameters: any) => Promise<string | string[]>;
minimizeHandler?: (text: string) => string;
}
export declare const ObjectsContextProvider: React.FC<Props>;
export {};