/*
 * Copyright (c) 2025 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

import * as path from 'path';

export const EXTERNAL_SOURCE_ARKTS_BUILTIN: (string | RegExp)[] = [
    'std',
    'escompat'
];

export const LINTER_EXCLUDE_EXTERNAL_SOURCE_PREFIXES: Array<string | RegExp> = [
    ...EXTERNAL_SOURCE_ARKTS_BUILTIN,
    'security',
    'application',
    'permissions',
    'bundleManager',
    'commonEvent',
    'global',
    'arkui',
    /@arkts\..*/,
    /@ohos\.*/,
    /@system\..*/,
    /@koalaui\./,
    /ability\..*/,
];

export const EXTERNAL_SOURCE_PREFIX_NAMES: (string | RegExp)[] = [
    ...EXTERNAL_SOURCE_ARKTS_BUILTIN,
    /@arkts\..*/,
    '@ohos.pluginComponent',
    /@system\..*/,
];

export const EXTERNAL_SOURCE_PREFIX_NAMES_FOR_FRAMEWORK: (string | RegExp)[] = [
    ...EXTERNAL_SOURCE_ARKTS_BUILTIN,
    'global',
    /@arkts\..*/,
];

export const ARKUI_IMPORT_PREFIX_NAMES: (string | RegExp)[] = [/arkui\..*/, /@ohos\..*/, /@kit\..*/];
export const MEMO_IMPORT_SOURCE_NAME: string = 'arkui.stateManagement.runtime';
export const MEMO_SKIP_UI_IMPORT_SOURCE_NAME: string = 'arkui.incremental.annotation';
export const CUSTOM_COMPONENT_IMPORT_SOURCE_NAME: string = 'arkui.component.customComponent';
export const CUSTOM_DIALOG_CONTROLLER_SOURCE_NAME: string = 'arkui.component.customDialogController';
export const ARKUI_COMPONENT_COMMON_SOURCE_NAME: string = 'arkui.component.common';
export const ARKUI_FOREACH_SOURCE_NAME: string = 'arkui.component.forEach';
export const ARKUI_BUILDER_SOURCE_NAME: string = 'arkui.component.builder';
export const ARKUI_INTEROP_SOURCE_NAME: string = 'arkui.component.interop';
export const ARKUI_NAVIGATION_SOURCE_NAME: string = 'arkui.component.navigation';
export const ARKUI_NAV_DESTINATION_SOURCE_NAME: string = 'arkui.component.navDestination';
export const ARKUI_LOCAL_STORAGE_SOURCE_NAME: string = 'arkui.stateManagement.storage.localStorage';
export const ARKUI_STATE_MANAGEMENT_DECORATOR_SOURCE_NAME: string = 'arkui.stateManagement.decorator';

export const LIB_UI_COMPONENTS_PATH: string = path.resolve(__dirname, '../components');
export const PREVIEWER_RESOURCE_PATH: string = path.resolve(
    __dirname,
    '../../../../../../previewer/common/resources/entry/resources.txt'
);
export const PREVIEWER_RESOURCE_SKIP_PREFIX_NAMES: string[] = ['ohos_id', 'ohos_fa'];
export const APPLICATION_MAIN_BASE_RESOURCE_PATH = 'src/main/resources/base';
export const APPLICATION_MAIN_ETS_PATH = 'src/main/ets';

export const ARKTS_FILE_EXTENSION_LIST: string[] = ['.d.ets', '.ets'];

export const INSIGHT_INTENT_FILE_NAME = 'insight_intent.json';

export const ETSGLOBAL = 'ETSGLOBAL';

export const DECLGEN_V2 = 'declgenV2';

export enum UIClass {
    LOCAL_STORAGE = 'LocalStorage',
}

export enum ModuleType {
    HAR = 'har',
    ENTRY = 'entry',
    FEATURE = 'feature',
    SHARED = 'shared',
}

export enum DefaultConfiguration {
    HAR_DEFAULT_MODULE_NAME = '__harDefaultModuleName__',
    HAR_DEFAULT_BUNDLE_NAME = '__harDefaultBundleName__',
    DYNAMIC_MODULE_NAME = '__MODULE_NAME__',
    DYNAMIC_BUNDLE_NAME = '__BUNDLE_NAME__',
}

export enum LogType {
    ERROR = 'ERROR',
    WARN = 'WARN',
}

export enum Dollars {
    DOLLAR_RESOURCE = '$r',
    DOLLAR_RAWFILE = '$rawfile',
    DOLLAR_DOLLAR = '$$',
    TRANSFORM_DOLLAR_RESOURCE = '_r',
    TRANSFORM_DOLLAR_RAWFILE = '_rawfile',
}

