import { Observable } from 'rxjs'; import { SystemSettingsConfig } from '../config-center/common/system-settings'; type SiderFeatureItem = { title: string; name: string; items: SiderFeatureItem[]; }; /** * config api 数据 */ export interface ConfigApiData { global_config: { support_shared?: boolean; console_id?: string; docs_center_url?: string; new_docs_url?: string; docs_url?: string; DOC_PATH?: Record; docs_endpoint?: string; docs_embed_endpoint?: string; support_imagemarket_zones?: string[]; PRODUCTION_SERVICES?: { enable: boolean; items: { enable: boolean; name: string; title: string; 'zh-cn': string; }[]; name: string; title: string; 'zh-cn': string; }[]; SYSTEM_SETTINGS?: SystemSettingsConfig; [name: string]: unknown; }; all_zone_config: { default: { disable_create_resource_in_vxnet_0?: boolean; valid_sider_features?: { name: string; title: string; items: SiderFeatureItem[]; related_names: string[]; }[]; support_instance_hotplug?: boolean; }; [name: string]: { disable_create_resource_in_vxnet_0?: boolean; valid_sider_features?: { name: string; title: string; items: SiderFeatureItem[]; related_names: string[]; }[]; support_instance_hotplug?: boolean; }; }; settings: { CONSOLE_URL?: string; PUSH_URL?: string; [name: string]: unknown; }; theme_config: { [name: string]: unknown; }; products_brief: { instance?: { attr_rules: { zoneIdBindInstanceStyle: { [zone: string]: string[]; }; }; attrs: { instance_category: { [name: string]: { 'zh-cn': string; en: string | null; }; }; instance_class: { [name: number]: { 'zh-cn': string; en: string | null; }; }; instance_class_feature: { [name: number]: { 'zh-cn': string; en: string | null; }; }; instance_style: { [name: string]: { 'zh-cn': string; en: string | null; }; }; }; }; volume?: { attr_rules: { volumeBindReplicaCount: { [name: number]: string[]; }; zoneIdBindVolume: { [name: string]: string[]; }; }; attrs: { repl: { [name: string]: { 'zh-cn': string; en: string | null; }; }; volume_type: { [name: number]: { 'zh-cn': string; en: string | null; }; }; }; }; router?: { attr_rules: { regionIdBindRouterType: { [name: string]: string[]; }; }; attrs: { router_type: { [name: number]: { 'zh-cn': string; en: string | null; }; }; }; }; }; } /** * 请求config api (from request) * @returns Observable {@link ConfigApiData} */ export declare const fromRequestConfigApi: () => Observable; /** * 请求config api (request) * @returns Promise {@link ConfigApiData} */ export declare const requestConfigApi: () => Promise; /** * @deprecated 请使用 window.GLOBAL_CONFIG,window.ALL_ZONE_CONFIG,window.SETTINGS,window.THEME_CONFIG,window.PRODUCTS_BRIEF, */ export declare const useConfigApi: () => { data: { global_config: { [name: string]: unknown; support_shared?: boolean; console_id?: string; docs_center_url?: string; new_docs_url?: string; docs_url?: string; DOC_PATH?: Record; docs_endpoint?: string; docs_embed_endpoint?: string; support_imagemarket_zones?: string[]; PRODUCTION_SERVICES?: { enable: boolean; items: { enable: boolean; name: string; title: string; "zh-cn": string; }[]; name: string; title: string; "zh-cn": string; }[]; SYSTEM_SETTINGS?: SystemSettingsConfig; } | undefined; all_zone_config: { [name: string]: { disable_create_resource_in_vxnet_0?: boolean; valid_sider_features?: { name: string; title: string; items: SiderFeatureItem[]; related_names: string[]; }[]; support_instance_hotplug?: boolean; }; default: { disable_create_resource_in_vxnet_0?: boolean; valid_sider_features?: { name: string; title: string; items: SiderFeatureItem[]; related_names: string[]; }[]; support_instance_hotplug?: boolean; }; } | undefined; settings: { CONSOLE_URL: string; PUSH_URL: string; }; theme_config: { [name: string]: unknown; } | undefined; products_brief: { instance?: { attr_rules: { zoneIdBindInstanceStyle: { [zone: string]: string[]; }; }; attrs: { instance_category: { [name: string]: { "zh-cn": string; en: string | null; }; }; instance_class: { [name: number]: { "zh-cn": string; en: string | null; }; }; instance_class_feature: { [name: number]: { "zh-cn": string; en: string | null; }; }; instance_style: { [name: string]: { "zh-cn": string; en: string | null; }; }; }; }; volume?: { attr_rules: { volumeBindReplicaCount: { [name: number]: string[]; }; zoneIdBindVolume: { [name: string]: string[]; }; }; attrs: { repl: { [name: string]: { "zh-cn": string; en: string | null; }; }; volume_type: { [name: number]: { "zh-cn": string; en: string | null; }; }; }; }; router?: { attr_rules: { regionIdBindRouterType: { [name: string]: string[]; }; }; attrs: { router_type: { [name: number]: { "zh-cn": string; en: string | null; }; }; }; }; } | undefined; }; }; /** * 查询区域下是否支持某个服务 * @param zone 区域 * @param portal 子portal名称 用于请求config_api的参数 * @param portalServiceName 所在portal的服务名称 * @param serviceName 服务名称(如果是一个数组则查询多级菜单) */ export declare const useSupportService: (zone: string | undefined, portal: string, portalServiceName: string, serviceName: string[] | string) => boolean; /** * 查询当前区是否支持Eip服务 */ export declare const useSupportEipService: (zone: string | undefined) => boolean | undefined; /** * @deprecated 请使用 window.PRODUCTS_BRIEF */ export declare const useProductsBrief: () => { instance?: { attr_rules: { zoneIdBindInstanceStyle: { [zone: string]: string[]; }; }; attrs: { instance_category: { [name: string]: { "zh-cn": string; en: string | null; }; }; instance_class: { [name: number]: { "zh-cn": string; en: string | null; }; }; instance_class_feature: { [name: number]: { "zh-cn": string; en: string | null; }; }; instance_style: { [name: string]: { "zh-cn": string; en: string | null; }; }; }; }; volume?: { attr_rules: { volumeBindReplicaCount: { [name: number]: string[]; }; zoneIdBindVolume: { [name: string]: string[]; }; }; attrs: { repl: { [name: string]: { "zh-cn": string; en: string | null; }; }; volume_type: { [name: number]: { "zh-cn": string; en: string | null; }; }; }; }; router?: { attr_rules: { regionIdBindRouterType: { [name: string]: string[]; }; }; attrs: { router_type: { [name: number]: { "zh-cn": string; en: string | null; }; }; }; }; } | undefined; /** * @deprecated 请使用 pText */ export declare const usePText: () => (attr: string) => string; export declare const pText: (attr: string) => string; export {};