Commit 1f7174f6 authored by Robert Knight's avatar Robert Knight

Convert Guest class to JS

parent 70693ddf
This diff is collapsed.
This diff is collapsed.
// TODO - Convert this to an ES import once the `Guest` class is converted to JS. import Guest from './guest';
// @ts-expect-error
const Guest = require('./guest');
export default class Host extends Guest { export default class Host extends Guest {
constructor(element, config) { constructor(element, config) {
......
...@@ -20,19 +20,18 @@ import iconSet from './icons'; ...@@ -20,19 +20,18 @@ import iconSet from './icons';
registerIcons(iconSet); registerIcons(iconSet);
import configFrom from './config/index'; import configFrom from './config/index';
import PdfSidebar from './pdf-sidebar'; import CrossFramePlugin from './plugin/cross-frame';
import DocumentPlugin from './plugin/document'; import DocumentPlugin from './plugin/document';
import Guest from './guest';
import PdfSidebar from './pdf-sidebar';
import Sidebar from './sidebar';
// Modules that are still written in CoffeeScript and need to be converted to // Modules that are still written in CoffeeScript and need to be converted to
// JS. // JS.
// @ts-expect-error // @ts-expect-error
import Guest from './guest';
// @ts-expect-error
import BucketBarPlugin from './plugin/bucket-bar'; import BucketBarPlugin from './plugin/bucket-bar';
import CrossFramePlugin from './plugin/cross-frame';
// @ts-expect-error // @ts-expect-error
import PDFPlugin from './plugin/pdf'; import PDFPlugin from './plugin/pdf';
import Sidebar from './sidebar';
const pluginClasses = { const pluginClasses = {
// UI plugins // UI plugins
...@@ -59,6 +58,7 @@ const config = configFrom(window); ...@@ -59,6 +58,7 @@ const config = configFrom(window);
$.noConflict(true)(function () { $.noConflict(true)(function () {
const isPDF = typeof window_.PDFViewerApplication !== 'undefined'; const isPDF = typeof window_.PDFViewerApplication !== 'undefined';
/** @type {new (e: Element, config: any) => Guest} */
let Klass = isPDF ? PdfSidebar : Sidebar; let Klass = isPDF ? PdfSidebar : Sidebar;
if (config.subFrameIdentifier) { if (config.subFrameIdentifier) {
......
...@@ -5,7 +5,7 @@ Plugin = require('../plugin') ...@@ -5,7 +5,7 @@ Plugin = require('../plugin')
{ default: Delegator } = require('../delegator') { default: Delegator } = require('../delegator')
$ = require('jquery') $ = require('jquery')
Guest = require('../guest') { default: Guest } = require('../guest')
{ $imports } = require('../guest') { $imports } = require('../guest')
rangeUtil = null rangeUtil = null
selections = null selections = null
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment