1/* 2 * Copyright (c) 2023 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 16export const enum Extension { 17 TS = '.ts', 18 DTS = '.d.ts', 19 JS = '.js', 20 CJS = '.cjs', 21 MJS = '.mjs', 22 JSON = '.json', 23 ETS = '.ets', 24 DETS = '.d.ets' 25} 26 27export interface PathAndExtension { 28 path: string; 29 ext: string | undefined; 30} 31 32export const supportedRunningExtension: readonly string[] = [Extension.TS, Extension.JS]; 33export const supportedDeclarationExtension: readonly string[] = [Extension.DTS, Extension.DETS]; 34 35export const fileExtensions: string[] = [Extension.DETS, Extension.ETS, Extension.DTS, Extension.TS, Extension.JS, Extension.JSON]; 36 37// supported file suffixes from ets-loader. 38export const supportedParsingExtension: string[] = [Extension.ETS, Extension.TS, Extension.JS, Extension.CJS, Extension.MJS];