Skip to content

Commit 578ad37

Browse files
committed
updated task typing
1 parent 0f692a5 commit 578ad37

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/modules/task.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const taskplaner = {
99
* @param {string} task - The task to be added.
1010
* @returns {Promise<AddTaskResponse>} A promise that resolves with the response from the add task event.
1111
*/
12-
addTask: async (task: string): Promise<any> => {
12+
addTask: async (task: string): Promise<AddTaskResponse> => {
1313
return cbws.messageManager.sendAndWaitForResponse(
1414
{
1515
"type": "taskEvent",
@@ -26,7 +26,7 @@ const taskplaner = {
2626
* Retrieves all tasks using a WebSocket message.
2727
* @returns {Promise<GetTasksResponse>} A promise that resolves with the response from the get tasks event.
2828
*/
29-
getTasks: async (): Promise<any> => {
29+
getTasks: async (): Promise<GetTasksResponse> => {
3030
return cbws.messageManager.sendAndWaitForResponse(
3131
{
3232
"type":"taskEvent",
@@ -41,7 +41,7 @@ const taskplaner = {
4141
* @param {string} task - The updated task information.
4242
* @returns {Promise<UpdateTasksResponse>} A promise that resolves with the response from the update task event.
4343
*/
44-
updateTask: async ( task: string): Promise<any> => {
44+
updateTask: async (task: string): Promise<UpdateTasksResponse> => {
4545
return cbws.messageManager.sendAndWaitForResponse(
4646
{
4747
"type": "taskEvent",

src/types/socketMessageTypes.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -572,6 +572,7 @@ export interface MemoryClearResponse extends BaseWebSocketResponse {
572572
export interface AddTaskResponse extends BaseWebSocketResponse {
573573
type: 'addTaskResponse';
574574
task?: import('./commonTypes').Task;
575+
data?: any;
575576
}
576577

577578
export interface GetTasksResponse extends BaseWebSocketResponse {

0 commit comments

Comments
 (0)