@i18n-micro/types
Advanced tools
+34
-0
@@ -536,3 +536,37 @@ /** BCP-47 locale code string (e.g. `'en'`, `'de-DE'`, `'zh-Hans'`). */ | ||
| } | ||
| /** Link entry for page-level i18n head overrides (`useI18nHead`). */ | ||
| export interface I18nHeadLink { | ||
| rel: string; | ||
| href: string; | ||
| hreflang?: string; | ||
| [key: string]: string | undefined; | ||
| } | ||
| /** Meta entry for page-level i18n head overrides (`useI18nHead`). */ | ||
| export interface I18nHeadMeta { | ||
| [key: string]: string | undefined; | ||
| } | ||
| /** Groups of built-in i18n SEO tags that can be disabled per page. */ | ||
| export type I18nHeadDisableGroup = 'hreflang' | 'x-default' | 'canonical' | 'og' | 'og-alternates' | 'html'; | ||
| /** Page-level overrides merged on top of `useLocaleHead` output. */ | ||
| export interface I18nHeadInput { | ||
| /** Extra or overriding `<html>` attributes. */ | ||
| htmlAttrs?: Record<string, string>; | ||
| /** Meta tags appended after base i18n tags (deduped by `id` / `property` / `name`). */ | ||
| meta?: I18nHeadMeta[]; | ||
| /** Link tags appended after base i18n tags (deduped by `id` / `rel` + `hreflang`). */ | ||
| link?: I18nHeadLink[]; | ||
| /** Replace or remove specific built-in i18n SEO tags. */ | ||
| replace?: { | ||
| canonical?: string | false; | ||
| hreflang?: I18nHeadLink[] | false; | ||
| xDefault?: I18nHeadLink | false; | ||
| ogLocale?: string | false; | ||
| ogUrl?: string | false; | ||
| /** Locale codes for `og:locale:alternate` (resolved via `locale.og` / `iso`). */ | ||
| ogAlternates?: string[] | false; | ||
| }; | ||
| /** Disable built-in i18n SEO tag groups for this page. */ | ||
| disable?: I18nHeadDisableGroup[]; | ||
| } | ||
| declare const init: () => void; | ||
| export { init }; |
+34
-0
@@ -536,3 +536,37 @@ /** BCP-47 locale code string (e.g. `'en'`, `'de-DE'`, `'zh-Hans'`). */ | ||
| } | ||
| /** Link entry for page-level i18n head overrides (`useI18nHead`). */ | ||
| export interface I18nHeadLink { | ||
| rel: string; | ||
| href: string; | ||
| hreflang?: string; | ||
| [key: string]: string | undefined; | ||
| } | ||
| /** Meta entry for page-level i18n head overrides (`useI18nHead`). */ | ||
| export interface I18nHeadMeta { | ||
| [key: string]: string | undefined; | ||
| } | ||
| /** Groups of built-in i18n SEO tags that can be disabled per page. */ | ||
| export type I18nHeadDisableGroup = 'hreflang' | 'x-default' | 'canonical' | 'og' | 'og-alternates' | 'html'; | ||
| /** Page-level overrides merged on top of `useLocaleHead` output. */ | ||
| export interface I18nHeadInput { | ||
| /** Extra or overriding `<html>` attributes. */ | ||
| htmlAttrs?: Record<string, string>; | ||
| /** Meta tags appended after base i18n tags (deduped by `id` / `property` / `name`). */ | ||
| meta?: I18nHeadMeta[]; | ||
| /** Link tags appended after base i18n tags (deduped by `id` / `rel` + `hreflang`). */ | ||
| link?: I18nHeadLink[]; | ||
| /** Replace or remove specific built-in i18n SEO tags. */ | ||
| replace?: { | ||
| canonical?: string | false; | ||
| hreflang?: I18nHeadLink[] | false; | ||
| xDefault?: I18nHeadLink | false; | ||
| ogLocale?: string | false; | ||
| ogUrl?: string | false; | ||
| /** Locale codes for `og:locale:alternate` (resolved via `locale.og` / `iso`). */ | ||
| ogAlternates?: string[] | false; | ||
| }; | ||
| /** Disable built-in i18n SEO tag groups for this page. */ | ||
| disable?: I18nHeadDisableGroup[]; | ||
| } | ||
| declare const init: () => void; | ||
| export { init }; |
+1
-1
| { | ||
| "name": "@i18n-micro/types", | ||
| "version": "1.2.5", | ||
| "version": "1.2.6", | ||
| "description": "TypeScript definitions for the Nuxt I18n Micro ecosystem.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
+15
-0
@@ -114,2 +114,17 @@ # @i18n-micro/types | ||
| #### Page-level SEO head (`useI18nHead`) | ||
| Types for per-page i18n SEO overrides: `I18nHeadInput`, `I18nHeadLink`, `I18nHeadMeta`, and `I18nHeadDisableGroup`. Use them in page helpers or when calling `useI18nHead` from `@i18n-micro/types` for typed `meta`, `link`, `replace`, and `disable` options. | ||
| ```typescript | ||
| import type { I18nHeadInput } from '@i18n-micro/types' | ||
| export function buildArticleHead(article: Article): I18nHeadInput { | ||
| return { | ||
| meta: [{ property: 'og:title', content: article.title }], | ||
| replace: { canonical: article.canonicalUrl, ogUrl: article.canonicalUrl }, | ||
| } | ||
| } | ||
| ``` | ||
| #### `Translation` | ||
@@ -116,0 +131,0 @@ |
54010
6.98%577
6.26%154
10.79%