| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148 |
- /**
- * @param {Schema} schema
- * Schema to use.
- * @param {string} defaultTagName
- * Default tag name.
- * @param {ReadonlyArray<string> | undefined} [caseSensitive]
- * Case-sensitive tag names (default: `undefined`).
- * @returns
- * `h`.
- */
- export function createH(schema: Schema, defaultTagName: string, caseSensitive?: ReadonlyArray<string> | undefined): {
- /**
- * Hyperscript compatible DSL for creating virtual hast trees.
- *
- * @overload
- * @param {null | undefined} [selector]
- * @param {...Child} children
- * @returns {Root}
- *
- * @overload
- * @param {string} selector
- * @param {Properties} properties
- * @param {...Child} children
- * @returns {Element}
- *
- * @overload
- * @param {string} selector
- * @param {...Child} children
- * @returns {Element}
- *
- * @param {string | null | undefined} [selector]
- * Selector.
- * @param {Child | Properties | null | undefined} [properties]
- * Properties (or first child) (default: `undefined`).
- * @param {...Child} children
- * Children.
- * @returns {Result}
- * Result.
- */
- (selector?: null | undefined, ...children: Child[]): Root;
- /**
- * Hyperscript compatible DSL for creating virtual hast trees.
- *
- * @overload
- * @param {null | undefined} [selector]
- * @param {...Child} children
- * @returns {Root}
- *
- * @overload
- * @param {string} selector
- * @param {Properties} properties
- * @param {...Child} children
- * @returns {Element}
- *
- * @overload
- * @param {string} selector
- * @param {...Child} children
- * @returns {Element}
- *
- * @param {string | null | undefined} [selector]
- * Selector.
- * @param {Child | Properties | null | undefined} [properties]
- * Properties (or first child) (default: `undefined`).
- * @param {...Child} children
- * Children.
- * @returns {Result}
- * Result.
- */
- (selector: string, properties: Properties, ...children: Child[]): Element;
- /**
- * Hyperscript compatible DSL for creating virtual hast trees.
- *
- * @overload
- * @param {null | undefined} [selector]
- * @param {...Child} children
- * @returns {Root}
- *
- * @overload
- * @param {string} selector
- * @param {Properties} properties
- * @param {...Child} children
- * @returns {Element}
- *
- * @overload
- * @param {string} selector
- * @param {...Child} children
- * @returns {Element}
- *
- * @param {string | null | undefined} [selector]
- * Selector.
- * @param {Child | Properties | null | undefined} [properties]
- * Properties (or first child) (default: `undefined`).
- * @param {...Child} children
- * Children.
- * @returns {Result}
- * Result.
- */
- (selector: string, ...children: Child[]): Element;
- };
- /**
- * List of children (deep).
- */
- export type ArrayChildNested = Array<Nodes | PrimitiveChild>;
- /**
- * List of children.
- */
- export type ArrayChild = Array<ArrayChildNested | Nodes | PrimitiveChild>;
- /**
- * List of property values for space- or comma separated values (such as `className`).
- */
- export type ArrayValue = Array<number | string>;
- /**
- * Acceptable child value.
- */
- export type Child = ArrayChild | Nodes | PrimitiveChild;
- /**
- * Primitive children, either ignored (nullish), or turned into text nodes.
- */
- export type PrimitiveChild = number | string | null | undefined;
- /**
- * Primitive property value.
- */
- export type PrimitiveValue = boolean | number | string | null | undefined;
- /**
- * Acceptable value for element properties.
- */
- export type Properties = Record<string, PropertyValue | Style>;
- /**
- * Primitive value or list value.
- */
- export type PropertyValue = ArrayValue | PrimitiveValue;
- /**
- * Result from a `h` (or `s`) call.
- */
- export type Result = Element | Root;
- /**
- * Value for a CSS style field.
- */
- export type StyleValue = number | string;
- /**
- * Supported value of a `style` prop.
- */
- export type Style = Record<string, StyleValue>;
- import type { Schema } from 'property-information';
- import type { Root } from 'hast';
- import type { Element } from 'hast';
- import type { Nodes } from 'hast';
- //# sourceMappingURL=create-h.d.ts.map
|