intentful
Version:
Create Custom Skills with less headache
149 lines (148 loc) • 5.06 kB
TypeScript
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?: {
[]: 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?: {
[]: 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?: {
[]: unknown;
};
/**
* A map of style name to style definition
*/
styles?: {
[]: 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?: {
[]: AVGGraphic;
};
resources?: APLResourceProps[];
dynamicTokenLists?: {
[]: DynamicTokenListProps;
};
dynamicIndexLists?: {
[]: DynamicIndexListProps;
};
staticData?: {
[]: unknown;
};
/**
* Override standard background color.
*/
background?: Color | Gradient<GradientModel, GradientProps>;
/**
* An optional description of this document.
*/
description?: string;
handleTick?: TickHandlerProps[];
environment?: {
[]: 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?: {
[]: unknown;
};
/**
* A map of style name to style definition
*/
styles?: {
[]: 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): {
[]: any;
};
writeToFile(baseSkillPackagePath?: string): void;
private convertDynamicIndexListPropsToModel;
private convertDynamicTokenListPropsToModel;
private convertDynamicTokenListPropsToRequestHandlers;
private convertDynamicIndexListPropsToRequestHandlers;
}