UNPKG

1.42 kBTypeScriptView Raw
1import { RequestEnvelope, Response, ResponseEnvelope, services } from 'ask-sdk-model';
2import { RequestDispatcher, Skill } from 'ask-sdk-runtime';
3import { PersistenceAdapter } from '../attributes/persistence/PersistenceAdapter';
4import { HandlerInput } from '../dispatcher/request/handler/HandlerInput';
5import { CustomSkillConfiguration } from './CustomSkillConfiguration';
6import ApiClient = services.ApiClient;
7/**
8 * Top level container for request dispatcher.
9 */
10export declare class CustomSkill implements Skill<RequestEnvelope, ResponseEnvelope> {
11 protected requestDispatcher: RequestDispatcher<HandlerInput, Response>;
12 protected persistenceAdapter: PersistenceAdapter;
13 protected apiClient: ApiClient;
14 protected customUserAgent: string;
15 protected skillId: string;
16 constructor(skillConfiguration: CustomSkillConfiguration);
17 /**
18 * Invokes the dispatcher to handler the request envelope and construct the handler input.
19 * @param requestEnvelope
20 * @param context
21 */
22 invoke(requestEnvelope: RequestEnvelope, context?: any): Promise<ResponseEnvelope>;
23 /**
24 * Determines if the skill can support the specific request type.
25 * @param input
26 * @param context
27 */
28 supports(input: any, context?: any): boolean;
29 /**
30 * Append additional user agent info
31 * @param userAgent
32 */
33 appendAdditionalUserAgent(userAgent: string): void;
34}