export enum BindableNames {
    MAKE_BINDABLE = 'makeBindable',
    BINDABLE = 'Bindable',
    VALUE = 'value',
    ON_CHANGE = 'onChange',
}

export enum StructDecoratorNames {
    ENTRY = 'Entry',
    COMPONENT = 'Component',
    COMPONENT_V2 = 'ComponentV2',
    RESUABLE = 'Reusable',
    RESUABLE_V2 = 'ReusableV2',
    CUSTOM_LAYOUT = 'CustomLayout',
    CUSTOMDIALOG = 'CustomDialog',
    PREVIEW = 'Preview'
}

export enum EntryWrapperNames {
    ENTRY_FUNC = 'entry',
    WRAPPER_CLASS_NAME = '__EntryWrapper',
    ENTRY_STORAGE_LOCAL_STORAGE_PROPERTY_NAME = '_entry_local_storage_',
    ENTRY_POINT_CLASS_NAME = 'EntryPoint',
    NAVIGATION_BUILDER_REGISTER = 'NavigationBuilderRegister',
    REGISTER_NAMED_ROUTER = 'RegisterNamedRouter',
    ROUTER_NAME = 'routerName',
    INSTANCE = 'instance',
    PARAM = 'param',
}

export enum ObservedNames {
    V1_RERENDER_ID = '____V1RenderId',
    RERENDER_ID = 'renderId',
    SET_V1_RERENDER_ID = 'setV1RenderId',
    META = 'meta',
    CONDITIONAL_ADD_REF = 'conditionalAddRef',
    ADD_REF = 'addRef',
    SHOULD_ADD_REF = 'shouldAddRef',
    NEW_NAME = 'newName',
    NEW_VALUE = 'newValue',
    FIRE_CHANGE = 'fireChange',
    EXECUATE_WATCHES = 'executeOnSubscribingWatches',
    SUBSCRIBED_WATCHES ='subscribedWatches',
    ADD_WATCH_SUBSCRIBER = 'addWatchSubscriber',
    REMOVE_WATCH_SUBSCRIBER = 'removeWatchSubscriber',
    WATCH_ID = 'watchId',
    PROPETY_NAME = 'propertyName',
    ADD_REF_ANY_PROP = 'addRefAnyProp',
}

export enum MonitorNames {
    PATH = 'path',
    VALUE_CALLBACK = 'valueCallback',
    I_MONITOR = 'IMonitor',
    M_PARAM = '_m',
    OWNER = 'owner',
    FUNCTION_NAME = 'functionName'
}

export enum EntryParamNames {
    ENTRY_STORAGE = 'storage',
    ENTRY_USE_SHARED_STORAGE = 'useSharedStorage',
    ENTRY_ROUTE_NAME = 'routeName',
}

export enum InnerComponentNames {
    FOR_EACH = 'ForEach',
    NAVIGATION = 'Navigation',
    NAV_DESTINATION = 'NavDestination',
}

export enum BuilderNames {
    BUILDER = 'builder',
    WRAP_BUILDER = 'wrapBuilder',
    WRAPPED_BUILDER = 'WrappedBuilder',
}

export enum InnerComponentAttributes {
    COMMON_METHOD = 'CommonMethod',
}

export enum InsightIntentDecoratorNames {
    LINK = 'InsightIntentLink',
    PAGE = 'InsightIntentPage',
    FUNCTION_METHOD = 'InsightIntentFunctionMethod',
    FUNCTION = 'InsightIntentFunction',
    ENTRY = 'InsightIntentEntry',
    LINK_PARAM_CATEGORY = 'LinkParamCategory',
    LINK_INTENT_PARAM_MAPPING = 'LinkIntentParamMapping',
    ENTITY = 'InsightIntentEntity',
    FORM = 'InsightIntentForm'
}

