2
0
mirror of https://github.com/tenrok/vue-meta.git synced 2026-06-14 18:22:24 +03:00

types: augment MetaInfo with missing titleChunk (#559)

* Augment MetaInfo with missing titleChunk

Fixes #557

* MetaInfoOutput extends MetaInfo

https://github.com/nuxt/vue-meta/pull/559#issuecomment-626967757
This commit is contained in:
Rodion Borisov
2020-06-07 14:54:29 +03:00
committed by GitHub
parent 8b02eb2ac6
commit d9475402f3
+8 -4
View File
@@ -33,7 +33,7 @@ interface RefreshedTags {
interface Refreshed {
vm: Component,
metaInfo: MetaInfo,
metaInfo: MetaInfoOutput,
tags: RefreshedTags
}
@@ -166,7 +166,7 @@ export interface NoScriptProperty extends MetaDataProperty {
export interface MetaInfo {
title?: string
titleTemplate?: string | ((titleChunk: string) => string)
titleTemplate?: string | ((titleChunk: string) => string),
htmlAttrs?: AttributeProperty
headAttrs?: AttributeProperty
@@ -188,8 +188,12 @@ export interface MetaInfo {
[key: string]: string[]
}
changed?: <T extends MetaInfo>(newInfo: T, addedTags: elements, removedTags: elements) => void
afterNavigation?: <T extends MetaInfo>(newInfo: T) => void
changed?: <T extends MetaInfoOutput>(newInfo: T, addedTags: elements, removedTags: elements) => void
afterNavigation?: <T extends MetaInfoOutput>(newInfo: T) => void
}
export interface MetaInfoOutput extends MetaInfo {
titleChunk?: string
}
export type MetaInfoComputed = () => MetaInfo