Socket
Socket
Sign inDemoInstall

@zhead/schema

Package Overview
Dependencies
Maintainers
1
Versions
61
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@zhead/schema - npm Package Compare versions

Comparing version 0.8.5 to 0.9.1

616

dist/index.d.ts

@@ -13,2 +13,66 @@ interface BodyAttributes {

style?: string;
/**
* This attribute defines the unique ID.
*/
id?: string;
/**
* Script to be run after the document is printed
*/
onafterprint?: string;
/**
* Script to be run before the document is printed
*/
onbeforeprint?: string;
/**
* Script to be run when the document is about to be unloaded
*/
onbeforeunload?: string;
/**
* Script to be run when an error occurs
*/
onerror?: string;
/**
* Script to be run when there has been changes to the anchor part of the a URL
*/
onhashchange?: string;
/**
* Fires after the page is finished loading
*/
onload?: string;
/**
* Script to be run when the message is triggered
*/
onmessage?: string;
/**
* Script to be run when the browser starts to work offline
*/
onoffline?: string;
/**
* Script to be run when the browser starts to work online
*/
ononline?: string;
/**
* Script to be run when a user navigates away from a page
*/
onpagehide?: string;
/**
* Script to be run when a user navigates to a page
*/
onpageshow?: string;
/**
* Script to be run when the window's history changes
*/
onpopstate?: string;
/**
* Fires when the browser window is resized
*/
onresize?: string;
/**
* Script to be run when a Web Storage area is updated
*/
onstorage?: string;
/**
* Fires once a page has unloaded (or the browser window has been closed)
*/
onunload?: string;
}

@@ -39,6 +103,499 @@

