import { ChildTask, FormSubmit, OrderHistoryFiltersType, PreparationStatus, Run, Scan, Task, TaskAutomaticallyCancelled, TaskHistory, TaskInventory, TaskNote, WayPoint } from '@bringg/types';
import StoreEntity from '../../Core/StoreEntity';
import { Answer } from '../../OrderExecutionActions/types';
import Session from '../../Services/Identity/Session';
import { KeysetPaginationRequest } from '../../utils/consts/keyset-pagination.consts';
import { BroadcastToDriversResponse, ClosedTasksByQueryResponse, GetOpenTasksRequest, GROUP_VALUES, HistoryTasksResponse, TaskLocation, TaskPriority, TasksCsvImportResponse, TasksKeySetPaginationResponse, WayPointDeleteResponse } from '../Tasks.consts';
export type TaskGroupValue = Map<GROUP_VALUES, number[]>;
export default class TaskEntity extends StoreEntity<Task> {
    private groupUpdateEvents;
    private groupedValues;
    constructor(session: Session, throttleTimeValue?: number);
    getGroupsCount(): number;
    subscribeToGroupUpdates(fn: (groupValues?: TaskGroupValue) => void): void;
    private emitGroupEvents;
    getOpenTasksIds(): number[];
    getPlanningTasksIds(): number[];
    getGeneralTasksIds(): number[];
    getInvalidTasksIds(): number[];
    getChildTasks(taskId: number): Promise<ChildTask[]>;
    getPickupQRCode(taskId: number): Promise<string>;
    rescheduleVirtualTasks(taskIds: number[], noLaterThan: string, noEarlierThan: string): Promise<number[]>;
    rescheduleCancelled(id: number): Promise<boolean>;
    unlock(taskIds: number[]): Promise<boolean>;
    lock(taskIds: number[]): Promise<boolean>;
    duplicate(taskId: number): Promise<Task>;
    submitForm(form: FormSubmit): Promise<TaskNote>;
    getLocations(id: number): Promise<TaskLocation[]>;
    changeTeam(id: number, teamId: number): Promise<boolean>;
    activityLog(id: number): Promise<TaskHistory[]>;
    closedTaskByQuery(query?: string, page?: number, limit?: number): Promise<ClosedTasksByQueryResponse>;
    getHistoryTasks(query?: OrderHistoryFiltersType, page?: number, limit?: number): Promise<HistoryTasksResponse>;
    getHistoryTasksMetadata(query?: OrderHistoryFiltersType): Promise<{
        count: number;
    }>;
    cancelAllOpen(): Promise<boolean>;
    updatePreparationStatus(taskId: number, preparationStatus: PreparationStatus): Promise<Task>;
    massCancel(taskIds: number[], reasonId: number, text?: string, automaticallyCancelled?: TaskAutomaticallyCancelled): Promise<boolean>;
    releaseToDrivers(ids: number[]): Promise<boolean>;
    moveToPlanning(task_ids: number[]): Promise<boolean>;
    massUnassign(task_ids: number[], options: {}): Promise<boolean>;
    massAssign(user_id: number, task_ids: number[], options: {}, targetRun?: Partial<Run>): Promise<boolean>;
    batchGet(ids: number[]): Promise<Task[]>;
    get(id: number): Promise<Task>;
    forceGet(id: number): Promise<Task>;
    acknowledge(id: number): Promise<Task>;
    cancel(id: number): Promise<Task>;
    finish(id: number): Promise<Task>;
    getPlanningTasks(options?: GetOpenTasksRequest): Promise<Task[]>;
    getOpenTasks(options?: GetOpenTasksRequest): Promise<Task[]>;
    getOpenTasksKeySetPagination(options?: KeysetPaginationRequest<null>): Promise<TasksKeySetPaginationResponse>;
    getInvalidTasks(): Promise<Task[]>;
    updatePriorities(tasksPriorities: TaskPriority[]): Promise<boolean>;
    getTaskNotesByWayPoint(taskId: number, waypointId: number): TaskNote[];
    getTaskInventoriesByWayPoint(taskId: number, waypointId: number): TaskInventory[];
    /*********/
    attachSubscriptions(): void;
    registerOnWayPointUpdate: (fn: (entity: WayPoint) => void) => () => ((entity: Task) => void)[];
    registerOnWayPointAdded: (fn: (entity: WayPoint) => void) => () => ((entity: Task) => void)[];
    registerOnWayPointDeleted: (fn: (entity: WayPoint) => void) => () => ((entity: Task) => void)[];
    onUpdateTask: (task: Task) => void;
    onNewTaskAdded: (task: Task) => void;
    onTaskDelete: (task: Task) => void;
    onWayPointAdded: (wayPoint: WayPoint) => void;
    onWayPointDeleted: (wayPoint: WayPoint) => void;
    onWayPointUpdate: (wayPoint: WayPoint) => void;
    onNewScanAdded: (scan: Scan) => void;
    onNewNoteAdded: (note: TaskNote) => void;
    handleTasksRequest: (route: string, options?: any) => Promise<Task[]>;
    handleTasksKeySetPaginationRequest: (route: string, options?: KeysetPaginationRequest<null>) => Promise<TasksKeySetPaginationResponse>;
    shouldAddTask: (task: Task) => boolean;
    sendRealTimeTaskUpdate: (task: Task) => void;
    updateTask: (task: Task) => void;
    addOrUpdateTask: (task: Task) => Task;
    importTasksCsv: (file: Blob) => Promise<TasksCsvImportResponse>;
    broadcastToDrivers: (taskId: number, userIds: number[], message?: string) => Promise<BroadcastToDriversResponse>;
    addTaskNote: (taskId: number, wayPointId: number, note?: string, type?: string, image?: string, hiddenFromDrivers?: boolean) => Promise<TaskNote>;
    deleteWayPoint: (taskId: number, wayPointId: number) => Promise<WayPointDeleteResponse>;
    getWayPointAnswers: (taskId: number, wayPointId: number) => Promise<Answer[]>;
}
