From 514b8cad35716e48782a0e1e3bad03fb44664156 Mon Sep 17 00:00:00 2001 From: li_juntao Date: Mon, 7 Mar 2022 14:42:46 +0800 Subject: [PATCH 1/3] add @system.storage.d.ts --- api/@system.storage.d.ts | 160 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 160 insertions(+) create mode 100644 api/@system.storage.d.ts diff --git a/api/@system.storage.d.ts b/api/@system.storage.d.ts new file mode 100644 index 0000000000..e2f25b3e95 --- /dev/null +++ b/api/@system.storage.d.ts @@ -0,0 +1,160 @@ +/* + * Copyright (c) 2022 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. + */ + +export interface GetStorageOptions { + /** + * Content index. + * For liteWearable and smartVision, the value contains a maximum of 32 characters and cannot contain special characters such as \/"*+,:;<=>?[]|\x7F. + * @since 3 + */ + key: string; + + /** + * Default value returned when the key does not exist. + * If this parameter is not specified, an empty string is returned. + * @since 3 + */ + default?: string; + + /** + * Called when the stored content is read successfully. + * @since 3 + */ + success?: (data: any) => void; + + /** + * Called when the stored content fails to be read. + * @since 3 + */ + fail?: (data: string, code: number) => void; + + /** + * Called when the execution is completed. + * @since 3 + */ + complete?: () => void; +} + +export interface SetStorageOptions { + /** + * Index of the stored content to be modified. + * For liteWearable and smartVision, the value contains a maximum of 32 characters and cannot contain special characters such as \/"*+,:;<=>?[]|\x7F. + * @since 3 + */ + key: string; + + /** + * Target storage content. If the content is an empty string, the data item with the key as the index will be deleted. + * @since 3 + */ + value: string; + + /** + * Called when the stored content is modified successfully. + * @since 3 + */ + success?: () => void; + + /** + * Called when the stored content fails to be modified. + * @since 3 + */ + fail?: (data: string, code: number) => void; + + /** + * Called when the execution is completed. + * @since 3 + */ + complete?: () => void; +} + +/** + * @devices tv, phone, tablet, wearable, liteWearable, smartVision + */ +export interface ClearStorageOptions { + /** + * Called when the stored content is cleared successfully. + * @since 3 + */ + success?: () => void; + + /** + * Called when the stored content fails to be cleared. + * @since 3 + */ + fail?: (data: string, code: number) => void; + + /** + * Called when the execution is completed. + * @since 3 + */ + complete?: () => void; +} + +export interface DeleteStorageOptions { + /** + * Content index. + * For liteWearable and smartVision, the value contains a maximum of 32 characters and cannot contain special characters such as \/"*+,:;<=>?[]|\x7F. + * @since 3 + */ + key: string; + + /** + * Called when the stored content is deleted successfully. + * @since 3 + */ + success?: () => void; + + /** + * Called when the stored content fails to be deleted. + * @since 3 + */ + fail?: (data: string, code: number) => void; + + /** + * Called when the execution is completed. + * @since 3 + */ + complete?: () => void; +} + +/** + * @Syscap SysCap.ACE.UIEngine + */ +export default class Storage { + /** + * Reads the stored content. + * @param options Options. + */ + static get(options: GetStorageOptions): void; + + /** + * Modifies the stored content. + * @param options Options. + */ + static set(options: SetStorageOptions): void; + + /** + * Clears the stored content. + * @param options Options. + */ + static clear(options?: ClearStorageOptions): void; + + /** + * Deletes the stored content. + * @param options Options. + */ + static delete(options: DeleteStorageOptions): void; +} -- Gitee From a822ffb657fc6d3a323dfe0b4f8f399b8064e099 Mon Sep 17 00:00:00 2001 From: li_juntao Date: Mon, 7 Mar 2022 14:47:29 +0800 Subject: [PATCH 2/3] delete --- api/@system.storage.d.ts | 160 --------------------------------------- 1 file changed, 160 deletions(-) delete mode 100644 api/@system.storage.d.ts diff --git a/api/@system.storage.d.ts b/api/@system.storage.d.ts deleted file mode 100644 index e2f25b3e95..0000000000 --- a/api/@system.storage.d.ts +++ /dev/null @@ -1,160 +0,0 @@ -/* - * Copyright (c) 2022 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. - */ - -export interface GetStorageOptions { - /** - * Content index. - * For liteWearable and smartVision, the value contains a maximum of 32 characters and cannot contain special characters such as \/"*+,:;<=>?[]|\x7F. - * @since 3 - */ - key: string; - - /** - * Default value returned when the key does not exist. - * If this parameter is not specified, an empty string is returned. - * @since 3 - */ - default?: string; - - /** - * Called when the stored content is read successfully. - * @since 3 - */ - success?: (data: any) => void; - - /** - * Called when the stored content fails to be read. - * @since 3 - */ - fail?: (data: string, code: number) => void; - - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; -} - -export interface SetStorageOptions { - /** - * Index of the stored content to be modified. - * For liteWearable and smartVision, the value contains a maximum of 32 characters and cannot contain special characters such as \/"*+,:;<=>?[]|\x7F. - * @since 3 - */ - key: string; - - /** - * Target storage content. If the content is an empty string, the data item with the key as the index will be deleted. - * @since 3 - */ - value: string; - - /** - * Called when the stored content is modified successfully. - * @since 3 - */ - success?: () => void; - - /** - * Called when the stored content fails to be modified. - * @since 3 - */ - fail?: (data: string, code: number) => void; - - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; -} - -/** - * @devices tv, phone, tablet, wearable, liteWearable, smartVision - */ -export interface ClearStorageOptions { - /** - * Called when the stored content is cleared successfully. - * @since 3 - */ - success?: () => void; - - /** - * Called when the stored content fails to be cleared. - * @since 3 - */ - fail?: (data: string, code: number) => void; - - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; -} - -export interface DeleteStorageOptions { - /** - * Content index. - * For liteWearable and smartVision, the value contains a maximum of 32 characters and cannot contain special characters such as \/"*+,:;<=>?[]|\x7F. - * @since 3 - */ - key: string; - - /** - * Called when the stored content is deleted successfully. - * @since 3 - */ - success?: () => void; - - /** - * Called when the stored content fails to be deleted. - * @since 3 - */ - fail?: (data: string, code: number) => void; - - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; -} - -/** - * @Syscap SysCap.ACE.UIEngine - */ -export default class Storage { - /** - * Reads the stored content. - * @param options Options. - */ - static get(options: GetStorageOptions): void; - - /** - * Modifies the stored content. - * @param options Options. - */ - static set(options: SetStorageOptions): void; - - /** - * Clears the stored content. - * @param options Options. - */ - static clear(options?: ClearStorageOptions): void; - - /** - * Deletes the stored content. - * @param options Options. - */ - static delete(options: DeleteStorageOptions): void; -} -- Gitee From 25834617c39b87fe9678f6f458730fa9217811c6 Mon Sep 17 00:00:00 2001 From: li_juntao Date: Mon, 7 Mar 2022 14:48:27 +0800 Subject: [PATCH 3/3] add @system.storage.d.ts Signed-off-by: li_juntao --- api/@system.storage.d.ts | 160 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 160 insertions(+) create mode 100644 api/@system.storage.d.ts diff --git a/api/@system.storage.d.ts b/api/@system.storage.d.ts new file mode 100644 index 0000000000..e2f25b3e95 --- /dev/null +++ b/api/@system.storage.d.ts @@ -0,0 +1,160 @@ +/* + * Copyright (c) 2022 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. + */ + +export interface GetStorageOptions { + /** + * Content index. + * For liteWearable and smartVision, the value contains a maximum of 32 characters and cannot contain special characters such as \/"*+,:;<=>?[]|\x7F. + * @since 3 + */ + key: string; + + /** + * Default value returned when the key does not exist. + * If this parameter is not specified, an empty string is returned. + * @since 3 + */ + default?: string; + + /** + * Called when the stored content is read successfully. + * @since 3 + */ + success?: (data: any) => void; + + /** + * Called when the stored content fails to be read. + * @since 3 + */ + fail?: (data: string, code: number) => void; + + /** + * Called when the execution is completed. + * @since 3 + */ + complete?: () => void; +} + +export interface SetStorageOptions { + /** + * Index of the stored content to be modified. + * For liteWearable and smartVision, the value contains a maximum of 32 characters and cannot contain special characters such as \/"*+,:;<=>?[]|\x7F. + * @since 3 + */ + key: string; + + /** + * Target storage content. If the content is an empty string, the data item with the key as the index will be deleted. + * @since 3 + */ + value: string; + + /** + * Called when the stored content is modified successfully. + * @since 3 + */ + success?: () => void; + + /** + * Called when the stored content fails to be modified. + * @since 3 + */ + fail?: (data: string, code: number) => void; + + /** + * Called when the execution is completed. + * @since 3 + */ + complete?: () => void; +} + +/** + * @devices tv, phone, tablet, wearable, liteWearable, smartVision + */ +export interface ClearStorageOptions { + /** + * Called when the stored content is cleared successfully. + * @since 3 + */ + success?: () => void; + + /** + * Called when the stored content fails to be cleared. + * @since 3 + */ + fail?: (data: string, code: number) => void; + + /** + * Called when the execution is completed. + * @since 3 + */ + complete?: () => void; +} + +export interface DeleteStorageOptions { + /** + * Content index. + * For liteWearable and smartVision, the value contains a maximum of 32 characters and cannot contain special characters such as \/"*+,:;<=>?[]|\x7F. + * @since 3 + */ + key: string; + + /** + * Called when the stored content is deleted successfully. + * @since 3 + */ + success?: () => void; + + /** + * Called when the stored content fails to be deleted. + * @since 3 + */ + fail?: (data: string, code: number) => void; + + /** + * Called when the execution is completed. + * @since 3 + */ + complete?: () => void; +} + +/** + * @Syscap SysCap.ACE.UIEngine + */ +export default class Storage { + /** + * Reads the stored content. + * @param options Options. + */ + static get(options: GetStorageOptions): void; + + /** + * Modifies the stored content. + * @param options Options. + */ + static set(options: SetStorageOptions): void; + + /** + * Clears the stored content. + * @param options Options. + */ + static clear(options?: ClearStorageOptions): void; + + /** + * Deletes the stored content. + * @param options Options. + */ + static delete(options: DeleteStorageOptions): void; +} -- Gitee