• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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// Regular
16import {
17    regularImportFunc1FromModule1
18} from './modules/module1';
19import {
20    regularImportFunc1FromModule2 as MF1M2
21} from './modules/module2';
22import regularDefaultImportFunc1FromModule3 from './modules/module3';
23import {
24    default as regularDefaultImportFunc2FromModule2
25} from './modules/module2';
26
27// Namespace
28import * as NS1 from './modules/module1';
29import * as NS2 from './modules/module2';
30import * as NS3 from './modules/module3';
31
32// Local export
33export function LocalExportFunc() {}
34export class LocalExportClass {}
35export let LocalExportLet = 2;
36export let LocalExportVar;
37export const LocalExportConst = 1;
38export default class LocalDefaultExportClass {}
39
40// Indirect export
41export {
42    indirectExportFunc1FromModule1
43}
44from './modules/module1';
45export {
46    indirectExportFunc2FromModule1 as MF2M1
47}
48from './modules/module1';
49
50// Star export
51export * as StarExport from './modules/module1';
52export * from './modules/module2';
53
54regularImportFunc1FromModule1();
55MF1M2();
56regularDefaultImportFunc1FromModule3();
57regularDefaultImportFunc2FromModule2();
58NS1.namespaceImportFunc2FromModule1();
59NS1.namespaceImportFunc3FromModule1();
60print(LocalExportConst);
61print(LocalExportLet);
62NS2.namespaceImportFunc3FromModule2();
63NS3.sameFuncInDifferentModules();
64