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 */ 15 16let GeneratedImportVar_1 = ESValue.load('./instantiated_js_obj_js'); 17let Foo = GeneratedImportVar_1.getProperty('Foo'); 18let Foo1 = GeneratedImportVar_1.getProperty('Foo1'); 19 20class A { 21 num: number = 1.0; 22 constructor() { 23 } 24} 25Foo.instantiate(ESValue.wrap(123.0)) 26Foo.instantiate(ESValue.wrap('hello')) 27Foo.instantiate(ESValue.wrap(new A())) 28let a: A = new A(); 29Foo.instantiate(ESValue.wrap(a.num)) 30Foo.instantiate(ESValue.wrap(a)) 31function test(): number { 32 return 1.0; 33} 34Foo.instantiate(ESValue.wrap(test())) 35Foo1.instantiate(ESValue.wrap(123.0), ESValue.wrap('hello'))