import { Router } from 'express'; import { H5PEditor } from '../..'; import H5PAjaxExpressRouterOptions from './H5PAjaxExpressRouterOptions'; /** * This router implements all Ajax calls necessary for the H5P (editor) client to work. * Use it like this: server.use('/h5p', H5P.adapters.express(h5pEditor, path.resolve('h5p/core'), path.resolve('h5p/editor'))); * If you only want certain routes, you can specify this in the options parameter. * @param h5pEditor the editor object * @param h5pCorePath the path on the local disk at which the core files (of the player) can be found * @param h5pEditorLibraryPath the path on the local disk at which the core files of the editor can be found * @param routeOptions sets which routes you want and how to handle errors * @param languageOverride the language to use when returning errors. * Only has an effect if you use the i18next http middleware, as it relies on * req.i18n.changeLanguage to be present. Defaults to auto, which means the * a language detector must have detected language and req.t translated to the * detected language. */ export default function (h5pEditor: H5PEditor, h5pCorePath: string, h5pEditorLibraryPath: string, routeOptions?: H5PAjaxExpressRouterOptions, languageOverride?: string | 'auto'): Router;