1/* 2 * Copyright (c) 2025 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 */ 15function ShowOptionalInt(x: Optional<i32>): void; 16 17function MakeOptionalInt(b: bool): Optional<i32>; 18 19function MakeOptionalArray(b: bool, val: i32, num: i32): Optional<Array<i32>>; 20 21struct ReturnResult { 22 results: Optional<Array<String>>; 23} 24function SendReturnResult(result: ReturnResult): Optional<String>; 25 26struct MyStruct { 27 param1: i32; 28 param2: String; 29} 30 31interface Test { 32 @set("string") Setstring(a: Optional<String>): void; 33 @get("string") Getstring(): Optional<String>; 34 SetIntData(a: String): void; 35 36 ShowOptionalString(a: Optional<String>): Optional<String>; 37 ShowOptionalInt32(a: Optional<i32>): Optional<i32>; 38 ShowOptionalBool(a: Optional<bool>): Optional<bool>; 39 ShowOptionalRecord(a: Optional<@record Map<String, bool>>): Optional<@record Map<String, bool>>; 40 ShowOptionalStruct(a: Optional<MyStruct>): Optional<MyStruct>; 41} 42 43function GetTest(): Test;