@unhead/schema
Advanced tools
Comparing version 0.2.5 to 0.2.6
@@ -223,9 +223,16 @@ import { HeadTag as HeadTag$1, MergeHead, BodyAttributes as BodyAttributes$1, HtmlAttributes as HtmlAttributes$1, Merge, Base as Base$1, DefinedValueOrEmptyObject, Link as Link$1, DataKeys, Style as Style$1, Script as Script$1, Noscript as Noscript$1, Meta as Meta$1, Stringable } from '@zhead/schema'; | ||
interface DomRenderTagContext { | ||
head: HeadClient; | ||
shouldRender: boolean; | ||
tag: HeadTag; | ||
document: Document; | ||
} | ||
interface BeforeRenderContext { | ||
shouldRender: boolean; | ||
tags: HeadTag[]; | ||
} | ||
interface SSRRenderContext { | ||
tags: HeadTag[]; | ||
html: SSRHeadPayload; | ||
} | ||
interface HeadHooks { | ||
'init': (ctx: HeadClient<any>) => HookResult; | ||
'entries:updated': (ctx: HeadClient<any>) => HookResult; | ||
'init': (ctx: Unhead<any>) => HookResult; | ||
'entries:updated': (ctx: Unhead<any>) => HookResult; | ||
'entries:resolve': (ctx: EntryResolveCtx<any>) => HookResult; | ||
@@ -239,15 +246,6 @@ 'tag:normalise': (ctx: { | ||
}) => HookResult; | ||
'dom:beforeRender': (ctx: { | ||
head: HeadClient; | ||
tags: HeadTag[]; | ||
document: Document; | ||
}) => HookResult; | ||
'dom:beforeRender': (ctx: BeforeRenderContext) => HookResult; | ||
'dom:renderTag': (ctx: DomRenderTagContext) => HookResult; | ||
'ssr:beforeRender': (ctx: { | ||
tags: HeadTag[]; | ||
}) => HookResult; | ||
'ssr:render': (ctx: { | ||
tags: HeadTag[]; | ||
html: SSRHeadPayload; | ||
}) => HookResult; | ||
'ssr:beforeRender': (ctx: BeforeRenderContext) => HookResult; | ||
'ssr:render': (ctx: SSRRenderContext) => HookResult; | ||
} | ||
@@ -262,7 +260,7 @@ | ||
declare type RuntimeMode = 'server' | 'client' | 'all'; | ||
interface HeadEntry<T> { | ||
interface HeadEntry<Input> { | ||
/** | ||
* User provided input for the entry. | ||
*/ | ||
input: T; | ||
input: Input; | ||
/** | ||
@@ -291,3 +289,3 @@ * The mode that the entry should be used in. | ||
*/ | ||
interface ActiveHeadEntry<T> { | ||
interface ActiveHeadEntry<Input> { | ||
/** | ||
@@ -298,3 +296,3 @@ * Updates the entry with new input. | ||
*/ | ||
patch: (resolvedInput: T) => void; | ||
patch: (input: Input) => void; | ||
/** | ||
@@ -308,2 +306,4 @@ * Dispose the entry, removing it from the active head. | ||
interface CreateHeadOptions { | ||
domDelayFn?: (fn: () => void) => void; | ||
document?: Document; | ||
plugins?: HeadPlugin[]; | ||
@@ -315,11 +315,11 @@ hooks?: NestedHooks<HeadHooks>; | ||
} | ||
interface HeadClient<T extends {} = Head> { | ||
interface Unhead<Input extends {} = Head> { | ||
/** | ||
* The active head entries. | ||
*/ | ||
headEntries: () => HeadEntry<T>[]; | ||
headEntries: () => HeadEntry<Input>[]; | ||
/** | ||
* Create a new head entry. | ||
*/ | ||
push: (entry: T, options?: HeadEntryOptions) => ActiveHeadEntry<T>; | ||
push: (entry: Input, options?: HeadEntryOptions) => ActiveHeadEntry<Input>; | ||
/** | ||
@@ -343,2 +343,2 @@ * Resolve tags from head entries. | ||
export { ActiveHeadEntry, Base, BaseBodyAttr, BaseHtmlAttr, BodyAttributes, CreateHeadOptions, DomRenderTagContext, EntryAugmentation, EntryResolveCtx, Head, HeadClient, HeadEntry, HeadEntryOptions, HeadHooks, HeadPlugin, HeadTag, HeadTagKeys, HookResult, HtmlAttributes, InnerContent, Link, MaybeArray, Meta, Never, Noscript, ResolvesDuplicates, RuntimeMode, SSRHeadPayload, SchemaAugmentations, Script, SideEffectsRecord, Style, TagInternalProperties, TagPosition, TagPriority, TagUserProperties, Title, TitleTemplate, UserAttributesConfig, UserTagConfigWithoutInnerContent }; | ||
export { ActiveHeadEntry, Base, BaseBodyAttr, BaseHtmlAttr, BeforeRenderContext, BodyAttributes, CreateHeadOptions, DomRenderTagContext, EntryAugmentation, EntryResolveCtx, Head, HeadEntry, HeadEntryOptions, HeadHooks, HeadPlugin, HeadTag, HeadTagKeys, HookResult, HtmlAttributes, InnerContent, Link, MaybeArray, Meta, Never, Noscript, ResolvesDuplicates, RuntimeMode, SSRHeadPayload, SSRRenderContext, SchemaAugmentations, Script, SideEffectsRecord, Style, TagInternalProperties, TagPosition, TagPriority, TagUserProperties, Title, TitleTemplate, Unhead, UserAttributesConfig, UserTagConfigWithoutInnerContent }; |
{ | ||
"name": "@unhead/schema", | ||
"type": "module", | ||
"version": "0.2.5", | ||
"version": "0.2.6", | ||
"packageManager": "pnpm@7.14.0", | ||
@@ -6,0 +6,0 @@ "author": "Harlan Wilton <harlan@harlanzw.com>", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13560