Files
vue-seo-layer/app/utils/types.ts

39 lines
1.2 KiB
TypeScript

// Wire types of GET /_seo/api/v1/resolve. Field names mirror the Go
// serializer (classes.Result in sm-seo-plugin) exactly. Types only, so
// `node --test` can import any util.
/** ok, not_found, redirect or gone. */
export type SeoAction = 'ok' | 'not_found' | 'redirect' | 'gone'
export interface SeoMetaTag {
name: string
content: string
}
/** The head metadata of a resolved page. Empty strings mean "no value". */
export interface SeoHead {
title: string
description: string
canonical: string
robots: string
x_robots_tag: string
og: { title: string; description: string; image: string; url: string }
twitter: { card: string; site: string }
verification: SeoMetaTag[]
}
export interface SeoResolveAnswer {
action: SeoAction
/** The HTTP status the frontend should answer with (200, 301, 302, 404, 410). */
status: number
/** The absolute target of a redirect answer; absent otherwise. */
location?: string
/** The absolute URL of the page on the site URL. */
url: string
locale: string
/** True outside the backend's production environment: noindex everywhere. */
staging: boolean
/** Set on ok answers only. */
seo: SeoHead | null
}