style?: string;
/**
* This attribute defines the unique ID.
*/
id?: string;
}
declare type Booleanable = boolean | 'false' | 'true' | '';
declare type Stringable = string | Booleanable | number;
interface DataKeys {
[key: `data-${string}`]: Stringable;
}
declare type Default<T extends undefined | Record<string, any>, D = {}> = [T] extends [undefined] ? D : T;
declare type Merge<T extends undefined | Record<string, any>, D = {}> = [T] extends [undefined] ? D : D & T;
interface MergeHead {
base?: {};
link?: {};
meta?: {};
style?: {};
script?: {};
noscript?: {};
htmlAttrs?: {};
bodyAttrs?: {};
}
interface GlobalAttributes {
/**
* Provides a hint for generating a keyboard shortcut for the current element. This attribute consists of a
* space-separated list of characters. The browser should use the first one that exists on the computer keyboard layout.
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/accesskey
*/
accesskey?: string;
/**
* Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/autocapitalize
*/
autocapitalize?: 'off' | 'none' | 'on' | 'sentences' | 'words' | 'characters';
/**
* Indicates that an element is to be focused on page load, or as soon as the <dialog> it is part of is displayed.
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/autofocus
*/
autofocus?: Booleanable;
/**
* A space-separated list of the classes of the element. Classes allows CSS and JavaScript to select and access
* specific elements via the class selectors or functions like the method Document.getElementsByClassName().
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/class
*/
class?: Stringable;
/**
* An enumerated attribute indicating if the element should be editable by the user.
* If so, the browser modifies its widget to allow editing.
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/contenteditable
*/
contenteditable?: Booleanable;
/**
* An enumerated attribute indicating the directionality of the element's text.
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/dir
*/
dir?: 'ltr' | 'rtl' | 'auto';
/**
* An enumerated attribute indicating whether the element can be dragged, using the Drag and Drop API.
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/draggable
*/
draggable?: Booleanable;
/**
* Hints what action label (or icon) to present for the enter key on virtual keyboards.
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/enterkeyhint
*/
enterkeyhint?: string;
/**
* Used to transitively export shadow parts from a nested shadow tree into a containing light tree.
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/exportparts
*/
exportparts?: string;
/**
* A Boolean attribute indicates that the element is not yet, or is no longer, relevant.
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/hidden
*/
hidden?: Booleanable;
/**
* The id global attribute defines a unique identifier (ID) which must be unique in the whole document.
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id
*/
id?: string;
/**
* Provides a hint to browsers as to the type of virtual keyboard configuration to use when editing this element or its contents.
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/inputmode
*/
inputmode?: string;
/**
* Allows you to specify that a standard HTML element should behave like a registered custom built-in element.
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/is
*/
is?: string;
/**
* The unique, global identifier of an item.
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/itemid
*/
itemid?: string;
/**
* Used to add properties to an item.
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/itemprop
*/
itemprop?: string;
/**
* Properties that are not descendants of an element with the itemscope attribute can be associated with the item using an itemref.
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/itemref
*/
itemref?: string;
/**
* itemscope (usually) works along with itemtype to specify that the HTML contained in a block is about a particular item.
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/itemscope
*/
itemscope?: string;
/**
* Specifies the URL of the vocabulary that will be used to define itemprops (item properties) in the data structure.
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/itemtype
*/
itemtype?: string;
/**
* Helps define the language of an element: the language that non-editable elements are in, or the language
* that editable elements should be written in by the user.
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/lang
*/
lang?: string;
/**
* A cryptographic nonce ("number used once") which can be used by Content Security Policy to determine whether or not
* a given fetch will be allowed to proceed.
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/nonce
*/
nonce?: string;
/**
* A space-separated list of the part names of the element. Part names allows CSS to select and style specific elements
* in a shadow tree via the ::part pseudo-element.
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/part
*/
part?: string;
/**
* Assigns a slot in a shadow DOM shadow tree to an element: An element with a slot attribute is assigned to the slot
* created by the <slot> element whose name attribute's value matches that slot attribute's value.
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/slot
*/
slot?: string;
/**
* An enumerated attribute defines whether the element may be checked for spelling errors.
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/spellcheck
*/
spellcheck?: Booleanable;
/**
* Contains CSS styling declarations to be applied to the element.
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/style
*/
style?: string;
/**
* An integer attribute indicating if the element can take input focus (is focusable),
* if it should participate to sequential keyboard navigation, and if so, at what position.
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex
*/
tabindex?: number;
/**
* Contains a text representing advisory information related to the element it belongs to.
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/title
*/
title?: string;
/**
* An enumerated attribute that is used to specify whether an element's attribute values and the values of its
* Text node children are to be translated when the page is localized, or whether to leave them unchanged.
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/translate
*/
translate?: 'yes' | 'no' | '';
}
interface AriaAttributes {
/**
* Indicates whether assistive technologies will present all, or only parts of, the changed region based on the change
* notifications defined by the aria-relevant attribute.
*/
role?: 'alert' | 'alertdialog' | 'application' | 'article' | 'banner' | 'button' | 'checkbox' | 'columnheader' | 'combobox' | 'complementary' | 'contentinfo' | 'definition' | 'dialog' | 'directory' | 'document' | 'feed' | 'figure' | 'form' | 'grid' | 'gridcell' | 'group' | 'heading' | 'img' | 'link' | 'list' | 'listbox' | 'listitem' | 'log' | 'main' | 'marquee' | 'math' | 'menu' | 'menubar' | 'menuitem' | 'menuitemcheckbox' | 'menuitemradio' | 'navigation' | 'note' | 'option' | 'presentation' | 'progressbar' | 'radio' | 'radiogroup' | 'region' | 'row' | 'rowgroup' | 'rowheader' | 'scrollbar' | 'search' | 'searchbox' | 'separator' | 'slider' | 'spinbutton' | 'status' | 'switch' | 'tab' | 'table' | 'tablist' | 'tabpanel' | 'textbox' | 'timer' | 'toolbar' | 'tooltip' | 'tree' | 'treegrid' | 'treeitem';
/**
* Identifies the currently active element when DOM focus is on a composite widget, textbox, group, or application.
*/
'aria-activedescendant'?: string;
/**
* Indicates whether assistive technologies will present all, or only parts of, the changed region based on the change
* notifications defined by the aria-relevant attribute.
*/
'aria-atomic'?: Booleanable;
/**
* Indicates whether inputting text could trigger display of one or more predictions of the user's intended value for
* an input and specifies how predictions would be presented if they are made.
*/
'aria-autocomplete'?: 'none' | 'inline' | 'list' | 'both';
/**
* Indicates an element is being modified and that assistive technologies MAY want to wait until the modifications are
* complete before exposing them to the user.
*/
'aria-busy'?: Booleanable;
/**
* Indicates the current "checked" state of checkboxes, radio buttons, and other widgets.
*/
'aria-checked'?: Booleanable | 'mixed';
/**
* Defines the total number of columns in a table, grid, or treegrid.
*/
'aria-colcount'?: number;
/**
* Defines an element's column index or position with respect to the total number of columns within a table, grid, or
* treegrid.
*/
'aria-colindex'?: number;
/**
* Defines the number of columns spanned by a cell or gridcell within a table, grid, or treegrid.
*/
'aria-colspan'?: number;
/**
* Identifies the element (or elements) whose contents or presence are controlled by the current element.
*/
'aria-controls'?: string;
/**
* Indicates the element that represents the current item within a container or set of related elements.
*/
'aria-current'?: Booleanable | 'page' | 'step' | 'location' | 'date' | 'time';
/**
* Identifies the element (or elements) that describes the object.
*/
'aria-describedby'?: string;
/**
* Identifies the element that provides a detailed, extended description for the object.
*/
'aria-details'?: string;
/**
* Indicates that the element is perceivable but disabled, so it is not editable or otherwise operable.
*/
'aria-disabled'?: Booleanable;
/**
* Indicates what functions can be performed when a dragged object is released on the drop target.
*/
'aria-dropeffect'?: 'none' | 'copy' | 'execute' | 'link' | 'move' | 'popup';
/**
* Identifies the element that provides an error message for the object.
*/
'aria-errormessage'?: string;
/**
* Indicates whether the element, or another grouping element it controls, is currently expanded or collapsed.
*/
'aria-expanded'?: Booleanable;
/**
* Identifies the next element (or elements) in an alternate reading order of content which, at the user's discretion,
* allows assistive technology to override the general default of reading in document source order.
*/
'aria-flowto'?: string;
/**
* Indicates an element's "grabbed" state in a drag-and-drop operation.
*/
'aria-grabbed'?: Booleanable;
/**
* Indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by
* an element.
*/
'aria-haspopup'?: Booleanable | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog';
/**
* Indicates whether the element is exposed to an accessibility API.
*/
'aria-hidden'?: Booleanable;
/**
* Indicates the entered value does not conform to the format expected by the application.
*/
'aria-invalid'?: Booleanable | 'grammar' | 'spelling';
/**
* Indicates keyboard shortcuts that an author has implemented to activate or give focus to an element.
*/
'aria-keyshortcuts'?: string;
/**
* Defines a string value that labels the current element.
*/
'aria-label'?: string;
/**
* Identifies the element (or elements) that labels the current element.
*/
'aria-labelledby'?: string;
/**
* Defines the hierarchical level of an element within a structure.
*/
'aria-level'?: number;
/**
* Indicates that an element will be updated, and describes the types of updates the user agents, assistive
* technologies, and user can expect from the live region.
*/
'aria-live'?: 'off' | 'assertive' | 'polite';
/**
* Indicates whether an element is modal when displayed.
*/
'aria-modal'?: Booleanable;
/**
* Indicates whether a text box accepts multiple lines of input or only a single line.
*/
'aria-multiline'?: Booleanable;
/**
* Indicates that the user may select more than one item from the current selectable descendants.
*/
'aria-multiselectable'?: Booleanable;
/**
* Indicates whether the element's orientation is horizontal, vertical, or unknown/ambiguous.
*/
'aria-orientation'?: 'horizontal' | 'vertical';
/**
* Identifies an element (or elements) in order to define a visual, functional, or contextual parent/child relationship
* between DOM elements where the DOM hierarchy cannot be used to represent the relationship.
*/
'aria-owns'?: string;
/**
* Defines a short hint (a word or short phrase) intended to aid the user with data entry when the control has no
* value. A hint could be a sample value or a brief description of the expected format.
*/
'aria-placeholder'?: string;
/**
* Defines an element's number or position in the current set of listitems or treeitems. Not required if all elements
* in the set are present in the DOM.
*/
'aria-posinset'?: number;
/**
* Indicates the current "pressed" state of toggle buttons.
*/
'aria-pressed'?: Booleanable | 'mixed';
/**
* Indicates that the element is not editable, but is otherwise operable.
*/
'aria-readonly'?: Booleanable;
/**
* Indicates what notifications the user agent will trigger when the accessibility tree within a live region is modified.
*/
'aria-relevant'?: 'additions' | 'additions text' | 'all' | 'removals' | 'text';
/**
* Indicates that user input is required on the element before a form may be submitted.
*/
'aria-required'?: Booleanable;
/**
* Defines a human-readable, author-localized description for the role of an element.
*/
'aria-roledescription'?: string;
/**
* Defines the total number of rows in a table, grid, or treegrid.
*/
'aria-rowcount'?: number;
/**
* Defines an element's row index or position with respect to the total number of rows within a table, grid, or treegrid.
*/
'aria-rowindex'?: number;
/**
* Defines the number of rows spanned by a cell or gridcell within a table, grid, or treegrid.
*/
'aria-rowspan'?: number;
/**
* Indicates the current "selected" state of various widgets.
*/
'aria-selected'?: Booleanable;
/**
* Defines the number of items in the current set of listitems or treeitems. Not required if all elements in the set are present in the DOM.
*/
'aria-setsize'?: number;
/**
* Indicates if items in a table or grid are sorted in ascending or descending order.
*/
'aria-sort'?: 'none' | 'ascending' | 'descending' | 'other';
/**
* Defines the maximum allowed value for a range widget.
*/
'aria-valuemax'?: number;
/**
* Defines the minimum allowed value for a range widget.
*/
'aria-valuemin'?: number;
/**
* Defines the current value for a range widget.
*/
'aria-valuenow'?: number;
/**
* Defines the human readable text alternative of aria-valuenow for a range widget.
*/
'aria-valuetext'?: string;
}
interface EventAttributes {
onafterprint?: string;
onabort?: string;
onautocomplete?: string;
onautocompleteerror?: string;
onblur?: string;
oncancel?: string;
oncanplay?: string;
oncanplaythrough?: string;
onchange?: string;
onclick?: string;
onclose?: string;
oncontextmenu?: string;
oncuechange?: string;
ondblclick?: string;
ondrag?: string;
ondragend?: string;
ondragenter?: string;
ondragleave?: string;
ondragover?: string;
ondragstart?: string;
ondrop?: string;
ondurationchange?: string;
onemptied?: string;
onended?: string;
onerror?: string;
onfocus?: string;
oninput?: string;
oninvalid?: string;
onkeydown?: string;
onkeypress?: string;
onkeyup?: string;
onload?: string;
onloadeddata?: string;
onloadedmetadata?: string;
onloadstart?: string;
onmousedown?: string;
onmouseenter?: string;
onmouseleave?: string;
onmousemove?: string;
onmouseout?: string;
onmouseover?: string;
onmouseup?: string;
onmousewheel?: string;
onpause?: string;
onplay?: string;
onplaying?: string;
onprogress?: string;
onratechange?: string;
onreset?: string;
onresize?: string;
onscroll?: string;
onseeked?: string;
onseeking?: string;
onselect?: string;
onshow?: string;
onsort?: string;
onstalled?: string;
onsubmit?: string;
onsuspend?: string;
ontimeupdate?: string;
ontoggle?: string;
onvolumechange?: string;
onwaiting?: string;
}
interface HttpEventAttributes {
/**
* Script to be run on abort
*/
onabort?: string;
/**
* Script to be run when an error occurs when the file is being loaded
*/
onerror?: string;
/**
* Script to be run when the file is loaded
*/
onload?: string;
/**
* The progress event is fired periodically when a request receives more data.
*/
onprogress?: string;
/**
* Script to be run just as the file begins to load before anything is actually loaded
*/
onloadstart?: string;
}
declare type LinkRelTypes = 'alternate' | 'author' | 'shortcut icon' | 'bookmark' | 'canonical' | 'dns-prefetch' | 'external' | 'help' | 'icon' | 'license' | 'manifest' | 'me' | 'modulepreload' | 'next' | 'nofollow' | 'noopener' | 'noreferrer' | 'opener' | 'pingback' | 'preconnect' | 'prefetch' | 'preload' | 'prerender' | 'prev' | 'search' | 'shortlink' | 'stylesheet' | 'tag' | 'apple-touch-icon' | 'apple-touch-startup-image';
interface Link {
interface Link extends HttpEventAttributes {
/**

@@ -158,22 +715,8 @@ * This attribute is only used when rel="preload" or rel="prefetch" has been set on the <link> element.

type?: 'audio/aac' | 'application/x-abiword' | 'application/x-freearc' | 'image/avif' | 'video/x-msvideo' | 'application/vnd.amazon.ebook' | 'application/octet-stream' | 'image/bmp' | 'application/x-bzip' | 'application/x-bzip2' | 'application/x-cdf' | 'application/x-csh' | 'text/css' | 'text/csv' | 'application/msword' | 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' | 'application/vnd.ms-fontobject' | 'application/epub+zip' | 'application/gzip' | 'image/gif' | 'text/html' | 'image/vnd.microsoft.icon' | 'text/calendar' | 'application/java-archive' | 'image/jpeg' | 'text/javascript' | 'application/json' | 'application/ld+json' | 'audio/midi' | 'audio/x-midi' | 'audio/mpeg' | 'video/mp4' | 'video/mpeg' | 'application/vnd.apple.installer+xml' | 'application/vnd.oasis.opendocument.presentation' | 'application/vnd.oasis.opendocument.spreadsheet' | 'application/vnd.oasis.opendocument.text' | 'audio/ogg' | 'video/ogg' | 'application/ogg' | 'audio/opus' | 'font/otf' | 'image/png' | 'application/pdf' | 'application/x-httpd-php' | 'application/vnd.ms-powerpoint' | 'application/vnd.openxmlformats-officedocument.presentationml.presentation' | 'application/vnd.rar' | 'application/rtf' | 'application/x-sh' | 'image/svg+xml' | 'application/x-tar' | 'image/tiff' | 'video/mp2t' | 'font/ttf' | 'text/plain' | 'application/vnd.visio' | 'audio/wav' | 'audio/webm' | 'video/webm' | 'image/webp' | 'font/woff' | 'font/woff2' | 'application/xhtml+xml' | 'application/vnd.ms-excel' | 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' | 'text/xml' | 'application/atom+xml' | 'application/xml' | 'application/vnd.mozilla.xul+xml' | 'application/zip' | 'video/3gpp' | 'audio/3gpp' | 'video/3gpp2' | 'audio/3gpp2' | string;
/**
* This attribute defines the unique ID.
*/
id?: string;
}
declare type Booleanable = boolean | 'false' | 'true' | '';
declare type Stringable = string | Booleanable | number;
interface DataKeys {
[key: `data-${string}`]: Stringable;
}
declare type Default<T extends undefined | Record<string, any>, D = {}> = [T] extends [undefined] ? D : T;
declare type Merge<T extends undefined | Record<string, any>, D = {}> = [T] extends [undefined] ? D : D & T;
interface MergeHead {
base?: Record<string, any>;
link?: Record<string, any>;
meta?: Record<string, any>;
style?: Record<string, any>;
script?: Record<string, any>;
noscript?: Record<string, any>;
htmlAttrs?: Record<string, any>;
bodyAttrs?: Record<string, any>;
}
interface MetaFlat {

@@ -811,5 +1354,9 @@ /**

property?: FixCase<PropertyKeys<keyof MetaFlat>> | string;
/**
* This attribute defines the unique ID.
*/
id?: string;
}
interface Script {
interface Script extends HttpEventAttributes {
/**

@@ -889,5 +1436,24 @@ * For classic scripts, if the async attribute is present,

type?: '' | 'text/javascript' | 'module' | 'application/json' | 'application/ld+json' | string;
/**
* This attribute defines the unique ID.
*/
id?: string;
}
interface Noscript {
/**
* This attribute defines the unique ID.
*/
id?: string;
/**
* The class global attribute is a space-separated list of the case-sensitive classes of the element.
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/class
*/
class?: string;
/**
* The style global attribute contains CSS styling declarations to be applied to the element.
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/style
*/
style?: string;
}

@@ -917,2 +1483,6 @@

title?: string;
/**
* This attribute defines the unique ID.
*/
id?: string;
}

@@ -947,4 +1517,6 @@ declare type StyleEntries<T extends Record<string, any>> = Partial<Style & T>[];

* Generate the title from a template.
*
* Should include a `%s` placeholder for the title, for example `%s - My Site`.
*/
titleTemplate?: string | ((title?: string) => string);
titleTemplate?: string;
/**

@@ -1006,2 +1578,2 @@ * The <base> HTML element specifies the base URL to use for all relative URLs in a document.

export { Base, BodyAttributes, Booleanable, DataKeys, Default, Head, HtmlAttributes, Link, LinkRelTypes, Merge, MergeHead, Meta, MetaFlat, MetaFlatInput, Noscript, Script, Stringable, Style, StyleEntries };
export { AriaAttributes, Base, BodyAttributes, Booleanable, DataKeys, Default, EventAttributes, GlobalAttributes, Head, HtmlAttributes, HttpEventAttributes, Link, LinkRelTypes, Merge, MergeHead, Meta, MetaFlat, MetaFlatInput, Noscript, Script, Stringable, Style, StyleEntries };

2

package.json
{
"name": "@zhead/schema",
"version": "0.8.5",
"version": "0.9.1",
"packageManager": "pnpm@7.8.0",

@@ -5,0 +5,0 @@ "author": "Harlan Wilton <harlan@harlanzw.com>",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc