ubean 0.1.13 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2480 @@
1
+ import { CSSProperties, ComputedRef, Plugin, Ref } from "vue";
2
+ export * from "@ubean/client";
3
+ //#region ../../node_modules/.pnpm/hookable@6.1.1/node_modules/hookable/dist/index.d.mts
4
+ type HookCallback = (...arguments_: any) => Promise<void> | void;
5
+ type HookKeys<T> = keyof T & string;
6
+ type InferCallback<HT, HN extends keyof HT> = HT[HN] extends HookCallback ? HT[HN] : never;
7
+ declare class HookableCore<HooksT extends Record<string, any> = Record<string, HookCallback>, HookNameT extends HookKeys<HooksT> = HookKeys<HooksT>> {
8
+ protected _hooks: {
9
+ [key: string]: HookCallback[] | undefined;
10
+ };
11
+ constructor();
12
+ hook<NameT extends HookNameT>(name: NameT, fn: InferCallback<HooksT, NameT>): () => void;
13
+ removeHook<NameT extends HookNameT>(name: NameT, function_: InferCallback<HooksT, NameT>): void;
14
+ callHook<NameT extends HookNameT>(name: NameT, ...args: Parameters<InferCallback<HooksT, NameT>>): Promise<any> | void;
15
+ }
16
+ type CreateTask = (name?: string) => {
17
+ run: (function_: () => Promise<any> | any) => Promise<any> | any;
18
+ };
19
+ declare global {
20
+ interface Console {
21
+ createTask?: CreateTask;
22
+ }
23
+ }
24
+ //#endregion
25
+ //#region ../../node_modules/.pnpm/unhead@3.3.2_@voidzero-dev+vite-plus-core@0.2.9_rollup@4.62.4/node_modules/unhead/dist/shared/unhead.DZFTh_Dn.d.ts
26
+ type Booleanable = boolean | 'false' | 'true' | '';
27
+ type Stringable = string | Booleanable | number;
28
+ type Falsy$1 = false | null | undefined;
29
+ type ResolvableValue$1<T> = T | Falsy$1 | (() => (T | Falsy$1));
30
+ type Prettify$1<T> = { [K in keyof T]: T[K]; } & {};
31
+ type _ResolvablePropertiesRaw$1<T> = { [K in keyof T as {} extends Pick<T, K> ? never : K]: ResolvableValue$1<T[K]>; } & { [K in keyof T as {} extends Pick<T, K> ? K : never]?: ResolvableValue$1<T[K]>; };
32
+ type ResolvableProperties$1<T> = Prettify$1<_ResolvablePropertiesRaw$1<T>>;
33
+ interface DataKeys {
34
+ [key: `data-${string}`]: Stringable;
35
+ }
36
+ interface BaseFields {
37
+ /**
38
+ * The base URL to be used throughout the document for relative URLs. Absolute and relative URLs are allowed.
39
+ *
40
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base#attr-href
41
+ */
42
+ href?: string;
43
+ /**
44
+ * A keyword or author-defined name of the default browsing context to show the results of navigation from `<a>`,
45
+ * `<area>`, or `<form>` elements without explicit target attributes.
46
+ *
47
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base#attr-target
48
+ */
49
+ target?: '_blank' | '_self' | '_parent' | '_top' | (string & Record<never, never>);
50
+ }
51
+ /**
52
+ * The `<base>` HTML element requires at least `href` or `target` to be valid.
53
+ *
54
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base
55
+ */
56
+ type Base$1 = (BaseFields & {
57
+ href: string;
58
+ }) | (BaseFields & {
59
+ target: '_blank' | '_self' | '_parent' | '_top' | (string & Record<never, never>);
60
+ });
61
+ interface GlobalAttributes {
62
+ /**
63
+ * Provides a hint for generating a keyboard shortcut for the current element. This attribute consists of a
64
+ * space-separated list of characters. The browser should use the first one that exists on the computer keyboard layout.
65
+ *
66
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/accesskey
67
+ */
68
+ accesskey?: string;
69
+ /**
70
+ * Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
71
+ *
72
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/autocapitalize
73
+ */
74
+ autocapitalize?: 'off' | 'none' | 'on' | 'sentences' | 'words' | 'characters';
75
+ /**
76
+ * Indicates that an element is to be focused on page load, or as soon as the `<dialog>` it is part of is displayed.
77
+ *
78
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/autofocus
79
+ */
80
+ autofocus?: Booleanable;
81
+ /**
82
+ * A space-separated list of the classes of the element. Classes allows CSS and JavaScript to select and access
83
+ * specific elements via the class selectors or functions like the method Document.getElementsByClassName().
84
+ *
85
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/class
86
+ */
87
+ class?: Stringable;
88
+ /**
89
+ * An enumerated attribute indicating if the element should be editable by the user.
90
+ * If so, the browser modifies its widget to allow editing.
91
+ *
92
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/contenteditable
93
+ */
94
+ contenteditable?: Booleanable;
95
+ /**
96
+ * An enumerated attribute indicating the directionality of the element's text.
97
+ *
98
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/dir
99
+ */
100
+ dir?: 'ltr' | 'rtl' | 'auto';
101
+ /**
102
+ * An enumerated attribute indicating whether the element can be dragged, using the Drag and Drop API.
103
+ *
104
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/draggable
105
+ */
106
+ draggable?: Booleanable;
107
+ /**
108
+ * Hints what action label (or icon) to present for the enter key on virtual keyboards.
109
+ *
110
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/enterkeyhint
111
+ */
112
+ enterkeyhint?: string;
113
+ /**
114
+ * Used to transitively export shadow parts from a nested shadow tree into a containing light tree.
115
+ *
116
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/exportparts
117
+ */
118
+ exportparts?: string;
119
+ /**
120
+ * A Boolean attribute indicates that the element is not yet, or is no longer, relevant.
121
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/hidden
122
+ */
123
+ hidden?: Booleanable;
124
+ /**
125
+ * The id global attribute defines a unique identifier (ID) which must be unique in the whole document.
126
+ *
127
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id
128
+ */
129
+ id?: string;
130
+ /**
131
+ * Provides a hint to browsers as to the type of virtual keyboard configuration to use when editing this element or its contents.
132
+ *
133
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/inputmode
134
+ */
135
+ inputmode?: 'none' | 'text' | 'decimal' | 'numeric' | 'tel' | 'search' | 'email' | 'url';
136
+ /**
137
+ * Allows you to specify that a standard HTML element should behave like a registered custom built-in element.
138
+ *
139
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/is
140
+ */
141
+ is?: string;
142
+ /**
143
+ * The unique, global identifier of an item.
144
+ *
145
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/itemid
146
+ */
147
+ itemid?: string;
148
+ /**
149
+ * Used to add properties to an item.
150
+ *
151
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/itemprop
152
+ */
153
+ itemprop?: string;
154
+ /**
155
+ * Properties that are not descendants of an element with the itemscope attribute can be associated with the item using an itemref.
156
+ *
157
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/itemref
158
+ */
159
+ itemref?: string;
160
+ /**
161
+ * itemscope (usually) works along with itemtype to specify that the HTML contained in a block is about a particular item.
162
+ *
163
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/itemscope
164
+ */
165
+ itemscope?: string;
166
+ /**
167
+ * Specifies the URL of the vocabulary that will be used to define itemprops (item properties) in the data structure.
168
+ *
169
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/itemtype
170
+ */
171
+ itemtype?: string;
172
+ /**
173
+ * Helps define the language of an element: the language that non-editable elements are in, or the language
174
+ * that editable elements should be written in by the user.
175
+ *
176
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/lang
177
+ */
178
+ lang?: 'en' | 'en-US' | 'en-GB' | 'de' | 'fr' | 'es' | 'it' | 'ja' | 'ko' | 'nl' | 'pl' | 'pt' | 'pt-BR' | 'ru' | 'zh' | 'zh-CN' | 'zh-TW' | 'ar' | 'hi' | 'id' | 'th' | 'tr' | 'uk' | 'vi' | (string & Record<never, never>);
179
+ /**
180
+ * A cryptographic nonce ("number used once") which can be used by Content Security Policy to determine whether or not
181
+ * a given fetch will be allowed to proceed.
182
+ *
183
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/nonce
184
+ */
185
+ nonce?: string;
186
+ /**
187
+ * A space-separated list of the part names of the element. Part names allows CSS to select and style specific elements
188
+ * in a shadow tree via the ::part pseudo-element.
189
+ *
190
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/part
191
+ */
192
+ part?: string;
193
+ /**
194
+ * Assigns a slot in a shadow DOM shadow tree to an element: An element with a slot attribute is assigned to the slot
195
+ * created by the `<slot>` element whose name attribute's value matches that slot attribute's value.
196
+ *
197
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/slot
198
+ */
199
+ slot?: string;
200
+ /**
201
+ * An enumerated attribute defines whether the element may be checked for spelling errors.
202
+ *
203
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/spellcheck
204
+ */
205
+ spellcheck?: Booleanable;
206
+ /**
207
+ * Contains CSS styling declarations to be applied to the element.
208
+ *
209
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/style
210
+ */
211
+ style?: string;
212
+ /**
213
+ * An integer attribute indicating if the element can take input focus (is focusable),
214
+ * if it should participate to sequential keyboard navigation, and if so, at what position.
215
+ *
216
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex
217
+ */
218
+ tabindex?: number;
219
+ /**
220
+ * Contains a text representing advisory information related to the element it belongs to.
221
+ *
222
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/title
223
+ */
224
+ title?: string;
225
+ /**
226
+ * An enumerated attribute that is used to specify whether an element's attribute values and the values of its
227
+ * Text node children are to be translated when the page is localized, or whether to leave them unchanged.
228
+ *
229
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/translate
230
+ */
231
+ translate?: 'yes' | 'no' | '';
232
+ }
233
+ interface BodyEvents {
234
+ /**
235
+ * Script to be run after the document is printed
236
+ */
237
+ onafterprint?: string;
238
+ /**
239
+ * Script to be run before the document is printed
240
+ */
241
+ onbeforeprint?: string;
242
+ /**
243
+ * Script to be run when the document is about to be unloaded
244
+ */
245
+ onbeforeunload?: string;
246
+ /**
247
+ * Script to be run when an error occurs
248
+ */
249
+ onerror?: string;
250
+ /**
251
+ * Script to be run when there has been changes to the anchor part of the a URL
252
+ */
253
+ onhashchange?: string;
254
+ /**
255
+ * Fires after the page is finished loading
256
+ */
257
+ onload?: string;
258
+ /**
259
+ * Script to be run when the message is triggered
260
+ */
261
+ onmessage?: string;
262
+ /**
263
+ * Script to be run when the browser starts to work offline
264
+ */
265
+ onoffline?: string;
266
+ /**
267
+ * Script to be run when the browser starts to work online
268
+ */
269
+ ononline?: string;
270
+ /**
271
+ * Script to be run when a user navigates away from a page
272
+ */
273
+ onpagehide?: string;
274
+ /**
275
+ * Script to be run when a user navigates to a page
276
+ */
277
+ onpageshow?: string;
278
+ /**
279
+ * Script to be run when the window's history changes
280
+ */
281
+ onpopstate?: string;
282
+ /**
283
+ * Fires when the browser window is resized
284
+ */
285
+ onresize?: string;
286
+ /**
287
+ * Script to be run when a Web Storage area is updated
288
+ */
289
+ onstorage?: string;
290
+ /**
291
+ * Fires once a page has unloaded (or the browser window has been closed)
292
+ */
293
+ onunload?: string;
294
+ }
295
+ interface BodyAttributesWithoutEvents extends Pick<GlobalAttributes, 'class' | 'style' | 'id' | 'dir' | 'lang' | 'translate'> {}
296
+ interface HtmlAttributes$1 extends Pick<GlobalAttributes, 'lang' | 'dir' | 'translate' | 'class' | 'style' | 'id'> {
297
+ /**
298
+ * Open-graph protocol prefix.
299
+ *
300
+ * @see https://ogp.me/
301
+ */
302
+ prefix?: 'og: https://ogp.me/ns#' | (string & Record<never, never>);
303
+ /**
304
+ * XML namespace
305
+ *
306
+ * @see https://developer.mozilla.org/en-US/docs/Web/SVG/Namespaces_Crash_Course
307
+ */
308
+ xmlns?: string;
309
+ /**
310
+ * Custom XML namespace
311
+ *
312
+ * @See https://developer.mozilla.org/en-US/docs/Web/SVG/Namespaces_Crash_Course
313
+ */
314
+ [key: `xmlns:${'og' | string}`]: string;
315
+ }
316
+ interface HttpEventAttributes {
317
+ /**
318
+ * Script to be run on abort
319
+ */
320
+ onabort?: string;
321
+ /**
322
+ * Script to be run when an error occurs when the file is being loaded
323
+ */
324
+ onerror?: string;
325
+ /**
326
+ * Script to be run when the file is loaded
327
+ */
328
+ onload?: string;
329
+ /**
330
+ * The progress event is fired periodically when a request receives more data.
331
+ */
332
+ onprogress?: string;
333
+ /**
334
+ * Script to be run just as the file begins to load before anything is actually loaded
335
+ */
336
+ onloadstart?: string;
337
+ }
338
+ type ReferrerPolicy = '' | 'no-referrer' | 'no-referrer-when-downgrade' | 'origin' | 'origin-when-cross-origin' | 'same-origin' | 'strict-origin' | 'strict-origin-when-cross-origin' | 'unsafe-url';
339
+ /**
340
+ * Represents the possible blocking tokens for an element.
341
+ */
342
+ type BlockingToken = 'render';
343
+ /**
344
+ * Represents the blocking attribute for an element.
345
+ * The blocking attribute must have a value that is an unordered set of unique space-separated tokens,
346
+ * each of which are possible blocking tokens.
347
+ */
348
+ interface Blocking {
349
+ /**
350
+ * The blocking attribute indicates that certain operations should be blocked on the fetching of an external resource.
351
+ * The value is an unordered set of unique space-separated tokens, each of which are possible blocking tokens.
352
+ *
353
+ * @example
354
+ * blocking: "render"
355
+ */
356
+ blocking?: BlockingToken | string;
357
+ }
358
+ /**
359
+ * Events that fire on link elements (load/error)
360
+ */
361
+ type LinkHttpEvents = Pick<HttpEventAttributes, 'onload' | 'onerror'>;
362
+ /**
363
+ * Base properties shared by all link types
364
+ */
365
+ interface LinkBase extends Pick<GlobalAttributes, 'nonce' | 'id'>, Blocking, DataKeys {
366
+ /**
367
+ * Provides a hint of the relative priority to use when fetching a preloaded resource.
368
+ *
369
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#attr-fetchpriority
370
+ */
371
+ fetchpriority?: 'high' | 'low' | 'auto';
372
+ /**
373
+ * A string indicating which referrer to use when fetching the resource.
374
+ *
375
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#attr-referrerpolicy
376
+ */
377
+ referrerpolicy?: ReferrerPolicy;
378
+ }
379
+ /**
380
+ * Stylesheet-specific link (fires events)
381
+ */
382
+ interface StylesheetLink extends LinkBase, LinkHttpEvents {
383
+ rel: 'stylesheet';
384
+ /**
385
+ * This attribute specifies the URL of the linked resource.
386
+ *
387
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#attr-href
388
+ */
389
+ href: string;
390
+ /**
391
+ * This attribute specifies the media that the linked resource applies to.
392
+ *
393
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#attr-media
394
+ */
395
+ media?: string;
396
+ /**
397
+ * Contains inline metadata — a base64-encoded cryptographic hash of the resource.
398
+ *
399
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#attr-integrity
400
+ */
401
+ integrity?: string;
402
+ /**
403
+ * This enumerated attribute indicates whether CORS must be used when fetching the resource.
404
+ *
405
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#attr-crossorigin
406
+ */
407
+ crossorigin?: '' | 'anonymous' | 'use-credentials';
408
+ /**
409
+ * The title attribute has special semantics on the `<link>` element.
410
+ * When used on a `<link rel="stylesheet">` it defines a default or an alternate stylesheet.
411
+ *
412
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#attr-title
413
+ */
414
+ title?: string;
415
+ /**
416
+ * This attribute is used to define the type of the content linked to.
417
+ * It can be omitted; `text/css` is assumed.
418
+ *
419
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#attr-type
420
+ */
421
+ type?: 'text/css' | (string & Record<never, never>);
422
+ /**
423
+ * Whether the stylesheet is disabled.
424
+ */
425
+ disabled?: boolean;
426
+ }
427
+ /**
428
+ * Base for preload links (fires events)
429
+ */
430
+ interface PreloadLinkBase extends LinkBase, LinkHttpEvents {
431
+ rel: 'preload';
432
+ /**
433
+ * This attribute specifies the URL of the linked resource.
434
+ *
435
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#attr-href
436
+ */
437
+ href: string;
438
+ /**
439
+ * This enumerated attribute indicates whether CORS must be used when fetching the resource.
440
+ *
441
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#attr-crossorigin
442
+ */
443
+ crossorigin?: '' | 'anonymous' | 'use-credentials';
444
+ /**
445
+ * Contains inline metadata — a base64-encoded cryptographic hash of the resource.
446
+ *
447
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#attr-integrity
448
+ */
449
+ integrity?: string;
450
+ /**
451
+ * This attribute specifies the media that the linked resource applies to.
452
+ *
453
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#attr-media
454
+ */
455
+ media?: string;
456
+ }
457
+ /**
458
+ * Base fields for image preload links.
459
+ */
460
+ interface PreloadImageLinkFields extends Omit<PreloadLinkBase, 'href'> {
461
+ as: 'image';
462
+ /**
463
+ * This attribute specifies the URL of the linked resource.
464
+ * Optional for image preloads when using imagesrcset instead.
465
+ *
466
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#attr-href
467
+ */
468
+ href?: string;
469
+ type?: 'image/webp' | 'image/avif' | 'image/png' | 'image/jpeg' | 'image/gif' | 'image/svg+xml' | (string & Record<never, never>);
470
+ /**
471
+ * For rel="preload" and as="image" only, the imagesizes attribute indicates
472
+ * to preload the appropriate resource used by an img element.
473
+ *
474
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#attr-imagesizes
475
+ */
476
+ imagesizes?: string;
477
+ /**
478
+ * For rel="preload" and as="image" only, the imagesrcset attribute indicates
479
+ * to preload the appropriate resource used by an img element.
480
+ *
481
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#attr-imagesrcset
482
+ */
483
+ imagesrcset?: string;
484
+ }
485
+ /**
486
+ * Preload: image (has imagesrcset/imagesizes).
487
+ * Requires at least one of `href` or `imagesrcset`.
488
+ */
489
+ type PreloadImageLink = (PreloadImageLinkFields & {
490
+ href: string;
491
+ }) | (PreloadImageLinkFields & {
492
+ imagesrcset: string;
493
+ });
494
+ /**
495
+ * Preload: font
496
+ */
497
+ interface PreloadFontLink extends PreloadLinkBase {
498
+ as: 'font';
499
+ type?: 'font/woff2' | 'font/woff' | 'font/ttf' | 'font/otf' | (string & Record<never, never>);
500
+ /**
501
+ * For fonts, crossorigin is required for CORS.
502
+ *
503
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#attr-crossorigin
504
+ */
505
+ crossorigin: '' | 'anonymous' | 'use-credentials';
506
+ }
507
+ /**
508
+ * Preload: script
509
+ */
510
+ interface PreloadScriptLink extends PreloadLinkBase {
511
+ as: 'script';
512
+ type?: 'text/javascript' | 'module' | (string & Record<never, never>);
513
+ }
514
+ /**
515
+ * Preload: style
516
+ */
517
+ interface PreloadStyleLink extends PreloadLinkBase {
518
+ as: 'style';
519
+ type?: 'text/css' | (string & Record<never, never>);
520
+ }
521
+ /**
522
+ * Preload: other types
523
+ */
524
+ interface PreloadOtherLink extends PreloadLinkBase {
525
+ as: 'audio' | 'document' | 'embed' | 'fetch' | 'object' | 'track' | 'video' | 'worker';
526
+ type?: string;
527
+ }
528
+ /**
529
+ * Combined preload union
530
+ */
531
+ type PreloadLink = PreloadImageLink | PreloadFontLink | PreloadScriptLink | PreloadStyleLink | PreloadOtherLink;
532
+ /**
533
+ * Modulepreload-specific link (fires events)
534
+ */
535
+ interface ModulepreloadLink extends LinkBase, LinkHttpEvents {
536
+ rel: 'modulepreload';
537
+ /**
538
+ * This attribute specifies the URL of the linked resource.
539
+ *
540
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#attr-href
541
+ */
542
+ href: string;
543
+ /**
544
+ * Contains inline metadata — a base64-encoded cryptographic hash of the resource.
545
+ *
546
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#attr-integrity
547
+ */
548
+ integrity?: string;
549
+ /**
550
+ * This enumerated attribute indicates whether CORS must be used when fetching the resource.
551
+ *
552
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#attr-crossorigin
553
+ */
554
+ crossorigin?: '' | 'anonymous' | 'use-credentials';
555
+ }
556
+ /**
557
+ * Prefetch-specific link
558
+ */
559
+ interface PrefetchLink extends LinkBase {
560
+ rel: 'prefetch';
561
+ /**
562
+ * This attribute specifies the URL of the linked resource.
563
+ *
564
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#attr-href
565
+ */
566
+ href: string;
567
+ /**
568
+ * This attribute is used when rel="prefetch" to specify the type of content being loaded.
569
+ *
570
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#attr-as
571
+ */
572
+ as?: 'audio' | 'document' | 'embed' | 'fetch' | 'font' | 'image' | 'object' | 'script' | 'style' | 'track' | 'video' | 'worker';
573
+ /**
574
+ * This enumerated attribute indicates whether CORS must be used when fetching the resource.
575
+ *
576
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#attr-crossorigin
577
+ */
578
+ crossorigin?: '' | 'anonymous' | 'use-credentials';
579
+ }
580
+ /**
581
+ * Icon links may be scoped to a media query, most commonly to serve
582
+ * separate light and dark variants.
583
+ */
584
+ interface IconLinkBase extends LinkBase {
585
+ /**
586
+ * This attribute specifies the media that the linked resource applies to,
587
+ * for example `(prefers-color-scheme: dark)`.
588
+ *
589
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#attr-media
590
+ */
591
+ media?: string;
592
+ /**
593
+ * This enumerated attribute indicates whether CORS must be used when fetching the resource.
594
+ *
595
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#attr-crossorigin
596
+ */
597
+ crossorigin?: '' | 'anonymous' | 'use-credentials';
598
+ }
599
+ /**
600
+ * Favicon link.
601
+ *
602
+ * Prefer `rel: 'icon'` over `'shortcut icon'` — the `shortcut` keyword is non-standard
603
+ * and was only used by older versions of Internet Explorer.
604
+ */
605
+ interface FaviconLink extends IconLinkBase {
606
+ rel: 'icon' | 'shortcut icon';
607
+ /**
608
+ * This attribute specifies the URL of the linked resource.
609
+ *
610
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#attr-href
611
+ */
612
+ href: string;
613
+ /**
614
+ * This attribute defines the sizes of the icons for visual media contained in the resource.
615
+ *
616
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#attr-sizes
617
+ */
618
+ sizes?: 'any' | '16x16' | '32x32' | '48x48' | '64x64' | '96x96' | '128x128' | '192x192' | '512x512' | (string & Record<never, never>);
619
+ /**
620
+ * This attribute is used to define the type of the content linked to.
621
+ *
622
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#attr-type
623
+ */
624
+ type?: 'image/png' | 'image/svg+xml' | 'image/x-icon' | 'image/gif' | 'image/webp' | (string & Record<never, never>);
625
+ }
626
+ /**
627
+ * Apple touch icon link
628
+ */
629
+ interface AppleTouchIconLink extends IconLinkBase {
630
+ rel: 'apple-touch-icon';
631
+ /**
632
+ * This attribute specifies the URL of the linked resource.
633
+ *
634
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#attr-href
635
+ */
636
+ href: string;
637
+ /**
638
+ * This attribute defines the sizes of the icons for visual media contained in the resource.
639
+ *
640
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#attr-sizes
641
+ */
642
+ sizes?: '180x180' | '152x152' | '120x120' | '76x76' | (string & Record<never, never>);
643
+ /**
644
+ * This attribute is used to define the type of the content linked to.
645
+ *
646
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#attr-type
647
+ */
648
+ type?: 'image/png' | (string & Record<never, never>);
649
+ }
650
+ /**
651
+ * Mask icon link (Safari pinned tab). Requires `color`.
652
+ *
653
+ * @see https://developer.apple.com/library/archive/documentation/AppleApplications/Reference/SafariWebContent/pinnedTabs/pinnedTabs.html
654
+ */
655
+ interface MaskIconLink extends IconLinkBase {
656
+ rel: 'mask-icon';
657
+ /**
658
+ * This attribute specifies the URL of the linked resource.
659
+ *
660
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#attr-href
661
+ */
662
+ href: string;
663
+ /**
664
+ * The color for the mask icon. Required per spec.
665
+ *
666
+ * @see https://html.spec.whatwg.org/multipage/semantics.html#attr-link-color
667
+ */
668
+ color: string;
669
+ }
670
+ /**
671
+ * Manifest link
672
+ */
673
+ interface ManifestLink extends LinkBase {
674
+ rel: 'manifest';
675
+ /**
676
+ * This attribute specifies the URL of the linked resource.
677
+ *
678
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#attr-href
679
+ */
680
+ href: string;
681
+ /**
682
+ * This attribute is used to define the type of the content linked to.
683
+ *
684
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#attr-type
685
+ */
686
+ type?: 'application/manifest+json' | (string & Record<never, never>);
687
+ /**
688
+ * This enumerated attribute indicates whether CORS must be used when fetching the resource.
689
+ *
690
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#attr-crossorigin
691
+ */
692
+ crossorigin?: '' | 'anonymous' | 'use-credentials';
693
+ }
694
+ /**
695
+ * Canonical link
696
+ */
697
+ interface CanonicalLink extends LinkBase {
698
+ rel: 'canonical';
699
+ /**
700
+ * This attribute specifies the URL of the linked resource.
701
+ *
702
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#attr-href
703
+ */
704
+ href: string;
705
+ }
706
+ /**
707
+ * DNS-prefetch link (no events, minimal props)
708
+ */
709
+ interface DnsPrefetchLink extends LinkBase {
710
+ rel: 'dns-prefetch';
711
+ /**
712
+ * This attribute specifies the URL of the linked resource.
713
+ *
714
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#attr-href
715
+ */
716
+ href: string;
717
+ }
718
+ /**
719
+ * Preconnect link (no events)
720
+ */
721
+ interface PreconnectLink extends LinkBase {
722
+ rel: 'preconnect';
723
+ /**
724
+ * This attribute specifies the URL of the linked resource.
725
+ *
726
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#attr-href
727
+ */
728
+ href: string;
729
+ /**
730
+ * This enumerated attribute indicates whether CORS must be used when fetching the resource.
731
+ *
732
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#attr-crossorigin
733
+ */
734
+ crossorigin?: '' | 'anonymous' | 'use-credentials';
735
+ }
736
+ /**
737
+ * Prerender link
738
+ */
739
+ interface PrerenderLink extends LinkBase {
740
+ rel: 'prerender';
741
+ /**
742
+ * This attribute specifies the URL of the linked resource.
743
+ *
744
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#attr-href
745
+ */
746
+ href: string;
747
+ }
748
+ /**
749
+ * Alternate language link (hreflang translations)
750
+ */
751
+ interface AlternateLanguageLink extends LinkBase {
752
+ rel: 'alternate';
753
+ /**
754
+ * This attribute specifies the URL of the linked resource.
755
+ *
756
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#attr-href
757
+ */
758
+ href: string;
759
+ /**
760
+ * This attribute indicates the language of the linked resource.
761
+ *
762
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#attr-hreflang
763
+ */
764
+ hreflang: 'x-default' | 'en' | 'en-US' | 'en-GB' | 'de' | 'fr' | 'es' | 'it' | 'ja' | 'ko' | 'nl' | 'pl' | 'pt' | 'pt-BR' | 'ru' | 'zh' | 'zh-CN' | 'zh-TW' | 'ar' | 'hi' | 'id' | 'th' | 'tr' | 'uk' | 'vi' | (string & Record<never, never>);
765
+ /**
766
+ * The title attribute defines the title of the link.
767
+ *
768
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#attr-title
769
+ */
770
+ title?: string;
771
+ /**
772
+ * This attribute is used to define the type of the content linked to.
773
+ *
774
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#attr-type
775
+ */
776
+ type?: string;
777
+ /**
778
+ * This attribute specifies the media that the linked resource applies to.
779
+ *
780
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#attr-media
781
+ */
782
+ media?: string;
783
+ }
784
+ /**
785
+ * Alternate feed link (RSS, Atom, JSON Feed)
786
+ */
787
+ interface AlternateFeedLink extends LinkBase {
788
+ rel: 'alternate';
789
+ /**
790
+ * This attribute specifies the URL of the linked resource.
791
+ *
792
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#attr-href
793
+ */
794
+ href: string;
795
+ /**
796
+ * This attribute is used to define the type of the content linked to.
797
+ *
798
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#attr-type
799
+ */
800
+ type: 'application/rss+xml' | 'application/atom+xml' | 'application/json' | (string & Record<never, never>);
801
+ /**
802
+ * The title attribute defines the title of the link.
803
+ *
804
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#attr-title
805
+ */
806
+ title?: string;
807
+ /**
808
+ * This attribute indicates the language of the linked resource.
809
+ *
810
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#attr-hreflang
811
+ */
812
+ hreflang?: 'x-default' | 'en' | 'en-US' | 'en-GB' | 'de' | 'fr' | 'es' | 'it' | 'ja' | 'ko' | 'nl' | 'pl' | 'pt' | 'pt-BR' | 'ru' | 'zh' | 'zh-CN' | 'zh-TW' | 'ar' | 'hi' | 'id' | 'th' | 'tr' | 'uk' | 'vi' | (string & Record<never, never>);
813
+ }
814
+ /**
815
+ * Alternate media link (responsive/device-specific)
816
+ */
817
+ interface AlternateMediaLink extends LinkBase {
818
+ rel: 'alternate';
819
+ /**
820
+ * This attribute specifies the URL of the linked resource.
821
+ *
822
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#attr-href
823
+ */
824
+ href: string;
825
+ /**
826
+ * This attribute specifies the media that the linked resource applies to.
827
+ *
828
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#attr-media
829
+ */
830
+ media: string;
831
+ /**
832
+ * The title attribute defines the title of the link.
833
+ *
834
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#attr-title
835
+ */
836
+ title?: string;
837
+ /**
838
+ * This attribute is used to define the type of the content linked to.
839
+ *
840
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#attr-type
841
+ */
842
+ type?: string;
843
+ }
844
+ /**
845
+ * Bare alternate link without hreflang, type, or media.
846
+ * Valid HTML, typically used as a fallback or generic alternate.
847
+ */
848
+ interface BareAlternateLink extends LinkBase {
849
+ rel: 'alternate';
850
+ /**
851
+ * This attribute specifies the URL of the linked resource.
852
+ *
853
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#attr-href
854
+ */
855
+ href: string;
856
+ }
857
+ /**
858
+ * Author link
859
+ */
860
+ interface AuthorLink extends LinkBase {
861
+ rel: 'author';
862
+ href: string;
863
+ }
864
+ /**
865
+ * License link
866
+ */
867
+ interface LicenseLink extends LinkBase {
868
+ rel: 'license';
869
+ href: string;
870
+ }
871
+ /**
872
+ * Help link
873
+ */
874
+ interface HelpLink extends LinkBase {
875
+ rel: 'help';
876
+ href: string;
877
+ }
878
+ /**
879
+ * Search link
880
+ */
881
+ interface SearchLink extends LinkBase {
882
+ rel: 'search';
883
+ href: string;
884
+ type?: 'application/opensearchdescription+xml' | (string & Record<never, never>);
885
+ title?: string;
886
+ }
887
+ /**
888
+ * Prev/Next navigation links
889
+ */
890
+ interface PrevLink extends LinkBase {
891
+ rel: 'prev';
892
+ href: string;
893
+ }
894
+ interface NextLink extends LinkBase {
895
+ rel: 'next';
896
+ href: string;
897
+ }
898
+ /**
899
+ * Pingback link
900
+ */
901
+ interface PingbackLink extends LinkBase {
902
+ rel: 'pingback';
903
+ href: string;
904
+ }
905
+ /**
906
+ * Me link. Identifies the resource as representing the current user
907
+ * (IndieWeb / rel-me verification, Mastodon profile verification).
908
+ *
909
+ * @see https://html.spec.whatwg.org/multipage/links.html#link-type-me
910
+ */
911
+ interface MeLink extends LinkBase {
912
+ rel: 'me';
913
+ href: string;
914
+ }
915
+ /**
916
+ * Privacy policy link.
917
+ *
918
+ * @see https://html.spec.whatwg.org/multipage/links.html#link-type-privacy-policy
919
+ */
920
+ interface PrivacyPolicyLink extends LinkBase {
921
+ rel: 'privacy-policy';
922
+ href: string;
923
+ }
924
+ /**
925
+ * Terms of service link.
926
+ *
927
+ * @see https://html.spec.whatwg.org/multipage/links.html#link-type-terms-of-service
928
+ */
929
+ interface TermsOfServiceLink extends LinkBase {
930
+ rel: 'terms-of-service';
931
+ href: string;
932
+ }
933
+ /**
934
+ * Expect link. Blocks rendering until a named element is present and ready.
935
+ *
936
+ * @see https://html.spec.whatwg.org/multipage/links.html#link-type-expect
937
+ */
938
+ interface ExpectLink extends LinkBase {
939
+ rel: 'expect';
940
+ href: string;
941
+ blocking?: 'render';
942
+ }
943
+ /**
944
+ * Webmention endpoint link (IndieWeb).
945
+ *
946
+ * @see https://www.w3.org/TR/webmention/
947
+ */
948
+ interface WebmentionLink extends LinkBase {
949
+ rel: 'webmention';
950
+ href: string;
951
+ }
952
+ /**
953
+ * Compression dictionary link (experimental).
954
+ *
955
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/link#compression-dictionary
956
+ */
957
+ interface CompressionDictionaryLink extends LinkBase {
958
+ rel: 'compression-dictionary';
959
+ href: string;
960
+ }
961
+ /**
962
+ * Sitemap link. Points to a sitemap for the site.
963
+ *
964
+ * @see https://www.iana.org/assignments/link-relations/link-relations.xhtml
965
+ */
966
+ interface SitemapLink extends LinkBase {
967
+ rel: 'sitemap';
968
+ href: string;
969
+ type?: 'application/xml' | (string & Record<never, never>);
970
+ title?: string;
971
+ }
972
+ /**
973
+ * Apple touch startup image link. Specifies a splash screen image for iOS
974
+ * when a web app is launched from the home screen.
975
+ *
976
+ * @see https://developer.apple.com/library/archive/documentation/AppleApplications/Reference/SafariWebContent/ConfiguringWebApplications/ConfiguringWebApplications.html
977
+ */
978
+ interface AppleTouchStartupImageLink extends LinkBase {
979
+ rel: 'apple-touch-startup-image';
980
+ href: string;
981
+ media?: string;
982
+ }
983
+ /**
984
+ * AMP HTML link. Points to the AMP version of the current document.
985
+ *
986
+ * @see https://amp.dev/documentation/guides-and-tutorials/start/create/prepare_for_discovery/
987
+ */
988
+ interface AmpHtmlLink extends LinkBase {
989
+ rel: 'amphtml';
990
+ href: string;
991
+ }
992
+ /**
993
+ * WebSub hub link. Points to a WebSub hub for real-time content distribution.
994
+ *
995
+ * @see https://www.w3.org/TR/websub/
996
+ */
997
+ interface HubLink extends LinkBase {
998
+ rel: 'hub';
999
+ href: string;
1000
+ }
1001
+ /**
1002
+ * Alternate stylesheet link. User-selectable alternate stylesheet.
1003
+ * Requires a `title` to appear in the browser's stylesheet picker.
1004
+ *
1005
+ * @see https://html.spec.whatwg.org/multipage/semantics.html#rel-alternate-stylesheet
1006
+ */
1007
+ interface AlternateStylesheetLink extends LinkBase, LinkHttpEvents {
1008
+ rel: 'alternate stylesheet';
1009
+ href: string;
1010
+ title: string;
1011
+ media?: string;
1012
+ crossorigin?: '' | 'anonymous' | 'use-credentials';
1013
+ integrity?: string;
1014
+ type?: 'text/css' | (string & Record<never, never>);
1015
+ disabled?: boolean;
1016
+ }
1017
+ /**
1018
+ * Discriminated union of all link types.
1019
+ *
1020
+ * Each named `rel` value maps to a specific interface that enforces per-`rel` required
1021
+ * attributes. For example, `rel="preload"` requires the `as` attribute (see {@link PreloadLink}),
1022
+ * and `rel="mask-icon"` requires `color` (see {@link MaskIconLink}).
1023
+ *
1024
+ * For non-standard `rel` values not covered by {@link KnownLinkRel}, use {@link defineLink}:
1025
+ * ```ts
1026
+ * import { defineLink } from 'unhead'
1027
+ * useHead({ link: [defineLink({ rel: 'openid2.provider', href: 'https://...' })] })
1028
+ * ```
1029
+ *
1030
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel
1031
+ */
1032
+ type Link = StylesheetLink | AlternateStylesheetLink | PreloadLink | ModulepreloadLink | PrefetchLink | FaviconLink | AppleTouchIconLink | MaskIconLink | ManifestLink | CanonicalLink | DnsPrefetchLink | PreconnectLink | PrerenderLink | AlternateLanguageLink | AlternateFeedLink | AlternateMediaLink | BareAlternateLink | AuthorLink | LicenseLink | HelpLink | SearchLink | PrevLink | NextLink | PingbackLink | MeLink | WebmentionLink | PrivacyPolicyLink | TermsOfServiceLink | ExpectLink | CompressionDictionaryLink | SitemapLink | AppleTouchStartupImageLink | AmpHtmlLink | HubLink;
1033
+ /**
1034
+ * Known meta name values
1035
+ */
1036
+ type MetaNames = 'apple-itunes-app' | 'apple-mobile-web-app-capable' | 'apple-mobile-web-app-status-bar-style' | 'apple-mobile-web-app-title' | 'application-name' | 'author' | 'color-scheme' | 'creator' | 'description' | 'fb:app_id' | 'fediverse:creator' | 'format-detection' | 'generator' | 'google-site-verification' | 'google' | 'googlebot' | 'keywords' | 'mobile-web-app-capable' | 'msapplication-Config' | 'msapplication-TileColor' | 'msapplication-TileImage' | 'publisher' | 'rating' | 'referrer' | 'robots' | 'theme-color' | 'twitter:app:id:googleplay' | 'twitter:app:id:ipad' | 'twitter:app:id:iphone' | 'twitter:app:name:googleplay' | 'twitter:app:name:ipad' | 'twitter:app:name:iphone' | 'twitter:app:url:googleplay' | 'twitter:app:url:ipad' | 'twitter:app:url:iphone' | 'twitter:card' | 'twitter:creator:id' | 'twitter:creator' | 'twitter:data:1' | 'twitter:data:2' | 'twitter:description' | 'twitter:image:alt' | 'twitter:image' | 'twitter:label:1' | 'twitter:label:2' | 'twitter:player:height' | 'twitter:player:stream' | 'twitter:player:width' | 'twitter:player' | 'twitter:site:id' | 'twitter:site' | 'twitter:title' | 'viewport';
1037
+ /**
1038
+ * Known meta property values (OpenGraph, etc.)
1039
+ */
1040
+ type MetaProperties = 'article:author' | 'article:expiration_time' | 'article:modified_time' | 'article:published_time' | 'article:section' | 'article:tag' | 'book:author' | 'book:isbn' | 'book:release_date' | 'book:tag' | 'fb:app:id' | 'og:audio:secure_url' | 'og:audio:type' | 'og:audio:url' | 'og:description' | 'og:determiner' | 'og:image:height' | 'og:image:secure_url' | 'og:image:type' | 'og:image:url' | 'og:image:width' | 'og:image' | 'og:locale:alternate' | 'og:locale' | 'og:site:name' | 'og:title' | 'og:type' | 'og:url' | 'og:video:height' | 'og:video:secure_url' | 'og:video:type' | 'og:video:url' | 'og:video:width' | 'og:video' | 'payment:amount' | 'payment:currency' | 'payment:description' | 'payment:expires_at' | 'payment:id' | 'payment:status' | 'payment:success_url' | 'profile:first_name' | 'profile:gender' | 'profile:last_name' | 'profile:username';
1041
+ /**
1042
+ * Base properties shared by all meta types
1043
+ */
1044
+ interface MetaBase extends Pick<GlobalAttributes, 'id'>, DataKeys {
1045
+ /**
1046
+ * A valid media query list that can be included to set the media the metadata applies to.
1047
+ *
1048
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta/name/theme-color
1049
+ */
1050
+ media?: '(prefers-color-scheme: light)' | '(prefers-color-scheme: dark)' | (string & Record<never, never>);
1051
+ }
1052
+ /**
1053
+ * Name-based meta (description, viewport, robots, etc.)
1054
+ * Mutual exclusion: no property, no http-equiv, no charset
1055
+ */
1056
+ interface NameMeta extends MetaBase {
1057
+ /**
1058
+ * The name and content attributes can be used together to provide document metadata
1059
+ * in terms of name-value pairs.
1060
+ *
1061
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta#attr-name
1062
+ */
1063
+ 'name': MetaNames | (string & Record<never, never>);
1064
+ /**
1065
+ * This attribute contains the value for the name attribute.
1066
+ *
1067
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta#attr-content
1068
+ */
1069
+ 'content': string | number;
1070
+ 'property'?: never;
1071
+ 'http-equiv'?: never;
1072
+ 'charset'?: never;
1073
+ }
1074
+ /**
1075
+ * Property-based meta (OpenGraph, etc.)
1076
+ * Mutual exclusion: no name, no http-equiv, no charset
1077
+ */
1078
+ interface PropertyMeta extends MetaBase {
1079
+ /**
1080
+ * The property attribute is used to define a property associated with the content attribute.
1081
+ * Mainly used for og and twitter meta tags.
1082
+ */
1083
+ 'property': MetaProperties | (string & Record<never, never>);
1084
+ /**
1085
+ * This attribute contains the value for the property attribute.
1086
+ *
1087
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta#attr-content
1088
+ */
1089
+ 'content': string | number;
1090
+ 'name'?: never;
1091
+ 'http-equiv'?: never;
1092
+ 'charset'?: never;
1093
+ }
1094
+ /**
1095
+ * HTTP-equiv meta
1096
+ * Mutual exclusion: no name, no property, no charset
1097
+ */
1098
+ interface HttpEquivMeta extends MetaBase {
1099
+ /**
1100
+ * Defines a pragma directive. The attribute is named http-equiv(alent) because all
1101
+ * the allowed values are names of particular HTTP headers.
1102
+ *
1103
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta#attr-http-equiv
1104
+ */
1105
+ 'http-equiv': 'content-security-policy' | 'content-type' | 'default-style' | 'x-ua-compatible' | 'refresh' | 'accept-ch' | 'origin-trial' | (string & Record<never, never>);
1106
+ /**
1107
+ * This attribute contains the value for the http-equiv attribute.
1108
+ *
1109
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta#attr-content
1110
+ */
1111
+ 'content': string | number;
1112
+ 'name'?: never;
1113
+ 'property'?: never;
1114
+ 'charset'?: never;
1115
+ }
1116
+ /**
1117
+ * Charset meta (standalone, no content)
1118
+ * Mutual exclusion: no name, no property, no http-equiv, no content
1119
+ */
1120
+ interface CharsetMeta extends MetaBase {
1121
+ /**
1122
+ * This attribute declares the document's character encoding.
1123
+ * If the attribute is present, its value must be an ASCII case-insensitive match for the string "utf-8".
1124
+ *
1125
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta#attr-charset
1126
+ */
1127
+ 'charset': 'utf-8' | (string & Record<never, never>);
1128
+ 'name'?: never;
1129
+ 'property'?: never;
1130
+ 'http-equiv'?: never;
1131
+ 'content'?: never;
1132
+ }
1133
+ /**
1134
+ * Discriminated union of all meta types.
1135
+ * Provides mutual exclusion of name/property/http-equiv/charset.
1136
+ */
1137
+ type Meta = NameMeta | PropertyMeta | HttpEquivMeta | CharsetMeta;
1138
+ /**
1139
+ * Content for noscript elements - either textContent or innerHTML, not both
1140
+ */
1141
+ type NoscriptContent = {
1142
+ /**
1143
+ * Sets the textContent of an element. Safer for XSS.
1144
+ */
1145
+ textContent?: string;
1146
+ innerHTML?: never;
1147
+ } | {
1148
+ textContent?: never;
1149
+ /**
1150
+ * Text content of the tag.
1151
+ *
1152
+ * Warning: This is not safe for XSS. Do not use this with user input, use `textContent` instead.
1153
+ */
1154
+ innerHTML?: string;
1155
+ };
1156
+ type Noscript$1 = Pick<GlobalAttributes, 'id' | 'class' | 'style'> & NoscriptContent;
1157
+ /**
1158
+ * A JSON speculation rule set.
1159
+ *
1160
+ * @see https://html.spec.whatwg.org/multipage/speculative-loading.html#speculation-rules
1161
+ */
1162
+ interface SpeculationRules {
1163
+ /** Identifies speculative requests through the `Sec-Speculation-Tags` header. */
1164
+ tag?: string | null;
1165
+ prefetch?: readonly SpeculationRule[];
1166
+ prerender?: readonly SpeculationRule[];
1167
+ }
1168
+ type SpeculationRuleEagerness = 'immediate' | 'eager' | 'moderate' | 'conservative' | (string & Record<never, never>);
1169
+ type SpeculationRuleRequirement = 'anonymous-client-ip-when-cross-origin';
1170
+ interface SpeculationRuleBase {
1171
+ /** A hint about when the browser should consider the speculative load. */
1172
+ eagerness?: SpeculationRuleEagerness;
1173
+ /** The referrer policy for the speculative request. */
1174
+ referrer_policy?: ReferrerPolicy;
1175
+ /** Identifies this rule through the `Sec-Speculation-Tags` header. */
1176
+ tag?: string | null;
1177
+ /** Required browser capabilities for executing the rule. */
1178
+ requires?: readonly SpeculationRuleRequirement[];
1179
+ /** Expected `No-Vary-Search` response header value. */
1180
+ expects_no_vary_search?: string;
1181
+ /** The browsing context in which a prerendered page is expected to open. */
1182
+ target_hint?: '_blank' | '_self' | '_parent' | '_top' | (string & Record<never, never>);
1183
+ }
1184
+ /** An explicit list of URLs to speculate. */
1185
+ type SpeculationRuleList = SpeculationRuleBase & {
1186
+ source?: 'list';
1187
+ urls: readonly string[];
1188
+ where?: never;
1189
+ /** Selects the base URL used to resolve `urls`. */
1190
+ relative_to?: 'ruleset' | 'document';
1191
+ };
1192
+ /** A rule which selects links from the current document. */
1193
+ type SpeculationRuleDocument = SpeculationRuleBase & {
1194
+ urls?: never;
1195
+ relative_to?: never;
1196
+ } & ({
1197
+ source: 'document';
1198
+ where?: SpeculationRuleWhere;
1199
+ } | {
1200
+ source?: never;
1201
+ where: SpeculationRuleWhere;
1202
+ });
1203
+ type SpeculationRule = SpeculationRuleList | SpeculationRuleDocument;
1204
+ /** The object form accepted by `href_matches`, equivalent to `URLPatternInit`. */
1205
+ interface SpeculationRuleUrlPattern {
1206
+ baseURL?: string;
1207
+ protocol?: string;
1208
+ username?: string;
1209
+ password?: string;
1210
+ hostname?: string;
1211
+ port?: string;
1212
+ pathname?: string;
1213
+ search?: string;
1214
+ hash?: string;
1215
+ }
1216
+ type SpeculationRuleUrlPatternInput = string | SpeculationRuleUrlPattern;
1217
+ /**
1218
+ * A recursive document rule predicate. Exactly one predicate operator is valid
1219
+ * at each level; only `href_matches` also accepts `relative_to`.
1220
+ */
1221
+ type SpeculationRuleWhere = {
1222
+ and: readonly SpeculationRuleWhere[];
1223
+ or?: never;
1224
+ not?: never;
1225
+ href_matches?: never;
1226
+ selector_matches?: never;
1227
+ relative_to?: never;
1228
+ } | {
1229
+ and?: never;
1230
+ or: readonly SpeculationRuleWhere[];
1231
+ not?: never;
1232
+ href_matches?: never;
1233
+ selector_matches?: never;
1234
+ relative_to?: never;
1235
+ } | {
1236
+ and?: never;
1237
+ or?: never;
1238
+ not: SpeculationRuleWhere;
1239
+ href_matches?: never;
1240
+ selector_matches?: never;
1241
+ relative_to?: never;
1242
+ } | {
1243
+ and?: never;
1244
+ or?: never;
1245
+ not?: never;
1246
+ href_matches: SpeculationRuleUrlPatternInput | readonly SpeculationRuleUrlPatternInput[];
1247
+ selector_matches?: never;
1248
+ relative_to?: 'ruleset' | 'document';
1249
+ } | {
1250
+ and?: never;
1251
+ or?: never;
1252
+ not?: never;
1253
+ href_matches?: never;
1254
+ selector_matches: string | readonly string[];
1255
+ relative_to?: never;
1256
+ };
1257
+ /**
1258
+ * Events that fire on script elements (load/error)
1259
+ */
1260
+ type ScriptHttpEvents = Pick<HttpEventAttributes, 'onload' | 'onerror'>;
1261
+ /**
1262
+ * Base properties shared by all script types
1263
+ */
1264
+ interface ScriptBase extends Pick<GlobalAttributes, 'nonce' | 'id'>, Blocking, DataKeys {
1265
+ /**
1266
+ * Provides a hint of the relative priority to use when fetching an external script.
1267
+ *
1268
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script#attr-fetchpriority
1269
+ */
1270
+ fetchpriority?: 'high' | 'low' | 'auto';
1271
+ /**
1272
+ * Indicates which referrer to send when fetching the script, or resources fetched by the script.
1273
+ *
1274
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script#attr-referrerpolicy
1275
+ */
1276
+ referrerpolicy?: ReferrerPolicy;
1277
+ }
1278
+ /**
1279
+ * Props that are invalid on non-loadable script types (data scripts, inline scripts)
1280
+ */
1281
+ interface NoLoadableScriptProps {
1282
+ src?: never;
1283
+ async?: never;
1284
+ defer?: never;
1285
+ integrity?: never;
1286
+ crossorigin?: never;
1287
+ nomodule?: never;
1288
+ }
1289
+ /**
1290
+ * Content for data scripts — requires exactly one of `textContent` or
1291
+ * `innerHTML`. Data scripts (JSON-LD, speculation rules, application/json) must
1292
+ * carry inline content; an empty payload is invalid.
1293
+ */
1294
+ type DataScriptTextContent<T = string | Record<string, unknown>> = {
1295
+ /**
1296
+ * Sets the textContent of an element. Safer for XSS.
1297
+ * Can be a string or an object that will be serialized to JSON.
1298
+ */
1299
+ textContent: T;
1300
+ innerHTML?: never;
1301
+ } | {
1302
+ textContent?: never;
1303
+ /**
1304
+ * Sets the innerHTML of an element.
1305
+ * Can be a string or an object that will be serialized to JSON.
1306
+ */
1307
+ innerHTML: T;
1308
+ };
1309
+ /**
1310
+ * External JavaScript (fires events)
1311
+ */
1312
+ interface ExternalScript extends ScriptBase, ScriptHttpEvents {
1313
+ /**
1314
+ * This attribute specifies the URI of an external script.
1315
+ *
1316
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script#attr-src
1317
+ */
1318
+ src: string;
1319
+ /**
1320
+ * This attribute indicates the type of script represented.
1321
+ *
1322
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script#attr-type
1323
+ */
1324
+ type?: '' | 'text/javascript';
1325
+ /**
1326
+ * For classic scripts, if the async attribute is present,
1327
+ * then the classic script will be fetched in parallel to parsing and evaluated as soon as it is available.
1328
+ *
1329
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script#attr-async
1330
+ */
1331
+ async?: Booleanable;
1332
+ /**
1333
+ * This Boolean attribute is set to indicate to a browser that the script is meant to be executed after the document
1334
+ * has been parsed, but before firing DOMContentLoaded.
1335
+ *
1336
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script#attr-defer
1337
+ */
1338
+ defer?: Booleanable;
1339
+ /**
1340
+ * Normal script elements pass minimal information to the window.onerror
1341
+ * for scripts which do not pass the standard CORS checks.
1342
+ *
1343
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script#attr-crossorigin
1344
+ */
1345
+ crossorigin?: '' | 'anonymous' | 'use-credentials';
1346
+ /**
1347
+ * This attribute contains inline metadata that a user agent can use to verify
1348
+ * that a fetched resource has been delivered free of unexpected manipulation.
1349
+ *
1350
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script#attr-integrity
1351
+ */
1352
+ integrity?: string;
1353
+ /**
1354
+ * This Boolean attribute is set to indicate that the script should not be executed in browsers
1355
+ * that support ES modules.
1356
+ *
1357
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script#attr-nomodule
1358
+ */
1359
+ nomodule?: Booleanable;
1360
+ /** Inline content is ignored when `src` is present. */
1361
+ textContent?: never;
1362
+ /** Inline content is ignored when `src` is present. */
1363
+ innerHTML?: never;
1364
+ }
1365
+ /**
1366
+ * ES Module script (fires events)
1367
+ */
1368
+ interface ModuleScript extends ScriptBase, ScriptHttpEvents {
1369
+ /**
1370
+ * This attribute specifies the URI of an external script.
1371
+ *
1372
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script#attr-src
1373
+ */
1374
+ src: string;
1375
+ /**
1376
+ * This attribute indicates the type of script represented.
1377
+ * Required discriminant for module scripts.
1378
+ *
1379
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script#attr-type
1380
+ */
1381
+ type: 'module';
1382
+ /**
1383
+ * For module scripts, if the async attribute is present then the scripts and all their dependencies
1384
+ * will be executed in the defer queue.
1385
+ *
1386
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script#attr-async
1387
+ */
1388
+ async?: Booleanable;
1389
+ /**
1390
+ * Normal script elements pass minimal information to the window.onerror
1391
+ * for scripts which do not pass the standard CORS checks.
1392
+ *
1393
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script#attr-crossorigin
1394
+ */
1395
+ crossorigin?: '' | 'anonymous' | 'use-credentials';
1396
+ /**
1397
+ * This attribute contains inline metadata that a user agent can use to verify
1398
+ * that a fetched resource has been delivered free of unexpected manipulation.
1399
+ *
1400
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script#attr-integrity
1401
+ */
1402
+ integrity?: string;
1403
+ /** Inline content is ignored when `src` is present. */
1404
+ textContent?: never;
1405
+ /** Inline content is ignored when `src` is present. */
1406
+ innerHTML?: never;
1407
+ }
1408
+ /**
1409
+ * Inline JavaScript (no events, no src).
1410
+ * Requires either `textContent` (recommended, XSS-safe) or `innerHTML`.
1411
+ */
1412
+ type InlineScript = ScriptBase & NoLoadableScriptProps & {
1413
+ /**
1414
+ * This attribute indicates the type of script represented.
1415
+ *
1416
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script#attr-type
1417
+ */
1418
+ type?: '' | 'text/javascript';
1419
+ } & ({
1420
+ /** Sets the textContent of an element. Safer for XSS. */
1421
+ textContent: string;
1422
+ innerHTML?: never;
1423
+ } | {
1424
+ textContent?: never;
1425
+ /**
1426
+ * Sets the innerHTML of an element.
1427
+ *
1428
+ * Warning: not safe for XSS. Prefer `textContent` for inline scripts.
1429
+ */
1430
+ innerHTML: string | Record<string, unknown>;
1431
+ });
1432
+ /**
1433
+ * Inline ES Module script (no src).
1434
+ * Requires either `textContent` (recommended, XSS-safe) or `innerHTML`.
1435
+ */
1436
+ type InlineModuleScript = ScriptBase & NoLoadableScriptProps & {
1437
+ /**
1438
+ * This attribute indicates the type of script represented.
1439
+ * Required discriminant for module scripts.
1440
+ *
1441
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script#attr-type
1442
+ */
1443
+ type: 'module';
1444
+ } & ({
1445
+ /** Sets the textContent of an element. Safer for XSS. */
1446
+ textContent: string;
1447
+ innerHTML?: never;
1448
+ } | {
1449
+ textContent?: never;
1450
+ /**
1451
+ * Sets the innerHTML of an element.
1452
+ *
1453
+ * Warning: not safe for XSS. Prefer `textContent` for inline scripts.
1454
+ */
1455
+ innerHTML: string;
1456
+ });
1457
+ /**
1458
+ * JSON-LD structured data (uses textContent for XSS safety)
1459
+ * Note: For full schema.org typing, use @unhead/schema-org with useSchemaOrg()
1460
+ */
1461
+ type JsonLdScript = ScriptBase & NoLoadableScriptProps & DataScriptTextContent & {
1462
+ /**
1463
+ * This attribute indicates the type of script represented.
1464
+ * Required discriminant for JSON-LD scripts.
1465
+ *
1466
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script#attr-type
1467
+ */
1468
+ type: 'application/ld+json';
1469
+ };
1470
+ /**
1471
+ * Speculation Rules (uses textContent for safety)
1472
+ */
1473
+ type SpeculationRulesScript = ScriptBase & NoLoadableScriptProps & DataScriptTextContent<string | SpeculationRules> & {
1474
+ /**
1475
+ * This attribute indicates the type of script represented.
1476
+ * Required discriminant for speculation rules scripts.
1477
+ *
1478
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script#attr-type
1479
+ */
1480
+ type: 'speculationrules';
1481
+ };
1482
+ /**
1483
+ * Import map configuration
1484
+ */
1485
+ interface ImportMapConfig {
1486
+ imports: Record<string, string>;
1487
+ scopes?: Record<string, Record<string, string>>;
1488
+ }
1489
+ /**
1490
+ * Import map. Requires either `textContent` (recommended) or `innerHTML`.
1491
+ */
1492
+ type ImportMapScript = ScriptBase & NoLoadableScriptProps & {
1493
+ /**
1494
+ * This attribute indicates the type of script represented.
1495
+ * Required discriminant for import map scripts.
1496
+ *
1497
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script#attr-type
1498
+ */
1499
+ type: 'importmap';
1500
+ } & ({
1501
+ /** Import map content as a string or ImportMapConfig object (auto-serialized). */
1502
+ textContent: string | ImportMapConfig;
1503
+ innerHTML?: never;
1504
+ } | {
1505
+ textContent?: never;
1506
+ /** Import map content as a string or ImportMapConfig object (auto-serialized). */
1507
+ innerHTML: string | ImportMapConfig;
1508
+ });
1509
+ /**
1510
+ * Application JSON script (generic JSON data)
1511
+ */
1512
+ type ApplicationJsonScript = ScriptBase & NoLoadableScriptProps & DataScriptTextContent & {
1513
+ /**
1514
+ * This attribute indicates the type of script represented.
1515
+ * Required discriminant for JSON scripts.
1516
+ *
1517
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script#attr-type
1518
+ */
1519
+ type: 'application/json';
1520
+ };
1521
+ /**
1522
+ * Discriminated union of all script types.
1523
+ *
1524
+ * Each `type` value maps to a specific interface that enforces per-type constraints.
1525
+ * For example, inline scripts require `textContent` and forbid `src`/`async`/`defer`.
1526
+ *
1527
+ * For custom or non-standard `type` values, use {@link defineScript}:
1528
+ * ```ts
1529
+ * import { defineScript } from 'unhead'
1530
+ * useHead({ script: [defineScript({ type: 'text/plain', textContent: '...' })] })
1531
+ * ```
1532
+ */
1533
+ type Script = ExternalScript | ModuleScript | InlineScript | InlineModuleScript | JsonLdScript | SpeculationRulesScript | ImportMapScript | ApplicationJsonScript;
1534
+ interface Style$1 extends Pick<GlobalAttributes, 'nonce' | 'id'>, Blocking {
1535
+ /**
1536
+ * This attribute defines which media the style should be applied to.
1537
+ * Its value is a media query, which defaults to all if the attribute is missing.
1538
+ *
1539
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/style#attr-media
1540
+ */
1541
+ media?: string;
1542
+ /**
1543
+ * A cryptographic nonce (number used once) used to allow inline styles in a style-src Content-Security-Policy.
1544
+ * The server must generate a unique nonce value each time it transmits a policy.
1545
+ * It is critical to provide a nonce that cannot be guessed as bypassing a resource's policy is otherwise trivial.
1546
+ *
1547
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/style#attr-nonce
1548
+ */
1549
+ nonce?: string;
1550
+ /**
1551
+ * This attribute specifies alternative style sheet sets.
1552
+ *
1553
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/style#attr-title
1554
+ */
1555
+ title?: string;
1556
+ }
1557
+ interface TemplateParamsAugmentations {}
1558
+ interface SchemaAugmentations {
1559
+ title: TagPriority;
1560
+ titleTemplate: TagPriority;
1561
+ base: ResolvesDuplicates & TagPriority;
1562
+ htmlAttrs: ResolvesDuplicates & TagPriority;
1563
+ bodyAttrs: ResolvesDuplicates & TagPriority;
1564
+ link: TagPriority & TagPosition & ResolvesDuplicates & ProcessesTemplateParams;
1565
+ meta: TagPriority & ResolvesDuplicates & ProcessesTemplateParams;
1566
+ style: TagPriority & TagPosition & StringInnerContent & ResolvesDuplicates & ProcessesTemplateParams;
1567
+ script: TagPriority & TagPosition & InnerContent & ResolvesDuplicates & ProcessesTemplateParams;
1568
+ noscript: TagPriority & TagPosition & StringInnerContent & ResolvesDuplicates & ProcessesTemplateParams;
1569
+ }
1570
+ type MaybeArray<T> = T | T[];
1571
+ interface UnheadBodyAttributesWithoutEvents extends Omit<BodyAttributesWithoutEvents, 'class' | 'style'> {
1572
+ /**
1573
+ * The class global attribute is a space-separated list of the case-sensitive classes of the element.
1574
+ *
1575
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/class
1576
+ */
1577
+ class?: MaybeArray<ResolvableValue$1<Stringable>> | Record<string, ResolvableValue$1<boolean>>;
1578
+ /**
1579
+ * The style attribute contains CSS styling declarations to be applied to the element.
1580
+ *
1581
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/style
1582
+ */
1583
+ style?: MaybeArray<ResolvableValue$1<Stringable>> | Record<string, ResolvableValue$1<Stringable>>;
1584
+ }
1585
+ interface UnheadHtmlAttributes extends Omit<HtmlAttributes$1, 'class' | 'style'> {
1586
+ /**
1587
+ * The class global attribute is a space-separated list of the case-sensitive classes of the element.
1588
+ *
1589
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/class
1590
+ */
1591
+ class?: MaybeArray<ResolvableValue$1<Stringable>> | Record<string, ResolvableValue$1<boolean>>;
1592
+ /**
1593
+ * The style attribute contains CSS styling declarations to be applied to the element.
1594
+ *
1595
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/style
1596
+ */
1597
+ style?: MaybeArray<ResolvableValue$1<Stringable>> | Record<string, ResolvableValue$1<Stringable>>;
1598
+ }
1599
+ /**
1600
+ * Unhead meta with support for array content values.
1601
+ * Content is required (use `null` explicitly to remove a meta tag).
1602
+ */
1603
+ type UnheadMeta = (Omit<NameMeta, 'content'> & {
1604
+ content: MaybeArray<string | number> | null;
1605
+ }) | (Omit<PropertyMeta, 'content'> & {
1606
+ content: MaybeArray<string | number> | null;
1607
+ }) | (Omit<HttpEquivMeta, 'content'> & {
1608
+ content: MaybeArray<string | number> | null;
1609
+ }) | CharsetMeta;
1610
+ type MaybeEventFnHandlers<T> = { [key in keyof T]?: T[key] | ((e: Event) => void); };
1611
+ type ResolvableTitle$1 = ResolvableValue$1<Stringable> | ResolvableProperties$1<({
1612
+ textContent: string;
1613
+ } & SchemaAugmentations['title'])>;
1614
+ type ResolvableTitleTemplate$1 = string | ((title?: string) => string | null) | null | ({
1615
+ textContent: string | ((title?: string) => string | null);
1616
+ } & SchemaAugmentations['titleTemplate']);
1617
+ type ResolvableBase$1 = DistributeResolvable$1<Base$1, SchemaAugmentations['base']>;
1618
+ type DistributeResolvable$1<T, Aug> = T extends any ? ResolvableProperties$1<T & Aug> : never;
1619
+ type DistributeResolvableWithEvents$1<T, Aug, Events> = T extends any ? T extends Events ? ResolvableProperties$1<Omit<T, keyof Events> & Aug> & MaybeEventFnHandlers<Events> : ResolvableProperties$1<T & Aug> : never;
1620
+ type ResolvableLink$1 = DistributeResolvableWithEvents$1<Link, SchemaAugmentations['link'], LinkHttpEvents>;
1621
+ type ResolvableMeta$1 = DistributeResolvable$1<UnheadMeta, SchemaAugmentations['meta']>;
1622
+ type ResolvableStyle$1 = ResolvableProperties$1<Style$1 & DataKeys & SchemaAugmentations['style']> | string;
1623
+ type ResolvableScript$1 = DistributeResolvableWithEvents$1<Script, SchemaAugmentations['script'], ScriptHttpEvents> | string;
1624
+ type ResolvableNoscript$1 = ResolvableProperties$1<Noscript$1 & DataKeys & SchemaAugmentations['noscript']> | string;
1625
+ type ResolvableHtmlAttributes$1 = ResolvableProperties$1<UnheadHtmlAttributes & DataKeys & SchemaAugmentations['htmlAttrs']>;
1626
+ type ResolvableBodyAttributes$1 = ResolvableProperties$1<UnheadBodyAttributesWithoutEvents & DataKeys & SchemaAugmentations['bodyAttrs']> & MaybeEventFnHandlers<BodyEvents>;
1627
+ type ResolvableTemplateParams = {
1628
+ separator?: '|' | '-' | '·' | string;
1629
+ } & Record<string, null | string | Record<string, string>> & TemplateParamsAugmentations;
1630
+ interface ResolvableHead {
1631
+ /**
1632
+ * The `<title>` HTML element defines the document's title that is shown in a browser's title bar or a page's tab.
1633
+ * It only contains text; tags within the element are ignored.
1634
+ *
1635
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/title
1636
+ */
1637
+ title?: ResolvableTitle$1;
1638
+ /**
1639
+ * The `<base>` HTML element specifies the base URL to use for all relative URLs in a document.
1640
+ * There can be only one <base> element in a document.
1641
+ *
1642
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base
1643
+ */
1644
+ base?: ResolvableValue$1<ResolvableBase$1>;
1645
+ /**
1646
+ * The `<link>` HTML element specifies relationships between the current document and an external resource.
1647
+ * This element is most commonly used to link to stylesheets, but is also used to establish site icons
1648
+ * (both "favicon" style icons and icons for the home screen and apps on mobile devices) among other things.
1649
+ *
1650
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#attr-as
1651
+ */
1652
+ link?: ResolvableValue$1<ResolvableValue$1<ResolvableLink$1>[]>;
1653
+ /**
1654
+ * The `<meta>` element represents metadata that cannot be expressed in other HTML elements, like `<link>` or `<script>`.
1655
+ *
1656
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta
1657
+ */
1658
+ meta?: ResolvableValue$1<ResolvableValue$1<ResolvableMeta$1>[]>;
1659
+ /**
1660
+ * The `<style>` HTML element contains style information for a document, or part of a document.
1661
+ * It contains CSS, which is applied to the contents of the document containing the `<style>` element.
1662
+ *
1663
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/style
1664
+ */
1665
+ style?: ResolvableValue$1<ResolvableValue$1<(ResolvableStyle$1)>[]>;
1666
+ /**
1667
+ * The `<script>` HTML element is used to embed executable code or data; this is typically used to embed or refer to JavaScript code.
1668
+ *
1669
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script
1670
+ */
1671
+ script?: ResolvableValue$1<ResolvableValue$1<(ResolvableScript$1)>[]>;
1672
+ /**
1673
+ * The `<noscript>` HTML element defines a section of HTML to be inserted if a script type on the page is unsupported
1674
+ * or if scripting is currently turned off in the browser.
1675
+ *
1676
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/noscript
1677
+ */
1678
+ noscript?: ResolvableValue$1<ResolvableValue$1<(ResolvableNoscript$1)>[]>;
1679
+ /**
1680
+ * Attributes for the `<html>` HTML element.
1681
+ *
1682
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/html
1683
+ */
1684
+ htmlAttrs?: ResolvableValue$1<ResolvableHtmlAttributes$1>;
1685
+ /**
1686
+ * Attributes for the `<body>` HTML element.
1687
+ *
1688
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/body
1689
+ */
1690
+ bodyAttrs?: ResolvableValue$1<ResolvableBodyAttributes$1>;
1691
+ /**
1692
+ * Generate the title from a template.
1693
+ *
1694
+ * Should include a `%s` placeholder for the title, for example `%s - My Site`.
1695
+ */
1696
+ titleTemplate?: ResolvableTitleTemplate$1;
1697
+ /**
1698
+ * Variables used to substitute in the title and meta content.
1699
+ */
1700
+ templateParams?: ResolvableTemplateParams;
1701
+ }
1702
+ interface SerializableHead {
1703
+ title?: string;
1704
+ titleTemplate?: string;
1705
+ base?: Base$1 & DataKeys & SchemaAugmentations['base'];
1706
+ templateParams?: Record<string, any>;
1707
+ link?: (Link & SchemaAugmentations['link'])[];
1708
+ meta?: (Meta & SchemaAugmentations['meta'])[];
1709
+ style?: (Style$1 & DataKeys & SchemaAugmentations['style'])[];
1710
+ script?: (Script & SchemaAugmentations['script'])[];
1711
+ noscript?: (Noscript$1 & DataKeys & SchemaAugmentations['noscript'])[];
1712
+ htmlAttrs?: HtmlAttributes$1 & DataKeys & SchemaAugmentations['htmlAttrs'];
1713
+ bodyAttrs?: BodyAttributesWithoutEvents & DataKeys & BodyEvents & SchemaAugmentations['bodyAttrs'];
1714
+ }
1715
+ type RawInput<K extends keyof SerializableHead> = Required<SerializableHead>[K] extends Array<infer T> ? T : Required<SerializableHead>[K];
1716
+ interface ResolvesDuplicates {
1717
+ /**
1718
+ * By default, tags which share the same unique key `name`, `property` are de-duped. To allow duplicates
1719
+ * to be made you can provide a unique key for each entry.
1720
+ */
1721
+ key?: string;
1722
+ /**
1723
+ * The strategy to use when a duplicate tag is encountered.
1724
+ *
1725
+ * - `replace` - Replace the existing tag with the new tag
1726
+ * - `merge` - Merge the existing tag with the new tag
1727
+ *
1728
+ * @default 'replace' (some tags will default to 'merge', such as htmlAttr)
1729
+ */
1730
+ tagDuplicateStrategy?: 'replace' | 'merge';
1731
+ }
1732
+ type ValidTagPositions = 'head' | 'bodyClose' | 'bodyOpen';
1733
+ interface TagPosition {
1734
+ /**
1735
+ * Specify where to render the tag.
1736
+ *
1737
+ * @default 'head'
1738
+ */
1739
+ tagPosition?: ValidTagPositions;
1740
+ }
1741
+ type InnerContentVal = string | Record<string, any>;
1742
+ interface InnerContent {
1743
+ /**
1744
+ * Text content of the tag.
1745
+ *
1746
+ * Warning: This is not safe for XSS. Do not use this with user input, use `textContent` instead.
1747
+ */
1748
+ innerHTML?: InnerContentVal;
1749
+ /**
1750
+ * Sets the textContent of an element. Safer for XSS.
1751
+ */
1752
+ textContent?: InnerContentVal;
1753
+ }
1754
+ /**
1755
+ * String-only inner content for elements that don't support object serialization (style, noscript).
1756
+ */
1757
+ interface StringInnerContent {
1758
+ /**
1759
+ * Text content of the tag.
1760
+ *
1761
+ * Warning: This is not safe for XSS. Do not use this with user input, use `textContent` instead.
1762
+ */
1763
+ innerHTML?: string;
1764
+ /**
1765
+ * Sets the textContent of an element. Safer for XSS.
1766
+ */
1767
+ textContent?: string;
1768
+ }
1769
+ interface TagPriority {
1770
+ /**
1771
+ * The priority for rendering the tag, without this all tags are rendered as they are registered
1772
+ * (besides some special tags).
1773
+ *
1774
+ * The following special tags have default priorities:
1775
+ * -2 `<meta charset ...>`
1776
+ * -1 `<base>`
1777
+ * 0 `<meta http-equiv="content-security-policy" ...>`
1778
+ *
1779
+ * All other tags have a default priority of 10: `<meta>`, `<script>`, `<link>`, `<style>`, etc
1780
+ */
1781
+ tagPriority?: number | 'critical' | 'high' | 'low' | `before:${string}` | `after:${string}`;
1782
+ }
1783
+ type TagKey = keyof ResolvableHead | InternalTagKey;
1784
+ /**
1785
+ * Internal tag types used by plugins
1786
+ * @internal
1787
+ */
1788
+ type InternalTagKey = '_flatMeta';
1789
+ type TemplateParams = {
1790
+ separator?: '|' | '-' | '·' | string;
1791
+ } & Record<string, null | string | Record<string, string>>;
1792
+ interface ProcessesTemplateParams {
1793
+ processTemplateParams?: boolean;
1794
+ }
1795
+ interface HasTemplateParams {
1796
+ templateParams?: TemplateParams;
1797
+ }
1798
+ interface HeadTag extends TagPriority, TagPosition, ResolvesDuplicates, HasTemplateParams {
1799
+ tag: TagKey;
1800
+ props: Record<string, string>;
1801
+ processTemplateParams?: boolean;
1802
+ innerHTML?: string;
1803
+ textContent?: string;
1804
+ /**
1805
+ * @internal
1806
+ */
1807
+ _w?: number;
1808
+ /**
1809
+ * @internal
1810
+ */
1811
+ _p?: number;
1812
+ /**
1813
+ * @internal
1814
+ */
1815
+ _d?: string;
1816
+ /**
1817
+ * @internal
1818
+ */
1819
+ _h?: string;
1820
+ /**
1821
+ * Source file:line that created this tag (devtools only).
1822
+ * @internal
1823
+ */
1824
+ _source?: string;
1825
+ }
1826
+ //#endregion
1827
+ //#region ../../node_modules/.pnpm/unhead@3.3.2_@voidzero-dev+vite-plus-core@0.2.9_rollup@4.62.4/node_modules/unhead/dist/shared/unhead.DoGkYKkW.d.ts
1828
+ type UseScriptStatus = 'awaitingLoad' | 'loading' | 'loaded' | 'error' | 'removed';
1829
+ type BaseScriptApi = Record<symbol | string, any>;
1830
+ type HasDiscriminatedParameters<T> = T extends {
1831
+ (first: infer A, ...rest1: any[]): any;
1832
+ (first: infer B, ...rest2: any[]): any;
1833
+ } ? A extends B ? B extends A ? false : true : true : false;
1834
+ type HasDifferentParameterCounts<T> = T extends {
1835
+ (...args: infer A): any;
1836
+ } & {
1837
+ (...args: infer B): any;
1838
+ } ? A['length'] extends B['length'] ? B['length'] extends A['length'] ? false : true : true : false;
1839
+ type IsOverloadedFunction<T> = HasDiscriminatedParameters<T> extends true ? true : HasDifferentParameterCounts<T> extends true ? true : false;
1840
+ type AsVoidFunctions<T extends BaseScriptApi> = { [K in keyof T]: T[K] extends any[] ? T[K] : T[K] extends ((...args: infer A) => any) ? IsOverloadedFunction<T[K]> extends true ? T[K] : (...args: A) => void : T[K] extends Record<any, any> ? AsVoidFunctions<T[K]> : never; };
1841
+ type WarmupStrategy = false | 'preload' | 'preconnect' | 'dns-prefetch';
1842
+ interface UseScriptWaitForResolve<T = unknown> {
1843
+ <V extends T>(value: V): V;
1844
+ <V extends T>(value: PromiseLike<V>): PromiseLike<V>;
1845
+ (value: T | PromiseLike<T>): T | PromiseLike<T>;
1846
+ }
1847
+ type UseScriptWaitForInferredResult<T> = [T] extends [void | (() => void)] ? unknown : NonNullable<Awaited<T>>;
1848
+ interface UseScriptWaitFor {
1849
+ /**
1850
+ * With an explicit result type, setup may use callback-style registration and
1851
+ * return cleanup. Without one, `waitFor(resolve => resolve(value))` infers it.
1852
+ */
1853
+ <T = never, R = void>(setup: (resolve: UseScriptWaitForResolve<[T] extends [never] ? unknown : T>, reject: (reason?: unknown) => void) => R): Promise<[T] extends [never] ? UseScriptWaitForInferredResult<R> : T>;
1854
+ }
1855
+ interface UseScriptContextOptions {
1856
+ /**
1857
+ * Aborted when the script is removed or fails to load.
1858
+ */
1859
+ signal: AbortSignal;
1860
+ /**
1861
+ * Wait for an SDK-specific readiness callback. Abort rejection and returned
1862
+ * cleanup are tied to the script lifecycle.
1863
+ */
1864
+ waitFor: UseScriptWaitFor;
1865
+ }
1866
+ type UseScriptResolver<T extends BaseScriptApi> = (ctx: UseScriptContextOptions) => T | PromiseLike<T | undefined | null> | undefined | null;
1867
+ /**
1868
+ * Register a script load trigger. A returned function is treated as cleanup;
1869
+ * other return values are ignored for backwards compatibility.
1870
+ */
1871
+ type UseScriptTrigger = (load: () => void) => any;
1872
+ interface ScriptInstance<T extends BaseScriptApi> {
1873
+ proxy: AsVoidFunctions<T>;
1874
+ instance?: T;
1875
+ id: string;
1876
+ /**
1877
+ * Aborted when the script is removed or fails to load.
1878
+ */
1879
+ signal: AbortSignal;
1880
+ status: Readonly<UseScriptStatus>;
1881
+ entry?: ActiveHeadEntry<any>;
1882
+ load: () => Promise<T>;
1883
+ warmup: (rel: WarmupStrategy) => ActiveHeadEntry<any>;
1884
+ remove: () => boolean;
1885
+ setupTriggerHandler: (trigger: UseScriptOptions['trigger']) => () => void;
1886
+ onLoaded: (fn: (instance: T) => void | Promise<void>, options?: EventHandlerOptions) => () => void;
1887
+ onError: (fn: (err?: Error) => void | Promise<void>, options?: EventHandlerOptions) => () => void;
1888
+ /**
1889
+ * @internal
1890
+ */
1891
+ _warmupStrategy?: string;
1892
+ /**
1893
+ * @internal
1894
+ */
1895
+ _loadPromise: Promise<T | false>;
1896
+ /**
1897
+ * @internal
1898
+ */
1899
+ _warmupEl: any;
1900
+ /**
1901
+ * @internal
1902
+ */
1903
+ _triggerAbortController?: AbortController | null;
1904
+ /**
1905
+ * @internal
1906
+ */
1907
+ _triggerAbortControllers?: Set<AbortController>;
1908
+ /**
1909
+ * @internal
1910
+ */
1911
+ _triggerPromises?: Promise<void>[];
1912
+ /**
1913
+ * @internal
1914
+ */
1915
+ _setupTriggerHandler: (trigger: UseScriptOptions['trigger'], removeOnError?: boolean) => () => void;
1916
+ /**
1917
+ * @internal
1918
+ */
1919
+ _cbs: {
1920
+ loaded: null | ((instance: T) => void | Promise<void>)[];
1921
+ error: null | ((err?: Error) => void | Promise<void>)[];
1922
+ };
1923
+ }
1924
+ interface EventHandlerOptions {
1925
+ /**
1926
+ * Used to dedupe the event, allowing you to have an event run only a single time.
1927
+ */
1928
+ key?: string;
1929
+ }
1930
+ interface UseScriptOptions<T extends BaseScriptApi = Record<string, any>> extends HeadEntryOptions {
1931
+ /**
1932
+ * Create a consumer-owned handle without changing the shared script lifecycle.
1933
+ * Existing callers receive the cached shared script unless this is enabled.
1934
+ */
1935
+ scope?: boolean;
1936
+ /**
1937
+ * Resolve the script instance from the window. This legacy callback is always
1938
+ * called without arguments. It may return the API asynchronously.
1939
+ */
1940
+ use?: () => T | PromiseLike<T | undefined | null> | undefined | null;
1941
+ /**
1942
+ * Resolve the script API with lifecycle helpers. Prefer this over `use` when
1943
+ * readiness needs an abort signal or `waitFor()` callback bridge.
1944
+ */
1945
+ resolve?: UseScriptResolver<T>;
1946
+ /**
1947
+ * The trigger to load the script:
1948
+ * - `undefined` | `client` - (Default) Load the script on the client when this js is loaded.
1949
+ * - `manual` - Load the script manually by calling `$script.load()`, exists only on the client.
1950
+ * - `Promise` - Load the script when the promise resolves, exists only on the client.
1951
+ * - `Function` - Register a callback function to load the script, exists only on the client. It may return a cleanup function.
1952
+ * - `server` - Have the script injected on the server.
1953
+ */
1954
+ trigger?: 'client' | 'server' | 'manual' | Promise<boolean | void> | UseScriptTrigger | null;
1955
+ /**
1956
+ * Add a preload or preconnect link tag before the script is loaded.
1957
+ */
1958
+ warmupStrategy?: WarmupStrategy;
1959
+ /**
1960
+ * Context to run events with. This is useful in Vue to attach the current instance context before
1961
+ * calling the event, allowing the event to be reactive.
1962
+ */
1963
+ eventContext?: any;
1964
+ /**
1965
+ * Called before the script is initialized. Will not be triggered when the script is already loaded. This means
1966
+ * this is guaranteed to be called only once, unless the script is removed and re-added.
1967
+ */
1968
+ beforeInit?: () => void;
1969
+ }
1970
+ type HookResult = Promise<void> | void;
1971
+ type SyncHookResult = void;
1972
+ interface SSRHeadPayload {
1973
+ headTags: string;
1974
+ bodyTags: string;
1975
+ bodyTagsOpen: string;
1976
+ htmlAttrs: string;
1977
+ bodyAttrs: string;
1978
+ }
1979
+ interface RenderSSRHeadOptions {
1980
+ omitLineBreaks?: boolean;
1981
+ resolvedTags?: HeadTag[];
1982
+ tagWeight?: (tag: HeadTag) => number;
1983
+ }
1984
+ interface EntryResolveCtx<T> {
1985
+ tags: HeadTag[];
1986
+ entries: HeadEntry<T>[];
1987
+ }
1988
+ interface DomBeforeRenderCtx extends ShouldRenderContext {
1989
+ tags: HeadTag[];
1990
+ }
1991
+ interface ShouldRenderContext {
1992
+ shouldRender: boolean;
1993
+ }
1994
+ interface DomRenderTagContext {
1995
+ tag: HeadTag;
1996
+ id: string;
1997
+ $el?: Element;
1998
+ shouldRender: boolean;
1999
+ }
2000
+ interface SSRRenderContext {
2001
+ tags: HeadTag[];
2002
+ html: SSRHeadPayload;
2003
+ }
2004
+ interface TagResolveContext {
2005
+ tagMap: Map<string, HeadTag>;
2006
+ tags: HeadTag[];
2007
+ }
2008
+ interface CoreHeadHooks {
2009
+ 'entries:updated': (ctx: Unhead<any>) => HookResult;
2010
+ 'entries:resolve': (ctx: EntryResolveCtx<any>) => SyncHookResult;
2011
+ 'entries:normalize': (ctx: {
2012
+ tags: HeadTag[];
2013
+ entry: HeadEntry<any>;
2014
+ }) => SyncHookResult;
2015
+ 'tag:normalise': (ctx: {
2016
+ tag: HeadTag;
2017
+ entry: HeadEntry<any>;
2018
+ resolvedOptions: CreateClientHeadOptions;
2019
+ }) => SyncHookResult;
2020
+ 'tags:beforeResolve': (ctx: TagResolveContext) => SyncHookResult;
2021
+ 'tags:resolve': (ctx: TagResolveContext) => SyncHookResult;
2022
+ 'tags:afterResolve': (ctx: TagResolveContext) => SyncHookResult;
2023
+ 'script:updated': (ctx: {
2024
+ script: ScriptInstance<any>;
2025
+ }) => void | Promise<void>;
2026
+ }
2027
+ interface DOMHeadHooks {
2028
+ 'dom:beforeRender': (ctx: DomBeforeRenderCtx) => SyncHookResult;
2029
+ /** @deprecated Not called internally. Will be removed in v4. */
2030
+ 'dom:renderTag': (ctx: DomRenderTagContext, document: Document, track: (id: string, scope: string, fn: () => void) => void) => HookResult;
2031
+ /** @deprecated Will be removed in v4. DOM rendering is synchronous; run post-render logic after calling `renderDOMHead()` directly. */
2032
+ 'dom:rendered': (ctx: {
2033
+ renders: DomRenderTagContext[];
2034
+ }) => HookResult;
2035
+ }
2036
+ interface SSRHeadHooks {
2037
+ 'ssr:beforeRender': (ctx: ShouldRenderContext) => HookResult;
2038
+ 'ssr:render': (ctx: {
2039
+ tags: HeadTag[];
2040
+ options: RenderSSRHeadOptions;
2041
+ }) => HookResult;
2042
+ 'ssr:rendered': (ctx: SSRRenderContext) => HookResult;
2043
+ }
2044
+ type ClientHeadHooks = CoreHeadHooks & DOMHeadHooks;
2045
+ type ServerHeadHooks = CoreHeadHooks & SSRHeadHooks;
2046
+ type HeadHooks = CoreHeadHooks & DOMHeadHooks & SSRHeadHooks;
2047
+ /**
2048
+ * Side effects are mapped with a key and their cleanup function.
2049
+ *
2050
+ * For example, `meta:data-h-4h46h465`: () => { document.querySelector('meta[data-h-4h46h465]').remove() }
2051
+ */
2052
+ type SideEffectsRecord = Record<string, () => void>;
2053
+ interface HeadEntry<Input> {
2054
+ /**
2055
+ * User provided input for the entry.
2056
+ */
2057
+ input: Input;
2058
+ options?: Omit<HeadEntryOptions, 'head' | 'onRendered'>;
2059
+ /**
2060
+ * Head entry index
2061
+ *
2062
+ * @internal
2063
+ */
2064
+ _i: number;
2065
+ /**
2066
+ * Resolved tags
2067
+ *
2068
+ * @internal
2069
+ */
2070
+ _tags?: HeadTag[];
2071
+ /**
2072
+ * Precomputed normalized tags shared across head instances (SSR default init
2073
+ * entry). Only used when no entry hooks, tag weight overrides or entry
2074
+ * options could observe or alter normalization, see `resolveTags`.
2075
+ *
2076
+ * @internal
2077
+ */
2078
+ _precomputedTags?: HeadTag[];
2079
+ /**
2080
+ * Pending patch to apply on next render (client-only)
2081
+ * @internal
2082
+ */
2083
+ _pending?: Input;
2084
+ /**
2085
+ * @internal
2086
+ */
2087
+ _o?: Input;
2088
+ }
2089
+ interface HeadPluginOptions extends CreateHeadOptions {
2090
+ hooks?: Record<string, (...args: any[]) => any>;
2091
+ }
2092
+ type HeadPluginInput = (HeadPluginOptions & {
2093
+ key: string;
2094
+ }) | (((head: Unhead) => HeadPluginOptions & {
2095
+ key: string;
2096
+ }) & {
2097
+ key?: string;
2098
+ });
2099
+ type HeadPlugin = HeadPluginOptions & {
2100
+ key: string;
2101
+ };
2102
+ /**
2103
+ * An active head entry provides an API to manipulate it.
2104
+ */
2105
+ interface ActiveHeadEntry<Input> {
2106
+ /**
2107
+ * Updates the entry with new input.
2108
+ *
2109
+ * Will first clear any side effects for previous input.
2110
+ */
2111
+ patch: (input: Input) => void;
2112
+ /**
2113
+ * Dispose the entry, removing it from the active head.
2114
+ *
2115
+ * Will queue side effects for removal.
2116
+ */
2117
+ dispose: () => void;
2118
+ /**
2119
+ * @internal
2120
+ */
2121
+ _i: number;
2122
+ }
2123
+ type PropResolver = ((key?: string, value?: any, tag?: HeadTag) => any) & {
2124
+ /**
2125
+ * Marks the resolver as the identity function for plain non-reactive JSON
2126
+ * values (strings/numbers/booleans/plain objects/arrays). When every
2127
+ * configured resolver is static, the SSR default init entry can use the
2128
+ * precomputed fast path (see `server/createHead.ts`).
2129
+ *
2130
+ * @internal
2131
+ */
2132
+ _static?: boolean;
2133
+ };
2134
+ interface CreateHeadOptions {
2135
+ document?: Document;
2136
+ /**
2137
+ * Initial head input that should be added.
2138
+ *
2139
+ * Any tags here are added with low priority.
2140
+ */
2141
+ init?: (ResolvableHead | undefined | false)[];
2142
+ /**
2143
+ * Prop resolvers for tags.
2144
+ */
2145
+ propResolvers?: PropResolver[];
2146
+ /**
2147
+ * @experimental
2148
+ * Key used for window attachment during streaming SSR.
2149
+ * Allows multiple Unhead instances on the same page.
2150
+ * @default '__unhead__'
2151
+ */
2152
+ experimentalStreamKey?: string;
2153
+ /**
2154
+ * @internal
2155
+ */
2156
+ _tagWeight?: (tag: HeadTag) => number;
2157
+ }
2158
+ interface CreateServerHeadOptions extends CreateHeadOptions {
2159
+ plugins?: HeadPluginInput[];
2160
+ hooks?: Partial<ServerHeadHooks>;
2161
+ /**
2162
+ * Custom tag weight function for controlling `<head>` tag ordering.
2163
+ *
2164
+ * By default, tags are sorted using CAPO weights optimised for the browser preload scanner.
2165
+ * Override this to change the ordering — for example, to prioritise SEO meta tags for bot requests.
2166
+ *
2167
+ * @example
2168
+ * ```ts
2169
+ * import { capoTagWeight } from 'unhead/server'
2170
+ *
2171
+ * createHead({
2172
+ * tagWeight(tag) {
2173
+ * // Promote SEO meta above styles for bots
2174
+ * if (isBot && tag.tag === 'meta' && tag.props.property?.startsWith('og:'))
2175
+ * return 55 // just above styles (60)
2176
+ * return capoTagWeight(tag)
2177
+ * }
2178
+ * })
2179
+ * ```
2180
+ */
2181
+ tagWeight?: (tag: HeadTag) => number;
2182
+ /**
2183
+ * Should default important tags be skipped.
2184
+ *
2185
+ * Adds the following tags with low priority:
2186
+ * - <html lang="en">
2187
+ * - <meta charset="utf-8">
2188
+ * - <meta name="viewport" content="width=device-width, initial-scale=1">
2189
+ */
2190
+ disableDefaults?: boolean;
2191
+ /**
2192
+ * Omit line breaks between rendered tags, producing a single line of output.
2193
+ *
2194
+ * Only removes the separators *between* tags; newlines inside inline
2195
+ * `<script>`/`<style>`/JSON-LD content are preserved.
2196
+ *
2197
+ * @deprecated Prefer `MinifyPlugin` from `unhead/plugins`, which minifies the
2198
+ * inline content itself (where the real bytes are) rather than only dropping
2199
+ * separators.
2200
+ */
2201
+ omitLineBreaks?: boolean;
2202
+ }
2203
+ interface CreateClientHeadOptions extends CreateHeadOptions {
2204
+ plugins?: HeadPluginInput[];
2205
+ hooks?: Partial<ClientHeadHooks>;
2206
+ /**
2207
+ * Custom render function for DOM updates.
2208
+ */
2209
+ render?: (head: Unhead<any>) => boolean | void;
2210
+ }
2211
+ interface HeadEntryOptions extends TagPosition, TagPriority, ProcessesTemplateParams, ResolvesDuplicates {
2212
+ head?: Unhead;
2213
+ /**
2214
+ * Called after unhead has finished applying DOM updates.
2215
+ *
2216
+ * Useful for synchronising external tools (e.g. analytics) with the current document head.
2217
+ *
2218
+ * Only called on the client — ignored during SSR.
2219
+ *
2220
+ * @example
2221
+ * useHead({ title: 'My Page' }, {
2222
+ * onRendered({ renders }) {
2223
+ * amplitude.track('Page View', { title: document.title })
2224
+ * }
2225
+ * })
2226
+ */
2227
+ onRendered?: (ctx: {
2228
+ renders: DomRenderTagContext[];
2229
+ }) => void | Promise<void>;
2230
+ /**
2231
+ * @internal
2232
+ */
2233
+ _safe?: boolean;
2234
+ /**
2235
+ * @internal
2236
+ */
2237
+ _index?: number;
2238
+ /**
2239
+ * Source location for devtools tracing.
2240
+ * @internal
2241
+ */
2242
+ _source?: string;
2243
+ }
2244
+ interface Unhead<Input = ResolvableHead, RenderResult = unknown> {
2245
+ /**
2246
+ * Render the head tags using the configured renderer.
2247
+ */
2248
+ render: () => RenderResult;
2249
+ /**
2250
+ * Registered plugins.
2251
+ */
2252
+ plugins: Map<string, HeadPlugin>;
2253
+ /**
2254
+ * The head entries.
2255
+ */
2256
+ entries: Map<number, HeadEntry<Input>>;
2257
+ /**
2258
+ * Create a new head entry.
2259
+ */
2260
+ push: (entry: Input, options?: HeadEntryOptions) => ActiveHeadEntry<Input>;
2261
+ /**
2262
+ * Exposed hooks for easier extension.
2263
+ */
2264
+ hooks?: HookableCore<HeadHooks>;
2265
+ /**
2266
+ * Resolved options
2267
+ */
2268
+ resolvedOptions: CreateHeadOptions;
2269
+ /**
2270
+ * Use a head plugin, loads the plugins hooks.
2271
+ */
2272
+ use: (plugin: HeadPluginInput) => void;
2273
+ /**
2274
+ * Is it a server-side render context.
2275
+ */
2276
+ ssr: boolean;
2277
+ /**
2278
+ * @internal
2279
+ */
2280
+ _entryCount: number;
2281
+ /**
2282
+ * Number of entry hooks included in cached normalization.
2283
+ *
2284
+ * @internal
2285
+ */
2286
+ _h: number;
2287
+ /**
2288
+ * @internal
2289
+ */
2290
+ dirty?: boolean;
2291
+ /**
2292
+ * Invalidate all entries and re-queue them for normalization.
2293
+ * @internal
2294
+ */
2295
+ invalidate?: () => void;
2296
+ /**
2297
+ * @internal
2298
+ */
2299
+ _dom?: DomState;
2300
+ /**
2301
+ * @internal
2302
+ */
2303
+ _du?: boolean;
2304
+ /**
2305
+ * @internal
2306
+ */
2307
+ _scripts?: Record<string, any>;
2308
+ /**
2309
+ * @internal
2310
+ */
2311
+ _templateParams?: TemplateParams;
2312
+ /**
2313
+ * @internal
2314
+ */
2315
+ _separator?: string;
2316
+ /**
2317
+ * @internal
2318
+ */
2319
+ _title?: string;
2320
+ /**
2321
+ * @internal
2322
+ */
2323
+ _titleTemplate?: string;
2324
+ /**
2325
+ * @internal
2326
+ */
2327
+ _rootStreamedTags?: Record<string, HeadTag>;
2328
+ }
2329
+ interface DomState {
2330
+ /**
2331
+ * @internal
2332
+ */
2333
+ _t: string;
2334
+ /**
2335
+ * @internal
2336
+ */
2337
+ _p: SideEffectsRecord;
2338
+ /**
2339
+ * @internal
2340
+ */
2341
+ _s: SideEffectsRecord;
2342
+ /**
2343
+ * @internal
2344
+ */
2345
+ _e: Map<string, Element>;
2346
+ }
2347
+ //#endregion
2348
+ //#region ../../node_modules/.pnpm/unhead@3.3.2_@voidzero-dev+vite-plus-core@0.2.9_rollup@4.62.4/node_modules/unhead/dist/shared/unhead.CrqY7gyY.d.ts
2349
+ type Base = RawInput<'base'>;
2350
+ type HtmlAttributes = RawInput<'htmlAttrs'>;
2351
+ type Noscript = RawInput<'noscript'>;
2352
+ type Style = RawInput<'style'>;
2353
+ //#endregion
2354
+ //#region ../../node_modules/.pnpm/@unhead+vue@3.3.2_@oxc-project+types@0.143.0_@vitejs+devtools-kit@0.4.12_@voidzero-dev+_9529223e8c649ac859b173200c2c7a75/node_modules/@unhead/vue/dist/shared/vue.B8YcFbNO.d.ts
2355
+ type Falsy = false | null | undefined;
2356
+ type MaybeFalsy<T> = T | Falsy;
2357
+ type ResolvableValue<T> = MaybeFalsy<T> | (() => MaybeFalsy<T>) | ComputedRef<MaybeFalsy<T>> | Ref<MaybeFalsy<T>>;
2358
+ type ResolvableArray<T> = ResolvableValue<ResolvableValue<T>[]>;
2359
+ type Prettify<T> = { [K in keyof T]: T[K]; } & {};
2360
+ type _ResolvablePropertiesRaw<T> = { [K in keyof T as {} extends Pick<T, K> ? never : K]: ResolvableValue<T[K]>; } & { [K in keyof T as {} extends Pick<T, K> ? K : never]?: ResolvableValue<T[K]>; };
2361
+ type ResolvableProperties<T> = Prettify<_ResolvablePropertiesRaw<T>>;
2362
+ interface HtmlAttr extends Omit<HtmlAttributes, 'class' | 'style'> {
2363
+ /**
2364
+ * The class global attribute is a space-separated list of the case-sensitive classes of the element.
2365
+ *
2366
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/class
2367
+ */
2368
+ class?: MaybeArray<ResolvableValue<Stringable> | Record<string, ResolvableValue<boolean>>>;
2369
+ /**
2370
+ * The style attribute contains CSS styling declarations to be applied to the element.
2371
+ *
2372
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/style
2373
+ */
2374
+ style?: MaybeArray<ResolvableValue<Stringable> | ResolvableProperties<CSSProperties>>;
2375
+ }
2376
+ interface BodyAttr extends Omit<BodyAttributesWithoutEvents, 'class' | 'style'> {
2377
+ /**
2378
+ * The class global attribute is a space-separated list of the case-sensitive classes of the element.
2379
+ *
2380
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/class
2381
+ */
2382
+ class?: MaybeArray<ResolvableValue<Stringable> | Record<string, ResolvableValue<boolean>>>;
2383
+ /**
2384
+ * The style attribute contains CSS styling declarations to be applied to the element.
2385
+ *
2386
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/style
2387
+ */
2388
+ style?: MaybeArray<ResolvableValue<Stringable> | ResolvableProperties<CSSProperties>>;
2389
+ }
2390
+ type ResolvableTitle = ResolvableValue<Stringable> | ResolvableProperties<({
2391
+ textContent: Stringable;
2392
+ } & SchemaAugmentations['title'])>;
2393
+ type ResolvableTitleTemplate = ResolvableTitleTemplate$1 | Ref<string>;
2394
+ type ResolvableBase = DistributeResolvable<Base, SchemaAugmentations['base']>;
2395
+ type DistributeResolvable<T, Aug> = T extends any ? ResolvableProperties<T & Aug> : never;
2396
+ type DistributeResolvableWithEvents<T, Aug, Events> = T extends any ? T extends Events ? ResolvableProperties<Omit<T, keyof Events> & Aug> & MaybeEventFnHandlers<Events> : ResolvableProperties<T & Aug> : never;
2397
+ type ResolvableLink = DistributeResolvableWithEvents<Link, SchemaAugmentations['link'], LinkHttpEvents>;
2398
+ type ResolvableMeta = DistributeResolvable<UnheadMeta, SchemaAugmentations['meta']>;
2399
+ type ResolvableStyle = ResolvableProperties<Style & DataKeys & SchemaAugmentations['style']>;
2400
+ type ResolvableScript = DistributeResolvableWithEvents<Script, SchemaAugmentations['script'], ScriptHttpEvents>;
2401
+ type ResolvableNoscript = ResolvableProperties<Noscript & DataKeys & SchemaAugmentations['noscript']>;
2402
+ type ResolvableHtmlAttributes = ResolvableProperties<HtmlAttr & DataKeys & SchemaAugmentations['htmlAttrs']>;
2403
+ type ResolvableBodyAttributes = ResolvableProperties<BodyAttr & DataKeys & SchemaAugmentations['bodyAttrs']> & MaybeEventFnHandlers<BodyEvents>;
2404
+ interface ReactiveHead {
2405
+ /**
2406
+ * The `<title>` HTML element defines the document's title that is shown in a browser's title bar or a page's tab.
2407
+ * It only contains text; tags within the element are ignored.
2408
+ *
2409
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/title
2410
+ */
2411
+ title?: ResolvableTitle;
2412
+ /**
2413
+ * Generate the title from a template.
2414
+ */
2415
+ titleTemplate?: ResolvableTitleTemplate;
2416
+ /**
2417
+ * Variables used to substitute in the title and meta content.
2418
+ */
2419
+ templateParams?: ResolvableProperties<ResolvableTemplateParams>;
2420
+ /**
2421
+ * The `<base>` HTML element specifies the base URL to use for all relative URLs in a document.
2422
+ * There can be only one <base> element in a document.
2423
+ *
2424
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base
2425
+ */
2426
+ base?: ResolvableBase;
2427
+ /**
2428
+ * The `<link>` HTML element specifies relationships between the current document and an external resource.
2429
+ * This element is most commonly used to link to stylesheets, but is also used to establish site icons
2430
+ * (both "favicon" style icons and icons for the home screen and apps on mobile devices) among other things.
2431
+ *
2432
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#attr-as
2433
+ */
2434
+ link?: ResolvableArray<ResolvableLink>;
2435
+ /**
2436
+ * The `<meta>` element represents metadata that cannot be expressed in other HTML elements, like `<link>` or `<script>`.
2437
+ *
2438
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta
2439
+ */
2440
+ meta?: ResolvableArray<ResolvableMeta>;
2441
+ /**
2442
+ * The `<style>` HTML element contains style information for a document, or part of a document.
2443
+ * It contains CSS, which is applied to the contents of the document containing the `<style>` element.
2444
+ *
2445
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/style
2446
+ */
2447
+ style?: ResolvableArray<(ResolvableStyle | string)>;
2448
+ /**
2449
+ * The `<script>` HTML element is used to embed executable code or data; this is typically used to embed or refer to JavaScript code.
2450
+ *
2451
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script
2452
+ */
2453
+ script?: ResolvableArray<(ResolvableScript | string)>;
2454
+ /**
2455
+ * The `<noscript>` HTML element defines a section of HTML to be inserted if a script type on the page is unsupported
2456
+ * or if scripting is currently turned off in the browser.
2457
+ *
2458
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/noscript
2459
+ */
2460
+ noscript?: ResolvableArray<(ResolvableNoscript | string)>;
2461
+ /**
2462
+ * Attributes for the `<html>` HTML element.
2463
+ *
2464
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/html
2465
+ */
2466
+ htmlAttrs?: ResolvableHtmlAttributes;
2467
+ /**
2468
+ * Attributes for the `<body>` HTML element.
2469
+ *
2470
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/body
2471
+ */
2472
+ bodyAttrs?: ResolvableBodyAttributes;
2473
+ }
2474
+ type UseHeadInput<_Deprecated = never> = ResolvableValue<ReactiveHead>;
2475
+ type VueHeadClient<I = UseHeadInput, R = unknown> = Unhead<I, R> & Plugin;
2476
+ //#endregion
2477
+ //#region ../../node_modules/.pnpm/@unhead+vue@3.3.2_@oxc-project+types@0.143.0_@vitejs+devtools-kit@0.4.12_@voidzero-dev+_9529223e8c649ac859b173200c2c7a75/node_modules/@unhead/vue/dist/server.d.ts
2478
+ declare function createHead(options?: Omit<CreateServerHeadOptions, 'propResolvers'>): VueHeadClient<UseHeadInput, SSRHeadPayload>;
2479
+ //#endregion
2480
+ export { createHead as createServerHead };