1/* 2 * Copyright (c) 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 16// export 17export let export1 = 1; 18export class MyExport { 19 exportedProp = 1; 20} 21export let usb = 3; // lang 22 23// string property 24class MyString { 25 'string1' = 1; 26 'string2' = 2; 27 'unit' = 3; // lang 28} 29 30// toplevel 31function toplevel1(): number { // conf 32 return 1; 33} 34function toplevel2(): number { 35 return 2; 36} 37 38// property 39class MyClass { 40 property1 = 1; // conf 41 exportedProp = 1; 42 a = 2; // lang 43 abcde(){}; // conf 44 string1 = '1'; 45} 46 47// local variable and parameter 48function add(param1: number, param2: number): number { // lang 49 let variable1 = param1; 50 let variable2 = param2; 51 return variable1 + variable2; 52} 53 54function myfunc(input: number): number { 55 return input + 1; 56} 57