export enum DecoratorNames {
    STATE = 'State',
    STORAGE_LINK = 'StorageLink',
    LINK = 'Link',
    PROVIDE = 'Provide',
    CONSUME = 'Consume',
    OBJECT_LINK = 'ObjectLink',
    OBSERVED = 'Observed',
    OBSERVED_V2 = 'ObservedV2',
    WATCH = 'Watch',
    BUILDER_PARAM = 'BuilderParam',
    BUILDER = 'Builder',
    CUSTOM_DIALOG = 'CustomDialog',
    LOCAL_STORAGE_LINK = 'LocalStorageLink',
    REUSABLE = 'Reusable',
    TRACK = 'Track',
    TRACE = 'Trace',
    JSONSTRINGIFYIGNORE = 'JSONStringifyIgnore',
    JSONPARSEIGNORE = 'JSONParseIgnore',
    JSONRENAME = 'JSONRename',
    ANIMATABLE_EXTEND = 'AnimatableExtend',
    PROP_REF = 'PropRef',
    LOCAL = 'Local',
    LOCAL_STORAGE_PROP_REF = 'LocalStoragePropRef',
    STORAGE_PROP_REF = 'StoragePropRef',
    PARAM = 'Param',
    ONCE = 'Once',
    PROVIDER = 'Provider',
    CONSUMER = 'Consumer',
    MONITOR = 'Monitor',
    SYNC_MONITOR = 'SyncMonitor',
    COMPUTED = 'Computed',
    EVENT = 'Event',
    REQUIRE = 'Require',
    ENV = 'Env',
    COMPONENT_INIT = 'ComponentInit',
    COMPONENT_APPEAR = 'ComponentAppear',
    COMPONENT_BUILT = 'ComponentBuilt',
    COMPONENT_DISAPPEAR = 'ComponentDisappear',
    COMPONENT_REUSE = 'ComponentReuse',
    COMPONENT_RECYCLE = 'ComponentRecycle',
    COMPONENT_ACTIVE = 'ComponentActive',
    COMPONENT_INACTIVE = 'ComponentInactive',
    LOCAL_STORAGE_PROP = 'LocalStorageProp',
    STORAGE_PROP = 'StorageProp',
    REGULAR = 'regular',
    VARIABLE = 'variable',
    CUSTOM_ENV = 'CustomEnv',
}

export enum DeprecatedDecoratorNames {
    PROP = 'Prop',
    LOCAL_STORAGE_PROP = 'LocalStorageProp',
    STORAGE_PROP = 'StorageProp'
}

export enum TypeNames {
    ERROR = 'Error',
    NULLISH_TYPE = 'Any',
    ANY = 'Any',
    ARRAY = 'Array',
    MAP = 'Map',
    STRING = 'string',
    TYPE_T = 'T',
}

export enum StateManagementTypes {
    STATE_MANAGEMENT_FACTORY = 'STATE_MGMT_FACTORY',
    STATE_DECORATED = 'IStateDecoratedVariable',
    LINK_DECORATED = 'ILinkDecoratedVariable',
    LINK_SOURCE_TYPE = 'LinkSourceType',
    STORAGE_LINK_DECORATED = 'IStorageLinkDecoratedVariable',
    STORAGE_PROP_REF_DECORATED = 'IStoragePropRefDecoratedVariable',
    LOCAL_STORAGE_LINK_DECORATED = 'ILocalStorageLinkDecoratedVariable',
    PROP_DECORATED = 'IPropDecoratedVariable',
    PROVIDE_DECORATED = 'IProvideDecoratedVariable',
    CONSUME_DECORATED = 'IConsumeDecoratedVariable',
    OBJECT_LINK_DECORATED = 'IObjectLinkDecoratedVariable',
    PROP_REF_DECORATED = 'IPropRefDecoratedVariable',
    LOCAL_DECORATED = 'ILocalDecoratedVariable',
    LOCAL_STORAGE_PROP_REF_DECORATED = 'ILocalStoragePropRefDecoratedVariable',
    PARAM_DECORATED = 'IParamDecoratedVariable',
    ONCE_DECORATED = 'IParamOnceDecoratedVariable',
    PROVIDER_DECORATED = 'IProviderDecoratedVariable',
    CONSUMER_DECORATED = 'IConsumerDecoratedVariable',
    COMPUTED_DECORATED = 'IComputedDecoratedVariable',
    MONITOR_DECORATED = 'IMonitorDecoratedVariable',
    ENV_DECORATED = 'IEnvDecoratedVariable',
    MUTABLE_STATE_META = 'IMutableStateMeta',
    OBSERVED_OBJECT = 'IObservedObject',
    WATCH_ID_TYPE = 'WatchIdType',
    RENDER_ID_TYPE = 'RenderIdType',
    OBSERVE = 'OBSERVE',
    META = '__meta',
    SUBSCRIBED_WATCHES = 'ISubscribedWatches',
    OBSERVED_ANY_PROP = 'IObservedAnyProp',
    STORAGE_LINK_STATE = 'StorageLinkState',
    OBSERVABLE_PROXY = 'observableProxy',
    PROP_STATE = 'propState',
    UPDATE = 'update',
    MAKE_STATE = 'makeState',
    MAKE_LINK = 'makeLink',
    MAKE_PROP_REF = 'makePropRef',
    MAKE_LOCAL = 'makeLocal',
    MAKE_STATIC_LOCAL = 'makeStaticLocal',
    MAKE_STORAGE_PROP_REF = 'makeStoragePropRef',
    MAKE_LOCAL_STORAGE_PROP_REF = 'makeLocalStoragePropRef',
    MAKE_STORAGE_LINK = 'makeStorageLink',
    MAKE_LOCAL_STORAGE_LINK = 'makeLocalStorageLink',
    MAKE_PROVIDE = 'makeProvide',
    MAKE_CONSUME = 'makeConsume',
    MAKE_OBJECT_LINK = 'makeObjectLink',
    MAKE_SUBSCRIBED_WATCHES = 'makeSubscribedWatches',
    MAKE_MUTABLESTATE_META = 'makeMutableStateMeta',
    MAKE_PARAM = 'makeParam',
    MAKE_PARAM_ONCE = 'makeParamOnce',
    MAKE_PROVIDER = 'makeProvider',
    MAKE_CONSUMER = 'makeConsumer',
    MAKE_COMPUTED = 'makeComputed',
    MAKE_MONITOR = 'makeMonitor',
    MAKE_SYNC_MONITOR = 'makeSyncMonitor',
    IMONITOR_PATH_INFO = 'IMonitorPathInfo',
    MAKE_MONITOR_OPTIONS = 'MakeMonitorOptions',
    UI_UTILS = 'UIUtils',
    MAKE_OBSERVED = 'makeObserved',
    MAKE_BUILDER_PARAM_PROXY = 'makeBuilderParameterProxy',
    SET_OWNER = 'setOwner',
    BACKING = '__backing',
    RESET_ON_REUSE = 'resetOnReuse',
    MAKE_ENV = 'makeEnv',
    CUSTOM_ENV_DECORATED = 'ICustomEnvDecoratedVariable',
    MAKE_CUSTOM_ENV = 'makeCustomEnv',
    CUSTOM_ENV_KEY = 'CustomEnvKey',
    WRITABLE_ENV_KEY = 'WritableEnvKey',
    WRITABLE_SYSTEM_ENV_KEY = 'WritableSystemEnvKey',
    READONLY_ENV_KEY = 'ReadonlyEnvKey',
    READONLY_SYSTEM_ENV_KEY = 'ReadonlySystemEnvKey',
    CUSTOM_COMPONENT_LIFECYCLE_OBSERVER = 'CustomComponentLifecycleObserver',
    REUSE_OBJECT = 'ReuseObject',
    I_MONITOR = 'IMonitor',
    REGISTER_ACTIVE_AND_INACTIVE_FUNC = 'registerActiveAndInactiveCallback',
    IGLOBAL_REUSE_POOL_VARIABLE = 'IGlobalReusePoolVariable',
    MAKE_GLOBAL_REUSE_POOL = 'makeGlobalReusePool',
    REUSE_POOL_OWNERSHIP = 'ReusePoolOwnership',
}

