mirror of
https://gitee.com/openharmony/interface_sdk-js
synced 2024-10-07 14:13:45 +00:00
!6363 remove app account capability api
Merge pull request !6363 from jidong/dev071501
This commit is contained in:
commit
a55667dde2
@ -1,97 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2023 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import ExtensionAbility from './@ohos.app.ability.ExtensionAbility';
|
||||
import type appAccount from './@ohos.account.appAccount';
|
||||
import type { AsyncCallback } from './@ohos.base';
|
||||
|
||||
/**
|
||||
* Class of the application account authorization extension ability.
|
||||
*
|
||||
* @extends ExtensionAbility
|
||||
* @syscap SystemCapability.Account.AppAccount
|
||||
* @systemapi
|
||||
* @StageModelOnly
|
||||
* @since 10
|
||||
*/
|
||||
export default class AuthorizationExtensionAbility extends ExtensionAbility {
|
||||
/**
|
||||
* Called back when an authorization request is started.
|
||||
*
|
||||
* @param { AuthorizationRequest } request - Indicates the authorization request.
|
||||
* @param { AuthorizationCallback } callback - Indicates the authorization callback.
|
||||
* @syscap SystemCapability.Account.AppAccount
|
||||
* @systemapi
|
||||
* @StageModelOnly
|
||||
* @since 10
|
||||
*/
|
||||
onStartAuthorization(request: AuthorizationRequest, callback: AuthorizationCallback): void;
|
||||
}
|
||||
|
||||
/**
|
||||
* The definition of an authorization request.
|
||||
*
|
||||
* @interface AuthorizationRequest
|
||||
* @syscap SystemCapability.Account.AppAccount
|
||||
* @systemapi
|
||||
* @StageModelOnly
|
||||
* @since 10
|
||||
*/
|
||||
declare interface AuthorizationRequest {
|
||||
/**
|
||||
* Indicates the caller UID of the authorization request.
|
||||
*
|
||||
* @type { number }
|
||||
* @syscap SystemCapability.Account.AppAccount
|
||||
* @systemapi
|
||||
* @StageModelOnly
|
||||
* @since 10
|
||||
*/
|
||||
readonly callerUid: number;
|
||||
|
||||
/**
|
||||
* Indicates the business parameters of the authorization request.
|
||||
*
|
||||
* @type { appAccount.AccountCapabilityRequest }
|
||||
* @syscap SystemCapability.Account.AppAccount
|
||||
* @systemapi
|
||||
* @StageModelOnly
|
||||
* @since 10
|
||||
*/
|
||||
readonly parameters: appAccount.AccountCapabilityRequest;
|
||||
}
|
||||
|
||||
/**
|
||||
* The definition of an authorization callback.
|
||||
*
|
||||
* @interface AuthorizationCallback
|
||||
* @syscap SystemCapability.Account.AppAccount
|
||||
* @systemapi
|
||||
* @StageModelOnly
|
||||
* @since 10
|
||||
*/
|
||||
declare interface AuthorizationCallback {
|
||||
/**
|
||||
* Indicates the callback for notifying the result.
|
||||
*
|
||||
* @type { AsyncCallback<appAccount.AccountCapabilityResponse, { [key: string]: object }> }
|
||||
* @throws { BusinessError } 401 - The parameter check failed.
|
||||
* @syscap SystemCapability.Account.AppAccount
|
||||
* @systemapi
|
||||
* @StageModelOnly
|
||||
* @since 10
|
||||
*/
|
||||
onResult: AsyncCallback<appAccount.AccountCapabilityResponse, { [key: string]: object }>;
|
||||
}
|
172
api/@ohos.account.appAccount.d.ts
vendored
172
api/@ohos.account.appAccount.d.ts
vendored
@ -2652,178 +2652,6 @@ declare namespace appAccount {
|
||||
*/
|
||||
getRemoteObject(): rpc.RemoteObject;
|
||||
}
|
||||
|
||||
/**
|
||||
* Enum for account capability type.
|
||||
*
|
||||
* @enum { number } AccountCapabilityType
|
||||
* @syscap SystemCapability.Account.AppAccount
|
||||
* @since 10
|
||||
*/
|
||||
enum AccountCapabilityType {
|
||||
/**
|
||||
* Indicates the type of account authorization capability.
|
||||
*
|
||||
* @syscap SystemCapability.Account.AppAccount
|
||||
* @since 10
|
||||
*/
|
||||
AUTHORIZATION = 1
|
||||
}
|
||||
|
||||
/**
|
||||
* The class of the account capability provider.
|
||||
*
|
||||
* @syscap SystemCapability.Account.AppAccount
|
||||
* @since 10
|
||||
*/
|
||||
class AccountCapabilityProvider {
|
||||
/**
|
||||
* Indicates the type of account capability provided.
|
||||
*
|
||||
* @type { AccountCapabilityType }
|
||||
* @syscap SystemCapability.Account.AppAccount
|
||||
* @since 10
|
||||
*/
|
||||
readonly capabilityType: AccountCapabilityType;
|
||||
|
||||
/**
|
||||
* A constructor used to create a AccountCapabilityProvider object.
|
||||
*
|
||||
* @param { AccountCapabilityType } capabilityType - Indicates the type of account capability provided.
|
||||
* @throws { BusinessError } 401 - The parameter check failed.
|
||||
* @syscap SystemCapability.Account.AppAccount
|
||||
* @since 10
|
||||
*/
|
||||
constructor(capabilityType: AccountCapabilityType);
|
||||
}
|
||||
|
||||
/**
|
||||
* The class of an authorization provider.
|
||||
*
|
||||
* @extends AccountCapabilityProvider
|
||||
* @syscap SystemCapability.Account.AppAccount
|
||||
* @since 10
|
||||
*/
|
||||
class AuthorizationProvider extends AccountCapabilityProvider {
|
||||
/**
|
||||
* A constructor used to create a AuthorizationProvider object.
|
||||
*
|
||||
* @param { AuthorizationProviderInfo } info - Indicates the provider information.
|
||||
* @throws { BusinessError } 401 - The parameter check failed.
|
||||
* @syscap SystemCapability.Account.AppAccount
|
||||
* @since 10
|
||||
*/
|
||||
constructor(info: AuthorizationProviderInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* The definition of the authorization provider information.
|
||||
*
|
||||
* @interface AuthorizationProviderInfo
|
||||
* @syscap SystemCapability.Account.AppAccount
|
||||
* @since 10
|
||||
*/
|
||||
interface AuthorizationProviderInfo {
|
||||
/**
|
||||
* Indicates the bundle name of the provider.
|
||||
*
|
||||
* @type { string }
|
||||
* @syscap SystemCapability.Account.AppAccount
|
||||
* @since 10
|
||||
*/
|
||||
readonly bundleName: string;
|
||||
|
||||
/**
|
||||
* Indicates the ability name of the provider.
|
||||
*
|
||||
* @type { string }
|
||||
* @syscap SystemCapability.Account.AppAccount
|
||||
* @since 10
|
||||
*/
|
||||
readonly abilityName: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* The class of an account capability request.
|
||||
*
|
||||
* @syscap SystemCapability.Account.AppAccount
|
||||
* @since 10
|
||||
*/
|
||||
class AccountCapabilityRequest {
|
||||
/**
|
||||
* A constructor used to create a AccountCapabilityRequest object.
|
||||
*
|
||||
* @param { AccountCapabilityProvider } provider - Indicates the account capability provider for handling the request.
|
||||
* @throws { BusinessError } 401 - The parameter check failed.
|
||||
* @syscap SystemCapability.Account.AppAccount
|
||||
* @since 10
|
||||
*/
|
||||
constructor(provider: AccountCapabilityProvider);
|
||||
}
|
||||
|
||||
/**
|
||||
* The class of an account capability response.
|
||||
*
|
||||
* @syscap SystemCapability.Account.AppAccount
|
||||
* @since 10
|
||||
*/
|
||||
class AccountCapabilityResponse {
|
||||
/**
|
||||
* Indicates the request corresponding to the current response.
|
||||
*
|
||||
* @type { AccountCapabilityRequest }
|
||||
* @syscap SystemCapability.Account.AppAccount
|
||||
* @since 10
|
||||
*/
|
||||
readonly request: AccountCapabilityRequest;
|
||||
|
||||
/**
|
||||
* A constructor used to create a AccountCapabilityResponse object.
|
||||
*
|
||||
* @param { AccountCapabilityRequest } request - Indicates the request corresponding to the current response.
|
||||
* @throws { BusinessError } 401 - The parameter check failed.
|
||||
* @syscap SystemCapability.Account.AppAccount
|
||||
* @since 10
|
||||
*/
|
||||
constructor(request: AccountCapabilityRequest);
|
||||
}
|
||||
|
||||
/**
|
||||
* The class of an account capability scheduler.
|
||||
*
|
||||
* @syscap SystemCapability.Account.AppAccount
|
||||
* @since 10
|
||||
*/
|
||||
class AccountCapabilityScheduler {
|
||||
/**
|
||||
* Executes the specified account capability request.
|
||||
*
|
||||
* @param { AccountCapabilityRequest } request - Indicates the account capability request.
|
||||
* @param { AsyncCallback<AccountCapabilityResponse, { [key: string]: object }> } callback - Indicates the callback for getting the response.
|
||||
* @throws { BusinessError } 401 - The parameter check failed.
|
||||
* @throws { BusinessError } 12300001 - System service exception.
|
||||
* @throws { BusinessError } 12300002 - Invalid request.
|
||||
* @syscap SystemCapability.Account.AppAccount
|
||||
* @since 10
|
||||
*/
|
||||
executeRequest(
|
||||
request: AccountCapabilityRequest,
|
||||
callback: AsyncCallback<AccountCapabilityResponse, { [key: string]: object }>
|
||||
): void;
|
||||
|
||||
/**
|
||||
* Executes the specified account capability request.
|
||||
*
|
||||
* @param { AccountCapabilityRequest } request - Indicates the account capability request.
|
||||
* @returns { Promise<AccountCapabilityResponse> } The promise returned by the function.
|
||||
* @throws { BusinessError } 401 - The parameter check failed.
|
||||
* @throws { BusinessError } 12300001 - System service exception.
|
||||
* @throws { BusinessError } 12300002 - Invalid request.
|
||||
* @syscap SystemCapability.Account.AppAccount
|
||||
* @since 10
|
||||
*/
|
||||
executeRequest(request: AccountCapabilityRequest): Promise<AccountCapabilityResponse>;
|
||||
}
|
||||
}
|
||||
|
||||
export default appAccount;
|
||||
|
Loading…
Reference in New Issue
Block a user