refactor(types): mark internal API exports and exclude from d.ts
BREAKING CHANGE: Internal APIs are now excluded from type decalrations.
This commit is contained in:
@@ -41,7 +41,11 @@ function toNumber(val: string): number | string {
|
||||
type ModelDirective<T> = ObjectDirective<T & { _assign: AssignerFn }>
|
||||
|
||||
// We are exporting the v-model runtime directly as vnode hooks so that it can
|
||||
// be tree-shaken in case v-model is never used.
|
||||
// be tree-shaken in case v-model is never used. These are used by compilers
|
||||
// only and userland code should avoid relying on them.
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export const vModelText: ModelDirective<
|
||||
HTMLInputElement | HTMLTextAreaElement
|
||||
> = {
|
||||
@@ -90,6 +94,9 @@ export const vModelText: ModelDirective<
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export const vModelCheckbox: ModelDirective<HTMLInputElement> = {
|
||||
beforeMount(el, binding, vnode) {
|
||||
setChecked(el, binding, vnode)
|
||||
@@ -135,6 +142,9 @@ function setChecked(
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export const vModelRadio: ModelDirective<HTMLInputElement> = {
|
||||
beforeMount(el, { value }, vnode) {
|
||||
el.checked = looseEqual(value, vnode.props!.value)
|
||||
@@ -151,6 +161,9 @@ export const vModelRadio: ModelDirective<HTMLInputElement> = {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export const vModelSelect: ModelDirective<HTMLSelectElement> = {
|
||||
// use mounted & updated because <select> relies on its children <option>s.
|
||||
mounted(el, { value }, vnode) {
|
||||
@@ -212,6 +225,9 @@ function getCheckboxValue(
|
||||
return key in el ? el[key] : checked
|
||||
}
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export const vModelDynamic: ObjectDirective<
|
||||
HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement
|
||||
> = {
|
||||
|
||||
Reference in New Issue
Block a user