export enum AnimationNames {
    ANIMATABLE_ARITHMETIC = 'AnimatableArithmetic',
    CREATE_OR_SET_ANIMATABLEPROPERTY = '__createOrSetAnimatableProperty',
    ANIMATION = 'animation',
    ANIMATION_START = 'animationStart',
    ANIMATION_STOP = 'animationStop',
}

export enum NavigationNames {
    NAVINTERFACE = 'NavInterface',
    BUNDLE_NAME = 'bundleName',
    MODULE_NAME = 'moduleName',
    PAGE_PATH = 'pagePath',
    PAGE_FULL_PATH = 'pageFullPath',
    INTEGRATED_HSP = 'integratedHsp',
    MODULE_INFO = 'ModuleInfo',
    NAVIGATION_MODULE_INFO = 'NavigationModuleInfo',
    NAV_DESTINATION_MODULE_INFO = 'NavDestinationModuleInfo',
    IS_USER_CREATE_STACK = 'isUserCreateStack',
    NAME = 'name',
    NAVIGATION_REGISTER_CLASS = '__NavigationBuilderRegisterClass',
    STATIC_BLOCK_TRIGGER_FIELD = 'staticBlockTriggerField',
}

export enum ConditionNames {
    CONDITION_SCOPE = 'ConditionScope',
    CONDITION_BRANCH = 'ConditionBranch',
}

export enum ArkTsDefaultNames {
    DEFAULT_STATIC_BLOCK_NAME = '<cctor>',
}

export const RESOURCE_TYPE: Record<string, number> = {
    color: 10001,
    float: 10002,
    string: 10003,
    plural: 10004,
    boolean: 10005,
    intarray: 10006,
    integer: 10007,
    pattern: 10008,
    strarray: 10009,
    media: 20000,
    rawfile: 30000,
    symbol: 40000,
};

export const REQUIRED_ANNOTATIONS = [
    DecoratorNames.LINK, 
    DecoratorNames.OBJECT_LINK, 
    DecoratorNames.REQUIRE
];

