1- import type { InnerContent , ProcessesTemplateParams , ResolvesDuplicates , TagPosition , TagPriority } from '../tags'
1+ import type { InnerContent , ProcessesTemplateParams , ResolvesDuplicates , StringInnerContent , TagPosition , TagPriority } from '../tags'
22import type { DeepResolvableProperties , ResolvableProperties , ResolvableValue , Stringable } from '../util'
33import type { DataKeys } from './attributes/data'
44import type { Base } from './base'
55import type { BodyAttributesWithoutEvents , BodyEvents } from './bodyAttributes'
66import type { HtmlAttributes } from './htmlAttributes'
77import type {
8+ AlternateFeedLink ,
9+ AlternateLanguageLink ,
810 AlternateLink ,
11+ AlternateMediaLink ,
12+ AppleTouchIconLink ,
913 AuthorLink ,
1014 CanonicalLink ,
1115 DnsPrefetchLink ,
16+ FaviconLink ,
1217 GenericLink ,
1318 HelpLink ,
1419 IconLink ,
@@ -17,6 +22,7 @@ import type {
1722 LinkBase ,
1823 LinkHttpEvents ,
1924 ManifestLink ,
25+ MaskIconLink ,
2026 ModulepreloadLink ,
2127 NextLink ,
2228 PingbackLink ,
@@ -73,9 +79,9 @@ export interface SchemaAugmentations {
7379 bodyAttrs : ResolvesDuplicates & TagPriority
7480 link : TagPriority & TagPosition & ResolvesDuplicates & ProcessesTemplateParams
7581 meta : TagPriority & ResolvesDuplicates & ProcessesTemplateParams
76- style : TagPriority & TagPosition & InnerContent & ResolvesDuplicates & ProcessesTemplateParams
82+ style : TagPriority & TagPosition & StringInnerContent & ResolvesDuplicates & ProcessesTemplateParams
7783 script : TagPriority & TagPosition & InnerContent & ResolvesDuplicates & ProcessesTemplateParams
78- noscript : TagPriority & TagPosition & InnerContent & ResolvesDuplicates & ProcessesTemplateParams
84+ noscript : TagPriority & TagPosition & StringInnerContent & ResolvesDuplicates & ProcessesTemplateParams
7985}
8086
8187export type MaybeArray < T > = T | T [ ]
@@ -114,9 +120,9 @@ export interface UnheadHtmlAttributes extends Omit<HtmlAttributes, 'class' | 'st
114120 * Unhead meta with support for array content values
115121 */
116122export type UnheadMeta
117- = | ( Omit < NameMeta , 'content' > & { content ?: MaybeArray < Stringable > | null } )
118- | ( Omit < PropertyMeta , 'content' > & { content ?: MaybeArray < Stringable > | null } )
119- | ( Omit < HttpEquivMeta , 'content' > & { content ?: MaybeArray < Stringable > | null } )
123+ = | ( Omit < NameMeta , 'content' > & { content ?: MaybeArray < string | number > | null } )
124+ | ( Omit < PropertyMeta , 'content' > & { content ?: MaybeArray < string | number > | null } )
125+ | ( Omit < HttpEquivMeta , 'content' > & { content ?: MaybeArray < string | number > | null } )
120126 | CharsetMeta
121127
122128export type MaybeEventFnHandlers < T > = {
@@ -125,11 +131,17 @@ export type MaybeEventFnHandlers<T> = {
125131
126132export type ResolvableTitle = ResolvableValue < Stringable > | ResolvableProperties < ( { textContent : string } & SchemaAugmentations [ 'title' ] ) >
127133export type ResolvableTitleTemplate = string | ( ( title ?: string ) => string | null ) | null | ( { textContent : string | ( ( title ?: string ) => string | null ) } & SchemaAugmentations [ 'titleTemplate' ] )
128- export type ResolvableBase = ResolvableProperties < Base & SchemaAugmentations [ 'base' ] >
129- export type ResolvableLink = ResolvableProperties < Link & SchemaAugmentations [ 'link' ] > & MaybeEventFnHandlers < LinkHttpEvents >
130- export type ResolvableMeta = ResolvableProperties < UnheadMeta & SchemaAugmentations [ 'meta' ] >
134+ export type ResolvableBase = DistributeResolvable < Base , SchemaAugmentations [ 'base' ] >
135+ type DistributeResolvable < T , Aug > = T extends any ? ResolvableProperties < T & Aug > : never
136+ type DistributeResolvableWithEvents < T , Aug , Events > = T extends any
137+ ? T extends Events
138+ ? ResolvableProperties < Omit < T , keyof Events > & Aug > & MaybeEventFnHandlers < Events >
139+ : ResolvableProperties < T & Aug >
140+ : never
141+ export type ResolvableLink = DistributeResolvableWithEvents < Link , SchemaAugmentations [ 'link' ] , LinkHttpEvents >
142+ export type ResolvableMeta = DistributeResolvable < UnheadMeta , SchemaAugmentations [ 'meta' ] >
131143export type ResolvableStyle = ResolvableProperties < Style & DataKeys & SchemaAugmentations [ 'style' ] > | string
132- export type ResolvableScript = ResolvableProperties < Script & SchemaAugmentations [ 'script' ] > & MaybeEventFnHandlers < ScriptHttpEvents > | string
144+ export type ResolvableScript = DistributeResolvableWithEvents < Script , SchemaAugmentations [ 'script' ] , ScriptHttpEvents > | string
133145export type ResolvableNoscript = ResolvableProperties < Noscript & DataKeys & SchemaAugmentations [ 'noscript' ] > | string
134146export type ResolvableHtmlAttributes = ResolvableProperties < UnheadHtmlAttributes & DataKeys & SchemaAugmentations [ 'htmlAttrs' ] >
135147export type ResolvableBodyAttributes = ResolvableProperties < UnheadBodyAttributesWithoutEvents & DataKeys & SchemaAugmentations [ 'bodyAttrs' ] > & MaybeEventFnHandlers < BodyEvents >
@@ -243,10 +255,15 @@ export type { BodyAttributesWithoutEvents, BodyEvents } from './bodyAttributes'
243255
244256// Link types (narrowed)
245257export type {
258+ AlternateFeedLink ,
259+ AlternateLanguageLink ,
246260 AlternateLink ,
261+ AlternateMediaLink ,
262+ AppleTouchIconLink ,
247263 AuthorLink ,
248264 CanonicalLink ,
249265 DnsPrefetchLink ,
266+ FaviconLink ,
250267 GenericLink ,
251268 HelpLink ,
252269 IconLink ,
@@ -255,6 +272,7 @@ export type {
255272 LinkBase ,
256273 LinkHttpEvents ,
257274 ManifestLink ,
275+ MaskIconLink ,
258276 ModulepreloadLink ,
259277 NextLink ,
260278 PingbackLink ,
@@ -302,12 +320,8 @@ export type {
302320 PropertyMeta ,
303321}
304322
305- // Legacy exports for backwards compatibility
306- export type { GenericLink as LinkWithoutEvents } from './link'
307323// Other types
308324export type { MetaFlat } from './metaFlat'
309-
310- export type { GenericScript as ScriptWithoutEvents } from './script'
311325export type { SpeculationRules } from './struct/speculationRules'
312326
313327// ============================================================================
@@ -325,5 +339,5 @@ export interface MetaGeneric extends MetaBase {
325339 'property' ?: MetaProperties | ( string & Record < never , never > )
326340 'http-equiv' ?: 'content-security-policy' | 'content-type' | 'default-style' | 'x-ua-compatible' | 'refresh' | 'accept-ch' | ( string & Record < never , never > )
327341 'charset' ?: 'utf-8' | ( string & Record < never , never > )
328- 'content' ?: Stringable
342+ 'content' ?: string | number
329343}
0 commit comments