1/**
2 * Error object that can be received through [`TaskManagerTaskBody`](#taskmanagertaskbody) when the
3 * task fails.
4 */
5export interface TaskManagerError {
6    code: string | number;
7    message: string;
8}
9/**
10 * Represents the object that is passed to the task executor.
11 */
12export interface TaskManagerTaskBody<T = unknown> {
13    /**
14     * An object of data passed to the task executor. Its properties depends on the type of the task.
15     */
16    data: T;
17    /**
18     * Error object if the task failed or `null` otherwise.
19     */
20    error: TaskManagerError | null;
21    /**
22     * Additional details containing unique ID of task event and name of the task.
23     */
24    executionInfo: TaskManagerTaskBodyExecutionInfo;
25}
26/**
27 * Additional details about execution provided in `TaskManagerTaskBody`.
28 */
29export interface TaskManagerTaskBodyExecutionInfo {
30    /**
31     * State of the application.
32     * @platform ios
33     */
34    appState?: 'active' | 'background' | 'inactive';
35    /**
36     * Unique ID of task event.
37     */
38    eventId: string;
39    /**
40     * Name of the task.
41     */
42    taskName: string;
43}
44/**
45 * Represents an already registered task.
46 */
47export interface TaskManagerTask {
48    /**
49     * Name that the task is registered with.
50     */
51    taskName: string;
52    /**
53     * Type of the task which depends on how the task was registered.
54     */
55    taskType: string;
56    /**
57     * Provides `options` that the task was registered with.
58     */
59    options: any;
60}
61/**
62 * @deprecated Use `TaskManagerTask` instead.
63 * @hidden
64 */
65export interface RegisteredTask extends TaskManagerTask {
66}
67/**
68 * Type of task executor – a function that handles the task.
69 */
70export type TaskManagerTaskExecutor<T = unknown> = (body: TaskManagerTaskBody<T>) => void;
71/**
72 * Defines task function. It must be called in the global scope of your JavaScript bundle.
73 * In particular, it cannot be called in any of React lifecycle methods like `componentDidMount`.
74 * This limitation is due to the fact that when the application is launched in the background,
75 * we need to spin up your JavaScript app, run your task and then shut down — no views are mounted
76 * in this scenario.
77 *
78 * @param taskName Name of the task. It must be the same as the name you provided when registering the task.
79 * @param taskExecutor A function that will be invoked when the task with given `taskName` is executed.
80 */
81export declare function defineTask<T = unknown>(taskName: string, taskExecutor: TaskManagerTaskExecutor<T>): void;
82/**
83 * Checks whether the task is already defined.
84 *
85 * @param taskName Name of the task.
86 */
87export declare function isTaskDefined(taskName: string): boolean;
88/**
89 * Determine whether the task is registered. Registered tasks are stored in a persistent storage and
90 * preserved between sessions.
91 *
92 * @param taskName Name of the task.
93 * @returns A promise which fulfills with a `boolean` value whether or not the task with given name
94 * is already registered.
95 */
96export declare function isTaskRegisteredAsync(taskName: string): Promise<boolean>;
97/**
98 * Retrieves `options` associated with the task, that were passed to the function registering the task
99 * (eg. `Location.startLocationUpdatesAsync`).
100 *
101 * @param taskName Name of the task.
102 * @return A promise which fulfills with the `options` object that was passed while registering task
103 * with given name or `null` if task couldn't be found.
104 */
105export declare function getTaskOptionsAsync<TaskOptions>(taskName: string): Promise<TaskOptions>;
106/**
107 * Provides information about tasks registered in the app.
108 *
109 * @returns A promise which fulfills with an array of tasks registered in the app. Example:
110 * ```json
111 * [
112 *   {
113 *     taskName: 'location-updates-task-name',
114 *     taskType: 'location',
115 *     options: {
116 *       accuracy: Location.Accuracy.High,
117 *       showsBackgroundLocationIndicator: false,
118 *     },
119 *   },
120 *   {
121 *     taskName: 'geofencing-task-name',
122 *     taskType: 'geofencing',
123 *     options: {
124 *       regions: [...],
125 *     },
126 *   },
127 * ]
128 * ```
129 */
130export declare function getRegisteredTasksAsync(): Promise<TaskManagerTask[]>;
131/**
132 * Unregisters task from the app, so the app will not be receiving updates for that task anymore.
133 * _It is recommended to use methods specialized by modules that registered the task, eg.
134 * [`Location.stopLocationUpdatesAsync`](./location/#expolocationstoplocationupdatesasynctaskname)._
135 *
136 * @param taskName Name of the task to unregister.
137 * @return A promise which fulfills as soon as the task is unregistered.
138 */
139export declare function unregisterTaskAsync(taskName: string): Promise<void>;
140/**
141 * Unregisters all tasks registered for the running app. You may want to call this when the user is
142 * signing out and you no longer need to track his location or run any other background tasks.
143 * @return A promise which fulfills as soon as all tasks are completely unregistered.
144 */
145export declare function unregisterAllTasksAsync(): Promise<void>;
146/**
147 * Determine if the `TaskManager` API can be used in this app.
148 * @return A promise fulfills with `true` if the API can be used, and `false` otherwise.
149 * On the web it always returns `false`.
150 */
151export declare function isAvailableAsync(): Promise<boolean>;
152//# sourceMappingURL=TaskManager.d.ts.map