rime-react
Version:
React Component for the RIME Input Method Engine
34 lines (31 loc) • 1.16 kB
TypeScript
// Generated by dts-bundle-generator v9.5.1
export type Listeners = {
[K in keyof ListenerArgsMap]: (...args: ListenerArgsMap[K]) => void;
};
declare function subscribe<K extends keyof Listeners>(type: K, callback: Listeners[K]): () => void;
export type RimeDeployStatus = "start" | "success" | "failure";
export interface ListenerArgsMap {
deployStatusChanged: [
status: RimeDeployStatus
];
}
export interface RimeContextState {
isLoading: boolean;
isInitialized: boolean;
isDeploying: boolean;
subscribe: typeof subscribe;
}
export function useRimeContext(): RimeContextState;
export function RimeReact({ pathToRimeJS, pathToRimeWASM, schemaFilesFetchPrefix, schemaFilesToSHA256, includeElements, onError, children, }: {
/** @default "rime.js" */
pathToRimeJS?: string | URL;
/** @default "rime.wasm" */
pathToRimeWASM?: string | URL;
schemaFilesFetchPrefix: string;
schemaFilesToSHA256: Record<string, string>;
/** @default "input[type='text'], input[type='search'], textarea, [contenteditable]" */
includeElements?: string;
onError?(error: unknown): void;
children: JSX.Element;
}): import("react/jsx-runtime").JSX.Element;
export {};