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 16abstract class NativeViewPartialUpdate { 17 18 static create(newView: ViewPU): void { 19 console.error("NativeViewPU(Mock).create - unimplemented"); 20 } 21 22 static createRerender(): void { 23 console.error("NativeViewPU(Mock).createRerender - unimplemented"); 24 } 25 26 constructor() { 27 console.log(`${this.constructor.name}: new instance`); 28 } 29 30 abstract id__(): void; 31 32 isFirstRender(): boolean { 33 console.warn(`${this.id__()}:${this.constructor.name}: isFirstRender Always returns true!`); 34 return true; 35 } 36 37 protected markNeedUpdate(): void { 38 console.log(`${this.id__()}:${this.constructor.name}: markNeedUpdate`); 39 } 40 41 findChildById(compilerAssignedUniqueChildId: string): View { 42 console.log(`${this.id__()}:${this.constructor.name}: findChildById ${compilerAssignedUniqueChildId}. Will not work!`); 43 return undefined; 44 } 45 46 syncInstanceId(): void { 47 console.warn("NativeViewPU(Mock).syncInstanceId() - unimplemented!"); 48 } 49 restoreInstanceId(): void { 50 console.warn("NativeViewPU(Mock).restoreInstanceId() - unimplemented!"); 51 } 52 53 finishUpdateFunc(elmtId: number): void { 54 console.warn("NativeViewPU(Mock).restoreInstanceId() - unimplemented!"); 55 } 56 getDeletedElemtIds(elmtIds: number[]): void { 57 console.warn("NativeViewPU(Mock).finishUpdateFunc() - unimplemented!"); 58 } 59 60 deletedElmtIdsHaveBeenPurged(elmtIds: number[]): void { 61 console.warn("NativeViewPU(Mock).deletedElmtIdsHaveBeenPurged() - unimplemented!"); 62 } 63 64 isLazyItemRender(elmtId: number): boolean { 65 console.warn("NativeViewPU(Mock).isLazyItemRender() - unimplemented!"); 66 return false; 67 } 68 69 setCardId(cardId: number): void { 70 console.warn("NativeViewPU(Mock).setCardId() - unimplemented!"); 71 } 72 73 getCardId(): number { 74 console.warn("NativeViewPU(Mock).getCardId() - unimplemented!"); 75 return -1; 76 } 77 78 setIsV2(test: boolean): void { 79 console.warn("NativeViewPU(Mock).setIsV2() - unimplemented!"); 80 } 81 82 resetRecycleCustomNode(): void { 83 console.warn("NativeViewPU(Mock).resetRecycleCustomNode() - unimplemented!"); 84 } 85 86 sendStateInfo(stateInfo: string): void { 87 console.warn("NativeViewPU(Mock).sendStateInfo() - unimplemented!"); 88 } 89} 90