export const DECORATOR_TYPE_MAP = new Map<DecoratorNames, StateManagementTypes>([
    [DecoratorNames.STATE, StateManagementTypes.STATE_DECORATED],
    [DecoratorNames.LINK, StateManagementTypes.LINK_SOURCE_TYPE],
    [DecoratorNames.PROP_REF, StateManagementTypes.PROP_REF_DECORATED],
    [DecoratorNames.STORAGE_LINK, StateManagementTypes.STORAGE_LINK_DECORATED],
    [DecoratorNames.STORAGE_PROP_REF, StateManagementTypes.STORAGE_PROP_REF_DECORATED],
    [DecoratorNames.LOCAL_STORAGE_PROP_REF, StateManagementTypes.LOCAL_STORAGE_PROP_REF_DECORATED],
    [DecoratorNames.LOCAL_STORAGE_LINK, StateManagementTypes.LOCAL_STORAGE_LINK_DECORATED],
    [DecoratorNames.OBJECT_LINK, StateManagementTypes.OBJECT_LINK_DECORATED],
    [DecoratorNames.PROVIDE, StateManagementTypes.PROVIDE_DECORATED],
    [DecoratorNames.CONSUME, StateManagementTypes.CONSUME_DECORATED],
    [DecoratorNames.LOCAL, StateManagementTypes.LOCAL_DECORATED],
    [DecoratorNames.PARAM, StateManagementTypes.PARAM_DECORATED],
    [DecoratorNames.ONCE, StateManagementTypes.ONCE_DECORATED],
    [DecoratorNames.PROVIDER, StateManagementTypes.PROVIDER_DECORATED],
    [DecoratorNames.CONSUMER, StateManagementTypes.CONSUMER_DECORATED],
    [DecoratorNames.ENV, StateManagementTypes.ENV_DECORATED],
    [DecoratorNames.CUSTOM_ENV, StateManagementTypes.CUSTOM_ENV_DECORATED]
]);

