@@ -52,13 +52,13 @@ export interface BodyAttr extends Omit<BaseBodyAttr, 'class' | 'style'> {
52
52
*
53
53
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/class
54
54
*/
55
- class ?: MaybeArray < string > | Record < string , boolean >
55
+ class ?: MaybeArray < ResolvableValue < Stringable > > | Record < string , ResolvableValue < boolean > >
56
56
/**
57
57
* The style attribute contains CSS styling declarations to be applied to the element.
58
58
*
59
59
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/style
60
60
*/
61
- style ?: MaybeArray < string > | Record < string , ResolvableValue < string > >
61
+ style ?: MaybeArray < ResolvableValue < Stringable > > | Record < string , ResolvableValue < Stringable > >
62
62
}
63
63
64
64
export interface HtmlAttr extends Omit < _HtmlAttributes , 'class' | 'style' > {
@@ -67,13 +67,13 @@ export interface HtmlAttr extends Omit<_HtmlAttributes, 'class' | 'style'> {
67
67
*
68
68
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/class
69
69
*/
70
- class ?: MaybeArray < string > | Record < string , boolean >
70
+ class ?: MaybeArray < ResolvableValue < Stringable > > | Record < string , ResolvableValue < boolean > >
71
71
/**
72
72
* The style attribute contains CSS styling declarations to be applied to the element.
73
73
*
74
74
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/style
75
75
*/
76
- style ?: MaybeArray < string > | Record < string , ResolvableValue < string > >
76
+ style ?: MaybeArray < ResolvableValue < Stringable > > | Record < string , ResolvableValue < Stringable > >
77
77
}
78
78
79
79
export interface BaseMeta extends Omit < _Meta , 'content' > {
@@ -193,7 +193,7 @@ export interface ResolvableHead<E extends MergeHead = SchemaAugmentations> exten
193
193
bodyAttrs ?: ResolvableValue < BodyAttributes < E [ 'bodyAttrs' ] > >
194
194
}
195
195
196
- export interface ResolvedHead < E extends MergeHead = ResolvedSchemaAugmentations > extends HeadUtils {
196
+ export interface NormalizedHead < E extends MergeHead = ResolvedSchemaAugmentations > extends HeadUtils {
197
197
title ?: ResolvedTitle
198
198
base ?: ResolvedBase < E [ 'base' ] >
199
199
link ?: ResolvedLink < E [ 'link' ] > [ ]
@@ -205,9 +205,34 @@ export interface ResolvedHead<E extends MergeHead = ResolvedSchemaAugmentations>
205
205
bodyAttrs ?: ResolvedBodyAttributes < E [ 'bodyAttrs' ] >
206
206
}
207
207
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
209
234
210
235
export 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 >
212
237
213
238
export { type BodyEvents , type DataKeys , type HttpEventAttributes , type LinkBase , type MetaFlatInput , type ScriptBase }
0 commit comments