Skip to content

Commit d947540

Browse files
authored
types: augment MetaInfo with missing titleChunk (#559)
* Augment MetaInfo with missing titleChunk Fixes #557 * MetaInfoOutput extends MetaInfo #559 (comment)
1 parent 8b02eb2 commit d947540

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

types/vue-meta.d.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ interface RefreshedTags {
3333

3434
interface Refreshed {
3535
vm: Component,
36-
metaInfo: MetaInfo,
36+
metaInfo: MetaInfoOutput,
3737
tags: RefreshedTags
3838
}
3939

@@ -166,7 +166,7 @@ export interface NoScriptProperty extends MetaDataProperty {
166166

167167
export interface MetaInfo {
168168
title?: string
169-
titleTemplate?: string | ((titleChunk: string) => string)
169+
titleTemplate?: string | ((titleChunk: string) => string),
170170

171171
htmlAttrs?: AttributeProperty
172172
headAttrs?: AttributeProperty
@@ -188,8 +188,12 @@ export interface MetaInfo {
188188
[key: string]: string[]
189189
}
190190

191-
changed?: <T extends MetaInfo>(newInfo: T, addedTags: elements, removedTags: elements) => void
192-
afterNavigation?: <T extends MetaInfo>(newInfo: T) => void
191+
changed?: <T extends MetaInfoOutput>(newInfo: T, addedTags: elements, removedTags: elements) => void
192+
afterNavigation?: <T extends MetaInfoOutput>(newInfo: T) => void
193+
}
194+
195+
export interface MetaInfoOutput extends MetaInfo {
196+
titleChunk?: string
193197
}
194198

195199
export type MetaInfoComputed = () => MetaInfo

0 commit comments

Comments
 (0)