import { Node, Types } from '../types';
/**
 * Get the URL used in Microdata attributes.
 *
 * This is used to normalize the versioned URL from the
 * JSON-LD context.
 */
export declare function microdataUrl(type?: string): string;
/**
 * Attributes for Microdata ["items"](https://www.w3.org/TR/microdata/#items)
 *
 * "The itemtype attribute must not be specified on elements that do not have
 *  an itemscope attribute specified."
 */
export interface MicrodataItem {
    itemscope?: '';
    itemtype?: string;
    'data-itemtype'?: string;
    itemid?: string;
}
/**
 * Create `MicrodataItem` attributes for a node.
 *
 * Does not create the `itemscope` and `itemtype` attributes for nodes that
 * are primitive (and therefore which do not represent a "scope" having
 * `itemprop`s nested within it). Instead, for primitive nodes, other than `Text`
 * add the `data-itemtype` attribute, do they can be styled if so desired.
 *
 * @param node The node to create Microdata attributes for
 * @param id Id of the Microdata item. Used to link to this node using the `itemref` property.
 */
export declare function microdataItem(node: Node, id?: string): MicrodataItem;
/**
 * Get the HTML Microdata `itemtype` for a Stencila Schema type
 *
 * @see {@link https://www.w3.org/TR/microdata/#dfn-itemtype}
 */
export declare function microdataItemtype(type: keyof Types): string | undefined;
/**
 * Get the Stencila Schema type from a HTML Microdata `itemtype`.
 *
 * This is the inverse of `microdataItemtype`.
 */
export declare function microdataType(itemtype: string): keyof Types | undefined;
/**
 * Attributes for Microdata ["properties"](https://www.w3.org/TR/microdata/#names:-the-itemprop-attribute)
 *
 * The `data-itemprop` attribute is not part of the Microdata standard.
 * It is used for properties that are not defined in schema.org and which validators
 * like Google Structured Data Testing Tool throw errors about.
 */
export interface MicrodataProperty {
    itemprop?: string;
    'data-itemprop'?: string;
    itemref?: string;
}
declare type Role = 'array' | 'item';
/**
 * Create `MicrodataProperty` attributes for a node property.
 *
 * @param property The name of the property
 * @param isItem Is the node for which attributes are being generated
 *                    an item within an array property? e.g. a `Person` in `authors`.
 * @param id Id of another Microdata item to link to using the `itemref` property.
 */
export declare function microdataProperty(property: string, role?: Role, id?: string): MicrodataProperty;
/**
 * Get the HTML Microdata `itemprop` for a Stencila Schema property.
 *
 * The `itemprop` attribute is normally just the name of the property
 * i.e. it is not prefixed by a base URL. This function returns the
 * `[prefix, name]` pair e.g. `["schema", "author"]`,
 * `["codemeta", "maintainer"]` because you may only want to encode
 * `itemprop`s for well known schemas e.g. schema.org
 *
 * @see {@link https://www.w3.org/TR/microdata/#dfn-attr-itemprop}
 *
 * @param property The name of the property
 * @param role Is the node for which attributes are being generated
 *               an item within an array property? e.g. a `Person` in `authors`.
 */
export declare function microdataItemprop(property: string, role?: Role): [string | undefined, string | undefined];
export declare type Microdata = MicrodataItem & MicrodataProperty;
/**
 * Create all Microdata attributes for a Stencila `Node`.
 *
 * @param node The node e.g. a `Person` node
 * @param property The name of the property that this node is part of e.g `authors`
 * @param role Is this an item within an array property e.g a `Person` within `authors`
 * @param id The id used to link to / from this Microdata item
 */
export declare function microdata(node: Node, property?: string, role?: Role, id?: string): Microdata;
/**
 * Get the 'pseudo' HTML Microdata attribute for the root element.
 *
 * This attribute name / value pair is used to scope CSS variables to
 * the root Stencila node in an HML document. It is used by Encoda when
 * encoding to HTML, it is in Thema to scope CSS variable thereby
 * avoiding variable name clashes from using the CSS `:root` pseudo-class.
 *
 * Although not directly related to Microdata, given it is used in both
 * of those projects, this appears to be the best place for it.
 */
export declare function microdataRoot(): {
    'data-itemscope': 'root';
};
export {};
