• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2022-2023 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License"),
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *     http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16/**
17 * @file
18 * @kit AbilityKit
19 */
20
21import { Callback } from './@ohos.base';
22import { AsyncCallback } from './@ohos.base';
23import type { ContinuationResult as _ContinuationResult } from './continuation/continuationResult';
24import type { ContinuationExtraParams as _ContinuationExtraParams } from './continuation/continuationExtraParams';
25
26/**
27 * Provides methods for interacting with the continuation manager service, including methods for registering and
28 * Unregister the ability to hop, updating the device connection state, and showing the list of devices
29 * that can be selected for hopping.
30 *
31 * @namespace continuationManager
32 * @syscap SystemCapability.Ability.DistributedAbilityManager
33 * @since 8
34 */
35/**
36 * Provides methods for interacting with the continuation manager service, including methods for registering and
37 * Unregister the ability to hop, updating the device connection state, and showing the list of devices
38 * that can be selected for hopping.
39 *
40 * @namespace continuationManager
41 * @syscap SystemCapability.Ability.DistributedAbilityManager
42 * @atomicservice
43 * @since 11
44 */
45declare namespace continuationManager {
46  /**
47   * Called when the user selects devices from the candidate device list.
48   * You can implement your own processing logic in this callback to initiate the hop process.
49   *
50   * @permission ohos.permission.DISTRIBUTED_DATASYNC
51   * @param { 'deviceSelected' } type - deviceSelected.
52   * @param { number } token - Registered token.
53   * @param { Callback<Array<ContinuationResult>> } callback - Called when the user selects a device from the device
54   *                                                         selection module, returning the device ID,device type,
55   *                                                         and device name for developers to use
56   * @throws { BusinessError } 201 - Permission denied.
57   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified.
58   * <br>2. Incorrect parameter types. 3.Parameter verification failed.
59   * @throws { BusinessError } 16600001 - The system ability works abnormally.
60   * @throws { BusinessError } 16600002 - The specified token or callback is not registered.
61   * @throws { BusinessError } 16600004 - The specified callback has been registered.
62   * @syscap SystemCapability.Ability.DistributedAbilityManager
63   * @since 9
64   */
65  /**
66   * Called when the user selects devices from the candidate device list.
67   * You can implement your own processing logic in this callback to initiate the hop process.
68   *
69   * @permission ohos.permission.DISTRIBUTED_DATASYNC
70   * @param { 'deviceSelected' } type - deviceSelected.
71   * @param { number } token - Registered token.
72   * @param { Callback<Array<ContinuationResult>> } callback - Called when the user selects a device from the device
73   *                                                         selection module, returning the device ID,device type,
74   *                                                         and device name for developers to use
75   * @throws { BusinessError } 201 - Permission denied.
76   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
77   * <br>2. Incorrect parameter types; 3. Parameter verification failed.
78   * @throws { BusinessError } 16600001 - The system ability works abnormally.
79   * @throws { BusinessError } 16600002 - The specified token or callback is not registered.
80   * @throws { BusinessError } 16600004 - The specified callback has been registered.
81   * @syscap SystemCapability.Ability.DistributedAbilityManager
82   * @atomicservice
83   * @since 11
84   */
85  function on(type: 'deviceSelected', token: number, callback: Callback<Array<ContinuationResult>>): void;
86
87  /**
88   * Called when devices are disconnected from the continuation manager service.
89   * You can implement your own processing logic in this callback, such as notifying the user of the disconnection.
90   *
91   * @permission ohos.permission.DISTRIBUTED_DATASYNC
92   * @param { 'deviceSelected' } type - deviceSelected.
93   * @param { number } token - Registered token.
94   * @throws { BusinessError } 201 - Permission denied.
95   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
96   * <br>2. Incorrect parameter types; 3. Parameter verification failed.
97   * @throws { BusinessError } 16600001 - The system ability works abnormally.
98   * @throws { BusinessError } 16600002 - The specified token or callback is not registered.
99   * @throws { BusinessError } 16600004 - The specified callback has been registered.
100   * @syscap SystemCapability.Ability.DistributedAbilityManager
101   * @since 9
102   */
103  /**
104   * Called when devices are disconnected from the continuation manager service.
105   * You can implement your own processing logic in this callback, such as notifying the user of the disconnection.
106   *
107   * @permission ohos.permission.DISTRIBUTED_DATASYNC
108   * @param { 'deviceSelected' } type - deviceSelected.
109   * @param { number } token - Registered token.
110   * @throws { BusinessError } 201 - Permission denied.
111   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
112   * <br>2. Incorrect parameter types; 3. Parameter verification failed.
113   * @throws { BusinessError } 16600001 - The system ability works abnormally.
114   * @throws { BusinessError } 16600002 - The specified token or callback is not registered.
115   * @throws { BusinessError } 16600004 - The specified callback has been registered.
116   * @syscap SystemCapability.Ability.DistributedAbilityManager
117   * @atomicservice
118   * @since 11
119   */
120  function off(type: 'deviceSelected', token: number): void;
121
122  /**
123   * Called when devices are disconnected from the continuation manager service.
124   * You can implement your own processing logic in this callback, such as notifying the user of the disconnection.
125   *
126   * @permission ohos.permission.DISTRIBUTED_DATASYNC
127   * @param { 'deviceUnselected' } type - deviceUnselected.
128   * @param { number } token - Registered token.
129   * @param { Callback<Array<ContinuationResult>> } callback - Called when the user disconnects the device from the
130   *                                                           device selection module, returning the device ID,
131   *                                                           device type, and device name for developers to use
132   * @throws { BusinessError } 201 - Permission denied.
133   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
134   * <br>2. Incorrect parameter types; 3. Parameter verification failed.
135   * @throws { BusinessError } 16600001 - The system ability works abnormally.
136   * @throws { BusinessError } 16600002 - The specified token or callback is not registered.
137   * @throws { BusinessError } 16600004 - The specified callback has been registered.
138   * @syscap SystemCapability.Ability.DistributedAbilityManager
139   * @since 9
140   */
141  /**
142   * Called when devices are disconnected from the continuation manager service.
143   * You can implement your own processing logic in this callback, such as notifying the user of the disconnection.
144   *
145   * @permission ohos.permission.DISTRIBUTED_DATASYNC
146   * @param { 'deviceUnselected' } type - deviceUnselected.
147   * @param { number } token - Registered token.
148   * @param { Callback<Array<ContinuationResult>> } callback - Called when the user disconnects the device from the
149   *                                                           device selection module, returning the device ID,
150   *                                                           device type, and device name for developers to use
151   * @throws { BusinessError } 201 - Permission denied.
152   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
153   * <br>2. Incorrect parameter types; 3. Parameter verification failed.
154   * @throws { BusinessError } 16600001 - The system ability works abnormally.
155   * @throws { BusinessError } 16600002 - The specified token or callback is not registered.
156   * @throws { BusinessError } 16600004 - The specified callback has been registered.
157   * @syscap SystemCapability.Ability.DistributedAbilityManager
158   * @atomicservice
159   * @since 11
160   */
161  function on(type: 'deviceUnselected', token: number, callback: Callback<Array<ContinuationResult>>): void;
162
163  /**
164   * Called when devices are disconnected from the continuation manager service.
165   * You can implement your own processing logic in this callback, such as notifying the user of the disconnection.
166   *
167   * @permission ohos.permission.DISTRIBUTED_DATASYNC
168   * @param { 'deviceUnselected' } type - deviceUnselected.
169   * @param { number } token - Registered token.
170   * @throws { BusinessError } 201 - Permission denied.
171   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
172   * <br>2. Incorrect parameter types; 3. Parameter verification failed.
173   * @throws { BusinessError } 16600001 - The system ability works abnormally.
174   * @throws { BusinessError } 16600002 - The specified token or callback is not registered.
175   * @throws { BusinessError } 16600004 - The specified callback has been registered.
176   * @syscap SystemCapability.Ability.DistributedAbilityManager
177   * @since 9
178   */
179  /**
180   * Called when devices are disconnected from the continuation manager service.
181   * You can implement your own processing logic in this callback, such as notifying the user of the disconnection.
182   *
183   * @permission ohos.permission.DISTRIBUTED_DATASYNC
184   * @param { 'deviceUnselected' } type - deviceUnselected.
185   * @param { number } token - Registered token.
186   * @throws { BusinessError } 201 - Permission denied.
187   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
188   * <br>2. Incorrect parameter types; 3. Parameter verification failed.
189   * @throws { BusinessError } 16600001 - The system ability works abnormally.
190   * @throws { BusinessError } 16600002 - The specified token or callback is not registered.
191   * @throws { BusinessError } 16600004 - The specified callback has been registered.
192   * @syscap SystemCapability.Ability.DistributedAbilityManager
193   * @atomicservice
194   * @since 11
195   */
196  function off(type: 'deviceUnselected', token: number): void;
197
198  /**
199   * Called when the user selects a device from the candidate device list.
200   * You can implement your own processing logic in this callback to initiate the hop process.
201   *
202   * @param { 'deviceConnect' } type - deviceConnect.
203   * @param { Callback<ContinuationResult> } callback - Called when the user selects a device from the device selection
204   *                                                    module, returning the device ID,device type, and device name for
205   *                                                    developers to use.
206   * @syscap SystemCapability.Ability.DistributedAbilityManager
207   * @since 8
208   * @deprecated since 9
209   * @useinstead ohos.continuation.continuationManager/continuationManager#on
210   */
211  function on(type: 'deviceConnect', callback: Callback<ContinuationResult>): void;
212
213  /**
214   * Called when the user selects a device from the candidate device list.
215   * You can implement your own processing logic in this callback to initiate the hop process.
216   *
217   * @param { 'deviceConnect' } type - deviceConnect.
218   * @param { Callback<ContinuationResult> } [callback] - Called when the user selects a device from the device
219   *                                                      selection module, returning the device ID,device type,
220   *                                                      and device name for developers to use.
221   * @syscap SystemCapability.Ability.DistributedAbilityManager
222   * @since 8
223   * @deprecated since 9
224   * @useinstead ohos.continuation.continuationManager/continuationManager#off
225   */
226  function off(type: 'deviceConnect', callback?: Callback<ContinuationResult>): void;
227
228  /**
229   * Called when a device is disconnected from the continuation manager service.
230   * You can implement your own processing logic in this callback, such as notifying the user of the disconnection.
231   *
232   * @param { 'deviceDisconnect' } type - deviceDisconnect.
233   * @param { Callback<string> } callback - Called when the user disconnects the device from the device selection
234   *                                        module, returning the device ID for developers to use.
235   * @syscap SystemCapability.Ability.DistributedAbilityManager
236   * @since 8
237   * @deprecated since 9
238   * @useinstead ohos.continuation.continuationManager/continuationManager#on
239   */
240  function on(type: 'deviceDisconnect', callback: Callback<string>): void;
241
242  /**
243   * Called when a device is disconnected from the continuation manager service.
244   * You can implement your own processing logic in this callback, such as notifying the user of the disconnection.
245   *
246   * @param { 'deviceDisconnect' } type - deviceDisconnect.
247   * @param { Callback<string> } [callback] - Called when the user selects a device from the device selection module,
248   *                                          returning the device ID,device type, and device name for developers to use.
249   * @syscap SystemCapability.Ability.DistributedAbilityManager
250   * @since 8
251   * @deprecated since 9
252   * @useinstead ohos.continuation.continuationManager/continuationManager#off
253   */
254  function off(type: 'deviceDisconnect', callback?: Callback<string>): void;
255
256  /**
257   * Registers an ability to be hopped with the continuation manager service and obtains the registration token
258   * assigned to the ability.
259   *
260   * @param { AsyncCallback<number> } callback - The AsyncCallback form returns the token generated after connecting to
261   *                                             the flow management service.
262   * @syscap SystemCapability.Ability.DistributedAbilityManager
263   * @since 8
264   * @deprecated since 9
265   * @useinstead ohos.continuation.continuationManager/continuationManager#registerContinuation
266   */
267  function register(callback: AsyncCallback<number>): void;
268
269  /**
270   * Registers an ability to be hopped with the continuation manager service and obtains the registration token
271   * assigned to the ability.
272   *
273   * @param { ContinuationExtraParams } options - Indicates the {@link ExtraParams} object containing the extra
274   *                                              parameters used to filter the list of available devices.
275   * @param { AsyncCallback<number> } callback - The AsyncCallback form returns the token generated after
276   *                                             connecting to the flow management service.
277   * @syscap SystemCapability.Ability.DistributedAbilityManager
278   * @since 8
279   * @deprecated since 9
280   * @useinstead ohos.continuation.continuationManager/continuationManager#registerContinuation
281   */
282  function register(options: ContinuationExtraParams, callback: AsyncCallback<number>): void;
283
284  /**
285   * Registers an ability to be hopped with the continuation manager service and obtains the registration token
286   * assigned to the ability.
287   *
288   * @param { ContinuationExtraParams } [options] - Indicates the {@link ExtraParams} object containing the extra
289   *                                                parameters used to filter the list of available devices.
290   * @returns { Promise<number> } callback Indicates the callback to be invoked when the continuation manager service
291   *                              is connected.
292   * @syscap SystemCapability.Ability.DistributedAbilityManager
293   * @since 8
294   * @deprecated since 9
295   * @useinstead ohos.continuation.continuationManager/continuationManager#registerContinuation
296   */
297  function register(options?: ContinuationExtraParams): Promise<number>;
298
299  /**
300   * Unregisters a specified ability from the continuation manager service based on the token obtained during ability
301   * registration.
302   *
303   * @param { number } token - Indicates the registration token of the ability.
304   * @param { AsyncCallback<void> } callback - AsyncCallback returns the interface call result.
305   * @syscap SystemCapability.Ability.DistributedAbilityManager
306   * @since 8
307   * @deprecated since 9
308   * @useinstead ohos.continuation.continuationManager/continuationManager#unregisterContinuation
309   */
310  function unregister(token: number, callback: AsyncCallback<void>): void;
311
312  /**
313   * Unregisters a specified ability from the continuation manager service based on the token obtained during ability
314   * registration.
315   *
316   * @param { number } token - Indicates the registration token of the ability.
317   * @returns { Promise<void> } callback Indicates the callback to be invoked when the continuation manager
318   *                            service is connected.
319   * @syscap SystemCapability.Ability.DistributedAbilityManager
320   * @since 8
321   * @deprecated since 9
322   * @useinstead ohos.continuation.continuationManager/continuationManager#unregisterContinuation
323   */
324  function unregister(token: number): Promise<void>;
325
326  /**
327   * Updates the connection state of the device where the specified ability is successfully hopped.
328   *
329   * @param { number } token - Indicates the registration token of the ability.
330   * @param { string } deviceId - Indicates the ID of the device whose connection state is to be updated.
331   * @param { DeviceConnectState } status - Indicates the connection state to update.
332   * @param { AsyncCallback<void> } callback - AsyncCallback returns the interface call result.
333   * @syscap SystemCapability.Ability.DistributedAbilityManager
334   * @since 8
335   * @deprecated since 9
336   * @useinstead ohos.continuation.continuationManager/continuationManager#updateContinuationState
337   */
338  function updateConnectStatus(
339    token: number,
340    deviceId: string,
341    status: DeviceConnectState,
342    callback: AsyncCallback<void>
343  ): void;
344
345  /**
346   * Updates the connection state of the device where the specified ability is successfully hopped.
347   *
348   * @param { number } token - Indicates the registration token of the ability.
349   * @param { string } deviceId - Indicates the ID of the device whose connection state is to be updated.
350   * @param { DeviceConnectState } status - Indicates the connection state to update.
351   * @returns { Promise<void> } callback Indicates the callback to be invoked when the continuation
352   *                            manager service is connected.
353   * @syscap SystemCapability.Ability.DistributedAbilityManager
354   * @since 8
355   * @deprecated since 9
356   * @useinstead ohos.continuation.continuationManager/continuationManager#updateContinuationState
357   */
358  function updateConnectStatus(token: number, deviceId: string, status: DeviceConnectState): Promise<void>;
359
360  /**
361   * Start to manage the devices that can be selected for continuation.
362   *
363   * @param { number } token - Indicates the registration token of the ability.
364   * @param { AsyncCallback<void> } callback - AsyncCallback returns the interface call result.
365   * @syscap SystemCapability.Ability.DistributedAbilityManager
366   * @since 8
367   * @deprecated since 9
368   * @useinstead ohos.continuation.continuationManager/continuationManager#startContinuationDeviceManager
369   */
370  function startDeviceManager(token: number, callback: AsyncCallback<void>): void;
371
372  /**
373   * Start to manage the devices that can be selected for continuation.
374   *
375   * @param { number } token - Indicates the registration token of the ability.
376   * @param { ContinuationExtraParams } options - Indicates the extraParams object containing the extra parameters
377   *                                            used to filter the list of available devices. This parameter is null.
378   * @param { AsyncCallback<void> } callback - AsyncCallback returns the interface call result.
379   * @syscap SystemCapability.Ability.DistributedAbilityManager
380   * @since 8
381   * @deprecated since 9
382   * @useinstead ohos.continuation.continuationManager/continuationManager#startContinuationDeviceManager
383   */
384  function startDeviceManager(token: number, options: ContinuationExtraParams, callback: AsyncCallback<void>): void;
385
386  /**
387   * Start to manage the devices that can be selected for continuation.
388   *
389   * @param { number } token - Indicates the registration token of the ability.
390   * @param { ContinuationExtraParams } [options] - Indicates the extraParams object containing the extra parameters
391   *                                                used to filter the list of available devices. This parameter is null.
392   * @returns { Promise<void> } callback Indicates the callback to be invoked when the continuation manager service
393   *                            is connected.
394   * @syscap SystemCapability.Ability.DistributedAbilityManager
395   * @since 8
396   * @deprecated since 9
397   * @useinstead ohos.continuation.continuationManager/continuationManager#startContinuationDeviceManager
398   */
399  function startDeviceManager(token: number, options?: ContinuationExtraParams): Promise<void>;
400
401  /**
402   * Registers an ability to be hopped with the continuation manager service and obtains the registration token
403   * assigned to the ability.
404   *
405   * @permission ohos.permission.DISTRIBUTED_DATASYNC
406   * @param { AsyncCallback<number> } callback - The AsyncCallback form returns the token generated after connecting to
407   *                                             the flow management service.
408   * @throws { BusinessError } 201 - Permission denied.
409   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
410   * <br>2. Incorrect parameter types; 3. Parameter verification failed.
411   * @throws { BusinessError } 16600001 - The system ability works abnormally.
412   * @throws { BusinessError } 16600003 - The number of token registration times has reached the upper limit.
413   * @syscap SystemCapability.Ability.DistributedAbilityManager
414   * @since 9
415   */
416  /**
417   * Registers an ability to be hopped with the continuation manager service and obtains the registration token
418   * assigned to the ability.
419   *
420   * @permission ohos.permission.DISTRIBUTED_DATASYNC
421   * @param { AsyncCallback<number> } callback - The AsyncCallback form returns the token generated after connecting to
422   *                                             the flow management service.
423   * @throws { BusinessError } 201 - Permission denied.
424   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
425   * <br>2. Incorrect parameter types; 3. Parameter verification failed.
426   * @throws { BusinessError } 16600001 - The system ability works abnormally.
427   * @throws { BusinessError } 16600003 - The number of token registration times has reached the upper limit.
428   * @syscap SystemCapability.Ability.DistributedAbilityManager
429   * @atomicservice
430   * @since 11
431   */
432  function registerContinuation(callback: AsyncCallback<number>): void;
433
434  /**
435   * Registers an ability to be hopped with the continuation manager service and obtains the registration token
436   * assigned to the ability.
437   *
438   * @permission ohos.permission.DISTRIBUTED_DATASYNC
439   * @param { ContinuationExtraParams } options - Indicates the {@link ExtraParams} object containing extra parameters
440   *                                              used to filter the list of available devices.
441   * @param { AsyncCallback<number> } callback - The AsyncCallback form returns the token generated after connecting to
442   *                                             flow management service.
443   * @throws { BusinessError } 201 - Permission denied.
444   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
445   * <br>2. Incorrect parameter types; 3. Parameter verification failed.
446   * @throws { BusinessError } 16600001 - The system ability works abnormally.
447   * @throws { BusinessError } 16600003 - The number of token registration times has reached the upper limit.
448   * @syscap SystemCapability.Ability.DistributedAbilityManager
449   * @since 9
450   */
451  /**
452   * Registers an ability to be hopped with the continuation manager service and obtains the registration token
453   * assigned to the ability.
454   *
455   * @permission ohos.permission.DISTRIBUTED_DATASYNC
456   * @param { ContinuationExtraParams } options - Indicates the {@link ExtraParams} object containing extra parameters
457   *                                              used to filter the list of available devices.
458   * @param { AsyncCallback<number> } callback - The AsyncCallback form returns the token generated after connecting to
459   *                                             flow management service.
460   * @throws { BusinessError } 201 - Permission denied.
461   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
462   * <br>2. Incorrect parameter types; 3. Parameter verification failed.
463   * @throws { BusinessError } 16600001 - The system ability works abnormally.
464   * @throws { BusinessError } 16600003 - The number of token registration times has reached the upper limit.
465   * @syscap SystemCapability.Ability.DistributedAbilityManager
466   * @atomicservice
467   * @since 11
468   */
469  function registerContinuation(options: ContinuationExtraParams, callback: AsyncCallback<number>): void;
470
471  /**
472   * Registers an ability to be hopped with the continuation manager service and obtains the registration token
473   * assigned to the ability.
474   *
475   * @permission ohos.permission.DISTRIBUTED_DATASYNC
476   * @param { ContinuationExtraParams } [options] - Indicates the {@link ExtraParams} object containing the extra
477   *                                                parameters used to filter the list of available devices.
478   * @returns { Promise<number> } callback Indicates the callback to be invoked when the continuation manager
479   *                              service is connected.
480   * @throws { BusinessError } 201 - Permission denied.
481   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Incorrect parameter types
482   * <br>2. Parameter verification failed;
483   * @throws { BusinessError } 16600001 - The system ability works abnormally.
484   * @throws { BusinessError } 16600003 - The number of token registration times has reached the upper limit.
485   * @syscap SystemCapability.Ability.DistributedAbilityManager
486   * @since 9
487   */
488  /**
489   * Registers an ability to be hopped with the continuation manager service and obtains the registration token
490   * assigned to the ability.
491   *
492   * @permission ohos.permission.DISTRIBUTED_DATASYNC
493   * @param { ContinuationExtraParams } [options] - Indicates the {@link ExtraParams} object containing the extra
494   *                                                parameters used to filter the list of available devices.
495   * @returns { Promise<number> } callback Indicates the callback to be invoked when the continuation manager
496   *                              service is connected.
497   * @throws { BusinessError } 201 - Permission denied.
498   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Incorrect parameter types;
499   * <br>2. Parameter verification failed;
500   * @throws { BusinessError } 16600001 - The system ability works abnormally.
501   * @throws { BusinessError } 16600003 - The number of token registration times has reached the upper limit.
502   * @syscap SystemCapability.Ability.DistributedAbilityManager
503   * @atomicservice
504   * @since 11
505   */
506  function registerContinuation(options?: ContinuationExtraParams): Promise<number>;
507
508  /**
509   * Unregisters a specified ability from the continuation manager service based on the token obtained during ability
510   * registration.
511   *
512   * @permission ohos.permission.DISTRIBUTED_DATASYNC
513   * @param { number } token - Indicates the registration token of the ability.
514   * @param { AsyncCallback<void> } callback - The AsyncCallback form returns token generated after connecting to flow
515   *                                           management service.
516   * @throws { BusinessError } 201 - Permission denied.
517   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
518   * <br>2. Incorrect parameter types; 3. Parameter verification failed.
519   * @throws { BusinessError } 16600001 - The system ability works abnormally.
520   * @throws { BusinessError } 16600002 - The specified token or callback is not registered.
521   * @syscap SystemCapability.Ability.DistributedAbilityManager
522   * @since 9
523   */
524  /**
525   * Unregisters a specified ability from the continuation manager service based on the token obtained during ability
526   * registration.
527   *
528   * @permission ohos.permission.DISTRIBUTED_DATASYNC
529   * @param { number } token - Indicates the registration token of the ability.
530   * @param { AsyncCallback<void> } callback - The AsyncCallback form returns token generated after connecting to flow
531   *                                           management service.
532   * @throws { BusinessError } 201 - Permission denied.
533   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
534   * <br>2. Incorrect parameter types; 3. Parameter verification failed.
535   * @throws { BusinessError } 16600001 - The system ability works abnormally.
536   * @throws { BusinessError } 16600002 - The specified token or callback is not registered.
537   * @syscap SystemCapability.Ability.DistributedAbilityManager
538   * @atomicservice
539   * @since 11
540   */
541  function unregisterContinuation(token: number, callback: AsyncCallback<void>): void;
542
543  /**
544   * Unregisters a specified ability from the continuation manager service based on the token obtained during ability
545   * registration.
546   *
547   * @permission ohos.permission.DISTRIBUTED_DATASYNC
548   * @param { number } token - Indicates the registration token of the ability.
549   * @returns { Promise<void> } the promise returned by the function.
550   * @throws { BusinessError } 201 - Permission denied.
551   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
552   * <br>2. Incorrect parameter types; 3. Parameter verification failed.
553   * @throws { BusinessError } 16600001 - The system ability works abnormally.
554   * @throws { BusinessError } 16600002 - The specified token or callback is not registered.
555   * @syscap SystemCapability.Ability.DistributedAbilityManager
556   * @since 9
557   */
558  /**
559   * Unregisters a specified ability from the continuation manager service based on the token obtained during ability
560   * registration.
561   *
562   * @permission ohos.permission.DISTRIBUTED_DATASYNC
563   * @param { number } token - Indicates the registration token of the ability.
564   * @returns { Promise<void> } the promise returned by the function.
565   * @throws { BusinessError } 201 - Permission denied.
566   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
567   * <br>2. Incorrect parameter types; 3. Parameter verification failed.
568   * @throws { BusinessError } 16600001 - The system ability works abnormally.
569   * @throws { BusinessError } 16600002 - The specified token or callback is not registered.
570   * @syscap SystemCapability.Ability.DistributedAbilityManager
571   * @atomicservice
572   * @since 11
573   */
574  function unregisterContinuation(token: number): Promise<void>;
575
576  /**
577   * Updates the connection state of the device where the specified ability is successfully hopped.
578   *
579   * @permission ohos.permission.DISTRIBUTED_DATASYNC
580   * @param { number } token - Indicates the registration token of the ability.
581   * @param { string } deviceId - Indicates the ID of the device whose connection state is to be updated.
582   * @param { DeviceConnectState } status - Indicates the connection state to update.
583   * @param { AsyncCallback<void> } callback - AsyncCallback returns the interface call result.
584   * @throws { BusinessError } 201 - Permission denied.
585   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
586   * <br>2. Incorrect parameter types; 3. Parameter verification failed.
587   * @throws { BusinessError } 16600001 - The system ability works abnormally.
588   * @throws { BusinessError } 16600002 - The specified token or callback is not registered.
589   * @syscap SystemCapability.Ability.DistributedAbilityManager
590   * @since 9
591   */
592  /**
593   * Updates the connection state of the device where the specified ability is successfully hopped.
594   *
595   * @permission ohos.permission.DISTRIBUTED_DATASYNC
596   * @param { number } token - Indicates the registration token of the ability.
597   * @param { string } deviceId - Indicates the ID of the device whose connection state is to be updated.
598   * @param { DeviceConnectState } status - Indicates the connection state to update.
599   * @param { AsyncCallback<void> } callback - AsyncCallback returns the interface call result.
600   * @throws { BusinessError } 201 - Permission denied.
601   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
602   * <br>2. Incorrect parameter types; 3. Parameter verification failed.
603   * @throws { BusinessError } 16600001 - The system ability works abnormally.
604   * @throws { BusinessError } 16600002 - The specified token or callback is not registered.
605   * @syscap SystemCapability.Ability.DistributedAbilityManager
606   * @atomicservice
607   * @since 11
608   */
609  function updateContinuationState(
610    token: number,
611    deviceId: string,
612    status: DeviceConnectState,
613    callback: AsyncCallback<void>
614  ): void;
615
616  /**
617   * Updates the connection state of the device where the specified ability is successfully hopped.
618   *
619   * @permission ohos.permission.DISTRIBUTED_DATASYNC
620   * @param { number } token - Indicates the registration token of the ability.
621   * @param { string } deviceId - Indicates the ID of the device whose connection state is to be updated.
622   * @param { DeviceConnectState } status - Indicates the connection state to update.
623   * @returns { Promise<void> } callback Indicates the callback to be invoked when the continuation manager service
624   *                            is connected.
625   * @throws { BusinessError } 201 - Permission denied.
626   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
627   * <br>2. Incorrect parameter types; 3. Parameter verification failed.
628   * @throws { BusinessError } 16600001 - The system ability works abnormally.
629   * @throws { BusinessError } 16600002 - The specified token or callback is not registered.
630   * @syscap SystemCapability.Ability.DistributedAbilityManager
631   * @since 9
632   */
633  /**
634   * Updates the connection state of the device where the specified ability is successfully hopped.
635   *
636   * @permission ohos.permission.DISTRIBUTED_DATASYNC
637   * @param { number } token - Indicates the registration token of the ability.
638   * @param { string } deviceId - Indicates the ID of the device whose connection state is to be updated.
639   * @param { DeviceConnectState } status - Indicates the connection state to update.
640   * @returns { Promise<void> } callback Indicates the callback to be invoked when the continuation manager service
641   *                            is connected.
642   * @throws { BusinessError } 201 - Permission denied.
643   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
644   * <br>2. Incorrect parameter types; 3. Parameter verification failed.
645   * @throws { BusinessError } 16600001 - The system ability works abnormally.
646   * @throws { BusinessError } 16600002 - The specified token or callback is not registered.
647   * @syscap SystemCapability.Ability.DistributedAbilityManager
648   * @atomicservice
649   * @since 11
650   */
651  function updateContinuationState(token: number, deviceId: string, status: DeviceConnectState): Promise<void>;
652
653  /**
654   * Start to manage the devices that can be selected for continuation.
655   *
656   * @permission ohos.permission.DISTRIBUTED_DATASYNC
657   * @param { number } token - Indicates the registration token of the ability.
658   * @param { AsyncCallback<void> } callback - AsyncCallback returns the interface call result.
659   * @throws { BusinessError } 201 - Permission denied.
660   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
661   * <br>2. Incorrect parameter types; 3. Parameter verification failed.
662   * @throws { BusinessError } 16600001 - The system ability works abnormally.
663   * @throws { BusinessError } 16600002 - The specified token or callback is not registered.
664   * @syscap SystemCapability.Ability.DistributedAbilityManager
665   * @since 9
666   */
667  /**
668   * Start to manage the devices that can be selected for continuation.
669   *
670   * @permission ohos.permission.DISTRIBUTED_DATASYNC
671   * @param { number } token - Indicates the registration token of the ability.
672   * @param { AsyncCallback<void> } callback - AsyncCallback returns the interface call result.
673   * @throws { BusinessError } 201 - Permission denied.
674   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
675   * <br>2. Incorrect parameter types; 3. Parameter verification failed.
676   * @throws { BusinessError } 16600001 - The system ability works abnormally.
677   * @throws { BusinessError } 16600002 - The specified token or callback is not registered.
678   * @syscap SystemCapability.Ability.DistributedAbilityManager
679   * @atomicservice
680   * @since 11
681   */
682  function startContinuationDeviceManager(token: number, callback: AsyncCallback<void>): void;
683
684  /**
685   * Start to manage the devices that can be selected for continuation.
686   *
687   * @permission ohos.permission.DISTRIBUTED_DATASYNC
688   * @param { number } token - Indicates the registration token of the ability.
689   * @param { ContinuationExtraParams } options - Indicates the extraParams object containing the extra parameters
690   *                                            used to filter list of available devices. This parameter can be null.
691   * @param { AsyncCallback<void> } callback - AsyncCallback form returns the interface call result.
692   * @throws { BusinessError } 201 - Permission denied.
693   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
694   * <br>2. Incorrect parameter types; 3. Parameter verification failed.
695   * @throws { BusinessError } 16600001 - The system ability works abnormally.
696   * @throws { BusinessError } 16600002 - The specified token or callback is not registered.
697   * @syscap SystemCapability.Ability.DistributedAbilityManager
698   * @since 9
699   */
700  /**
701   * Start to manage the devices that can be selected for continuation.
702   *
703   * @permission ohos.permission.DISTRIBUTED_DATASYNC
704   * @param { number } token - Indicates the registration token of the ability.
705   * @param { ContinuationExtraParams } options - Indicates the extraParams object containing the extra parameters
706   *                                            used to filter list of available devices. This parameter can be null.
707   * @param { AsyncCallback<void> } callback - AsyncCallback form returns the interface call result.
708   * @throws { BusinessError } 201 - Permission denied.
709   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
710   * <br>2. Incorrect parameter types; 3. Parameter verification failed.
711   * @throws { BusinessError } 16600001 - The system ability works abnormally.
712   * @throws { BusinessError } 16600002 - The specified token or callback is not registered.
713   * @syscap SystemCapability.Ability.DistributedAbilityManager
714   * @atomicservice
715   * @since 11
716   */
717  function startContinuationDeviceManager(
718    token: number,
719    options: ContinuationExtraParams,
720    callback: AsyncCallback<void>
721  ): void;
722
723  /**
724   * Start to manage the devices that can be selected for continuation.
725   *
726   * @permission ohos.permission.DISTRIBUTED_DATASYNC
727   * @param { number } token - Indicates the registration token of the ability.
728   * @param { ContinuationExtraParams } [options] - Indicates extraParams object containing extra parameters used to
729   *                                                filter the list of available devices. This parameter can be null.
730   * @returns { Promise<void> } callback Indicates the callback to be invoked when continuation manager service is connected.
731   * @throws { BusinessError } 201 - Permission denied.
732   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Incorrect parameter types
733   * <br>2. Parameter verification failed;
734   * @throws { BusinessError } 16600001 - The system ability works abnormally.
735   * @throws { BusinessError } 16600002 - The specified token or callback is not registered.
736   * @syscap SystemCapability.Ability.DistributedAbilityManager
737   * @since 9
738   */
739  /**
740   * Start to manage the devices that can be selected for continuation.
741   *
742   * @permission ohos.permission.DISTRIBUTED_DATASYNC
743   * @param { number } token - Indicates the registration token of the ability.
744   * @param { ContinuationExtraParams } [options] - Indicates extraParams object containing extra parameters used to
745   *                                                filter the list of available devices. This parameter can be null.
746   * @returns { Promise<void> } callback Indicates the callback to be invoked when continuation manager service is connected.
747   * @throws { BusinessError } 201 - Permission denied.
748   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Incorrect parameter types;
749   * <br>2. Parameter verification failed;
750   * @throws { BusinessError } 16600001 - The system ability works abnormally.
751   * @throws { BusinessError } 16600002 - The specified token or callback is not registered.
752   * @syscap SystemCapability.Ability.DistributedAbilityManager
753   * @atomicservice
754   * @since 11
755   */
756  function startContinuationDeviceManager(token: number, options?: ContinuationExtraParams): Promise<void>;
757
758  /**
759   * Device connection status data structure.
760   *
761   * @enum { number }
762   * @syscap SystemCapability.Ability.DistributedAbilityManager
763   * @since 8
764   */
765  /**
766   * Device connection status data structure.
767   *
768   * @enum { number }
769   * @syscap SystemCapability.Ability.DistributedAbilityManager
770   * @atomicservice
771   * @since 11
772   */
773  export enum DeviceConnectState {
774    /**
775     * Initial state of device connection.
776     *
777     * @syscap SystemCapability.Ability.DistributedAbilityManager
778     * @since 8
779     */
780    /**
781     * Initial state of device connection.
782     *
783     * @syscap SystemCapability.Ability.DistributedAbilityManager
784     * @atomicservice
785     * @since 11
786     */
787    IDLE = 0,
788
789    /**
790     * Device connection status.
791     *
792     * @syscap SystemCapability.Ability.DistributedAbilityManager
793     * @since 8
794     */
795    /**
796     * Device connection status.
797     *
798     * @syscap SystemCapability.Ability.DistributedAbilityManager
799     * @atomicservice
800     * @since 11
801     */
802    CONNECTING = 1,
803
804    /**
805     * The device is connected.
806     *
807     * @syscap SystemCapability.Ability.DistributedAbilityManager
808     * @since 8
809     */
810    /**
811     * The device is connected.
812     *
813     * @syscap SystemCapability.Ability.DistributedAbilityManager
814     * @atomicservice
815     * @since 11
816     */
817    CONNECTED = 2,
818
819    /**
820     * The device is disconnected.
821     *
822     * @syscap SystemCapability.Ability.DistributedAbilityManager
823     * @since 8
824     */
825    /**
826     * The device is disconnected.
827     *
828     * @syscap SystemCapability.Ability.DistributedAbilityManager
829     * @atomicservice
830     * @since 11
831     */
832    DISCONNECTING = 3
833  }
834
835  /**
836   * Indicates the description of additional parameters for continuation.
837   *
838   * @enum { number }
839   * @syscap SystemCapability.Ability.DistributedAbilityManager
840   * @since 8
841   */
842  /**
843   * Indicates the description of additional parameters for continuation.
844   *
845   * @enum { number }
846   * @syscap SystemCapability.Ability.DistributedAbilityManager
847   * @atomicservice
848   * @since 11
849   */
850  export enum ContinuationMode {
851    /**
852     * Collaboration with a single device.
853     *
854     * @syscap SystemCapability.Ability.DistributedAbilityManager
855     * @since 8
856     */
857    /**
858     * Collaboration with a single device.
859     *
860     * @syscap SystemCapability.Ability.DistributedAbilityManager
861     * @atomicservice
862     * @since 11
863     */
864    COLLABORATION_SINGLE = 0,
865
866    /**
867     * Collaboration with multiple devices.
868     *
869     * @syscap SystemCapability.Ability.DistributedAbilityManager
870     * @since 8
871     */
872    /**
873     * Collaboration with multiple devices.
874     *
875     * @syscap SystemCapability.Ability.DistributedAbilityManager
876     * @atomicservice
877     * @since 11
878     */
879    COLLABORATION_MULTIPLE = 1
880  }
881
882  /**
883   * Indicates the description of transfer results for continuation.
884   *
885   * @syscap SystemCapability.Ability.DistributedAbilityManager
886   * @since 10
887   */
888  /**
889   * Indicates the description of transfer results for continuation.
890   * @typedef { _ContinuationResult }
891   * @syscap SystemCapability.Ability.DistributedAbilityManager
892   * @atomicservice
893   * @since 11
894   */
895  export type ContinuationResult = _ContinuationResult;
896
897  /**
898   * Indicates the description of additional parameters for continuation.
899   *
900   * @syscap SystemCapability.Ability.DistributedAbilityManager
901   * @since 10
902   */
903  /**
904   * Indicates the description of additional parameters for continuation.
905   * @typedef { _ContinuationExtraParams }
906   * @syscap SystemCapability.Ability.DistributedAbilityManager
907   * @atomicservice
908   * @since 11
909   */
910  export type ContinuationExtraParams = _ContinuationExtraParams;
911}
912export default continuationManager;
913