🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@i18n-micro/types

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@i18n-micro/types - npm Package Compare versions

Comparing version
1.2.5
to
1.2.6
+34
-0
dist/index.d.cts

@@ -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 };

@@ -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": [

@@ -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 @@