diff --git a/packages/angular/src/public-api.ts b/packages/angular/src/public-api.ts index ae81ef7fb..54403762a 100644 --- a/packages/angular/src/public-api.ts +++ b/packages/angular/src/public-api.ts @@ -5,3 +5,4 @@ export { useHead, useHeadSafe, useScript, useSeoMeta, useUnhead } from './composables' export { headSymbol, UnheadInjectionToken } from './context' export { Head } from './head.component' +export { defineLink, defineScript } from 'unhead' diff --git a/packages/react/src/index.ts b/packages/react/src/index.ts index 5146f74f5..f4f2fa1aa 100644 --- a/packages/react/src/index.ts +++ b/packages/react/src/index.ts @@ -1,3 +1,4 @@ export { hookImports } from './autoImports' export { Head } from './components' export { useHead, useHeadSafe, useScript, useSeoMeta, useUnhead } from './composables' +export { defineLink, defineScript } from 'unhead' diff --git a/packages/solid-js/src/index.ts b/packages/solid-js/src/index.ts index 05e453572..0d0cf4137 100644 --- a/packages/solid-js/src/index.ts +++ b/packages/solid-js/src/index.ts @@ -1,2 +1,3 @@ export { hookImports } from './autoImports' export { useHead, useHeadSafe, useScript, useSeoMeta, useUnhead } from './composables' +export { defineLink, defineScript } from 'unhead' diff --git a/packages/svelte/src/index.ts b/packages/svelte/src/index.ts index 7a5de2ebd..bb035ad64 100644 --- a/packages/svelte/src/index.ts +++ b/packages/svelte/src/index.ts @@ -1,3 +1,4 @@ export { autoImports } from './autoImports' export { useHead, useHeadSafe, useScript, useSeoMeta, useUnhead } from './composables' export { UnheadContextKey } from './context' +export { defineLink, defineScript } from 'unhead' diff --git a/packages/unhead/src/types/schema/link.ts b/packages/unhead/src/types/schema/link.ts index c11c9dbe5..01cabddfa 100644 --- a/packages/unhead/src/types/schema/link.ts +++ b/packages/unhead/src/types/schema/link.ts @@ -1,3 +1,4 @@ +import type { DeepReadonly } from '../util' import type { DataKeys } from './attributes/data' import type { HttpEventAttributes } from './attributes/event' import type { GlobalAttributes } from './attributes/global' @@ -847,8 +848,8 @@ type MatchLinkByRel export type InferLink = T extends { rel: infer R } ? R extends KnownLinkRel - ? MatchLinkByRel + ? DeepReadonly> : R extends string - ? GenericLink & { rel: R } + ? DeepReadonly & { rel: R } : never : never diff --git a/packages/unhead/src/types/schema/metaFlat.ts b/packages/unhead/src/types/schema/metaFlat.ts index 6665d714f..d42146e41 100644 --- a/packages/unhead/src/types/schema/metaFlat.ts +++ b/packages/unhead/src/types/schema/metaFlat.ts @@ -7,7 +7,7 @@ export interface MetaFlatArticle { * Writers of the article. * @example ['https://example.com/some.html', 'https://example.com/one.html'] */ - articleAuthor?: string[] + articleAuthor?: readonly string[] /** * When the article is out of date after. @@ -36,7 +36,7 @@ export interface MetaFlatArticle { * Tag words associated with this article. * @example ['Apple', 'Steve Jobs'] */ - articleTag?: string[] + articleTag?: readonly string[] } export interface MetaFlatBook { @@ -44,7 +44,7 @@ export interface MetaFlatBook { * Who wrote this book. * @example ['https://example.com/some.html', 'https://example.com/one.html'] */ - bookAuthor?: string[] + bookAuthor?: readonly string[] /** * The ISBN. @@ -62,7 +62,7 @@ export interface MetaFlatBook { * Tag words associated with this book. * @example ['Apple', 'Steve Jobs'] */ - bookTag?: string[] + bookTag?: readonly string[] } export interface MetaFlatProfile { diff --git a/packages/unhead/src/types/schema/script.ts b/packages/unhead/src/types/schema/script.ts index 4fd3e4106..b7e5da62c 100644 --- a/packages/unhead/src/types/schema/script.ts +++ b/packages/unhead/src/types/schema/script.ts @@ -1,4 +1,4 @@ -import type { Booleanable } from '../util' +import type { Booleanable, DeepReadonly } from '../util' import type { DataKeys } from './attributes/data' import type { HttpEventAttributes } from './attributes/event' import type { GlobalAttributes } from './attributes/global' @@ -489,7 +489,7 @@ export type InferScript = T extends { type: infer U } ? U extends string ? U extends KnownScriptType - ? MatchScriptByType - : GenericScript & { type: U } - : Script - : Script + ? DeepReadonly> + : DeepReadonly & { type: U } + : DeepReadonly