import { ChildTask, CreateTask, FeedbackResponse, FormSubmit, OrderHistoryFiltersType, PreparationStatus, Run, Task as BringgTask, TaskAutomaticallyCancelled, TaskHistory, TaskInventory, TaskNote } from '@bringg/types';
import { Task } from '../ApiTypes/ApiTypes';
import { Answer } from '../OrderExecutionActions/types';
import Session from '../Services/Identity/Session';
import { KeysetPaginationRequest } from '../utils/consts/keyset-pagination.consts';
import { TaskHelpers } from './TaskHelpers';
import { BroadcastToDriversResponse, ClosedTasksByQueryResponse, GetOpenTasksRequest, HistoryTasksResponse, TaskLocation, TaskPriority, TasksCsvImportResponse, TasksKeySetPaginationResponse, WayPointDeleteResponse } from './Tasks.consts';
export default class Tasks {
    private taskEntity;
    constructor(session: Session);
    getOpenTasks(options?: GetOpenTasksRequest): Promise<Task[]>;
    getHistoryTasks(query?: OrderHistoryFiltersType, page?: number, limit?: number): Promise<HistoryTasksResponse>;
    getHistoryTasksMetadata(query?: OrderHistoryFiltersType): Promise<{
        count: number;
    }>;
    getOpenTasksKeySetPagination(options?: KeysetPaginationRequest<null>): Promise<TasksKeySetPaginationResponse>;
    getInvalidTasks(): Promise<Task[]>;
    updatePriorities(taskPriorities?: TaskPriority[]): Promise<boolean>;
    getPlanningTasks(options?: GetOpenTasksRequest): Promise<Task[]>;
    update(id: number, diff: Partial<Task>): Promise<Task>;
    finish(id: number): Promise<Task>;
    cancel(id: number): Promise<Task>;
    acknowledge(id: number): Promise<Task>;
    get(id: number): Promise<Task>;
    forceGet(id: number): Promise<Task>;
    batchGet(ids: number[]): Promise<Task[]>;
    massAssign(userId: number, taskIds: number[], options: {}, targetRun?: Partial<Run>): Promise<boolean>;
    getChildTasks(taskId: number): Promise<ChildTask[]>;
    massUnassign(taskIds: number[], options: {}): Promise<boolean>;
    moveToPlanning(taskIds: number[]): Promise<boolean>;
    releaseToDrivers(taskIds: number[]): Promise<boolean>;
    /**
     * `/tasks` API accepting task wrapped in `{task: {...}}` or as plain task object.
     * The proper way to create task via API is with wrapped into `{task: {...}}` because this type of payload
     * support more properties for task creation(backend logic).
     * DO NOT use plain task object as payload for task creation, it is here only to support places where method was used before
     */
    create(payload: {
        task: CreateTask;
    } | BringgTask): Promise<FeedbackResponse & {
        task: Task;
    }>;
    massCancel(taskIds: number[], reasonId: number, text?: string, automaticallyCancelled?: TaskAutomaticallyCancelled): Promise<boolean>;
    updatePreparationStatus(taskId: number, preparationStatus: PreparationStatus): Promise<Task>;
    cancelAllOpen(): Promise<boolean>;
    closedTaskByQuery(query?: string, page?: number, limit?: number): Promise<ClosedTasksByQueryResponse>;
    activityLog(taskId: number): Promise<TaskHistory[]>;
    changeTeam(taskId: number, teamId: number): Promise<boolean>;
    getLocations(taskId: number): Promise<TaskLocation[]>;
    submitForm(form: FormSubmit): Promise<TaskNote>;
    lock(taskIds: number[]): Promise<boolean>;
    unlock(taskIds: number[]): Promise<boolean>;
    duplicate(taskId: number): Promise<Task>;
    rescheduleCancelled(taskId: number): Promise<boolean>;
    rescheduleVirtualTasks(taskIds: number[], noLaterThan: string, noEarlierThan: string): Promise<number[]>;
    getPickupQRCode(taskId: number): Promise<string>;
    getTaskNotesByWayPoint(taskId: number, waypointId: number): TaskNote[];
    getTaskInventoriesByWayPoint(taskId: number, waypointId: number): TaskInventory[];
    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>;
    attachSubscriptions(): void;
    unsubscribe: () => void;
    onUpdate: (callback: any) => () => ((entity: BringgTask) => void)[];
    onCreate: (callback: any) => () => ((entity: BringgTask) => void)[];
    onDelete: (callback: any) => () => ((entity: BringgTask) => void)[];
    onWayPointUpdate: (callback: any) => () => ((entity: BringgTask) => void)[];
    onWayPointAdd: (callback: any) => () => ((entity: BringgTask) => void)[];
    onWayPointDelete: (callback: any) => () => ((entity: BringgTask) => void)[];
    subscribeToGroupUpdates(fn: () => void): void;
    getOpenTasksIds(): number[];
    getPlanningTasksIds(): number[];
    getGeneralTasksIds(): number[];
    getInvalidTasksIds(): number[];
    getWayPointAnswers(taskId: number, wayPointId: number): Promise<Answer[]>;
    /**
     * task methods
     */
    static isReadyToExecute: typeof TaskHelpers.isReadyToExecute;
    static isActive: typeof TaskHelpers.isTaskInOpenState;
    static isDone: typeof TaskHelpers.isDone;
    static isGroupFollower: typeof TaskHelpers.isGroupFollower;
    static isUnacknowledged: typeof TaskHelpers.isUnacknowledged;
    static isLate: typeof TaskHelpers.isLate;
    static isInOpenState: typeof TaskHelpers.isInOpenState;
    static isInPlanningState: typeof TaskHelpers.isInPlanningState;
    static isInClosedState: typeof TaskHelpers.isInClosedState;
    static isInvalid: typeof TaskHelpers.isInvalid;
}
