• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 {
17  IFileNameObfuscationOption,
18  IPrinterOption,
19  INameObfuscationOption,
20  IKeepSourcePathsAndDependency,
21  IDeclarationCommentOption
22} from './INameObfuscationOption';
23
24export interface IOptions {
25  // Whether to generate compact code
26  readonly mCompact?: boolean;
27
28  // Whether to remove comments;
29  readonly mRemoveComments?: boolean;
30
31  // Whether to remove JSDoc comments;
32  readonly mRemoveDeclarationComments?: IDeclarationCommentOption;
33
34  // Whether to disable console output
35  readonly mDisableConsole?: 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  // Time&Memory printer option
61  readonly mPerformancePrinter?: IPrinterOption;
62
63  // The code of the file is not obfuscated, except for file name obfuscation
64  mKeepFileSourceCode?: IKeepSourcePathsAndDependency
65}
66