UNPKG

1.85 kBTypeScriptView Raw
1import { Response } from 'ask-sdk-model';
2import { CustomSkillErrorHandler } from '../../dispatcher/error/handler/CustomSkillErrorHandler';
3import { CustomSkillRequestHandler } from '../../dispatcher/request/handler/CustomSkillRequestHandler';
4import { HandlerInput } from '../../dispatcher/request/handler/HandlerInput';
5import { CustomSkillRequestInterceptor } from '../../dispatcher/request/interceptor/CustomSkillRequestInterceptor';
6import { CustomSkillResponseInterceptor } from '../../dispatcher/request/interceptor/CustomSkillResponseInterceptor';
7import { CustomSkill } from '../CustomSkill';
8import { CustomSkillConfiguration } from '../CustomSkillConfiguration';
9import { LambdaHandler } from './BaseSkillFactory';
10/**
11 * An interface containing help functions to build a {@link CustomSkill}.
12 */
13export interface BaseSkillBuilder {
14 addRequestHandler(matcher: ((input: HandlerInput) => Promise<boolean> | boolean) | string, executor: (input: HandlerInput) => Promise<Response> | Response): this;
15 addRequestHandlers(...requestHandlers: CustomSkillRequestHandler[]): this;
16 addRequestInterceptors(...executors: Array<CustomSkillRequestInterceptor | ((input: HandlerInput) => Promise<void> | void)>): this;
17 addResponseInterceptors(...executors: Array<CustomSkillResponseInterceptor | ((input: HandlerInput, response?: Response) => Promise<void> | void)>): this;
18 addErrorHandler(matcher: (input: HandlerInput, error: Error) => Promise<boolean> | boolean, executor: (input: HandlerInput, error: Error) => Promise<Response> | Response): this;
19 addErrorHandlers(...errorHandlers: CustomSkillErrorHandler[]): this;
20 withCustomUserAgent(customUserAgent: string): this;
21 withSkillId(skillId: string): this;
22 getSkillConfiguration(): CustomSkillConfiguration;
23 create(): CustomSkill;
24 lambda(): LambdaHandler;
25}
26
\No newline at end of file