@zhead/schema
Advanced tools
Comparing version 0.6.2 to 0.7.0
{ | ||
"name": "@zhead/schema", | ||
"version": "0.6.2", | ||
"version": "0.7.0", | ||
"packageManager": "pnpm@7.8.0", | ||
@@ -5,0 +5,0 @@ "author": "Harlan Wilton <harlan@harlanzw.com>", |
@@ -1,2 +0,2 @@ | ||
# `@zhead/head` | ||
# `@zhead/schema` | ||
@@ -16,14 +16,7 @@ Typescript definitions for document `<head>`. | ||
- `Head` - `<head>` schema. [head.ts](./src/head.ts) | ||
- `Link` - `<link>` schema. [link.ts](./src/link.ts) | ||
- `Meta` - `<meta>` schema. [meta.ts](./src/meta.ts) | ||
- `MetaFlat` - `<meta>` schema as a flat object. [meta-flat.ts](./src/meta-flat.ts) (see `zhead` `unpackMeta` function) | ||
- `Script` - `<script>` schema. [script.ts](./src/script.ts) | ||
- `Style` - `<style>` schema. [style.ts](./src/style.ts) | ||
See [head.ts](./src/head.ts) for the full list of types. | ||
## Preview | ||
```ts | ||
export interface Head { | ||
export interface Head<E extends MergeHead = MergeHead> { | ||
/** | ||
@@ -37,2 +30,6 @@ * The <title> HTML element defines the document's title that is shown in a browser's title bar or a page's tab. | ||
/** | ||
* Generate the title from a template. | ||
*/ | ||
titleTemplate?: string | ((title?: string) => string) | ||
/** | ||
* The <base> HTML element specifies the base URL to use for all relative URLs in a document. | ||
@@ -43,3 +40,3 @@ * There can be only one <base> element in a document. | ||
*/ | ||
base?: Base | ||
base?: Partial<Merge<E['base'], Base>> | ||
/** | ||
@@ -52,3 +49,3 @@ * The <link> HTML element specifies relationships between the current document and an external resource. | ||
*/ | ||
link?: LinkEntries | ||
link?: (Link & UnsafeKeys & Default<E['link']>)[] | ||
/** | ||
@@ -59,3 +56,3 @@ * The <meta> element represents metadata that cannot be expressed in other HTML elements, like <link> or <script>. | ||
*/ | ||
meta?: MetaEntries | ||
meta?: (Meta & UnsafeKeys & Default<E['meta']>)[] | ||
/** | ||
@@ -67,3 +64,3 @@ * The <style> HTML element contains style information for a document, or part of a document. | ||
*/ | ||
style?: StyleEntries | ||
style?: (Style & UnsafeKeys & Default<E['style']>)[] | ||
/** | ||
@@ -74,4 +71,24 @@ * The <script> HTML element is used to embed executable code or data; this is typically used to embed or refer to JavaScript code. | ||
*/ | ||
script?: ScriptEntries | ||
script?: (Script & UnsafeKeys & Default<E['script']>)[] | ||
/** | ||
* The <noscript> HTML element defines a section of HTML to be inserted if a script type on the page is unsupported | ||
* or if scripting is currently turned off in the browser. | ||
* | ||
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/noscript | ||
*/ | ||
noscript?: (Noscript & UnsafeKeys & Default<E['noscript']>)[] | ||
/** | ||
* Attributes for the <html> HTML element. | ||
* | ||
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/html | ||
*/ | ||
htmlAttrs?: (HtmlAttributes & UnsafeKeys & Default<E['htmlAttrs']>) | ||
/** | ||
* Attributes for the <body> HTML element. | ||
* | ||
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/body | ||
*/ | ||
bodyAttrs?: (BodyAttributes & UnsafeKeys & Default<E['bodyAttrs']>) | ||
} | ||
``` |
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
42438
88