From a0b710b003ef42c512ccab70a13596caf385651e Mon Sep 17 00:00:00 2001 From: hanlu Date: Tue, 11 Jan 2022 16:47:17 +0800 Subject: [PATCH 1/2] objectstore js d.ts Signed-off-by: hanlu --- api/@ohos.data.distributedDataObject.d.ts | 40 +++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 api/@ohos.data.distributedDataObject.d.ts diff --git a/api/@ohos.data.distributedDataObject.d.ts b/api/@ohos.data.distributedDataObject.d.ts new file mode 100644 index 0000000000..faff82a684 --- /dev/null +++ b/api/@ohos.data.distributedDataObject.d.ts @@ -0,0 +1,40 @@ +/* +* Copyright (c) 2021 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 { AsyncCallback, Callback } from './basic'; + +/** + * Provides interfaces to obtain and modify storage data. + * + * @name distributeddataobject + * @since 8 + * @sysCap + * @devices phone, tablet + */ +declare namespace distributedDataObject { + function distributed(obj: object): DistributedObject; + function genSessionId(): String; + + interface DistributedObject { + setSession(sessionId?: String): void; + on(type: 'change', callback: Callback): void; + off(type: 'change', callback?: Callback): void; + } + interface ChangedDataObserver { + sessionId: string; + changeData: Array; + } +} + +export default distributedDataObject; \ No newline at end of file -- Gitee From 457764eca8a408fbcac3ebf4ea70fa2e73aa2d10 Mon Sep 17 00:00:00 2001 From: hanlu Date: Wed, 12 Jan 2022 11:16:03 +0800 Subject: [PATCH 2/2] objectstore Signed-off-by: hanlu --- api/@ohos.data.distributedDataObject.d.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/api/@ohos.data.distributedDataObject.d.ts b/api/@ohos.data.distributedDataObject.d.ts index faff82a684..d44c275410 100644 --- a/api/@ohos.data.distributedDataObject.d.ts +++ b/api/@ohos.data.distributedDataObject.d.ts @@ -1,5 +1,5 @@ /* -* Copyright (c) 2021 Huawei Device Co., Ltd. +* 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 @@ -15,10 +15,10 @@ import { AsyncCallback, Callback } from './basic'; /** - * Provides interfaces to obtain and modify storage data. + * Provides interfaces to sync distributed object * - * @name distributeddataobject - * @since 8 + * @name distributedDataObject + * @since * @sysCap * @devices phone, tablet */ -- Gitee