1/* 2 * Copyright (c) 2022 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 16interface PeerChangeEventReceiverPU<T> { 17 /** 18 * emited by sync peer when it chnages 19 * @Prop - SynchedPropertySimple/ObjectOneWay: ObservedPropertyAbstractPU in parent 20 * @Link - SynchedPropertySimple/ObjectTwoWay: ObservedPropertyAbstractPU in parent 21 * 22 * ObservedPropertyAbstractPU given as source has changed ('set') 23 * the new value is available via ObservedPropertyAbstractPU.Get() 24 * or ObservedPropertyAbstractPU.Getunmonitored() 25 * the propert name is available via ObservedPropertyAbstractPU.Info() 26 * @see ObservedPropertyAbstractPU.notifyPropertryHasChangedPU() 27 * @param eventSource The 28 */ 29 syncPeerHasChanged(eventSource: ObservedPropertyAbstractPU<T>); 30} 31 32interface PropertyReadEventListener<T> { 33 /** 34 * ObservedPropertyAbstractPU given as source has been read ('get') 35 * @param eventSource 36 */ 37 propertyHasBeenReadPU(eventSource: ObservedPropertyAbstractPU<T>); 38} 39 40 41/** 42 * Events generated by an ObservedObject 43 */ 44interface ObservedObjectEventsPUReceiver<C extends Object> { 45 /** 46 * ObservedPropertyAbstractPU given as source has changed ('set') 47 * the new value is available via ObservedPropertyAbstractPU.Get() 48 * or ObservedPropertyAbstractPU.Getunmonitored 49 * the propert name is available via ObservedPropertyAbstractPU.Info() 50 */ 51 objectPropertyHasChangedPU(eventSource: ObservedObject<C>, changedPropName: string); 52 objectPropertyHasBeenReadPU(eventSource: ObservedObject<C>, readPropName: string); 53} 54 55