import type { IApi } from 'umi' ; import type { NProgressConfigureOptions , UmiPluginNProgressRuntimeConfig , } from 'umi-plugin-nprogress-runtime' ; import { Translations } from './locales' ; export interface UmiPluginNProgressConfig { default ie11 ? : boolean | 'esm' | 'cjs' ; /**
     * 运行时的插件配置。
     */ runtime ? : UmiPluginNProgressRuntimeConfig ; /**
     * 配置 nprogress 进度条的动效曲线、挂载容器、增速、渲染模板等样式。
     */ ui ? : NProgressConfigureOptions ; } export function describeConfig ( ) { const defaultValue = { } ; return { default : defaultValue , schema : ( joi ) => joi . object ( { ie11 : joi . equal ( 'esm' , 'cjs' , true , false ) . description ( Translations . ConfigIe11Description ) , type { UmiPluginNProgressRuntimeConfig } runtime : joi . object ( { XMLHttpRequest : joi . boolean ( ) . description ( Translations . ConfigRuntimeXMLHttpRequestDescription ) , fetch : joi . boolean ( ) . description ( Translations . ConfigRuntimeFetchDescription ) , } ) . description ( Translations . ConfigRuntimeDescription ) , type { NProgressConfigureOptions } ui : joi . object ( { easing : joi . string ( ) . description ( Translations . ConfigUiEasingDescription ) , minimum : joi . number ( ) . min ( 0 ) . max ( 1 ) . description ( Translations . ConfigUiMinimumDescription ) , parent : joi . string ( ) . description ( Translations . ConfigUiParentDescription ) , showSpinner : joi . boolean ( ) . description ( Translations . ConfigUiShowSpinnerDescription ) , speed : joi . number ( ) . positive ( ) . description ( Translations . ConfigUiSpeedDescription ) , template : joi . string ( ) . description ( Translations . ConfigUiTemplateDescription ) , trickle : joi . boolean ( ) . description ( Translations . ConfigUiTrickleDescription ) , trickleSpeed : joi . number ( ) . positive ( ) . description ( Translations . ConfigUiTrickleSpeedDescription ) , } ) . unknown ( true ) . description ( Translations . ConfigUiDescription ) , } ) , } ; }