export const INTERMEDIATE_IMPORT_SOURCE: Map<string, string[]> = new Map<string, string[]>([
    [Dollars.DOLLAR_RESOURCE, [Dollars.TRANSFORM_DOLLAR_RESOURCE]],
    [Dollars.DOLLAR_RAWFILE, [Dollars.TRANSFORM_DOLLAR_RAWFILE]],
    [Dollars.DOLLAR_DOLLAR, [BindableNames.BINDABLE, BindableNames.MAKE_BINDABLE]],
    [DecoratorNames.STATE, [StateManagementTypes.STATE_DECORATED, StateManagementTypes.STATE_MANAGEMENT_FACTORY]],
    [
        DecoratorNames.LINK,
        [
            StateManagementTypes.LINK_DECORATED,
            StateManagementTypes.LINK_SOURCE_TYPE,
            StateManagementTypes.STATE_MANAGEMENT_FACTORY
        ]
    ],
    [DecoratorNames.PROP_REF, [StateManagementTypes.PROP_REF_DECORATED, StateManagementTypes.STATE_MANAGEMENT_FACTORY]],
    [DecoratorNames.PROVIDE, [StateManagementTypes.PROVIDE_DECORATED, StateManagementTypes.STATE_MANAGEMENT_FACTORY]],
    [DecoratorNames.CONSUME, [StateManagementTypes.CONSUME_DECORATED, StateManagementTypes.STATE_MANAGEMENT_FACTORY]],
    [
        DecoratorNames.STORAGE_PROP_REF,
        [StateManagementTypes.STORAGE_PROP_REF_DECORATED, StateManagementTypes.STATE_MANAGEMENT_FACTORY]
    ],
    [
        DecoratorNames.LOCAL_STORAGE_PROP_REF,
        [StateManagementTypes.LOCAL_STORAGE_PROP_REF_DECORATED, StateManagementTypes.STATE_MANAGEMENT_FACTORY]
    ],
    [
        DecoratorNames.STORAGE_LINK,
        [StateManagementTypes.STORAGE_LINK_DECORATED, StateManagementTypes.STATE_MANAGEMENT_FACTORY]
    ],
    [
        DecoratorNames.OBJECT_LINK,
        [StateManagementTypes.OBJECT_LINK_DECORATED, StateManagementTypes.STATE_MANAGEMENT_FACTORY]
    ],
    [
        DecoratorNames.LOCAL_STORAGE_LINK,
        [StateManagementTypes.LOCAL_STORAGE_LINK_DECORATED, StateManagementTypes.STATE_MANAGEMENT_FACTORY]
    ],
    [DecoratorNames.LOCAL, [StateManagementTypes.LOCAL_DECORATED, StateManagementTypes.STATE_MANAGEMENT_FACTORY]],
    [DecoratorNames.PARAM, [StateManagementTypes.PARAM_DECORATED, StateManagementTypes.STATE_MANAGEMENT_FACTORY]],
    [DecoratorNames.ONCE, [StateManagementTypes.ONCE_DECORATED, StateManagementTypes.STATE_MANAGEMENT_FACTORY]],
    [DecoratorNames.PROVIDER, [StateManagementTypes.PROVIDER_DECORATED, StateManagementTypes.STATE_MANAGEMENT_FACTORY]],
    [DecoratorNames.CONSUMER, [StateManagementTypes.CONSUMER_DECORATED, StateManagementTypes.STATE_MANAGEMENT_FACTORY]],
    [DecoratorNames.COMPUTED, [StateManagementTypes.COMPUTED_DECORATED, StateManagementTypes.STATE_MANAGEMENT_FACTORY]],
    [
        DecoratorNames.MONITOR,
        [
            StateManagementTypes.MONITOR_DECORATED,
            StateManagementTypes.STATE_MANAGEMENT_FACTORY,
            StateManagementTypes.I_MONITOR,
            StateManagementTypes.IMONITOR_PATH_INFO,
            StateManagementTypes.MAKE_MONITOR_OPTIONS
        ]
    ],
    [
        DecoratorNames.SYNC_MONITOR,
        [
            StateManagementTypes.MONITOR_DECORATED,
            StateManagementTypes.STATE_MANAGEMENT_FACTORY,
            StateManagementTypes.I_MONITOR
        ]
    ],
    [DecoratorNames.ENV, [StateManagementTypes.ENV_DECORATED, StateManagementTypes.STATE_MANAGEMENT_FACTORY]],
    [DecoratorNames.CUSTOM_ENV, [StateManagementTypes.CUSTOM_ENV_DECORATED, StateManagementTypes.STATE_MANAGEMENT_FACTORY]],
    [
        DecoratorNames.OBSERVED,
        [
            StateManagementTypes.MUTABLE_STATE_META,
            StateManagementTypes.OBSERVED_OBJECT,
            StateManagementTypes.WATCH_ID_TYPE,
            StateManagementTypes.RENDER_ID_TYPE,
            StateManagementTypes.OBSERVE,
            StateManagementTypes.SUBSCRIBED_WATCHES,
            StateManagementTypes.STATE_MANAGEMENT_FACTORY,
        ],
    ],
    [
        DecoratorNames.TRACK,
        [
            StateManagementTypes.MUTABLE_STATE_META,
            StateManagementTypes.OBSERVED_OBJECT,
            StateManagementTypes.WATCH_ID_TYPE,
            StateManagementTypes.RENDER_ID_TYPE,
            StateManagementTypes.OBSERVE,
            StateManagementTypes.SUBSCRIBED_WATCHES,
            StateManagementTypes.STATE_MANAGEMENT_FACTORY,
        ],
    ],
    [
        DecoratorNames.OBSERVED_V2,
        [
            StateManagementTypes.MUTABLE_STATE_META,
            StateManagementTypes.OBSERVED_OBJECT,
            StateManagementTypes.WATCH_ID_TYPE,
            StateManagementTypes.RENDER_ID_TYPE,
            StateManagementTypes.SUBSCRIBED_WATCHES,
            StateManagementTypes.OBSERVED_ANY_PROP,
            StateManagementTypes.STATE_MANAGEMENT_FACTORY
        ],
    ],
    [DecoratorNames.TRACE, [StateManagementTypes.STATE_MANAGEMENT_FACTORY, StateManagementTypes.UI_UTILS]],
    [DecoratorNames.COMPONENT_APPEAR, [StateManagementTypes.UI_UTILS]],
    [DecoratorNames.COMPONENT_BUILT, [StateManagementTypes.UI_UTILS]],
    [DecoratorNames.COMPONENT_DISAPPEAR, [StateManagementTypes.UI_UTILS]],
    [DecoratorNames.COMPONENT_REUSE, [StateManagementTypes.UI_UTILS]],
    [DecoratorNames.COMPONENT_RECYCLE, [StateManagementTypes.UI_UTILS]],
    [DecoratorNames.COMPONENT_ACTIVE, [StateManagementTypes.UI_UTILS]],
    [DecoratorNames.COMPONENT_INACTIVE, [StateManagementTypes.UI_UTILS]],
    [DecoratorNames.ANIMATABLE_EXTEND, [AnimationNames.ANIMATABLE_ARITHMETIC]],
    [
        StructDecoratorNames.COMPONENT,
        [
            StateManagementTypes.IGLOBAL_REUSE_POOL_VARIABLE,
            StateManagementTypes.REUSE_POOL_OWNERSHIP,
            StateManagementTypes.STATE_MANAGEMENT_FACTORY
        ]
    ],
    [
        StructDecoratorNames.COMPONENT_V2,
        [
            StateManagementTypes.IGLOBAL_REUSE_POOL_VARIABLE,
            StateManagementTypes.REUSE_POOL_OWNERSHIP,
            StateManagementTypes.STATE_MANAGEMENT_FACTORY
        ]
    ],
]);

