• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2025 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 EXTERNAL_SOURCE_PREFIX_NAMES: (string | RegExp)[] = [
17    'std',
18    'escompat',
19    'security',
20    'application',
21    'permissions',
22    'bundleManager',
23    'commonEvent',
24    /@arkts\..*/,
25    /@ohos\.(?!arkui).*/,
26    /@system\..*/,
27    /ability\..*/,
28];
29
30export const EXTERNAL_SOURCE_PREFIX_NAMES_FOR_FRAMEWORK: (string | RegExp)[] = [
31    'std',
32    'escompat',
33    /@arkts\..*/
34];
35
36export const ARKUI_COMPONENT_IMPORT_NAME: string = '@ohos.arkui.component';
37export const ARKUI_STATEMANAGEMENT_IMPORT_NAME: string = '@ohos.arkui.stateManagement';
38export const KIT_ARKUI_NAME: string = '@kit.ArkUI';
39
40export const EXTERNAL_SOURCE_ALLOWED_IMPORT_INSERT_NAMES: string[] = [
41    ARKUI_COMPONENT_IMPORT_NAME,
42    ARKUI_STATEMANAGEMENT_IMPORT_NAME,
43];
44
45export const IMPORT_SOURCE_MAP: Map<string, Set<string>> = new Map<string, Set<string>>([
46    ['arkui.stateManagement.runtime', new Set(['memo', '__memo_context_type', '__memo_id_type'])]
47]);
48
49export const OUTPUT_DEPENDENCY_MAP: Map<string, string[]> = new Map<string, string[]>([
50    ['$r', ['_r']],
51    ['$rawfile', ['_rawfile']],
52    ['State', ['StateDecoratedVariable']],
53    ['Link', ['LinkDecoratedVariable', 'DecoratedV1VariableBase']],
54    ['Prop', ['PropDecoratedVariable']],
55    ['Provide', ['ProvideDecoratedVariable']],
56    ['Consume', ['ConsumeDecoratedVariable']],
57    ['StorageProp', ['StoragePropDecoratedVariable']],
58    ['StorageLink', ['StorageLinkDecoratedVariable']],
59    ['LocalStorageLink', ['StorageLinkState', 'MutableState', 'observableProxy']],
60    ['LocalStorageProp', ['StorageLinkState', 'SyncedProperty', 'observableProxy', 'propState']],
61    ['ObjectLink', ['ObjectLinkDecoratedVariable']],
62    ['Observed', ['MutableStateMeta', 'BackingValue', 'setObservationDepth', 'IObservedObject', 'int32', 'WatchIdType', 'SubscribedWatches']],
63    ['Track', ['MutableStateMeta', 'BackingValue', 'setObservationDepth', 'IObservedObject', 'int32', 'WatchIdType', 'SubscribedWatches']],
64    ['$$', ['Bindable']],
65]);
66
67
68export enum InteroperAbilityNames {
69    ARKTS_1_1 = '1.1',
70    ARKTS_1_2 = '1.2',
71    ARKUICOMPATIBLE = 'ArkUICompatible',
72    ESVALUE = 'ESValue',
73    ELMTID = 'elmtId',
74    INITEMPTYOBJECT = 'instantiateEmptyObject',
75    SETPROPERTY = 'setProperty',
76    NUMBER = 'number',
77    PARENT = 'parent',
78    INSTANCE = 'instance',
79    PARAM = 'param',
80    EXTRAINFO = 'extraInfo',
81    COMPONENT = 'component',
82    GETPROPERTY = 'getProperty',
83    CONSTRUCTOR = 'constructor',
84    MODULE = 'module',
85    LOAD = 'load',
86    STRUCTOBJECT = 'structObject',
87    INSTANTIATE = 'instantiate',
88    WRAP = 'wrap',
89    WRAPINT = 'wrapInt',
90    WRAPSTRING = 'wrapString',
91    PARAMSLAMBDA = 'paramsLambda',
92    INTEROPCOMPONENT = 'interopComponent',
93    OHMURL = '@normalized:N&entry&com.example.Interop2use1&har1/src/main/ets/components/MainPage&1.0.0',
94}
95