我是使用 typescript @types 文件的新手。我已经安装了 aws-sdk 和 @types/aws-sdk。我正在尝试在 swf 中调用列表打开工作流。第一个参数是“ListOpenWorkflowExcusionsInput”,我看到类型文件声明为接口。我真的需要实现这个接口还是我错过了什么?
import {SWF} from "aws-sdk"
import {ListOpenWorkflowExecutionsInput} from 'aws-sdk/clients/swf';
let swf:SWF = new SWF();
let params:ListOpenWorkflowExecutionsInput = new ListOpenWorkflowExecutionsInputClass();
params.domain = "domain";
//etc...
swf.listOpenWorkflowExecutions(params,function(e,d){
console.log(e);
console.log(d);
});
然后我需要定义 ListOpenWorkflowExecutionsInputClass。
export class ListOpenWorkflowExecutionsInputClass implements ListOpenWorkflowExecutionsInput{
domain: SWF.DomainName;
startTimeFilter: SWF.ExecutionTimeFilter;
typeFilter: SWF.WorkflowTypeFilter;
tagFilter: SWF.TagFilter;
nextPageToken: SWF.PageToken;
maximumPageSize: SWF.PageSize;
reverseOrder: SWF.ReverseOrder;
executionFilter: SWF.WorkflowExecutionFilter;
}