import React from 'react' import Vnmf from './index' declare module './index' { type MessageType = 'info' | 'success' | 'error' | 'warning' interface AtMessageOptions { message: string type?: MessageType duration?: number } interface RequestParams extends request.Option { [propName: string]: any } interface Current { app: AppInstance | null router: RouterInfo | null page: PageInstance | null onReady: string onHide: string onShow: string preloadData?: Record /** * RN Private object navigationRef,Used to use underlying interface control routing */ rnNavigationRef?: React.RefObject } interface SetGlobalDataPlugin { install (app: any, data: any): void } interface VNMF_ENV_TYPE { [VnmfGeneral.ENV_TYPE.WEAPP]: VnmfGeneral.ENV_TYPE.WEAPP [VnmfGeneral.ENV_TYPE.WEB]: VnmfGeneral.ENV_TYPE.WEB [VnmfGeneral.ENV_TYPE.RN]: VnmfGeneral.ENV_TYPE.RN [VnmfGeneral.ENV_TYPE.SWAN]: VnmfGeneral.ENV_TYPE.SWAN [VnmfGeneral.ENV_TYPE.ALIPAY]: VnmfGeneral.ENV_TYPE.ALIPAY [VnmfGeneral.ENV_TYPE.TT]: VnmfGeneral.ENV_TYPE.TT [VnmfGeneral.ENV_TYPE.QQ]: VnmfGeneral.ENV_TYPE.QQ [VnmfGeneral.ENV_TYPE.JD]: VnmfGeneral.ENV_TYPE.JD } interface VnmfStatic { Events: { new (): VnmfGeneral.Events } /** Event center * @supported global */ eventCenter: VnmfGeneral.Events ENV_TYPE: VNMF_ENV_TYPE /** Get environmental variables * @supported global */ getEnv(): VnmfGeneral.ENV_TYPE /** Sizes conversion * @supported global */ pxTransform(size: number, designWidth?: number): string /** Dimension conversion initialization * @supported global */ initPxTransform(config: { designWidth: number; deviceRatio: VnmfGeneral.TDeviceRatio }): void /** Little program reference plug -in JS interface * @supported weapp, alipay, h5, rn, jd, qq, swan, tt, quickapp */ requirePlugin(pluginName: string): any /** Get the current page instance * @supported global */ getCurrentInstance(): Current Current: Current /** Vue3 Plug -in ,For setting `getApp()` Global variables * @supported weapp, alipay, h5, rn, jd, qq, swan, tt, quickapp * @example * ```js * // Use plug -in * const App = createApp(...) * App.use(setGlobalDataPlugin, { * xxx: 999 * }) * // Get global variables * Vnmf.getApp().xxx * ``` */ setGlobalDataPlugin: SetGlobalDataPlugin /** Get the custom TabBar corresponding React or Vue Component instance * @supported weapp * @param page Application ,able to pass Vnmf.getCurrentInstance().page Obtain */ getTabBar(page: Current['page']): T | undefined } }