Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Augment MetaInfo with missing titleChunk #559

Merged
merged 2 commits into from
Jun 7, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions types/vue-meta.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ interface RefreshedTags {

interface Refreshed {
vm: Component,
metaInfo: MetaInfo,
metaInfo: MetaInfoOutput,
tags: RefreshedTags
}

Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down