H5P NodeJS Library
    Preparing search index...

    This interface represents the structure of library.json files.

    interface ILibraryMetadata {
        addTo?: {
            content?: { types?: { text?: { regex?: string } }[] };
            editor?: { machineNames: string[] };
            player?: { machineNames: string[] };
        };
        author?: string;
        coreApi?: { majorVersion: number; minorVersion: number };
        description?: string;
        dropLibraryCss?: { machineName: string }[];
        dynamicDependencies?: ILibraryName[];
        editorDependencies?: ILibraryName[];
        embedTypes?: ("div" | "iframe")[];
        fullscreen?: 0 | 1;
        h?: number;
        license?: string;
        machineName: string;
        majorVersion: number;
        metadataSettings?: { disable: 0 | 1; disableExtraTitleField: 0 | 1 };
        minorVersion: number;
        patchVersion: number;
        preloadedCss?: IPath[];
        preloadedDependencies?: ILibraryName[];
        preloadedJs?: IPath[];
        requiredExtensions?: { sharedState: number };
        runnable: boolean | 0 | 1;
        state?: {
            opLogicChecks: boolean;
            opSchema: boolean;
            snapshotLogicChecks: boolean;
            snapshotSchema: boolean;
        };
        title: string;
        w?: number;
    }

    Hierarchy (View Summary)

    Index

    Properties

    addTo?: {
        content?: { types?: { text?: { regex?: string } }[] };
        editor?: { machineNames: string[] };
        player?: { machineNames: string[] };
    }

    Addons can be added to other content types by

    Type declaration

    • Optionalcontent?: { types?: { text?: { regex?: string } }[] }
    • Optionaleditor?: { machineNames: string[] }

      Contains cases in which the library should be added to the editor.

      This is an extension to the H5P library metadata structure made by h5p-nodejs-library. That way addons can specify to which editors they should be added in general. The PHP implementation hard-codes this list into the server, which we want to avoid here.

      • machineNames: string[]

        A list of machine names in which the addon should be added.

    • Optionalplayer?: { machineNames: string[] }

      Contains cases in which the library should be added to the player.

      This is an extension to the H5P library metadata structure made by h5p-nodejs-library. That way addons can specify to which editors they should be added in general. The PHP implementation hard-codes this list into the server, which we want to avoid here.

      • machineNames: string[]

        A list of machine names in which the addon should be added.

    author?: string
    coreApi?: { majorVersion: number; minorVersion: number }

    The core API required to run the library.

    description?: string
    dropLibraryCss?: { machineName: string }[]
    dynamicDependencies?: ILibraryName[]
    editorDependencies?: ILibraryName[]
    embedTypes?: ("div" | "iframe")[]
    fullscreen?: 0 | 1
    h?: number
    license?: string
    machineName: string

    The name used to identify the library (e.g. H5P.Example)

    majorVersion: number

    The major version of the library (e.g. 1)

    metadataSettings?: { disable: 0 | 1; disableExtraTitleField: 0 | 1 }
    minorVersion: number

    The minor version of the library (e.g. 0)

    patchVersion: number
    preloadedCss?: IPath[]
    preloadedDependencies?: ILibraryName[]
    preloadedJs?: IPath[]
    requiredExtensions?: { sharedState: number }
    runnable: boolean | 0 | 1
    state?: {
        opLogicChecks: boolean;
        opSchema: boolean;
        snapshotLogicChecks: boolean;
        snapshotSchema: boolean;
    }
    title: string
    w?: number