import * as React from "react"; export interface ParametersSchema { type: string; properties: { [key: string]: { type: string; description: string; }; }; } export interface ActionResponse { action: string; params: { [key: string]: string; }; } export interface FunctionDetails { /** * The name of the function. */ name: string; /** * A description of the function. */ description: string; /** * The parameters that the function accepts. */ parameters: ParametersSchema; /** * The function to be executed. */ fn: Function; } interface ActionContextType { /** * The list of functions that have been registered. */ functions: FunctionDetails[]; /** * Register a new function. * @param fnDetails - The details of the function to register. * @returns */ registerFunction: (fnDetails: FunctionDetails) => void; /** * Deregsiter a function. * @param name - The name of the function to deregister. * @returns */ deregisterFunction: (name: string) => void; /** * Register a new context. * @param context - The name of the context to register. * @returns */ registerContext: (context: string) => void; /** * Deregister a context. * @param context - The name of the context to deregister. * @returns */ deregisterContext: (context: string) => void; } export declare const ActionContext: React.Context; interface ActionProviderProps { botId: string; domain?: string; chatId?: string | null; userId?: string | null; children: React.ReactNode; } /** * A provider that allows users to register/de-register custom functions for use in the chat bot. */ export declare const ActionProvider: React.FunctionComponent; /** * A hook that allows users to access to states in the actions. * @returns An action context store. */ export declare const useActionContext: () => ActionContextType; export {};