@@ -52,13 +52,13 @@ export interface BodyAttr extends Omit<BaseBodyAttr, 'class' | 'style'> {
5252 *
5353 * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/class
5454 */
55- class ?: MaybeArray < string > | Record < string , boolean >
55+ class ?: MaybeArray < ResolvableValue < Stringable > > | Record < string , ResolvableValue < boolean > >
5656 /**
5757 * The style attribute contains CSS styling declarations to be applied to the element.
5858 *
5959 * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/style
6060 */
61- style ?: MaybeArray < string > | Record < string , ResolvableValue < string > >
61+ style ?: MaybeArray < ResolvableValue < Stringable > > | Record < string , ResolvableValue < Stringable > >
6262}
6363
6464export interface HtmlAttr extends Omit < _HtmlAttributes , 'class' | 'style' > {
@@ -67,13 +67,13 @@ export interface HtmlAttr extends Omit<_HtmlAttributes, 'class' | 'style'> {
6767 *
6868 * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/class
6969 */
70- class ?: MaybeArray < string > | Record < string , boolean >
70+ class ?: MaybeArray < ResolvableValue < Stringable > > | Record < string , ResolvableValue < boolean > >
7171 /**
7272 * The style attribute contains CSS styling declarations to be applied to the element.
7373 *
7474 * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/style
7575 */
76- style ?: MaybeArray < string > | Record < string , ResolvableValue < string > >
76+ style ?: MaybeArray < ResolvableValue < Stringable > > | Record < string , ResolvableValue < Stringable > >
7777}
7878
7979export interface BaseMeta extends Omit < _Meta , 'content' > {
@@ -193,7 +193,7 @@ export interface ResolvableHead<E extends MergeHead = SchemaAugmentations> exten
193193 bodyAttrs ?: ResolvableValue < BodyAttributes < E [ 'bodyAttrs' ] > >
194194}
195195
196- export interface ResolvedHead < E extends MergeHead = ResolvedSchemaAugmentations > extends HeadUtils {
196+ export interface NormalizedHead < E extends MergeHead = ResolvedSchemaAugmentations > extends HeadUtils {
197197 title ?: ResolvedTitle
198198 base ?: ResolvedBase < E [ 'base' ] >
199199 link ?: ResolvedLink < E [ 'link' ] > [ ]
@@ -205,9 +205,34 @@ export interface ResolvedHead<E extends MergeHead = ResolvedSchemaAugmentations>
205205 bodyAttrs ?: ResolvedBodyAttributes < E [ 'bodyAttrs' ] >
206206}
207207
208- export type Head = ResolvableHead & ResolvedHead
208+ type AsSerializable < S extends keyof ResolvedSchemaAugmentations > = ResolvedSchemaAugmentations [ S ] & DataKeys
209+
210+ export interface SerializableHead < E extends MergeHead = ResolvedSchemaAugmentations > {
211+ /**
212+ * Generate the title from a template.
213+ *
214+ * Should include a `%s` placeholder for the title, for example `%s - My Site`.
215+ */
216+ titleTemplate ?: string
217+ /**
218+ * Variables used to substitute in the title and meta content.
219+ */
220+ templateParams ?: Record < string , Record < string , string | boolean | number > | string | boolean | number >
221+ title ?: string | ( { textContent : string } & ResolvedSchemaAugmentations [ 'title' ] )
222+ base ?: Partial < Merge < ResolvedSchemaAugmentations [ 'base' ] , _Base > > & DefinedValueOrEmptyObject < E [ 'base' ] >
223+ link ?: ( LinkBase & AsSerializable < 'link' > & HttpEventAttributes ) [ ]
224+ meta ?: ( _Meta & AsSerializable < 'meta' > ) [ ]
225+ style ?: ( _Style & AsSerializable < 'style' > ) [ ]
226+ script ?: ( ScriptBase & AsSerializable < 'script' > & HttpEventAttributes ) [ ]
227+ noscript ?: ( _Noscript & AsSerializable < 'noscript' > ) [ ]
228+ htmlAttrs ?: _HtmlAttributes & AsSerializable < 'htmlAttrs' >
229+ bodyAttrs ?: BaseBodyAttr & AsSerializable < 'bodyAttrs' > & BodyEvents
230+ }
231+
232+ export type Head = SerializableHead
233+ export type ResolvedHead = SerializableHead
209234
210235export type UseSeoMetaInput = MetaFlatInput & { title ?: Title , titleTemplate ?: TitleTemplate }
211- export type UseHeadInput < T extends MergeHead = MergeHead > = ResolvableHead < T >
236+ export type UseHeadInput < T extends MergeHead = MergeHead > = ResolvableHead < T > | SerializableHead < T >
212237
213238export { type BodyEvents , type DataKeys , type HttpEventAttributes , type LinkBase , type MetaFlatInput , type ScriptBase }
0 commit comments