-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
008cd6c
commit 2a88932
Showing
15 changed files
with
255 additions
and
4,782 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,52 @@ | ||
import { AActivities, IAActivities } from "./constructor"; | ||
import { ActivityModel } from "../../codic/activity/constructor"; | ||
interface IActivities extends IAActivities { | ||
all(): Promise<ActivityModel>; | ||
get(name: string): Promise<ActivityModel>; | ||
getById?(id: string | number): Promise<ActivityModel>; | ||
save(activity: ActivityModel): Promise<ActivityModel>; | ||
getActive(): Promise<Array<ActivityModel>>; | ||
clear(): Promise<number>; | ||
getDueList(): Promise<Array<ActivityModel>>; | ||
getActive(): Promise<Array<ActivityModel>>; | ||
get(name: string): Promise<ActivityModel>; | ||
all(): Promise<Array<ActivityModel>>; | ||
getNextRunDelay(): Promise<number>; | ||
clear(): Promise<number>; | ||
} | ||
declare class Activities extends AActivities implements IActivities { | ||
getActive(): Promise<ActivityModel[]>; | ||
all(): Promise<ActivityModel>; | ||
/** | ||
* Get all active activities | ||
*/ | ||
getActive(): Promise<Array<ActivityModel>>; | ||
/** | ||
* Get all activities | ||
*/ | ||
all(): Promise<Array<ActivityModel>>; | ||
/** | ||
* Get a single activity by name | ||
* @param name name of activity | ||
*/ | ||
get(name: string): Promise<ActivityModel>; | ||
/** | ||
* Get a single activity by id | ||
* @param id id of activity | ||
*/ | ||
getById(id: string | number): Promise<ActivityModel>; | ||
/** | ||
* Save activity to storage | ||
* @param activity activity model object | ||
*/ | ||
save(activity: ActivityModel): Promise<ActivityModel>; | ||
/** | ||
* Remove all activities from storage | ||
* Returns number of items removed | ||
*/ | ||
clear(): Promise<number>; | ||
/** | ||
* Get list of activities that are due for execution. | ||
* Compares the nextRun with current time | ||
*/ | ||
getDueList(): Promise<Array<ActivityModel>>; | ||
/** | ||
* Get the delay in miliseconds before next closest activity is due | ||
*/ | ||
getNextRunDelay(): Promise<number>; | ||
} | ||
export default Activities; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,36 @@ | ||
import { ATasks, IATasks } from "./constructor"; | ||
import { TaskModel } from "../../codic/task/constructor"; | ||
interface ITasks extends IATasks { | ||
all(): Promise<TaskModel>; | ||
get(name: string): Promise<TaskModel>; | ||
getById?(id: string | number): Promise<TaskModel>; | ||
save(activity: TaskModel): Promise<TaskModel>; | ||
clear(): number; | ||
get(name: string): Promise<TaskModel>; | ||
all(): Promise<Array<TaskModel>>; | ||
clear(): Promise<number>; | ||
} | ||
declare class Tasks extends ATasks implements ITasks { | ||
all(): Promise<TaskModel>; | ||
/** | ||
* Fetch all tasks in storage | ||
*/ | ||
all(): Promise<Array<TaskModel>>; | ||
/** | ||
* Get a single task by name | ||
* @param name name of task | ||
*/ | ||
get(name: string): Promise<TaskModel>; | ||
/** | ||
* Get a single task by id | ||
* @param id id of task | ||
*/ | ||
getById(id: string | number): Promise<TaskModel>; | ||
save(activity: TaskModel): Promise<TaskModel>; | ||
clear(): number; | ||
/** | ||
* Save a task to storage | ||
* @param activity task model object | ||
*/ | ||
save(task: TaskModel): Promise<TaskModel>; | ||
/** | ||
* Remove all tasks from storage | ||
* Returns number of items removed | ||
*/ | ||
clear(): Promise<number>; | ||
} | ||
export default Tasks; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.