unhead 1.0.21 → 1.0.22
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 +388 -436
- package/dist/index.d.ts +42 -23
- package/dist/index.mjs +386 -444
- package/package.json +9 -8
package/dist/index.d.ts
CHANGED
|
@@ -1,25 +1,30 @@
|
|
|
1
1
|
import * as _unhead_schema from '@unhead/schema';
|
|
2
|
-
import { Head, HeadEntryOptions, ActiveHeadEntry, Title, Base, Meta, MetaFlatInput, Link, Script, Style, Noscript, HtmlAttributes, BodyAttributes, TitleTemplate, Unhead, HeadPlugin, CreateHeadOptions, HeadEntry
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
import { HeadTag, Head, HeadEntryOptions, ActiveHeadEntry, Title, Base, Meta, MetaFlatInput, Link, Script, Style, Noscript, HtmlAttributes, BodyAttributes, TitleTemplate, Unhead, HeadPlugin, CreateHeadOptions, HeadEntry } from '@unhead/schema';
|
|
3
|
+
import { Arrayable } from '@unhead/shared';
|
|
4
|
+
export * from '@unhead/shared';
|
|
5
|
+
|
|
6
|
+
declare const TAG_WEIGHTS: {
|
|
7
|
+
readonly critical: 2;
|
|
8
|
+
readonly high: 9;
|
|
9
|
+
readonly low: 12;
|
|
10
|
+
readonly base: -1;
|
|
11
|
+
readonly title: 1;
|
|
12
|
+
readonly meta: 10;
|
|
13
|
+
};
|
|
14
|
+
declare function tagWeight<T extends HeadTag>(tag: T): any;
|
|
15
|
+
declare const SortModifiers: {
|
|
16
|
+
prefix: string;
|
|
17
|
+
offset: number;
|
|
18
|
+
}[];
|
|
19
|
+
declare function SortTagsPlugin(): _unhead_schema.HeadPlugin;
|
|
11
20
|
|
|
21
|
+
declare const renderTitleTemplate: (template: string | ((title?: string) => string | null) | null, title?: string) => string | null;
|
|
12
22
|
declare const TitleTemplatePlugin: () => _unhead_schema.HeadPlugin;
|
|
13
23
|
|
|
14
24
|
declare const DeprecatedTagAttrPlugin: () => _unhead_schema.HeadPlugin;
|
|
15
25
|
|
|
16
26
|
declare const ProvideTagHashPlugin: () => _unhead_schema.HeadPlugin;
|
|
17
27
|
|
|
18
|
-
interface TriggerDomPatchingOnUpdatesPluginOptions extends RenderDomHeadOptions {
|
|
19
|
-
delayFn?: (fn: () => void) => void;
|
|
20
|
-
}
|
|
21
|
-
declare const PatchDomOnEntryUpdatesPlugin: (options?: TriggerDomPatchingOnUpdatesPluginOptions) => _unhead_schema.HeadPlugin;
|
|
22
|
-
|
|
23
28
|
/**
|
|
24
29
|
* Supports DOM event handlers (i.e `onload`) as functions.
|
|
25
30
|
*
|
|
@@ -27,10 +32,6 @@ declare const PatchDomOnEntryUpdatesPlugin: (options?: TriggerDomPatchingOnUpdat
|
|
|
27
32
|
*/
|
|
28
33
|
declare const EventHandlersPlugin: () => _unhead_schema.HeadPlugin;
|
|
29
34
|
|
|
30
|
-
type Arrayable<T> = T | Array<T>;
|
|
31
|
-
declare function asArray<T>(value: Arrayable<T>): T[];
|
|
32
|
-
declare const HasElementTags: string[];
|
|
33
|
-
|
|
34
35
|
declare function useHead<T extends Head>(input: T, options?: HeadEntryOptions): ActiveHeadEntry<T> | void;
|
|
35
36
|
declare const useTagTitle: (title: Title) => ActiveHeadEntry<any> | void;
|
|
36
37
|
declare const useTagBase: (base: Base) => ActiveHeadEntry<any> | void;
|
|
@@ -78,14 +79,32 @@ declare function createHead<T extends {} = Head>(options?: CreateHeadOptions): U
|
|
|
78
79
|
*/
|
|
79
80
|
declare function createHeadCore<T extends {} = Head>(options?: CreateHeadOptions): Unhead<T>;
|
|
80
81
|
|
|
81
|
-
declare function defineHeadPlugin(plugin: HeadPlugin): HeadPlugin;
|
|
82
|
-
|
|
83
|
-
declare function normaliseEntryTags<T extends {} = Head>(e: HeadEntry<T>): Promise<HeadTag[]>;
|
|
84
|
-
|
|
85
82
|
declare const composableNames: string[];
|
|
86
83
|
declare const unheadComposablesImports: {
|
|
87
84
|
from: string;
|
|
88
85
|
imports: string[];
|
|
89
86
|
}[];
|
|
90
87
|
|
|
91
|
-
|
|
88
|
+
/**
|
|
89
|
+
* Convert an array of meta entries to a flat object.
|
|
90
|
+
* @param inputs
|
|
91
|
+
*/
|
|
92
|
+
declare function packMeta<T extends Required<Head>['meta']>(inputs: T): MetaFlatInput;
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Converts a flat meta object into an array of meta entries.
|
|
96
|
+
* @param input
|
|
97
|
+
*/
|
|
98
|
+
declare function unpackMeta<T extends MetaFlatInput>(input: T): Required<Head>['meta'];
|
|
99
|
+
|
|
100
|
+
declare function normaliseTag<T extends HeadTag>(tagName: T['tag'], input: any): Promise<T | T[]>;
|
|
101
|
+
declare function normaliseProps<T extends HeadTag['props']>(props: T): Promise<T>;
|
|
102
|
+
declare const TagEntityBits = 10;
|
|
103
|
+
declare function normaliseEntryTags<T extends {} = Head>(e: HeadEntry<T>): Promise<HeadTag[]>;
|
|
104
|
+
|
|
105
|
+
declare const PropertyPrefixKeys: RegExp;
|
|
106
|
+
declare const ColonPrefixKeys: RegExp;
|
|
107
|
+
declare function fixKeyCase(key: string): string;
|
|
108
|
+
declare function changeKeyCasingDeep<T extends any>(input: T): T;
|
|
109
|
+
|
|
110
|
+
export { ColonPrefixKeys, CorePlugins, DOMPlugins, DeprecatedTagAttrPlugin, EventHandlersPlugin, PropertyPrefixKeys, ProvideTagHashPlugin, SortModifiers, SortTagsPlugin, TAG_WEIGHTS, TagEntityBits, TitleTemplatePlugin, UseSeoMetaInput, activeHead, changeKeyCasingDeep, composableNames, createHead, createHeadCore, fixKeyCase, getActiveHead, normaliseEntryTags, normaliseProps, normaliseTag, packMeta, renderTitleTemplate, setActiveHead, tagWeight, unheadComposablesImports, unpackMeta, useBodyAttrs, useHead, useHtmlAttrs, useSeoMeta, useServerBodyAttrs, useServerHead, useServerHtmlAttrs, useServerTagBase, useServerTagLink, useServerTagMeta, useServerTagMetaFlat, useServerTagNoscript, useServerTagScript, useServerTagStyle, useServerTagTitle, useServerTitleTemplate, useTagBase, useTagLink, useTagMeta, useTagMetaFlat, useTagNoscript, useTagScript, useTagStyle, useTagTitle, useTitleTemplate };
|