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 16import type {IFileNameObfuscationOption, INameObfuscationOption} from './INameObfuscationOption'; 17 18export interface IOptions { 19 // Whether to generate compact code 20 readonly mCompact?: boolean; 21 22 // Whether to remove comments; 23 readonly mRemoveComments?: boolean; 24 25 // Whether to remove JSDoc comments; 26 readonly mRemoveDeclarationComments?: { 27 readonly mEnable: boolean, 28 mReservedComments: string[] 29 }; 30 31 // Whether to disable console output 32 readonly mDisableConsole?: boolean; 33 34 // whether to disable hilog output 35 readonly mDisableHilog?: boolean; 36 37 // Whether to do code simplification, includes variable declarations merging, expression merging... 38 readonly mSimplify?: boolean; 39 40 // Whether to do Name Obfuscation 41 readonly mNameObfuscation?: INameObfuscationOption; 42 43 mOutputDir?: string; 44 45 readonly mOhSdkPath?: string; 46 47 readonly mEnableSourceMap?: boolean; 48 49 readonly mEnableNameCache?: boolean; 50 51 readonly apiSavedDir?: string; 52 53 readonly applyReservedNamePath?: string; 54 55 readonly mRenameFileName?: IFileNameObfuscationOption; 56 57 // Whether to obfuscate the names or properties of the exported content 58 readonly mExportObfuscation?: boolean; 59} 60