UNPKG

assistant-robot

Version:

An assistant widget, have a 3D robot which can interact with user, have a simple LLM which can chat with user.

29 lines (28 loc) 1.09 kB
import type { Answer } from "@tensorflow-models/qna/dist/question_and_answer"; import { TEventListenFunc } from "./type"; export declare function isiOS(): boolean; export declare function isAndroid(): boolean; export declare function isMobile(): boolean; /** * turn a html string to dom * @param htmlString a html string * @returns a dom tree */ export declare function parseHTML(htmlString: string): Element | null; export declare function findHighestScoreItem(data: Answer[]): Answer | null; /** * utils class which implement Observer Pattern */ export declare class EventListener { private listeners; addEventListener(name: string, func: TEventListenFunc): void; removeEventListener(name: string, func: TEventListenFunc): void; emit(event: string, ...args: any[]): void; get(name: string): TEventListenFunc[]; } /** * to replace all children of parentNode to a new node * @param parentNode the pareent node * @param newNode the child node will insert to the parent node */ export declare function replaceChildren(parentNode: Node, newNode: Node): void;