/**
 * @deprecated
 */
export const IMPORT_SOURCE_MAP_V2: Map<string, string> = new Map<string, string>([
    [Dollars.TRANSFORM_DOLLAR_RESOURCE, 'arkui.component.resources'],
    [Dollars.TRANSFORM_DOLLAR_RAWFILE, 'arkui.component.resources'],
    [StateManagementTypes.STORAGE_LINK_STATE, 'arkui.stateManagement.runtime'],
    [StateManagementTypes.OBSERVABLE_PROXY, 'arkui.stateManagement.runtime'],
    [StateManagementTypes.PROP_STATE, 'arkui.stateManagement.runtime'],
    [StateManagementTypes.IGLOBAL_REUSE_POOL_VARIABLE, 'arkui.stateManagement.decorator'],
    [StateManagementTypes.UI_UTILS, 'arkui.stateManagement.utils'],
    [AnimationNames.ANIMATABLE_ARITHMETIC, 'arkui.component.common'],
]);

export const ENV_KEY_STRING_PATTERN = /^(WritableEnvKey|ReadonlyEnvKey)\.(\w+)$/;

export enum GetSetTypes {
    GET = 'get',
    SET = 'set',
}

export enum BuiltInNames {
    GENSYM_INTRINSIC_PREFIX = 'gensym%%',
    GENSYM_UI_PREFIX = 'gensym__',
    GLOBAL_INIT_METHOD = '_$init$_',
    GLOBAL_MAIN_METHOD = 'main',
    DEFAULT_STATIC_BLOCK_NAME = '<cctor>',
}

export enum CustomComponentNames {
    COMPONENT_BUILD_ORI = 'build',
    COMPONENT_CONSTRUCTOR_ORI = 'constructor',
    COMPONENT_CLASS_NAME = 'CustomComponent',
    COMPONENT_V2_CLASS_NAME = 'CustomComponentV2',
    BASE_CUSTOM_DIALOG_NAME = 'BaseCustomDialog',
    COMPONENT_INTERFACE_PREFIX = '__Options_',
    COMPONENT_INITIALIZE_STRUCT = '__initializeStruct',
    COMPONENT_UPDATE_STRUCT = '__updateStruct',
    COMPONENT_TO_RECORD = '__toRecord',
    COMPONENT_INITIALIZERS_NAME = 'initializers',
    BUILDCOMPATIBLENODE = '_buildCompatibleNode',
    OPTIONS = 'options',
    PAGE_LIFE_CYCLE = 'PageLifeCycle',
    LAYOUT_CALLBACKS = 'LayoutCallbacks',
    RESET_STATE_VARS_ON_REUSE = 'resetStateVarsOnReuse',
    RESOLVE_DECORATOR_SYMBOLS_METHOD = '__resolveDecoratorSymbols',
}
 	 
export enum CustomDialogNames {
    CUSTOM_DIALOG_ANNOTATION_NAME = 'CustomDialog',
    CUSTOM_DIALOG_CONTROLLER = 'CustomDialogController',
    CUSTOM_DIALOG_CONTROLLER_OPTIONS = 'CustomDialogControllerOptions',
    SET_DIALOG_CONTROLLER_METHOD = '__setDialogController__',
    CONTROLLER = 'controller',
    OPTIONS_BUILDER = 'builder',
    BASE_COMPONENT = 'baseComponent',
    EXTENDABLE_COMPONENT = 'ExtendableComponent',
    CUSTOM_BUILDER = 'CustomBuilder',
}
 	 
export enum BuilderLambdaNames {
    ANNOTATION_NAME = 'ComponentBuilder',
    INNER_METHOD_NAME = '$_instantiate',
    TRANSFORM_INNER_METHOD_NAME = '_instantiateImpl',
    ORIGIN_METHOD_NAME = '$_invoke',
    TRANSFORM_METHOD_NAME = '_invoke',
    CUSTOM_COMPONENT_INVOKE_NAME = '_invokeImpl',
    REUSE_ID_PARAM_NAME = 'reuseId',
    REUSE_PARAM_NAME = 'reuse',
    STORAGE_PARAM_NAME = 'storage',
    USE_SHARED_STORAGE_PARAM_NAME = 'useSharedStorage',
    STYLE_PARAM_NAME = 'style',
    STYLE_ARROW_PARAM_NAME = 'instance',
    CONTENT_PARAM_NAME = 'content',
    COMPONENT_PARAM_ORI = 'content_',
    APPLY_ATTRIBUTES_FINISH_METHOD = 'applyAttributesFinish',
    DEBUG_LINE_METHOD = 'debugLine'
}
 	 
