@unhead/vue 2.0.0-alpha.6 → 2.0.0-alpha.8

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.
package/dist/index.cjs CHANGED
@@ -10,6 +10,8 @@ const unheadVueComposablesImports = {
10
10
  "@unhead/vue": ["injectHead", ...shared.composableNames]
11
11
  };
12
12
 
13
+ const CapoPlugin = () => ({});
14
+
13
15
  exports.createHeadCore = unhead.createHeadCore;
14
16
  exports.headSymbol = composables.headSymbol;
15
17
  exports.injectHead = composables.injectHead;
@@ -21,4 +23,5 @@ exports.useServerHead = composables.useServerHead;
21
23
  exports.useServerHeadSafe = composables.useServerHeadSafe;
22
24
  exports.useServerSeoMeta = composables.useServerSeoMeta;
23
25
  exports.VueHeadMixin = VueHeadMixin.VueHeadMixin;
26
+ exports.CapoPlugin = CapoPlugin;
24
27
  exports.unheadVueComposablesImports = unheadVueComposablesImports;
package/dist/index.d.cts CHANGED
@@ -3,7 +3,7 @@ export { r as resolveUnrefHeadInput } from './shared/vue.BF-HCrO8.cjs';
3
3
  import { MergeHead, ActiveHeadEntry } from '@unhead/schema';
4
4
  export { ActiveHeadEntry, Head, HeadEntryOptions, HeadTag, MergeHead, ResolvedHead, Unhead } from '@unhead/schema';
5
5
  import { VueHeadClient, UseHeadInput, UseHeadOptions, UseHeadSafeInput, UseSeoMetaInput } from './types.cjs';
6
- export { Base, BodyAttr, BodyAttributes, HeadSafe, HtmlAttr, HtmlAttributes, Link, MaybeComputedRef, MaybeComputedRefEntries, MaybeComputedRefEntriesOnly, MaybeComputedRefOrFalsy, MaybeComputedRefOrPromise, MaybeReadonlyRef, Meta, Noscript, ReactiveHead, Script, Style, Title, TitleTemplate } from './types.cjs';
6
+ export { Base, BodyAttr, BodyAttributes, HeadSafe, HtmlAttr, HtmlAttributes, Link, MaybeComputedRef, Meta, Noscript, ReactiveHead, ResolvableArray, ResolvableProperties, Script, Style, Title, TitleTemplate } from './types.cjs';
7
7
  export { V as VueHeadMixin } from './shared/vue.DnywREVF.cjs';
8
8
  import 'vue';
9
9
 
