2
0
mirror of https://github.com/tenrok/vue-meta.git synced 2026-06-25 01:40:33 +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 { interface Refreshed {
vm: Component, vm: Component,
metaInfo: MetaInfo, metaInfo: MetaInfoOutput,
tags: RefreshedTags tags: RefreshedTags
} }
@@ -166,7 +166,7 @@ export interface NoScriptProperty extends MetaDataProperty {
export interface MetaInfo { export interface MetaInfo {
title?: string title?: string
titleTemplate?: string | ((titleChunk: string) => string) titleTemplate?: string | ((titleChunk: string) => string),
htmlAttrs?: AttributeProperty htmlAttrs?: AttributeProperty
headAttrs?: AttributeProperty headAttrs?: AttributeProperty
@@ -188,8 +188,12 @@ export interface MetaInfo {
[key: string]: string[] [key: string]: string[]
} }
changed?: <T extends MetaInfo>(newInfo: T, addedTags: elements, removedTags: elements) => void changed?: <T extends MetaInfoOutput>(newInfo: T, addedTags: elements, removedTags: elements) => void
afterNavigation?: <T extends MetaInfo>(newInfo: T) => void afterNavigation?: <T extends MetaInfoOutput>(newInfo: T) => void
}
export interface MetaInfoOutput extends MetaInfo {
titleChunk?: string
} }
export type MetaInfoComputed = () => MetaInfo export type MetaInfoComputed = () => MetaInfo