wip: compat configuration

This commit is contained in:
Evan You
2021-04-07 11:22:56 -04:00
parent 068d93b9e5
commit e2fc84c773
8 changed files with 111 additions and 52 deletions

View File

@@ -0,0 +1,26 @@
import { extend } from '@vue/shared'
import { DeprecationTypes } from './deprecations'
export type CompatConfig = Partial<
Record<DeprecationTypes, DeprecationConfigItem>
>
export interface DeprecationConfigItem {
warning?: boolean // defaults to true
mode?: 2 | 3 // defaults to 2
}
const globalCompatConfig: CompatConfig = {}
export function configureCompat(config: CompatConfig) {
extend(globalCompatConfig, config)
}
/**
* @internal
*/
export function getCompatConfig(
key: DeprecationTypes
): DeprecationConfigItem | undefined {
return globalCompatConfig[key]
}