Skip to content

Commit

Permalink
fix: typescript type inference issue. explicit type declaration is re…
Browse files Browse the repository at this point in the history
…quired

See this for more - microsoft/TypeScript#29221
  • Loading branch information
kevindra committed Oct 30, 2020
1 parent 4930879 commit 914e625
Show file tree
Hide file tree
Showing 18 changed files with 13,795 additions and 15,362 deletions.
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -40,7 +40,7 @@
"nyc": "^15.1.0",
"ts-node": "^9.0.0",
"tslint": "^6.1.3",
"typescript": "^4.0.3"
"typescript": "^3.7.5"
},
"config": {
"commitizen": {
Expand Down
4,728 changes: 2,144 additions & 2,584 deletions packages/alexa/package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/alexa/package.json
Expand Up @@ -59,6 +59,6 @@
"nyc": "^15.1.0",
"source-map-support": "^0.5.19",
"ts-node": "^9.0.0",
"typescript": "^3.9.7"
"typescript": "^3.7.5"
}
}
32 changes: 27 additions & 5 deletions packages/alexa/src/blocks/index.ts
Expand Up @@ -2,12 +2,16 @@ import { Directive, IntentRequest } from "ask-sdk-model";

import {
AgentBuilder,
CompoundBlock,
CompoundBlockBuilder,
DoBlock,
DoBlockBuilder,
GotoStateBlock,
GotoStateBlockBuilder,
RemoveGlobalStateBlockBuilder,
SetGlobalStateBlockBuilder,
StateBuilder,
WhenBlock,
WhenBlockBuilder,
} from "@chitchatjs/core";

Expand Down Expand Up @@ -111,11 +115,6 @@ export namespace alexa {
}

export function compound() {
// : CompoundBlockBuilder<
// AlexaBuilderContext,
// AlexaDialogContext,
// AlexaEvent
// >
return new CompoundBlockBuilder<
AlexaBuilderContext,
AlexaDialogContext,
Expand Down Expand Up @@ -325,3 +324,26 @@ export namespace alexa {
* A short hand of alexa
*/
export const ax = alexa;

/**
* Helper type aliases
*/
export type AlexaCompoundBlock = CompoundBlock<
AlexaBuilderContext,
AlexaDialogContext,
AlexaEvent
>;

export type AlexaWhenBlock = WhenBlock<
AlexaBuilderContext,
AlexaDialogContext,
AlexaEvent
>;

export type AlexaGotoStateBlock = GotoStateBlock<
AlexaBuilderContext,
AlexaDialogContext,
AlexaEvent
>;

export type AlexaDoBlock = DoBlock<AlexaBuilderContext, AlexaDialogContext, AlexaEvent>;

0 comments on commit 914e625

Please sign in to comment.