@jargon/platform-jovo
Version:
A Jovo Framework plugin for the Jargon Platform SDK
54 lines (53 loc) • 2.46 kB
TypeScript
import { RenderItem, ResourceManager } from '@jargon/platform-sdk-core';
import { Jovo } from 'jovo-core';
/**
* JovoJargon contains Jargon's additions to the core Jovo framework
* class.
*/
export interface JovoJargon {
/** The resource manager for the current request */
rm: ResourceManager;
/**
* Add a Jargon response to the output. This response may include multiple components (speak, reprompt, etc.).
* The response will map to an 'ask' if it contains both a speak and reprompt component.
*
* @param response The item to render for the response
*/
respond(response: RenderItem): Promise<void>;
/** Responds with the given text and ends session
* @param {RenderItem} speech The item to render for the speech content
*/
tell(speech: RenderItem): Promise<void>;
/**
* Says speech and waits for an answer from the user.
* Reprompt when user input fails.
* Keeps session open.
* @param {RenderItem} speech The item to render for the speech content
* @param {RenderItem} repromptSpeech The item to render for the reprompt content
*/
ask(speech: RenderItem, repromptSpeech?: RenderItem): Promise<void>;
/** Adds a simple card to the response
* @param {RenderItem} title The item to render for the card's title
* @param {RenderItem} content The item to render for the card's content
*/
showSimpleCard(title: RenderItem, content: RenderItem): Promise<void>;
/** Adds an image card to the response
* @param {RenderItem} title The item to render for the card's title
* @param {RenderItem} content The item to render for the card's content
* @param {string} imageUrl The URL for the image. Must be https
*/
showImageCard(title: RenderItem, content: RenderItem, imageUrl: string): Promise<void>;
}
export declare const jptAlexa = "Alexa";
export declare const jptGoogleAssistant = "GoogleAssistant";
export declare const jptBixby = "Bixby";
export declare class JJ implements JovoJargon {
private jovo;
rm: ResourceManager;
constructor(jovo: Jovo, rm: ResourceManager);
respond(response: RenderItem): Promise<void>;
tell(speech: RenderItem): Promise<void>;
ask(speech: RenderItem, repromptSpeech?: RenderItem): Promise<void>;
showSimpleCard(title: RenderItem, content: RenderItem): Promise<void>;
showImageCard(title: RenderItem, content: RenderItem, imageUrl: string): Promise<void>;
}