@unhead/schema 1.8.0-beta.2 → 1.8.0-beta.5

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.d.cts CHANGED
@@ -143,7 +143,14 @@ interface HeadEntry<Input> {
143
143
  type HeadPluginOptions = Omit<CreateHeadOptions, 'plugins'> & {
144
144
  mode?: RuntimeMode;
145
145
  };
146
- type HeadPlugin = HeadPluginOptions | ((head: Unhead) => HeadPluginOptions);
146
+ type HeadPluginInput = (HeadPluginOptions & {
147
+ key?: string;
148
+ }) | ((head: Unhead) => HeadPluginOptions & {
149
+ key?: string;
150
+ });
151
+ type HeadPlugin = HeadPluginOptions & {
152
+ key?: string;
153
+ };
147
154
  /**
148
155
  * An active head entry provides an API to manipulate it.
149
156
  */
@@ -164,7 +171,7 @@ interface ActiveHeadEntry<Input> {
164
171
  interface CreateHeadOptions {
165
172
  domDelayFn?: (fn: () => void) => void;
166
173
  document?: Document;
167
- plugins?: HeadPlugin[];
174
+ plugins?: HeadPluginInput[];
168
175
  hooks?: NestedHooks<HeadHooks>;
169
176
  }
170
177
  interface HeadEntryOptions extends TagPosition, TagPriority, ProcessesTemplateParams {
@@ -173,6 +180,10 @@ interface HeadEntryOptions extends TagPosition, TagPriority, ProcessesTemplatePa
173
180
  head?: Unhead;
174
181
  }
175
182
  interface Unhead<Input extends {} = Head> {
183
+ /**
184
+ * Registered plugins.
185
+ */
186
+ plugins: HeadPlugin[];
176
187
  /**
177
188
  * The active head entries.
178
189
  */
@@ -196,7 +207,7 @@ interface Unhead<Input extends {} = Head> {
196
207
  /**
197
208
  * Use a head plugin, loads the plugins hooks.
198
209
  */
199
- use: (plugin: HeadPlugin) => void;
210
+ use: (plugin: HeadPluginInput) => void;
200
211
  /**
201
212
  * Is it a server-side render context.
202
213
  */
@@ -293,7 +304,7 @@ interface TagPriority {
293
304
  type TagUserProperties = TagPriority & TagPosition & MaybePromiseProps<InnerContent> & ResolvesDuplicates & ProcessesTemplateParams;
294
305
  type TagKey = keyof Head;
295
306
  type TemplateParams = {
296
- separator?: string;
307
+ separator?: '|' | '-' | '·' | string;
297
308
  } & Record<string, null | string | Record<string, string>>;
298
309
  interface ProcessesTemplateParams {
299
310
  processTemplateParams?: boolean;
@@ -504,4 +515,4 @@ interface HeadSafe extends Pick<Head, 'title' | 'titleTemplate' | 'templateParam
504
515
  bodyAttrs?: SafeBodyAttr;
505
516
  }
506
517
 
507
- export type { ActiveHeadEntry, Base, BaseBodyAttr, BaseHtmlAttr, BaseMeta, BodyAttr, BodyAttributes, CreateHeadOptions, DomBeforeRenderCtx, DomRenderTagContext, DomState, EntryAugmentation, EntryResolveCtx, HasTemplateParams, Head, HeadEntry, HeadEntryOptions, HeadHooks, HeadPlugin, HeadPluginOptions, HeadSafe, HeadTag, HeadTagKeys, HeadUtils, HookResult, HtmlAttr, HtmlAttributes, InnerContent, InnerContentVal, Link, MaybeArray, MaybeFunctionEntries, Meta, Never, Noscript, ProcessesTemplateParams, ResolvesDuplicates, RuntimeMode, SSRHeadPayload, SSRRenderContext, SafeBodyAttr, SafeHtmlAttr, SafeLink, SafeMeta, SafeNoscript, SafeScript, SchemaAugmentations, Script, ScriptInstance, ShouldRenderContext, SideEffectsRecord, Style, TagKey, TagPosition, TagPriority, TagUserProperties, TemplateParams, Title, TitleTemplate, Unhead, UseScriptInput, UseScriptOptions, UseScriptStatus, UseSeoMetaInput, UserAttributesConfig, UserTagConfigWithoutInnerContent, ValidTagPositions };
518
+ export type { ActiveHeadEntry, Base, BaseBodyAttr, BaseHtmlAttr, BaseMeta, BodyAttr, BodyAttributes, CreateHeadOptions, DomBeforeRenderCtx, DomRenderTagContext, DomState, EntryAugmentation, EntryResolveCtx, HasTemplateParams, Head, HeadEntry, HeadEntryOptions, HeadHooks, HeadPlugin, HeadPluginInput, HeadPluginOptions, HeadSafe, HeadTag, HeadTagKeys, HeadUtils, HookResult, HtmlAttr, HtmlAttributes, InnerContent, InnerContentVal, Link, MaybeArray, MaybeFunctionEntries, Meta, Never, Noscript, ProcessesTemplateParams, ResolvesDuplicates, RuntimeMode, SSRHeadPayload, SSRRenderContext, SafeBodyAttr, SafeHtmlAttr, SafeLink, SafeMeta, SafeNoscript, SafeScript, SchemaAugmentations, Script, ScriptInstance, ShouldRenderContext, SideEffectsRecord, Style, TagKey, TagPosition, TagPriority, TagUserProperties, TemplateParams, Title, TitleTemplate, Unhead, UseScriptInput, UseScriptOptions, UseScriptStatus, UseSeoMetaInput, UserAttributesConfig, UserTagConfigWithoutInnerContent, ValidTagPositions };
package/dist/index.d.mts CHANGED
@@ -143,7 +143,14 @@ interface HeadEntry<Input> {
143
143
  type HeadPluginOptions = Omit<CreateHeadOptions, 'plugins'> & {
144
144
  mode?: RuntimeMode;
145
145
  };
146
- type HeadPlugin = HeadPluginOptions | ((head: Unhead) => HeadPluginOptions);
146
+ type HeadPluginInput = (HeadPluginOptions & {
147
+ key?: string;
148
+ }) | ((head: Unhead) => HeadPluginOptions & {
149
+ key?: string;
150
+ });
151
+ type HeadPlugin = HeadPluginOptions & {
152
+ key?: string;
153
+ };
147
154
  /**
148
155
  * An active head entry provides an API to manipulate it.
149
156
  */
@@ -164,7 +171,7 @@ interface ActiveHeadEntry<Input> {
164
171
  interface CreateHeadOptions {
165
172
  domDelayFn?: (fn: () => void) => void;
166
173
  document?: Document;
167
- plugins?: HeadPlugin[];
174
+ plugins?: HeadPluginInput[];
168
175
  hooks?: NestedHooks<HeadHooks>;
169
176
  }
170
177
  interface HeadEntryOptions extends TagPosition, TagPriority, ProcessesTemplateParams {
@@ -173,6 +180,10 @@ interface HeadEntryOptions extends TagPosition, TagPriority, ProcessesTemplatePa
173
180
  head?: Unhead;
174
181
  }
175
182
  interface Unhead<Input extends {} = Head> {
183
+ /**
184
+ * Registered plugins.
185
+ */
186
+ plugins: HeadPlugin[];
176
187
  /**
177
188
  * The active head entries.
178
189
  */
@@ -196,7 +207,7 @@ interface Unhead<Input extends {} = Head> {
196
207
  /**
197
208
  * Use a head plugin, loads the plugins hooks.
198
209
  */
199
- use: (plugin: HeadPlugin) => void;
210
+ use: (plugin: HeadPluginInput) => void;
200
211
  /**
201
212
  * Is it a server-side render context.
202
213
  */
@@ -293,7 +304,7 @@ interface TagPriority {
293
304
  type TagUserProperties = TagPriority & TagPosition & MaybePromiseProps<InnerContent> & ResolvesDuplicates & ProcessesTemplateParams;
294
305
  type TagKey = keyof Head;
295
306
  type TemplateParams = {
296
- separator?: string;
307
+ separator?: '|' | '-' | '·' | string;
297
308
  } & Record<string, null | string | Record<string, string>>;
298
309
  interface ProcessesTemplateParams {
299
310
  processTemplateParams?: boolean;
@@ -504,4 +515,4 @@ interface HeadSafe extends Pick<Head, 'title' | 'titleTemplate' | 'templateParam
504
515
  bodyAttrs?: SafeBodyAttr;
505
516
  }
506
517
 
507
- export type { ActiveHeadEntry, Base, BaseBodyAttr, BaseHtmlAttr, BaseMeta, BodyAttr, BodyAttributes, CreateHeadOptions, DomBeforeRenderCtx, DomRenderTagContext, DomState, EntryAugmentation, EntryResolveCtx, HasTemplateParams, Head, HeadEntry, HeadEntryOptions, HeadHooks, HeadPlugin, HeadPluginOptions, HeadSafe, HeadTag, HeadTagKeys, HeadUtils, HookResult, HtmlAttr, HtmlAttributes, InnerContent, InnerContentVal, Link, MaybeArray, MaybeFunctionEntries, Meta, Never, Noscript, ProcessesTemplateParams, ResolvesDuplicates, RuntimeMode, SSRHeadPayload, SSRRenderContext, SafeBodyAttr, SafeHtmlAttr, SafeLink, SafeMeta, SafeNoscript, SafeScript, SchemaAugmentations, Script, ScriptInstance, ShouldRenderContext, SideEffectsRecord, Style, TagKey, TagPosition, TagPriority, TagUserProperties, TemplateParams, Title, TitleTemplate, Unhead, UseScriptInput, UseScriptOptions, UseScriptStatus, UseSeoMetaInput, UserAttributesConfig, UserTagConfigWithoutInnerContent, ValidTagPositions };
518
+ export type { ActiveHeadEntry, Base, BaseBodyAttr, BaseHtmlAttr, BaseMeta, BodyAttr, BodyAttributes, CreateHeadOptions, DomBeforeRenderCtx, DomRenderTagContext, DomState, EntryAugmentation, EntryResolveCtx, HasTemplateParams, Head, HeadEntry, HeadEntryOptions, HeadHooks, HeadPlugin, HeadPluginInput, HeadPluginOptions, HeadSafe, HeadTag, HeadTagKeys, HeadUtils, HookResult, HtmlAttr, HtmlAttributes, InnerContent, InnerContentVal, Link, MaybeArray, MaybeFunctionEntries, Meta, Never, Noscript, ProcessesTemplateParams, ResolvesDuplicates, RuntimeMode, SSRHeadPayload, SSRRenderContext, SafeBodyAttr, SafeHtmlAttr, SafeLink, SafeMeta, SafeNoscript, SafeScript, SchemaAugmentations, Script, ScriptInstance, ShouldRenderContext, SideEffectsRecord, Style, TagKey, TagPosition, TagPriority, TagUserProperties, TemplateParams, Title, TitleTemplate, Unhead, UseScriptInput, UseScriptOptions, UseScriptStatus, UseSeoMetaInput, UserAttributesConfig, UserTagConfigWithoutInnerContent, ValidTagPositions };
package/dist/index.d.ts CHANGED
@@ -143,7 +143,14 @@ interface HeadEntry<Input> {
143
143
  type HeadPluginOptions = Omit<CreateHeadOptions, 'plugins'> & {
144
144
  mode?: RuntimeMode;
145
145
  };
146
- type HeadPlugin = HeadPluginOptions | ((head: Unhead) => HeadPluginOptions);
146
+ type HeadPluginInput = (HeadPluginOptions & {
147
+ key?: string;
148
+ }) | ((head: Unhead) => HeadPluginOptions & {
149
+ key?: string;
150
+ });
151
+ type HeadPlugin = HeadPluginOptions & {
152
+ key?: string;
153
+ };
147
154
  /**
148
155
  * An active head entry provides an API to manipulate it.
149
156
  */
@@ -164,7 +171,7 @@ interface ActiveHeadEntry<Input> {
164
171
  interface CreateHeadOptions {
165
172
  domDelayFn?: (fn: () => void) => void;
166
173
  document?: Document;
167
- plugins?: HeadPlugin[];
174
+ plugins?: HeadPluginInput[];
168
175
  hooks?: NestedHooks<HeadHooks>;
169
176
  }
170
177
  interface HeadEntryOptions extends TagPosition, TagPriority, ProcessesTemplateParams {
@@ -173,6 +180,10 @@ interface HeadEntryOptions extends TagPosition, TagPriority, ProcessesTemplatePa
173
180
  head?: Unhead;
174
181
  }
175
182
  interface Unhead<Input extends {} = Head> {
183
+ /**
184
+ * Registered plugins.
185
+ */
186
+ plugins: HeadPlugin[];
176
187
  /**
177
188
  * The active head entries.
178
189
  */
@@ -196,7 +207,7 @@ interface Unhead<Input extends {} = Head> {
196
207
  /**
197
208
  * Use a head plugin, loads the plugins hooks.
198
209
  */
199
- use: (plugin: HeadPlugin) => void;
210
+ use: (plugin: HeadPluginInput) => void;
200
211
  /**
201
212
  * Is it a server-side render context.
202
213
  */
@@ -293,7 +304,7 @@ interface TagPriority {
293
304
  type TagUserProperties = TagPriority & TagPosition & MaybePromiseProps<InnerContent> & ResolvesDuplicates & ProcessesTemplateParams;
294
305
  type TagKey = keyof Head;
295
306
  type TemplateParams = {
296
- separator?: string;
307
+ separator?: '|' | '-' | '·' | string;
297
308
  } & Record<string, null | string | Record<string, string>>;
298
309
  interface ProcessesTemplateParams {
299
310
  processTemplateParams?: boolean;
@@ -504,4 +515,4 @@ interface HeadSafe extends Pick<Head, 'title' | 'titleTemplate' | 'templateParam
504
515
  bodyAttrs?: SafeBodyAttr;
505
516
  }
506
517
 
507
- export type { ActiveHeadEntry, Base, BaseBodyAttr, BaseHtmlAttr, BaseMeta, BodyAttr, BodyAttributes, CreateHeadOptions, DomBeforeRenderCtx, DomRenderTagContext, DomState, EntryAugmentation, EntryResolveCtx, HasTemplateParams, Head, HeadEntry, HeadEntryOptions, HeadHooks, HeadPlugin, HeadPluginOptions, HeadSafe, HeadTag, HeadTagKeys, HeadUtils, HookResult, HtmlAttr, HtmlAttributes, InnerContent, InnerContentVal, Link, MaybeArray, MaybeFunctionEntries, Meta, Never, Noscript, ProcessesTemplateParams, ResolvesDuplicates, RuntimeMode, SSRHeadPayload, SSRRenderContext, SafeBodyAttr, SafeHtmlAttr, SafeLink, SafeMeta, SafeNoscript, SafeScript, SchemaAugmentations, Script, ScriptInstance, ShouldRenderContext, SideEffectsRecord, Style, TagKey, TagPosition, TagPriority, TagUserProperties, TemplateParams, Title, TitleTemplate, Unhead, UseScriptInput, UseScriptOptions, UseScriptStatus, UseSeoMetaInput, UserAttributesConfig, UserTagConfigWithoutInnerContent, ValidTagPositions };
518
+ export type { ActiveHeadEntry, Base, BaseBodyAttr, BaseHtmlAttr, BaseMeta, BodyAttr, BodyAttributes, CreateHeadOptions, DomBeforeRenderCtx, DomRenderTagContext, DomState, EntryAugmentation, EntryResolveCtx, HasTemplateParams, Head, HeadEntry, HeadEntryOptions, HeadHooks, HeadPlugin, HeadPluginInput, HeadPluginOptions, HeadSafe, HeadTag, HeadTagKeys, HeadUtils, HookResult, HtmlAttr, HtmlAttributes, InnerContent, InnerContentVal, Link, MaybeArray, MaybeFunctionEntries, Meta, Never, Noscript, ProcessesTemplateParams, ResolvesDuplicates, RuntimeMode, SSRHeadPayload, SSRRenderContext, SafeBodyAttr, SafeHtmlAttr, SafeLink, SafeMeta, SafeNoscript, SafeScript, SchemaAugmentations, Script, ScriptInstance, ShouldRenderContext, SideEffectsRecord, Style, TagKey, TagPosition, TagPriority, TagUserProperties, TemplateParams, Title, TitleTemplate, Unhead, UseScriptInput, UseScriptOptions, UseScriptStatus, UseSeoMetaInput, UserAttributesConfig, UserTagConfigWithoutInnerContent, ValidTagPositions };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@unhead/schema",
3
3
  "type": "module",
4
- "version": "1.8.0-beta.2",
4
+ "version": "1.8.0-beta.5",
5
5
  "author": "Harlan Wilton <harlan@harlanzw.com>",
6
6
  "license": "MIT",
7
7
  "funding": "https://github.com/sponsors/harlan-zw",