celery.node
celery.node copied to clipboard
Usage of Idiomatic TypeScript
Description
The code itself looks very nice and consistent. However, Looking over the code base it looks like we're not using idiomatic typescript. There are no type declarations, we are using string accessors instead of dot notation etc etc. Is there a design theory behind this or are we open to enhancements?
Defining the types that are flowing through the system would make understanding the codebase much easier to document and understand.
Happy to help
type TaskMeta = {status: string, result: any, traceback: any, children: any[], date_done: any, task_id:string};
...
public status(): Promise<string> {
return this.getTaskMeta()
.then((meta: TaskMeta) => {
if (meta) {
return meta.status;
} else {
return null;
}
});