Skip to content

Commit

Permalink
fix(pipeline): Fix type annotations on pipeline next parameter
Browse files Browse the repository at this point in the history
fixes #265
  • Loading branch information
bryanrsmith committed Dec 30, 2015
1 parent c6af5d1 commit b47a0dc
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -54,7 +54,7 @@
},
"devDependencies": {
"aurelia-tools": "0.1.16",
"babel-dts-generator": "^0.2.17",
"babel-dts-generator": "0.2.18",
"babel-eslint": "^4.1.1",
"conventional-changelog": "0.0.11",
"del": "^1.1.0",
Expand Down
28 changes: 27 additions & 1 deletion src/pipeline.js
Expand Up @@ -10,6 +10,32 @@ export const pipelineStatus = {
running: 'running'
};

/**
* A callback to indicate when pipeline processing should advance to the next step
* or be aborted.
*/
interface Next {
/**
* Indicates the successful completion of the pipeline step.
*/
(): Promise<any>,

/**
* Indicates the successful completion of the entire pipeline.
*/
complete: (result: any) => Promise<any>,

/**
* Indicates that the pipeline should cancel processing.
*/
cancel: (result: any) => Promise<any>,

/**
* Indicates that pipeline processing has failed and should be stopped.
*/
reject: (result: any) => Promise<any>
}

/**
* A step to be run during processing of the pipeline.
*/
Expand All @@ -21,7 +47,7 @@ interface PipelineStep {
* @param instruction The navigation instruction.
* @param next The next step in the pipeline.
*/
run(instruction: NavigationInstruction, next: Function): void;
run(instruction: NavigationInstruction, next: Next): void;
}

/**
Expand Down

0 comments on commit b47a0dc

Please sign in to comment.