UNPKG

intentful

Version:

Create Custom Skills with less headache

149 lines (148 loc) 5.06 kB
import { interfaces } from 'ask-sdk-model'; import { AVGGraphic, Gradient, GradientModel, GradientProps } from './avg'; import { Command, CommandModel, CommandProps } from './commands'; import { APLBaseComponentModel, APLBaseComponentProps, APLComponent } from './components/component'; import { APLResourceModel, APLResourceProps, APLVersion, BindingModel, Color, DynamicIndexListProps, DynamicTokenListProps, ExportModel, ExportProps, ExtensionsModel, ExtensionsProps, ImportModel, ImportProps, Style, Theme, TickHandlerModel, TickHandlerProps, UserDefinedCommandsModel } from './interfaces'; import { LabeledRequestHandler, RequestHandlerProvider } from '../skill'; export interface APLMainTemplateModel { parameters: string[]; items: APLBaseComponentModel[]; bind?: BindingModel[]; } export interface APLDocumentModel extends APLBaseComponentModel { import?: ImportModel[]; export?: ExportModel[]; extensions?: ExtensionsModel[]; graphics?: { [key: string]: AVGGraphic; }; resources?: APLResourceModel[]; mainTemplate: APLMainTemplateModel; /** * Override standard background color. */ background?: Color | Gradient<GradientModel, GradientProps>; /** * An optional description of this document. */ description?: string; handleTick?: TickHandlerModel[]; environment?: { [key: string]: unknown; }; /** * A list of commands to execute when the document configuration changes. */ onConfigChange?: Command<CommandModel, CommandProps>[]; /** * A list of the commands to execute whenever the display state of the document changes */ onDisplayStateChange?: Command<CommandModel, CommandProps>[]; /** * A list of commands to execute when the document is first displayed. */ onMount?: Command<CommandModel, CommandProps>[]; /** * A map of document-wide settings. */ settings?: { [key: string]: unknown; }; /** * A map of style name to style definition */ styles?: { [k: string]: Style; }; /** * A map of name to layout. */ version: APLVersion; /** * The sample templates are under Amazon Software License */ license?: string; theme?: Theme; } export interface APLDocumentProps extends APLBaseComponentProps { documentName: string; items: APLComponent<APLBaseComponentModel, APLBaseComponentProps>[]; import?: ImportProps[]; export?: ExportProps[]; commands?: UserDefinedCommandsModel; extensions?: ExtensionsProps[]; graphics?: { [key: string]: AVGGraphic; }; resources?: APLResourceProps[]; dynamicTokenLists?: { [key: string]: DynamicTokenListProps; }; dynamicIndexLists?: { [key: string]: DynamicIndexListProps; }; staticData?: { [key: string]: unknown; }; /** * Override standard background color. */ background?: Color | Gradient<GradientModel, GradientProps>; /** * An optional description of this document. */ description?: string; handleTick?: TickHandlerProps[]; environment?: { [key: string]: unknown; }; /** * A list of commands to execute when the document configuration changes. */ onConfigChange?: Command<CommandModel, CommandProps>[]; /** * A list of the commands to execute whenever the display state of the document changes */ onDisplayStateChange?: Command<CommandModel, CommandProps>[]; /** * A list of commands to execute when the document is first displayed. */ onMount?: Command<CommandModel, CommandProps>[]; /** * A map of document-wide settings. */ settings?: { [key: string]: unknown; }; /** * A map of style name to style definition */ styles?: { [k: string]: Style; }; /** * A map of name to layout. */ version?: APLVersion; /** * The sample templates are under Amazon Software License */ license?: string; theme?: Theme; } export declare class APLDocument extends APLComponent<APLDocumentModel, APLDocumentProps> implements RequestHandlerProvider { constructor(props: APLDocumentProps); addComponents(..._components: APLComponent<APLBaseComponentModel, APLBaseComponentProps>[]): this; componentSpecificModel(): APLDocumentModel; componentSpecificRequestHandlers(): LabeledRequestHandler[]; getDirective(additionalData?: unknown): interfaces.alexa.presentation.apl.RenderDocumentDirective; getFullDirective(additionalData?: unknown): interfaces.alexa.presentation.apl.RenderDocumentDirective; buildDatasources(additionalData?: unknown): { [key: string]: any; }; writeToFile(baseSkillPackagePath?: string): void; private convertDynamicIndexListPropsToModel; private convertDynamicTokenListPropsToModel; private convertDynamicTokenListPropsToRequestHandlers; private convertDynamicIndexListPropsToRequestHandlers; }