export enum NodeCacheNames {
    MEMO = 'memo',
    UI = 'ui',
}

export enum LANGUAGE_VERSION {
    ARKTS_1_2 = '1.2',
    ARKTS_1_1 = '1.1',
    ARKTS_HYBRID = 'hybrid',
};

export enum ReuseNames {
    REUSE_ID = 'reuseId',
    REUSE_OPTIONS = 'ReuseOptions'
}

export enum GlobalReusePoolNames {
    REUSE_POOL = 'reusePool',
    POOL_ACCEPTS = 'poolAccepts',
    BACKING_REUSE_POOL = '__backing_reusePool',
    REUSE_POOL_OWNERSHIP_OFF = 'OFF',
}

export enum EnvInternalProperty {
    ENV_VALUE = 'value'
}

export enum ReusableOptions {
    REUSABLE_MEM_OPT_STRATEGY = 'ReusableMemOptStrategy',
    MEMORY_OPT_STRATEGY = 'memoryOptimizationStrategy'
}

export enum APIVersions {
    API_20 = 20,
    API_24 = 24,
    API_26 = 26
}

export enum APIComparison {
    LESS_THAN = 'lt',
    LESS_THAN_OR_EQUAL = 'lte',
    GREATER_THAN = 'gt',
    GREATER_THAN_OR_EQUAL = 'gte',
    EQUAL = 'eq',
    NON_EQUAL = 'ne'
}

export const INNER_COMPONENT_NON_SKIP_DECL_NAMES: string[] = [
    // 'Badge',
    // 'ContainerSpan',
    // 'Counter',
    // 'DataPanel',
    // 'Gauge',
    // 'Hyperlink',
    // 'ImageSpan',
    // 'LoadingProgress',
    // 'Marquee',
    // 'PatternLock',
    // 'Progress',
    // 'QRCode',
    // 'RichEditor',
    // 'Search',
    // 'Span',
    // 'SymbolSpan',
    // 'SymbolGlyph',
    // 'Text',
    // 'TextArea',
    // 'TextClock',
    // 'TextInput',
    // 'TextTimer',
    // 'ArcAlphabetIndexer',
    // 'ArcSwiper',
    // 'AlphabetIndexer',
    // 'IndicatorComponent',
    // 'NavDestination',
    // 'Navigation',
    // 'SideBarContainer',
    // 'Swiper',
    // 'TabContent',
    // 'Tabs',
    // 'WithTheme',
    // 'EmbeddedComponent',
    // 'PluginComponent',
    // 'ToolBarItem',
    // 'UIExtensionComponent',
    // 'XComponent',
    // 'Button',
    // 'Checkbox',
    // 'CheckboxGroup',
    // 'Menu',
    // 'MenuItem',
    // 'MenuItemGroup',
    // 'Radio',
    // 'Rating',
    // 'Select',
    // 'Slider',
    // 'Toggle',
    // 'CalendarPicker',
    // 'DatePicker',
    // 'Image',
    // 'ImageAnimator',
    // 'TextPicker',
    // 'TimePicker',
    // 'UIPickerComponent',
    // 'ContentSlot',
    // 'ForEach',
    // 'If',
    // 'LazyForEach',
    // 'NodeContainer',
    // 'Repeat',
    // 'EffectComponent',
    // 'Particle',
    // 'UnionEffectContainer',
    // 'ArcList',
    // 'ArcListItem',
    // 'ArcScrollBar',
    // 'Grid',
    // 'GridItem',
    // 'LazyVGridLayout',
    // 'List',
    // 'ListItem',
    // 'ListItemGroup',
    // 'FlowItem',
    'LazyVColumn',
    'LazyVWaterflow',
    // 'Refresh',
    // 'Scroll',
    // 'ScrollBar',
    // 'WaterFlow',
    // 'Blank',
    // 'Canvas',
    // 'Circle',
    // 'Column',
    // 'ColumnSplit',
    // 'Divider',
    // 'Ellipse',
    // 'Flex',
    // 'FolderStack',
    // 'GridCol',
    // 'GridRow',
    // 'Line',
    // 'Path',
    // 'Polygon',
    // 'Polyline',
    // 'Rect',
    // 'RelativeContainer',
    // 'Row',
    // 'RowSplit',
    // 'Shape',
    // 'Stack',
    // 'Video',
    'MovingPhotoView',
    'DynamicLayout',
    'Component3D',
    'DepthComponent',
    'DistortionComponent',
    'DynamicComponent',
    'FormComponent',
    'MediaCachedImage',
    'PasteButton',
    'RemoteWindow',
    'RootScene',
    'SaveButton',
    'Screen',
    'SecurityUIExtensionComponent',
    'WindowScene',
    'Web'
]