import Vnmf from './index' declare module './index' { /** * WeChat applet overall Window Public projects configuration and page configuration */ interface CommonConfig { /** Navigation bar background color ,HexColor * @default: "#000000" */ navigationBarBackgroundColor?: string /** Navigation bar title color ,Only support black/white * @default: "white" */ navigationBarTextStyle?: 'white' | 'black' /** Navigation bar title text content */ navigationBarTitleText?: string /** Navigation bar style ,Only support the following values : * - default Default style * - custom Custom navigation bar */ navigationStyle?: 'default' | 'custom' /** Background color of the window , HexColor * @default: "#ffffff" */ backgroundColor?: string /** Pull background font 、loading Pattern ,Only support dark/light * @default: "dark" */ backgroundTextStyle?: 'dark' | 'light' /** The background color of the top window ,only iOS support * @default: "#ffffff" */ backgroundColorTop?: string /** Background color of the bottom window ,only iOS support * @default: "#ffffff" */ backgroundColorBottom?: string /** Whether to turn on the drop -down refreshment * @default: false */ enablePullDownRefresh?: boolean /** The distance from the bottom of the page to the bottom of the page ,Unit is px * @default: 50 */ onReachBottomDistance?: number /** Screen rotation settings * @see https://developers.weixin.qq.com/miniprogram/dev/framework/view/resizable.html */ pageOrientation?: 'auto' | 'portrait' | 'landscape' /** Page initial rendering cache configuration ,support static / dynamic */ initialRenderingCache?: 'static' | 'dynamic' /** Re -startup strategy configuration * - homePage: If you exit the applet from this page ,The next time I will start from the homepage cold * - homePageAndLatestPage: If you exit the applet from this page ,After starting the cold next time, load this page immediately ,The parameters of the page remain unchanged (Unavailable for tab Page ) * @default "homePage" */ restartStrategy?: 'homePage' | 'homePageAndLatestPage' } interface PageConfig extends CommonConfig { /** Set as true Then the page cannot be rolled up and down as a whole ; * Only valid in the page configuration ,Unable to app.json Set this item * @default: false */ disableScroll?: boolean /** Right -handed gesture of the page return * * **Notice ** From WeChat client 7.0.5 start ,Page configuration disableSwipeBack The attribute will no longer take effect , * See for details [Right slip gesture return ability adjustment ](https://developers.weixin.qq.com/community/develop/doc/000868190489286620a8b27f156c01)announcement * @default: false * @since WeChat client 7.0.0 */ disableSwipeBack?: boolean /** Whether to enable sharing with friends 。 * @default false */ enableShareAppMessage?: boolean /** Whether to enable and share to the circle of friends 。 * @default false */ enableShareTimeline?: boolean /** Page custom component configuration * @see https://developers.weixin.qq.com/miniprogram/dev/framework/custom-component/ */ usingComponents?: Record /** Specify after upgrading weui style * - v2: It can show that the new version of the component style is enabled * @default default */ style?: string /** Single -page mode related configuration */ singlePage?: SinglePage } interface WindowConfig extends CommonConfig { /** When cutting into the background of the system ,Hidden page content ,Protect user privacy 。support hidden / none * @default none */ visualEffectInBackground?: 'hidden' | 'none' /** Whether to allow drop -down and refresh * Remark :The premise of pulling down and refreshing is allowsBounceVertical Value YES * @default: "NO" */ pullRefresh?: 'YES' | 'NO' | boolean /** Whether allowed to pull down * @default: "YES" */ allowsBounceVertical?: 'YES' | 'NO' } interface TabBarItem { /** Page path ,gotta be pages Medium first definition */ pagePath: string /** tab Plug -in text */ text: string /** Picture path ,icon Limited to 40kb,The recommended size is 81px * 81px,when position for top Time ,This parameter is invalid ,Do not support network pictures */ iconPath?: string /** The picture path when chosen ,icon Limited to 40kb,The recommended size is 81px * 81px ,when position for top Time ,This parameter is invalid */ selectedIconPath?: string } interface TabBar { /** tab The default color on the text */ color?: string /** tab The color when the text is selected */ selectedColor?: string /** tab Background color */ backgroundColor?: string /** tabbarColor of the frame , Only support black/white * @default: black */ borderStyle?: 'black' | 'white' /** tab list of ,For details list Attribute description ,least 2 indivual 、most 5 indivual tab */ list: TabBarItem[] /** tabbar s position ,Optional value bottom、top * @default: 'bottom' */ position?: 'bottom' | 'top' /** customize tabBar,See [Detail ](https://developers.weixin.qq.com/miniprogram/dev/framework/ability/custom-tabbar.html) * @default false * @since 2.1.0 */ custom?: boolean } interface NetworkTimeout { /** Vnmf.request Timeout time ,Units millisecond 。 * @default 60000 */ request?: number /** Vnmf.connectSocket Timeout time ,Units millisecond 。 * @default 60000 */ connectSocket?: number /** Vnmf.uploadFile Timeout time ,Units millisecond 。 * @default 60000 */ uploadFile?: number /** Vnmf.downloadFile Timeout time ,Units millisecond 。 * @default 60000 */ downloadFile?: number } interface SubPackage { /** Subcontracting path * - Notice :Can't put it in the main bag pagesUnder contents */ root: string /** All page configuration under the subcontracting path */ pages: string[] /** Partial name ,You can use it when downloading pre -download */ name?: string /** Is the subcontracting independent subcontract */ independent?: boolean /** Subcultivation supports independent plug -in */ plugins?: Plugins } interface Plugins { [key: string]: { version: string provider: string } } interface PreloadRule { [key: string]: { /** After entering the page, pre -download subcontracting root or name。__APP__ Represent the main bag 。 */ packages: string[] /** Pre -download under the specified network ,Optional value : * - all: Unlimited network * - wifi: only wifiPre -download * @default "wifi" */ network?: 'all' | 'wifi' } } interface Permission { [key: string]: { /** Interface use description of the time display of mini -program acquisition permissions 。longest 30Individual character */ desc: string } } interface SinglePage { /** The intersection of the navigation bar and the page ,Value float It means that the navigation bar floats on the page ,Intersect with page ;Value squeezed When the page is squeezed by the navigation bar ,Not intersecting the page * @default "Default automatic adjustment ,If the original page is a custom navigation bar ,Then float,Otherwise squeezed" */ navigationBarFit?: string } interface RouterAnimate { /** Animation switching time ,Units millisecond * @default 300 */ duration?: number /** Animation switching time ,Units millisecond * @default 50 */ delay?: number } interface AppConfig { /** The small program starts the homepage by default ,Undecided entryPagePath Time ,The first item of the array represents the initial page of the applet (front page )。 */ entryPagePath?: string /** Accept an array ,Every item is a string ,Let's specify which pages of applets are composed ,The first item of the array represents the initial page of the applet */ pages?: string[] /** Global default window performance */ window?: WindowConfig /** bottom tab Performance */ tabBar?: TabBar /** The timeout of various types of network requests ,The unit is all milliseconds 。 */ networkTimeout?: NetworkTimeout /** Whether to open debug model ,By default * @default false */ debug?: boolean /** When enable the plug -in function page ,The small program of the plug -in owner needs to set it up functionalPages for true。 * @see https://developers.weixin.qq.com/miniprogram/dev/framework/plugin/functional-pages.html * @default false * @since 2.1.0 */ functionalPages?: boolean /** Container configuration * @example * ```json * [ * { * root: 'packages/module', * pages: [ * 'pages/page/index' * ] * } * ] * ``` * @since 1.7.3 */ subPackages?: SubPackage[] subpackages?: SubPackage[] /** Worker Code placement directory * use Worker When processing multi -threaded tasks ,set up Worker Code placement directory * @since 1.9.90 */ workers?: string /** Statement the ability to run in the background ,Types are array 。Currently supports the following projects : * - audio: Backstage music playback * - location: Background positioning * @since WeChat client 6.7.2 Under the above version support */ requiredBackgroundModes?: ('audio' | 'location')[] /** State the geographical location related interface that needs to be used ,Types are array 。Currently supports the following projects : * since 2022 year 7 moon 14 The applet released in the future ,Use below 8When the geographical location -related interface ,You need to declare the field ,Otherwise it will not be able to use normally 。2022 year 7 moon 14 The applet released a few days ago is not affected 。 * - getFuzzyLocation: Get blurred geographical location * - getLocation: Get accurate geographical location * - onLocationChange: Supervision and trial geographical change event * - startLocationUpdate: Receive location message (front desk ) * - startLocationUpdateBackground: Receive location message (Front and background ) * - chooseLocation: Open the map selection location * - choosePoi: Open POI List selection location * - chooseAddress: Get user address information * @see https://developers.weixin.qq.com/miniprogram/dev/reference/configuration/app.html#requiredPrivateInfos */ requiredPrivateInfos?: ('getFuzzyLocation' | 'getLocation' | 'onLocationChange' | 'startLocationUpdate' | 'startLocationUpdateBackground' | 'chooseLocation' | 'choosePoi' | 'chooseAddress')[] /** Plug -in * @since 1.9.6 */ plugins?: Plugins /** State the rules of the sub -package download 。 * preloadRule middle ,key Is the page path ,value Is the pre -download configuration that enters this page * Notice : Subcultivating pre -downloading currently supports only through configuration method ,Do not support the call APIFinish 。 * vConsole inside preloadSubpackages The log information at the beginning ,Can be used to verify the pre -download situation 。 * @since 2.3.0 */ preloadRule?: PreloadRule /** PC Whether the applet supports the user arbitrarily changing the window size (Including maximum windows );iPad Whether the applet supports screen rotation * @default false * @since 2.3.0 */ resizable?: boolean /** List of small components that need to jump * @since 2.4.0 */ navigateToMiniProgramAppIdList?: string[] /** Global custom component configuration * @see https://developers.weixin.qq.com/miniprogram/dev/framework/custom-component/ */ usingComponents?: Record /** Exic program interface authority related settings * @since WeChat client 7.0.0 */ permission?: Permission /** Indicate sitemap.json s position */ sitemapLocation?: string /** Specify after upgrading weui style * - v2: It can show that the new version of the component style is enabled * @default default */ style?: string /** Specify the expansion library that needs to be referenced * Specify the expansion library that needs to be referenced 。Currently supports the following projects : * - kbone: Multi -end development framework * - weui: WeUI Component library */ useExtendedLib?: Record /** WeChat message is opened with a small program * @see https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/location-message.html */ entranceDeclare?: { /** statement “Position message ”Scenes enter the startup page of the applet */ locationMessage?: { /** Start page path ,Must pagesAlready defined */ path?: string /** Start page parameters */ query?: string } } /** * Configuration darkMode for true,That is to indicate that the current applet is adapted DarkMode * @since 2.11.0 */ darkmode?: boolean /** Indicate theme.json s position ,darkmodefor trueFor a must -have * @since 2.11.0 */ themeLocation?: string /** Configure custom component code injection on demand */ lazyCodeLoading?: string /** Single -page mode related configuration */ singlePage?: SinglePage /** Chat material applet to open related configuration * @see https://developers.weixin.qq.com/miniprogram/dev/framework/material/support_material.html */ supportedMaterials?: { /** Support file type MimeType,Audio ,Video supports a secondary configuration communication mode ,E.g : video/*。When the configuration and accurate type configuration of the communication mode exist at the same time ,Then preferential use of accurate type configuration (E.g video/*and video/mp4simultaneously exist ,Will be used priority video/mp4Configuration )。 */ materialType: string /** Title of developer configuration ,This title will be displayed on the material page ,The configuration must contain ${nickname}, After the code package is compiled, it will automatically replace it with a small program name ,If you declare the abbreviation, you will use the abbreviation priority 。Removal ${nickname}The remaining words must not exceed more 6indivual 。 */ name: string /** Use description ,The description will be displayed in the recommendation list ,The number of limited words does not exceed more than 22indivual 。 */ desc: string /** Jump the page when opening the applet in this scene */ path: string } /** Customized service provider bill */ serviceProviderTicket?: string /** Half -screen applet appId */ embeddedAppIdList?: string[] /** Live live half -screen scene settings */ halfPage?: { /** The full -screen status of the first page of the live broadcast of the video number uses the top screen status ,support */ firstPageNavigationStyle?: 'default' | 'custom' } /** Application related configuration items */ debugOptions?: { /** Whether to open FPS panel ,default false */ enableFPSPanel?: boolean } /** touch Whether event monitoring is passive,default false */ enablePassiveEvent?: boolean | { /** Whether to set touchstart Incident passive,default false */ touchstart?: boolean /** Whether to set touchmove Incident passive,default false */ touchmove?: boolean /** Whether to set wheel Incident passive,default false */ wheel?: boolean } /** Custom module mapping rules */ resolveAlias?: Record /** Accept an array ,Every item is a string ,Let's specify the component entrance compiled as a native applet component */ components?: string[] /** Container on the rendering page id * @default "app" * @since 3.3.18 */ appId?: string /** Whether to open h5 End routing animation function ,By default * @supported h5 * @since 3.3.18 */ animation?: RouterAnimate | boolean } interface Config extends PageConfig, AppConfig { cloud?: boolean } interface VnmfStatic { CommonConfig: CommonConfig PageConfig: PageConfig WindowConfig: WindowConfig TarBarList: TabBarItem TabBar: TabBar NetworkTimeout: NetworkTimeout SubPackage: SubPackage Plugins: Plugins PreloadRule: PreloadRule Permission: Permission AppConfig: AppConfig RouterAnimate: RouterAnimate Config: Config } }