H5P NodeJS Library
    Preparing search index...

    This is an entry in the semantics of a library. The semantics define how content parameters must look like.

    Note: Attributes can only be used by specific semantic types. See https://h5p.org/semantics for a full reference.

    interface ISemanticsEntry {
        common?: boolean;
        decimals?: number;
        default?: string;
        description?: string;
        enterMode?: "div" | "p";
        entity?: string;
        expanded?: boolean;
        extraAttributes?: string[];
        field?: ISemanticsEntry;
        fields?: ISemanticsEntry[];
        font?: {
            background?:
                | boolean
                | { css: string; default?: boolean; label: string }[];
            color?: boolean | { css: string; default?: boolean; label: string }[];
            family?: boolean | { css: string; default?: boolean; label: string }[];
            height?: boolean | { css: string; default?: boolean; label: string }[];
            size?: boolean | { css: string; default?: boolean; label: string }[];
            spacing?: boolean | { css: string; default?: boolean; label: string }[];
        };
        importance?: "high"
        | "low"
        | "medium";
        important?: { description: string; example: string };
        isSubContent?: boolean;
        label?: string;
        max?: string | number;
        maxLength?: number;
        min?: string | number;
        name: string;
        optional?: boolean;
        options?: any[];
        placeholder?: string;
        regexp?: { modifiers: string; pattern: string };
        steps?: number;
        subContentId?: string;
        tags?: string[];
        type:
            | "number"
            | "boolean"
            | "file"
            | "audio"
            | "select"
            | "video"
            | "image"
            | "text"
            | "group"
            | "list"
            | "library";
        widget?: string;
    }
    Index

    Properties

    common?: boolean

    A common field is set for all instances of the library at once. In the editor, all common fields are displayed in a group at the bottom. Use this for localization / translations.

    decimals?: number

    (for number) the number of allowed decimals

    default?: string

    The default value of the field.

    description?: string

    An explanation text below the widget shown in the editor

    enterMode?: "div" | "p"

    (for text with html widget) what the html widget inserts when pressing enter

    entity?: string

    (for list) The name for a single entity in a list.

    expanded?: boolean

    (for group) Group is expanded by default

    extraAttributes?: string[]

    Further attributes allowed in the params.

    (in lists only) defines a single field type in the list

    fields?: ISemanticsEntry[]

    (in groups only) a list of field definitions

    font?: {
        background?:
            | boolean
            | { css: string; default?: boolean; label: string }[];
        color?: boolean | { css: string; default?: boolean; label: string }[];
        family?: boolean | { css: string; default?: boolean; label: string }[];
        height?: boolean | { css: string; default?: boolean; label: string }[];
        size?: boolean | { css: string; default?: boolean; label: string }[];
        spacing?: boolean | { css: string; default?: boolean; label: string }[];
    }

    The font choices the user has in the HTML editor widget. If set to true, the editor will display the default choices and the style will be allowed by the sanitization filter. All other styles will be removed.

    You an also specify lists of allowed CSS values with a label. These are currently ignored in the server-side CSS style filter, though.

    importance?: "high" | "low" | "medium"

    More important fields have a more prominent style in the editor.

    important?: { description: string; example: string }

    A help text that can be collapsed.

    isSubContent?: boolean

    (for group) unknown

    label?: string

    The text displayed in the editor for the entry. (localizable)

    max?: string | number

    (for number) the maximum number allowed (for list) the maximum number of elements

    maxLength?: number

    (for text) the maximum number of characters of the text

    min?: string | number

    (for number) the minimum number allowed (for list) the minimum number of elements

    name: string

    The internal name (e.g. for referencing it in code)

    optional?: boolean

    Optional fields don't have to be filled in.

    options?: any[]

    (for select) the options to choose from (for library) a list of library ubernames (whitespaces instead of hyphens as separators)

    placeholder?: string

    The text displayed in a text box if the user has entered nothing so far.

    regexp?: { modifiers: string; pattern: string }

    (for text) the regexp pattern the text must match

    steps?: number

    (for number) the allowed steps

    subContentId?: string

    (for library) an id identifying subcontent, set by the editor; Must be formatted like this: /^{?[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}}?$/

    tags?: string[]

    (for text) list of allowed html tags.

    type:
        | "number"
        | "boolean"
        | "file"
        | "audio"
        | "select"
        | "video"
        | "image"
        | "text"
        | "group"
        | "list"
        | "library"

    The object type of this entry.

    widget?: string

    Name of the widget to use in the editor.