@@ -21,4 +21,6 @@ declare function useServerSeoMeta(input: UseSeoMetaInput, options?: UseHeadOptio
21
21
 
22
22
  declare const headSymbol = "usehead";
23
23
 
24
- export { UseHeadInput, UseHeadOptions, UseHeadSafeInput, UseSeoMetaInput, VueHeadClient, headSymbol, injectHead, unheadVueComposablesImports, useHead, useHeadSafe, useSeoMeta, useServerHead, useServerHeadSafe, useServerSeoMeta };
24
+ declare const CapoPlugin: () => {};
25
+
26
+ export { CapoPlugin, UseHeadInput, UseHeadOptions, UseHeadSafeInput, UseSeoMetaInput, VueHeadClient, headSymbol, injectHead, unheadVueComposablesImports, useHead, useHeadSafe, useSeoMeta, useServerHead, useServerHeadSafe, useServerSeoMeta };
package/dist/index.d.mts CHANGED
@@ -3,7 +3,7 @@ export { r as resolveUnrefHeadInput } from './shared/vue.BF-HCrO8.mjs';
3
3
  import { MergeHead, ActiveHeadEntry } from '@unhead/schema';
4
4
  export { ActiveHeadEntry, Head, HeadEntryOptions, HeadTag, MergeHead, ResolvedHead, Unhead } from '@unhead/schema';
5
5
  import { VueHeadClient, UseHeadInput, UseHeadOptions, UseHeadSafeInput, UseSeoMetaInput } from './types.mjs';
6
- export { Base, BodyAttr, BodyAttributes, HeadSafe, HtmlAttr, HtmlAttributes, Link, MaybeComputedRef, MaybeComputedRefEntries, MaybeComputedRefEntriesOnly, MaybeComputedRefOrFalsy, MaybeComputedRefOrPromise, MaybeReadonlyRef, Meta, Noscript, ReactiveHead, Script, Style, Title, TitleTemplate } from './types.mjs';
6
+ export { Base, BodyAttr, BodyAttributes, HeadSafe, HtmlAttr, HtmlAttributes, Link, MaybeComputedRef, Meta, Noscript, ReactiveHead, ResolvableArray, ResolvableProperties, Script, Style, Title, TitleTemplate } from './types.mjs';
7
7
  export { V as VueHeadMixin } from './shared/vue.DnywREVF.mjs';
8
8
  import 'vue';
9
9
 
@@ -21,4 +21,6 @@ declare function useServerSeoMeta(input: UseSeoMetaInput, options?: UseHeadOptio
21
21
 
22
22
  declare const headSymbol = "usehead";
23
23
 
24
- export { UseHeadInput, UseHeadOptions, UseHeadSafeInput, UseSeoMetaInput, VueHeadClient, headSymbol, injectHead, unheadVueComposablesImports, useHead, useHeadSafe, useSeoMeta, useServerHead, useServerHeadSafe, useServerSeoMeta };
24
+ declare const CapoPlugin: () => {};
25
+
26
+ export { CapoPlugin, UseHeadInput, UseHeadOptions, UseHeadSafeInput, UseSeoMetaInput, VueHeadClient, headSymbol, injectHead, unheadVueComposablesImports, useHead, useHeadSafe, useSeoMeta, useServerHead, useServerHeadSafe, useServerSeoMeta };
package/dist/index.d.ts CHANGED
@@ -3,7 +3,7 @@ export { r as resolveUnrefHeadInput } from './shared/vue.BF-HCrO8.js';
3
3
  import { MergeHead, ActiveHeadEntry } from '@unhead/schema';
4
4
  export { ActiveHeadEntry, Head, HeadEntryOptions, HeadTag, MergeHead, ResolvedHead, Unhead } from '@unhead/schema';
5
5
  import { VueHeadClient, UseHeadInput, UseHeadOptions, UseHeadSafeInput, UseSeoMetaInput } from './types.js';
6
- export { Base, BodyAttr, BodyAttributes, HeadSafe, HtmlAttr, HtmlAttributes, Link, MaybeComputedRef, MaybeComputedRefEntries, MaybeComputedRefEntriesOnly, MaybeComputedRefOrFalsy, MaybeComputedRefOrPromise, MaybeReadonlyRef, Meta, Noscript, ReactiveHead, Script, Style, Title, TitleTemplate } from './types.js';
6
+ export { Base, BodyAttr, BodyAttributes, HeadSafe, HtmlAttr, HtmlAttributes, Link, MaybeComputedRef, Meta, Noscript, ReactiveHead, ResolvableArray, ResolvableProperties, Script, Style, Title, TitleTemplate } from './types.js';
7
7
  export { V as VueHeadMixin } from './shared/vue.DnywREVF.js';
8
8
  import 'vue';
9
9
 
@@ -21,4 +21,6 @@ declare function useServerSeoMeta(input: UseSeoMetaInput, options?: UseHeadOptio
21
21
 
22
22
  declare const headSymbol = "usehead";
23
23
 
24
- export { UseHeadInput, UseHeadOptions, UseHeadSafeInput, UseSeoMetaInput, VueHeadClient, headSymbol, injectHead, unheadVueComposablesImports, useHead, useHeadSafe, useSeoMeta, useServerHead, useServerHeadSafe, useServerSeoMeta };
24
+ declare const CapoPlugin: () => {};
25
+
26
+ export { CapoPlugin, UseHeadInput, UseHeadOptions, UseHeadSafeInput, UseSeoMetaInput, VueHeadClient, headSymbol, injectHead, unheadVueComposablesImports, useHead, useHeadSafe, useSeoMeta, useServerHead, useServerHeadSafe, useServerSeoMeta };
package/dist/index.mjs CHANGED
@@ -8,4 +8,6 @@ const unheadVueComposablesImports = {
8
8
  "@unhead/vue": ["injectHead", ...composableNames]
9
9
  };
10
10
 
11
- export { unheadVueComposablesImports };
11
+ const CapoPlugin = () => ({});
12
+
13
+ export { CapoPlugin, unheadVueComposablesImports };
package/dist/legacy.d.cts CHANGED
@@ -1,17 +1,17 @@
1
1
  import * as _unhead_schema from '@unhead/schema';
2
2
  import { ScriptBase, DataKeys, SchemaAugmentations, HeadEntryOptions, MergeHead, CreateClientHeadOptions, ActiveHeadEntry } from '@unhead/schema';
3
- import { VueHeadClient, UseHeadInput, UseHeadOptions as UseHeadOptions$1, UseHeadSafeInput, UseSeoMetaInput } from './types.cjs';
4
3
  export { createHeadCore } from 'unhead';
5
4
  export { r as resolveUnrefHeadInput } from './shared/vue.BF-HCrO8.cjs';
6
- import { MaybeComputedRefEntriesOnly, UseHeadOptions } from '@unhead/vue';
5
+ import { ResolvableProperties, UseHeadOptions } from '@unhead/vue';
7
6
  import { ScriptInstance, UseScriptStatus, UseScriptOptions as UseScriptOptions$1, UseFunctionType } from 'unhead/legacy';
8
7
  export { UseFunctionType, resolveScriptKey } from 'unhead/legacy';
9
8
  import { Ref } from 'vue';
9
+ import { VueHeadClient, UseHeadInput, UseHeadOptions as UseHeadOptions$1, UseHeadSafeInput, UseSeoMetaInput } from './types.cjs';
10
10
 
11
11
  interface VueScriptInstance<T extends Record<symbol | string, any>> extends Omit<ScriptInstance<T>, 'status'> {
12
12
  status: Ref<UseScriptStatus>;
13
13
  }
14
- type UseScriptInput = string | (MaybeComputedRefEntriesOnly<Omit<ScriptBase & DataKeys & SchemaAugmentations['script'], 'src'>> & {
14
+ type UseScriptInput = string | (ResolvableProperties<Omit<ScriptBase & DataKeys & SchemaAugmentations['script'], 'src'>> & {
15
15
  src: string;
16
16
  });
17
17
  interface UseScriptOptions<T extends Record<symbol | string, any> = Record<string, any>> extends Omit<HeadEntryOptions, 'head'>, Pick<UseScriptOptions$1<T>, 'use' | 'eventContext' | 'beforeInit'> {
package/dist/legacy.d.mts CHANGED
@@ -1,17 +1,17 @@
1
1
  import * as _unhead_schema from '@unhead/schema';
2
2
  import { ScriptBase, DataKeys, SchemaAugmentations, HeadEntryOptions, MergeHead, CreateClientHeadOptions, ActiveHeadEntry } from '@unhead/schema';
3
- import { VueHeadClient, UseHeadInput, UseHeadOptions as UseHeadOptions$1, UseHeadSafeInput, UseSeoMetaInput } from './types.mjs';
4
3
  export { createHeadCore } from 'unhead';
5
4
  export { r as resolveUnrefHeadInput } from './shared/vue.BF-HCrO8.mjs';
6
- import { MaybeComputedRefEntriesOnly, UseHeadOptions } from '@unhead/vue';
5
+ import { ResolvableProperties, UseHeadOptions } from '@unhead/vue';
7
6
  import { ScriptInstance, UseScriptStatus, UseScriptOptions as UseScriptOptions$1, UseFunctionType } from 'unhead/legacy';
8
7
  export { UseFunctionType, resolveScriptKey } from 'unhead/legacy';
9
8
  import { Ref } from 'vue';
9
+ import { VueHeadClient, UseHeadInput, UseHeadOptions as UseHeadOptions$1, UseHeadSafeInput, UseSeoMetaInput } from './types.mjs';
10
10
 
11
11
  interface VueScriptInstance<T extends Record<symbol | string, any>> extends Omit<ScriptInstance<T>, 'status'> {
12
12
  status: Ref<UseScriptStatus>;
13
13
  }
14
- type UseScriptInput = string | (MaybeComputedRefEntriesOnly<Omit<ScriptBase & DataKeys & SchemaAugmentations['script'], 'src'>> & {
14
+ type UseScriptInput = string | (ResolvableProperties<Omit<ScriptBase & DataKeys & SchemaAugmentations['script'], 'src'>> & {
15
15
  src: string;
16
16
  });
17
17
  interface UseScriptOptions<T extends Record<symbol | string, any> = Record<string, any>> extends Omit<HeadEntryOptions, 'head'>, Pick<UseScriptOptions$1<T>, 'use' | 'eventContext' | 'beforeInit'> {
package/dist/legacy.d.ts CHANGED
@@ -1,17 +1,17 @@
1
1
  import * as _unhead_schema from '@unhead/schema';
2
2
  import { ScriptBase, DataKeys, SchemaAugmentations, HeadEntryOptions, MergeHead, CreateClientHeadOptions, ActiveHeadEntry } from '@unhead/schema';
3
- import { VueHeadClient, UseHeadInput, UseHeadOptions as UseHeadOptions$1, UseHeadSafeInput, UseSeoMetaInput } from './types.js';
4
3
  export { createHeadCore } from 'unhead';
5
4
  export { r as resolveUnrefHeadInput } from './shared/vue.BF-HCrO8.js';
6
- import { MaybeComputedRefEntriesOnly, UseHeadOptions } from '@unhead/vue';
5
+ import { ResolvableProperties, UseHeadOptions } from '@unhead/vue';
7
6
  import { ScriptInstance, UseScriptStatus, UseScriptOptions as UseScriptOptions$1, UseFunctionType } from 'unhead/legacy';
8
7
  export { UseFunctionType, resolveScriptKey } from 'unhead/legacy';
9
8
  import { Ref } from 'vue';
9
+ import { VueHeadClient, UseHeadInput, UseHeadOptions as UseHeadOptions$1, UseHeadSafeInput, UseSeoMetaInput } from './types.js';
10
10
 
11
11
  interface VueScriptInstance<T extends Record<symbol | string, any>> extends Omit<ScriptInstance<T>, 'status'> {
12
12
  status: Ref<UseScriptStatus>;
13
13
  }
14
- type UseScriptInput = string | (MaybeComputedRefEntriesOnly<Omit<ScriptBase & DataKeys & SchemaAugmentations['script'], 'src'>> & {
14
+ type UseScriptInput = string | (ResolvableProperties<Omit<ScriptBase & DataKeys & SchemaAugmentations['script'], 'src'>> & {
15
15
  src: string;
16
16
  });
17
17
  interface UseScriptOptions<T extends Record<symbol | string, any> = Record<string, any>> extends Omit<HeadEntryOptions, 'head'>, Pick<UseScriptOptions$1<T>, 'use' | 'eventContext' | 'beforeInit'> {
package/dist/types.d.cts CHANGED
@@ -1,19 +1,11 @@
1
- import { BaseHtmlAttr, MaybeArray, BaseBodyAttr, Title as Title$1, TitleTemplate as TitleTemplate$1, EntryAugmentation, Base as Base$1, Link as Link$1, Meta as Meta$1, Style as Style$1, Script as Script$1, Noscript as Noscript$1, DataKeys, SchemaAugmentations, DefinedValueOrEmptyObject, MaybeEventFnHandlers, BodyEvents, MergeHead, HeadEntryOptions, MetaFlatInput, Unhead, SafeMeta, SafeLink, SafeNoscript, SafeScript, SafeHtmlAttr, SafeBodyAttr } from '@unhead/schema';
1
+ import { Falsey, BaseHtmlAttr, MaybeArray, BaseBodyAttr, MaybeFunction, ResolvableValues, SchemaAugmentations, TitleTemplate as TitleTemplate$1, EntryAugmentation, Base as Base$1, DefinedValueOrEmptyObject, LinkBase, DataKeys, MaybeEventFnHandlers, HttpEventAttributes, BaseMeta, Style as Style$1, ScriptBase, Noscript as Noscript$1, BodyEvents, MergeHead, HeadEntryOptions, MetaFlatInput, Unhead, SafeMeta, SafeLink, SafeNoscript, SafeScript, SafeHtmlAttr, SafeBodyAttr } from '@unhead/schema';
2
2
  export { ActiveHeadEntry, Head, HeadEntryOptions, HeadTag, MergeHead, ResolvedHead, Unhead } from '@unhead/schema';
3
3
  import { ComputedRef, Ref, Plugin } from 'vue';
4
4
 
5
- type MaybeReadonlyRef<T> = ComputedRef<T>;
6
- type MaybeComputedRef<T> = T | MaybeReadonlyRef<T> | Ref<T>;
7
- type MaybeComputedRefOrFalsy<T> = T | MaybeReadonlyRef<T> | Ref<T>;
8
- /**
9
- * @deprecated Use MaybeComputedRefOrFalsy
10
- */
11
- type MaybeComputedRefOrPromise<T> = MaybeComputedRefOrFalsy<T>;
12
- type MaybeComputedRefEntries<T> = MaybeComputedRef<T> | {
13
- [key in keyof T]?: MaybeComputedRefOrFalsy<T[key]>;
14
- };
15
- type MaybeComputedRefEntriesOnly<T> = {
16
- [key in keyof T]?: MaybeComputedRefOrFalsy<T[key]>;
5
+ type MaybeComputedRef<T> = T | (() => T) | ComputedRef<T> | Ref<T>;
6
+ type ResolvableArray<T> = MaybeComputedRef<MaybeComputedRef<T>[]>;
7
+ type ResolvableProperties<T> = {
8
+ [key in keyof T]?: MaybeComputedRef<T[key] | Falsey>;
17
9
  };
18
10
 
19
11
  interface HtmlAttr extends Omit<BaseHtmlAttr, 'class'> {
@@ -38,16 +30,18 @@ interface BodyAttr extends Omit<BaseBodyAttr, 'class' | 'style'> {
38
30
  */
39
31
  style?: MaybeArray<MaybeComputedRef<string>> | Record<string, MaybeComputedRef<string | boolean>>;
40
32
  }
41
- type Title = MaybeComputedRef<Title$1>;
33
+ type Title = MaybeFunction<number | string | Falsey> | ResolvableValues<({
34
+ textContent: string;
35
+ } & SchemaAugmentations['title'])>;
42
36
  type TitleTemplate = TitleTemplate$1 | Ref<TitleTemplate$1> | ((title?: string) => TitleTemplate$1);
43
- type Base<E extends EntryAugmentation = Record<string, any>> = MaybeComputedRef<MaybeComputedRefEntries<Base$1<E>>>;
44
- type Link<E extends EntryAugmentation = Record<string, any>> = MaybeComputedRefEntries<Link$1<E>>;
45
- type Meta<E extends EntryAugmentation = Record<string, any>> = MaybeComputedRefEntries<Meta$1<E>>;
46
- type Style<E extends EntryAugmentation = Record<string, any>> = MaybeComputedRefEntries<Style$1<E>>;
47
- type Script<E extends EntryAugmentation = Record<string, any>> = MaybeComputedRefEntries<Script$1<E>>;
48
- type Noscript<E extends EntryAugmentation = Record<string, any>> = MaybeComputedRefEntries<Noscript$1<E>>;
49
- type HtmlAttributes<E extends EntryAugmentation = Record<string, any>> = MaybeComputedRef<MaybeComputedRefEntries<HtmlAttr & DataKeys & SchemaAugmentations['htmlAttrs'] & DefinedValueOrEmptyObject<E>>>;
50
- type BodyAttributes<E extends EntryAugmentation = Record<string, any>> = MaybeComputedRef<MaybeComputedRefEntries<BodyAttr & DataKeys & SchemaAugmentations['bodyAttrs'] & DefinedValueOrEmptyObject<E>> & MaybeEventFnHandlers<BodyEvents>>;
37
+ type Base<E extends EntryAugmentation = Record<string, any>> = ResolvableProperties<Base$1 & SchemaAugmentations['base']> & DefinedValueOrEmptyObject<E>;
38
+ type Link<E extends EntryAugmentation = Record<string, any>> = ResolvableProperties<LinkBase & DataKeys & SchemaAugmentations['link']> & MaybeEventFnHandlers<HttpEventAttributes> & DefinedValueOrEmptyObject<E>;
39
+ type Meta<E extends EntryAugmentation = Record<string, any>> = ResolvableProperties<BaseMeta & DataKeys & SchemaAugmentations['meta']> & DefinedValueOrEmptyObject<E>;
40
+ type Style<E extends EntryAugmentation = Record<string, any>> = ResolvableProperties<Style$1 & DataKeys & SchemaAugmentations['style']> & DefinedValueOrEmptyObject<E>;
41
+ type Script<E extends EntryAugmentation = Record<string, any>> = ResolvableProperties<ScriptBase & DataKeys & SchemaAugmentations['script']> & MaybeEventFnHandlers<HttpEventAttributes> & DefinedValueOrEmptyObject<E>;
42
+ type Noscript<E extends EntryAugmentation = Record<string, any>> = ResolvableProperties<Noscript$1 & DataKeys & SchemaAugmentations['noscript']> & DefinedValueOrEmptyObject<E>;
43
+ type HtmlAttributes<E extends EntryAugmentation = Record<string, any>> = ResolvableProperties<HtmlAttr & DataKeys & SchemaAugmentations['htmlAttrs']> & DefinedValueOrEmptyObject<E>;
44
+ type BodyAttributes<E extends EntryAugmentation = Record<string, any>> = ResolvableProperties<BodyAttr & DataKeys & SchemaAugmentations['bodyAttrs']> & MaybeEventFnHandlers<BodyEvents> & DefinedValueOrEmptyObject<E>;
51
45
  interface ReactiveHead<E extends MergeHead = MergeHead> {
52
46
  /**
53
47
  * The `<title>` HTML element defines the document's title that is shown in a browser's title bar or a page's tab.
@@ -63,9 +57,9 @@ interface ReactiveHead<E extends MergeHead = MergeHead> {
63
57
  /**
64
58
  * Variables used to substitute in the title and meta content.
65
59
  */
66
- templateParams?: MaybeComputedRefEntries<{
60
+ templateParams?: ResolvableArray<{
67
61
  separator?: '|' | '-' | '·' | string;
68
- } & Record<string, null | string | MaybeComputedRefEntries<Record<string, null | string>>>>;
62
+ } & Record<string, null | string | ResolvableArray<Record<string, null | string>>>>;
69
63
  /**
70
64
  * The `<base>` HTML element specifies the base URL to use for all relative URLs in a document.
71
65
  * There can be only one <base> element in a document.
@@ -80,33 +74,33 @@ interface ReactiveHead<E extends MergeHead = MergeHead> {
80
74
  *
81
75
  * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#attr-as
82
76
  */
83
- link?: MaybeComputedRef<Link<E['link']>[]>;
77
+ link?: ResolvableArray<Link<E['link']>>;
84
78
  /**
85
79
  * The `<meta>` element represents metadata that cannot be expressed in other HTML elements, like `<link>` or `<script>`.
86
80
  *
87
81
  * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta
88
82
  */
89
- meta?: MaybeComputedRef<Meta<E['meta']>[]>;
83
+ meta?: ResolvableArray<Meta<E['meta']>>;
90
84
  /**
91
85
  * The `<style>` HTML element contains style information for a document, or part of a document.
92
86
  * It contains CSS, which is applied to the contents of the document containing the `<style>` element.
93
87
  *
94
88
  * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/style
95
89
  */
96
- style?: MaybeComputedRef<(Style<E['style']> | string)[]>;
90
+ style?: ResolvableArray<(Style<E['style']> | string)>;
97
91
  /**
98
92
  * The `<script>` HTML element is used to embed executable code or data; this is typically used to embed or refer to JavaScript code.
99
93
  *
100
94
  * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script
101
95
  */
102
- script?: MaybeComputedRef<(Script<E['script']> | string)[]>;
96
+ script?: ResolvableArray<(Script<E['script']> | string)>;
103
97
  /**
104
98
  * The `<noscript>` HTML element defines a section of HTML to be inserted if a script type on the page is unsupported
105
99
  * or if scripting is currently turned off in the browser.
106
100
  *
107
101
  * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/noscript
108
102
  */
109
- noscript?: MaybeComputedRef<(Noscript<E['noscript']> | string)[]>;
103
+ noscript?: ResolvableArray<(Noscript<E['noscript']> | string)>;
110
104
  /**
111
105
  * Attributes for the `<html>` HTML element.
112
106
  *
@@ -124,20 +118,20 @@ type UseHeadOptions = Omit<HeadEntryOptions, 'head'> & {
124
118
  head?: VueHeadClient<any>;
125
119
  };
126
120
  type UseHeadInput<T extends MergeHead = Record<string, any>> = MaybeComputedRef<ReactiveHead<T>>;
127
- type UseSeoMetaInput = MaybeComputedRefEntriesOnly<MetaFlatInput> & {
121
+ type UseSeoMetaInput = ResolvableProperties<MetaFlatInput> & {
128
122
  title?: ReactiveHead['title'];
129
123
  titleTemplate?: ReactiveHead['titleTemplate'];
130
124
  };
131
125
  type VueHeadClient<T extends MergeHead> = Unhead<MaybeComputedRef<ReactiveHead<T>>> & Plugin;
132
126
 
133
127
  interface HeadSafe extends Pick<ReactiveHead, 'title' | 'titleTemplate' | 'templateParams'> {
134
- meta?: MaybeComputedRefEntries<SafeMeta>[];
135
- link?: MaybeComputedRefEntries<SafeLink>[];
136
- noscript?: MaybeComputedRefEntries<SafeNoscript>[];
137
- script?: MaybeComputedRefEntries<SafeScript>[];
138
- htmlAttrs?: MaybeComputedRefEntries<SafeHtmlAttr>;
139
- bodyAttrs?: MaybeComputedRefEntries<SafeBodyAttr>;
128
+ meta?: ResolvableArray<SafeMeta>[];
129
+ link?: ResolvableArray<SafeLink>[];
130
+ noscript?: ResolvableArray<SafeNoscript>[];
131
+ script?: ResolvableArray<SafeScript>[];
132
+ htmlAttrs?: ResolvableArray<SafeHtmlAttr>;
133
+ bodyAttrs?: ResolvableArray<SafeBodyAttr>;
140
134
  }
141
135
  type UseHeadSafeInput = MaybeComputedRef<HeadSafe>;
142
136
 
143
- export type { Base, BodyAttr, BodyAttributes, HeadSafe, HtmlAttr, HtmlAttributes, Link, MaybeComputedRef, MaybeComputedRefEntries, MaybeComputedRefEntriesOnly, MaybeComputedRefOrFalsy, MaybeComputedRefOrPromise, MaybeReadonlyRef, Meta, Noscript, ReactiveHead, Script, Style, Title, TitleTemplate, UseHeadInput, UseHeadOptions, UseHeadSafeInput, UseSeoMetaInput, VueHeadClient };
137
+ export type { Base, BodyAttr, BodyAttributes, HeadSafe, HtmlAttr, HtmlAttributes, Link, MaybeComputedRef, Meta, Noscript, ReactiveHead, ResolvableArray, ResolvableProperties, Script, Style, Title, TitleTemplate, UseHeadInput, UseHeadOptions, UseHeadSafeInput, UseSeoMetaInput, VueHeadClient };
package/dist/types.d.mts CHANGED
@@ -1,19 +1,11 @@
1
- import { BaseHtmlAttr, MaybeArray, BaseBodyAttr, Title as Title$1, TitleTemplate as TitleTemplate$1, EntryAugmentation, Base as Base$1, Link as Link$1, Meta as Meta$1, Style as Style$1, Script as Script$1, Noscript as Noscript$1, DataKeys, SchemaAugmentations, DefinedValueOrEmptyObject, MaybeEventFnHandlers, BodyEvents, MergeHead, HeadEntryOptions, MetaFlatInput, Unhead, SafeMeta, SafeLink, SafeNoscript, SafeScript, SafeHtmlAttr, SafeBodyAttr } from '@unhead/schema';
1
+ import { Falsey, BaseHtmlAttr, MaybeArray, BaseBodyAttr, MaybeFunction, ResolvableValues, SchemaAugmentations, TitleTemplate as TitleTemplate$1, EntryAugmentation, Base as Base$1, DefinedValueOrEmptyObject, LinkBase, DataKeys, MaybeEventFnHandlers, HttpEventAttributes, BaseMeta, Style as Style$1, ScriptBase, Noscript as Noscript$1, BodyEvents, MergeHead, HeadEntryOptions, MetaFlatInput, Unhead, SafeMeta, SafeLink, SafeNoscript, SafeScript, SafeHtmlAttr, SafeBodyAttr } from '@unhead/schema';
2
2
  export { ActiveHeadEntry, Head, HeadEntryOptions, HeadTag, MergeHead, ResolvedHead, Unhead } from '@unhead/schema';
3
3
  import { ComputedRef, Ref, Plugin } from 'vue';
4
4
 
5
- type MaybeReadonlyRef<T> = ComputedRef<T>;
6
- type MaybeComputedRef<T> = T | MaybeReadonlyRef<T> | Ref<T>;
7
- type MaybeComputedRefOrFalsy<T> = T | MaybeReadonlyRef<T> | Ref<T>;
8
- /**
9
- * @deprecated Use MaybeComputedRefOrFalsy
10
- */
11
- type MaybeComputedRefOrPromise<T> = MaybeComputedRefOrFalsy<T>;
12
- type MaybeComputedRefEntries<T> = MaybeComputedRef<T> | {
13
- [key in keyof T]?: MaybeComputedRefOrFalsy<T[key]>;
14
- };
15
- type MaybeComputedRefEntriesOnly<T> = {
16
- [key in keyof T]?: MaybeComputedRefOrFalsy<T[key]>;
5
+ type MaybeComputedRef<T> = T | (() => T) | ComputedRef<T> | Ref<T>;
6
+ type ResolvableArray<T> = MaybeComputedRef<MaybeComputedRef<T>[]>;
7
+ type ResolvableProperties<T> = {
8
+ [key in keyof T]?: MaybeComputedRef<T[key] | Falsey>;
17
9
  };
18
10
 
19
11
  interface HtmlAttr extends Omit<BaseHtmlAttr, 'class'> {
@@ -38,16 +30,18 @@ interface BodyAttr extends Omit<BaseBodyAttr, 'class' | 'style'> {
38
30
  */
39
31
  style?: MaybeArray<MaybeComputedRef<string>> | Record<string, MaybeComputedRef<string | boolean>>;
40
32
  }
41
- type Title = MaybeComputedRef<Title$1>;
33
+ type Title = MaybeFunction<number | string | Falsey> | ResolvableValues<({
34
+ textContent: string;
35
+ } & SchemaAugmentations['title'])>;
42
36
  type TitleTemplate = TitleTemplate$1 | Ref<TitleTemplate$1> | ((title?: string) => TitleTemplate$1);
43
- type Base<E extends EntryAugmentation = Record<string, any>> = MaybeComputedRef<MaybeComputedRefEntries<Base$1<E>>>;
44
- type Link<E extends EntryAugmentation = Record<string, any>> = MaybeComputedRefEntries<Link$1<E>>;
45
- type Meta<E extends EntryAugmentation = Record<string, any>> = MaybeComputedRefEntries<Meta$1<E>>;
46
- type Style<E extends EntryAugmentation = Record<string, any>> = MaybeComputedRefEntries<Style$1<E>>;
47
- type Script<E extends EntryAugmentation = Record<string, any>> = MaybeComputedRefEntries<Script$1<E>>;
48
- type Noscript<E extends EntryAugmentation = Record<string, any>> = MaybeComputedRefEntries<Noscript$1<E>>;
49
- type HtmlAttributes<E extends EntryAugmentation = Record<string, any>> = MaybeComputedRef<MaybeComputedRefEntries<HtmlAttr & DataKeys & SchemaAugmentations['htmlAttrs'] & DefinedValueOrEmptyObject<E>>>;
50
- type BodyAttributes<E extends EntryAugmentation = Record<string, any>> = MaybeComputedRef<MaybeComputedRefEntries<BodyAttr & DataKeys & SchemaAugmentations['bodyAttrs'] & DefinedValueOrEmptyObject<E>> & MaybeEventFnHandlers<BodyEvents>>;
37
+ type Base<E extends EntryAugmentation = Record<string, any>> = ResolvableProperties<Base$1 & SchemaAugmentations['base']> & DefinedValueOrEmptyObject<E>;
38
+ type Link<E extends EntryAugmentation = Record<string, any>> = ResolvableProperties<LinkBase & DataKeys & SchemaAugmentations['link']> & MaybeEventFnHandlers<HttpEventAttributes> & DefinedValueOrEmptyObject<E>;
39
+ type Meta<E extends EntryAugmentation = Record<string, any>> = ResolvableProperties<BaseMeta & DataKeys & SchemaAugmentations['meta']> & DefinedValueOrEmptyObject<E>;
40
+ type Style<E extends EntryAugmentation = Record<string, any>> = ResolvableProperties<Style$1 & DataKeys & SchemaAugmentations['style']> & DefinedValueOrEmptyObject<E>;
41
+ type Script<E extends EntryAugmentation = Record<string, any>> = ResolvableProperties<ScriptBase & DataKeys & SchemaAugmentations['script']> & MaybeEventFnHandlers<HttpEventAttributes> & DefinedValueOrEmptyObject<E>;
42
+ type Noscript<E extends EntryAugmentation = Record<string, any>> = ResolvableProperties<Noscript$1 & DataKeys & SchemaAugmentations['noscript']> & DefinedValueOrEmptyObject<E>;
43
+ type HtmlAttributes<E extends EntryAugmentation = Record<string, any>> = ResolvableProperties<HtmlAttr & DataKeys & SchemaAugmentations['htmlAttrs']> & DefinedValueOrEmptyObject<E>;
44
+ type BodyAttributes<E extends EntryAugmentation = Record<string, any>> = ResolvableProperties<BodyAttr & DataKeys & SchemaAugmentations['bodyAttrs']> & MaybeEventFnHandlers<BodyEvents> & DefinedValueOrEmptyObject<E>;
51
45
  interface ReactiveHead<E extends MergeHead = MergeHead> {
52
46
  /**
53
47
  * The `<title>` HTML element defines the document's title that is shown in a browser's title bar or a page's tab.
@@ -63,9 +57,9 @@ interface ReactiveHead<E extends MergeHead = MergeHead> {
63
57
  /**
64
58
  * Variables used to substitute in the title and meta content.
65
59
  */
66
- templateParams?: MaybeComputedRefEntries<{
60
+ templateParams?: ResolvableArray<{
67
61
  separator?: '|' | '-' | '·' | string;
68
- } & Record<string, null | string | MaybeComputedRefEntries<Record<string, null | string>>>>;
62
+ } & Record<string, null | string | ResolvableArray<Record<string, null | string>>>>;
69
63
  /**
70
64
  * The `<base>` HTML element specifies the base URL to use for all relative URLs in a document.
71
65
  * There can be only one <base> element in a document.
@@ -80,33 +74,33 @@ interface ReactiveHead<E extends MergeHead = MergeHead> {
80
74
  *
81
75
  * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#attr-as
82
76
  */
83
- link?: MaybeComputedRef<Link<E['link']>[]>;
77
+ link?: ResolvableArray<Link<E['link']>>;
84
78
  /**
85
79
  * The `<meta>` element represents metadata that cannot be expressed in other HTML elements, like `<link>` or `<script>`.
86
80
  *
87
81
  * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta
88
82
  */
89
- meta?: MaybeComputedRef<Meta<E['meta']>[]>;
83
+ meta?: ResolvableArray<Meta<E['meta']>>;
90
84
  /**
91
85
  * The `<style>` HTML element contains style information for a document, or part of a document.
92
86
  * It contains CSS, which is applied to the contents of the document containing the `<style>` element.
93
87
  *
94
88
  * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/style
95
89
  */
96
- style?: MaybeComputedRef<(Style<E['style']> | string)[]>;
90
+ style?: ResolvableArray<(Style<E['style']> | string)>;
97
91
  /**
98
92
  * The `<script>` HTML element is used to embed executable code or data; this is typically used to embed or refer to JavaScript code.
99
93
  *
100
94
  * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script
101
95
  */
102
- script?: MaybeComputedRef<(Script<E['script']> | string)[]>;
96
+ script?: ResolvableArray<(Script<E['script']> | string)>;
103
97
  /**
104
98
  * The `<noscript>` HTML element defines a section of HTML to be inserted if a script type on the page is unsupported
105
99
  * or if scripting is currently turned off in the browser.
106
100
  *
107
101
  * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/noscript
108
102
  */
109
- noscript?: MaybeComputedRef<(Noscript<E['noscript']> | string)[]>;
103
+ noscript?: ResolvableArray<(Noscript<E['noscript']> | string)>;
110
104
  /**
111
105
  * Attributes for the `<html>` HTML element.
112
106
  *
@@ -124,20 +118,20 @@ type UseHeadOptions = Omit<HeadEntryOptions, 'head'> & {
124
118
  head?: VueHeadClient<any>;
125
119
  };
126
120
  type UseHeadInput<T extends MergeHead = Record<string, any>> = MaybeComputedRef<ReactiveHead<T>>;
127
- type UseSeoMetaInput = MaybeComputedRefEntriesOnly<MetaFlatInput> & {
121
+ type UseSeoMetaInput = ResolvableProperties<MetaFlatInput> & {
128
122
  title?: ReactiveHead['title'];
129
123
  titleTemplate?: ReactiveHead['titleTemplate'];
130
124
  };
131
125
  type VueHeadClient<T extends MergeHead> = Unhead<MaybeComputedRef<ReactiveHead<T>>> & Plugin;
132
126
 
133
127
  interface HeadSafe extends Pick<ReactiveHead, 'title' | 'titleTemplate' | 'templateParams'> {
134
- meta?: MaybeComputedRefEntries<SafeMeta>[];
135
- link?: MaybeComputedRefEntries<SafeLink>[];
136
- noscript?: MaybeComputedRefEntries<SafeNoscript>[];
137
- script?: MaybeComputedRefEntries<SafeScript>[];
138
- htmlAttrs?: MaybeComputedRefEntries<SafeHtmlAttr>;
139
- bodyAttrs?: MaybeComputedRefEntries<SafeBodyAttr>;
128
+ meta?: ResolvableArray<SafeMeta>[];
129
+ link?: ResolvableArray<SafeLink>[];
130
+ noscript?: ResolvableArray<SafeNoscript>[];
131
+ script?: ResolvableArray<SafeScript>[];
132
+ htmlAttrs?: ResolvableArray<SafeHtmlAttr>;
133
+ bodyAttrs?: ResolvableArray<SafeBodyAttr>;
140
134
  }
141
135
  type UseHeadSafeInput = MaybeComputedRef<HeadSafe>;
142
136
 
143
- export type { Base, BodyAttr, BodyAttributes, HeadSafe, HtmlAttr, HtmlAttributes, Link, MaybeComputedRef, MaybeComputedRefEntries, MaybeComputedRefEntriesOnly, MaybeComputedRefOrFalsy, MaybeComputedRefOrPromise, MaybeReadonlyRef, Meta, Noscript, ReactiveHead, Script, Style, Title, TitleTemplate, UseHeadInput, UseHeadOptions, UseHeadSafeInput, UseSeoMetaInput, VueHeadClient };
137
+ export type { Base, BodyAttr, BodyAttributes, HeadSafe, HtmlAttr, HtmlAttributes, Link, MaybeComputedRef, Meta, Noscript, ReactiveHead, ResolvableArray, ResolvableProperties, Script, Style, Title, TitleTemplate, UseHeadInput, UseHeadOptions, UseHeadSafeInput, UseSeoMetaInput, VueHeadClient };
package/dist/types.d.ts CHANGED
@@ -1,19 +1,11 @@
1
- import { BaseHtmlAttr, MaybeArray, BaseBodyAttr, Title as Title$1, TitleTemplate as TitleTemplate$1, EntryAugmentation, Base as Base$1, Link as Link$1, Meta as Meta$1, Style as Style$1, Script as Script$1, Noscript as Noscript$1, DataKeys, SchemaAugmentations, DefinedValueOrEmptyObject, MaybeEventFnHandlers, BodyEvents, MergeHead, HeadEntryOptions, MetaFlatInput, Unhead, SafeMeta, SafeLink, SafeNoscript, SafeScript, SafeHtmlAttr, SafeBodyAttr } from '@unhead/schema';
1
+ import { Falsey, BaseHtmlAttr, MaybeArray, BaseBodyAttr, MaybeFunction, ResolvableValues, SchemaAugmentations, TitleTemplate as TitleTemplate$1, EntryAugmentation, Base as Base$1, DefinedValueOrEmptyObject, LinkBase, DataKeys, MaybeEventFnHandlers, HttpEventAttributes, BaseMeta, Style as Style$1, ScriptBase, Noscript as Noscript$1, BodyEvents, MergeHead, HeadEntryOptions, MetaFlatInput, Unhead, SafeMeta, SafeLink, SafeNoscript, SafeScript, SafeHtmlAttr, SafeBodyAttr } from '@unhead/schema';
2
2
  export { ActiveHeadEntry, Head, HeadEntryOptions, HeadTag, MergeHead, ResolvedHead, Unhead } from '@unhead/schema';
3
3
  import { ComputedRef, Ref, Plugin } from 'vue';
4
4
 
5
- type MaybeReadonlyRef<T> = ComputedRef<T>;
6
- type MaybeComputedRef<T> = T | MaybeReadonlyRef<T> | Ref<T>;
7
- type MaybeComputedRefOrFalsy<T> = T | MaybeReadonlyRef<T> | Ref<T>;
8
- /**
9
- * @deprecated Use MaybeComputedRefOrFalsy
10
- */
11
- type MaybeComputedRefOrPromise<T> = MaybeComputedRefOrFalsy<T>;
12
- type MaybeComputedRefEntries<T> = MaybeComputedRef<T> | {
13
- [key in keyof T]?: MaybeComputedRefOrFalsy<T[key]>;
14
- };
15
- type MaybeComputedRefEntriesOnly<T> = {
16
- [key in keyof T]?: MaybeComputedRefOrFalsy<T[key]>;
5
+ type MaybeComputedRef<T> = T | (() => T) | ComputedRef<T> | Ref<T>;
6
+ type ResolvableArray<T> = MaybeComputedRef<MaybeComputedRef<T>[]>;
7
+ type ResolvableProperties<T> = {
8
+ [key in keyof T]?: MaybeComputedRef<T[key] | Falsey>;
17
9
  };
18
10
 
19
11
  interface HtmlAttr extends Omit<BaseHtmlAttr, 'class'> {
@@ -38,16 +30,18 @@ interface BodyAttr extends Omit<BaseBodyAttr, 'class' | 'style'> {
38
30
  */
39
31
  style?: MaybeArray<MaybeComputedRef<string>> | Record<string, MaybeComputedRef<string | boolean>>;
40
32
  }
41
- type Title = MaybeComputedRef<Title$1>;
33
+ type Title = MaybeFunction<number | string | Falsey> | ResolvableValues<({
34
+ textContent: string;
35
+ } & SchemaAugmentations['title'])>;
42
36
  type TitleTemplate = TitleTemplate$1 | Ref<TitleTemplate$1> | ((title?: string) => TitleTemplate$1);
43
- type Base<E extends EntryAugmentation = Record<string, any>> = MaybeComputedRef<MaybeComputedRefEntries<Base$1<E>>>;
44
- type Link<E extends EntryAugmentation = Record<string, any>> = MaybeComputedRefEntries<Link$1<E>>;
45
- type Meta<E extends EntryAugmentation = Record<string, any>> = MaybeComputedRefEntries<Meta$1<E>>;
46
- type Style<E extends EntryAugmentation = Record<string, any>> = MaybeComputedRefEntries<Style$1<E>>;
47
- type Script<E extends EntryAugmentation = Record<string, any>> = MaybeComputedRefEntries<Script$1<E>>;
48
- type Noscript<E extends EntryAugmentation = Record<string, any>> = MaybeComputedRefEntries<Noscript$1<E>>;
49
- type HtmlAttributes<E extends EntryAugmentation = Record<string, any>> = MaybeComputedRef<MaybeComputedRefEntries<HtmlAttr & DataKeys & SchemaAugmentations['htmlAttrs'] & DefinedValueOrEmptyObject<E>>>;
50
- type BodyAttributes<E extends EntryAugmentation = Record<string, any>> = MaybeComputedRef<MaybeComputedRefEntries<BodyAttr & DataKeys & SchemaAugmentations['bodyAttrs'] & DefinedValueOrEmptyObject<E>> & MaybeEventFnHandlers<BodyEvents>>;
37
+ type Base<E extends EntryAugmentation = Record<string, any>> = ResolvableProperties<Base$1 & SchemaAugmentations['base']> & DefinedValueOrEmptyObject<E>;
38
+ type Link<E extends EntryAugmentation = Record<string, any>> = ResolvableProperties<LinkBase & DataKeys & SchemaAugmentations['link']> & MaybeEventFnHandlers<HttpEventAttributes> & DefinedValueOrEmptyObject<E>;
39
+ type Meta<E extends EntryAugmentation = Record<string, any>> = ResolvableProperties<BaseMeta & DataKeys & SchemaAugmentations['meta']> & DefinedValueOrEmptyObject<E>;
40
+ type Style<E extends EntryAugmentation = Record<string, any>> = ResolvableProperties<Style$1 & DataKeys & SchemaAugmentations['style']> & DefinedValueOrEmptyObject<E>;
41
+ type Script<E extends EntryAugmentation = Record<string, any>> = ResolvableProperties<ScriptBase & DataKeys & SchemaAugmentations['script']> & MaybeEventFnHandlers<HttpEventAttributes> & DefinedValueOrEmptyObject<E>;
42
+ type Noscript<E extends EntryAugmentation = Record<string, any>> = ResolvableProperties<Noscript$1 & DataKeys & SchemaAugmentations['noscript']> & DefinedValueOrEmptyObject<E>;
43
+ type HtmlAttributes<E extends EntryAugmentation = Record<string, any>> = ResolvableProperties<HtmlAttr & DataKeys & SchemaAugmentations['htmlAttrs']> & DefinedValueOrEmptyObject<E>;
44
+ type BodyAttributes<E extends EntryAugmentation = Record<string, any>> = ResolvableProperties<BodyAttr & DataKeys & SchemaAugmentations['bodyAttrs']> & MaybeEventFnHandlers<BodyEvents> & DefinedValueOrEmptyObject<E>;
51
45
  interface ReactiveHead<E extends MergeHead = MergeHead> {
52
46
  /**
53
47
  * The `<title>` HTML element defines the document's title that is shown in a browser's title bar or a page's tab.
@@ -63,9 +57,9 @@ interface ReactiveHead<E extends MergeHead = MergeHead> {
63
57
  /**
64
58
  * Variables used to substitute in the title and meta content.
65
59
  */
66
- templateParams?: MaybeComputedRefEntries<{
60
+ templateParams?: ResolvableArray<{
67
61
  separator?: '|' | '-' | '·' | string;
68
- } & Record<string, null | string | MaybeComputedRefEntries<Record<string, null | string>>>>;
62
+ } & Record<string, null | string | ResolvableArray<Record<string, null | string>>>>;
69
63
  /**
70
64
  * The `<base>` HTML element specifies the base URL to use for all relative URLs in a document.
71
65
  * There can be only one <base> element in a document.
@@ -80,33 +74,33 @@ interface ReactiveHead<E extends MergeHead = MergeHead> {
80
74
  *
81
75
  * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#attr-as
82
76
  */
83
- link?: MaybeComputedRef<Link<E['link']>[]>;
77
+ link?: ResolvableArray<Link<E['link']>>;
84
78
  /**
85
79
  * The `<meta>` element represents metadata that cannot be expressed in other HTML elements, like `<link>` or `<script>`.
86
80
  *
87
81
  * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta
88
82
  */
89
- meta?: MaybeComputedRef<Meta<E['meta']>[]>;
83
+ meta?: ResolvableArray<Meta<E['meta']>>;
90
84
  /**
91
85
  * The `<style>` HTML element contains style information for a document, or part of a document.
92
86
  * It contains CSS, which is applied to the contents of the document containing the `<style>` element.
93
87
  *
94
88
  * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/style
95
89
  */
96
- style?: MaybeComputedRef<(Style<E['style']> | string)[]>;
90
+ style?: ResolvableArray<(Style<E['style']> | string)>;
97
91
  /**
98
92
  * The `<script>` HTML element is used to embed executable code or data; this is typically used to embed or refer to JavaScript code.
99
93
  *
100
94
  * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script
101
95
  */
102
- script?: MaybeComputedRef<(Script<E['script']> | string)[]>;
96
+ script?: ResolvableArray<(Script<E['script']> | string)>;
103
97
  /**
104
98
  * The `<noscript>` HTML element defines a section of HTML to be inserted if a script type on the page is unsupported
105
99
  * or if scripting is currently turned off in the browser.
106
100
  *
107
101
  * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/noscript
108
102
  */
109
- noscript?: MaybeComputedRef<(Noscript<E['noscript']> | string)[]>;
103
+ noscript?: ResolvableArray<(Noscript<E['noscript']> | string)>;
110
104
  /**
111
105
  * Attributes for the `<html>` HTML element.
112
106
  *
@@ -124,20 +118,20 @@ type UseHeadOptions = Omit<HeadEntryOptions, 'head'> & {
124
118
  head?: VueHeadClient<any>;
125
119
  };
126
120
  type UseHeadInput<T extends MergeHead = Record<string, any>> = MaybeComputedRef<ReactiveHead<T>>;
127
- type UseSeoMetaInput = MaybeComputedRefEntriesOnly<MetaFlatInput> & {
121
+ type UseSeoMetaInput = ResolvableProperties<MetaFlatInput> & {
128
122
  title?: ReactiveHead['title'];
129
123
  titleTemplate?: ReactiveHead['titleTemplate'];
130
124
  };
131
125
  type VueHeadClient<T extends MergeHead> = Unhead<MaybeComputedRef<ReactiveHead<T>>> & Plugin;
132
126
 
133
127
  interface HeadSafe extends Pick<ReactiveHead, 'title' | 'titleTemplate' | 'templateParams'> {
134
- meta?: MaybeComputedRefEntries<SafeMeta>[];
135
- link?: MaybeComputedRefEntries<SafeLink>[];
136
- noscript?: MaybeComputedRefEntries<SafeNoscript>[];
137
- script?: MaybeComputedRefEntries<SafeScript>[];
138
- htmlAttrs?: MaybeComputedRefEntries<SafeHtmlAttr>;
139
- bodyAttrs?: MaybeComputedRefEntries<SafeBodyAttr>;
128
+ meta?: ResolvableArray<SafeMeta>[];
129
+ link?: ResolvableArray<SafeLink>[];
130
+ noscript?: ResolvableArray<SafeNoscript>[];
131
+ script?: ResolvableArray<SafeScript>[];
132
+ htmlAttrs?: ResolvableArray<SafeHtmlAttr>;
133
+ bodyAttrs?: ResolvableArray<SafeBodyAttr>;
140
134
  }
141
135
  type UseHeadSafeInput = MaybeComputedRef<HeadSafe>;
142
136
 
143
- export type { Base, BodyAttr, BodyAttributes, HeadSafe, HtmlAttr, HtmlAttributes, Link, MaybeComputedRef, MaybeComputedRefEntries, MaybeComputedRefEntriesOnly, MaybeComputedRefOrFalsy, MaybeComputedRefOrPromise, MaybeReadonlyRef, Meta, Noscript, ReactiveHead, Script, Style, Title, TitleTemplate, UseHeadInput, UseHeadOptions, UseHeadSafeInput, UseSeoMetaInput, VueHeadClient };
137
+ export type { Base, BodyAttr, BodyAttributes, HeadSafe, HtmlAttr, HtmlAttributes, Link, MaybeComputedRef, Meta, Noscript, ReactiveHead, ResolvableArray, ResolvableProperties, Script, Style, Title, TitleTemplate, UseHeadInput, UseHeadOptions, UseHeadSafeInput, UseSeoMetaInput, VueHeadClient };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@unhead/vue",
3
3
  "type": "module",
4
- "version": "2.0.0-alpha.6",
4
+ "version": "2.0.0-alpha.8",
5
5
  "description": "Full-stack <head> manager built for Vue.",
6
6
  "author": "Harlan Wilton <harlan@harlanzw.com>",
7
7
  "license": "MIT",
@@ -77,9 +77,9 @@
77
77
  "files": [
78
78
  "client.d.ts",
79
79
  "dist",
80
+ "legacy.d.ts",
80
81
  "server.d.ts",
81
- "types.d.ts",
82
- "legacy.d.ts"
82
+ "types.d.ts"
83
83
  ],
84
84
  "peerDependencies": {
85
85
  "vue": ">=3.5.13"
@@ -91,9 +91,9 @@
91
91
  },
92
92
  "dependencies": {
93
93
  "hookable": "^5.5.3",
94
- "@unhead/schema": "2.0.0-alpha.6",
95
- "@unhead/shared": "2.0.0-alpha.6",
96
- "unhead": "2.0.0-alpha.6"
94
+ "@unhead/schema": "2.0.0-alpha.8",
95
+ "@unhead/shared": "2.0.0-alpha.8",
96
+ "unhead": "2.0.0-alpha.8"
97
97
  },
98
98
  "scripts": {
99
99
  "build": "unbuild .",