1/* 2 * Copyright (c) 2023-2024 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 16import { FooClass, FooFunction, BarFunction } from './foo'; 17 18function test(): void { 19 let arr = new Array<FooClass>(); 20 arr.push(new FooClass('zero')); 21 arr.push(new FooClass('one')); 22 arr.push(new FooClass('two')); 23 24 console.log('test: ' + FooFunction(arr)); 25 26 let arr2 = BarFunction(); 27 console.log('test: check instanceof Array: ' + (arr2 instanceof Array)); 28 29 console.log('test: ' + arr2.at(0).name); 30 console.log('test: ' + arr2.at(1).name); 31 console.log('test: ' + arr2.at(2).name); 32} 33test(); 34