Document constructors

This commit is contained in:
Simon Rozman 2024-06-12 12:50:15 +02:00
parent 2f8b8d0e45
commit 6b92aeb11a

View File

@ -28,6 +28,11 @@ window.addEventListener('resize', () =>
* *
*************************************************************************/ *************************************************************************/
class BesService { class BesService {
/**
* Constructs class.
*
* @param {Element} hostElement The element in DOM tree we are providing grammar-checking service for
*/
constructor(hostElement) { constructor(hostElement) {
this.hostElement = hostElement this.hostElement = hostElement
this.results = [] // Results of grammar-checking, one per each block/paragraph of text this.results = [] // Results of grammar-checking, one per each block/paragraph of text
@ -372,6 +377,11 @@ class BesService {
* *
*************************************************************************/ *************************************************************************/
class BesTreeService extends BesService { class BesTreeService extends BesService {
/**
* Constructs class.
*
* @param {Element} hostElement The element in DOM tree we are providing grammar-checking service for
*/
constructor(hostElement) { constructor(hostElement) {
super(hostElement) super(hostElement)
this.onClick = this.onClick.bind(this) this.onClick = this.onClick.bind(this)
@ -750,6 +760,11 @@ class BesTreeService extends BesService {
* *
*************************************************************************/ *************************************************************************/
class BesDOMService extends BesTreeService { class BesDOMService extends BesTreeService {
/**
* Constructs class.
*
* @param {Element} hostElement The element in DOM tree we are providing grammar-checking service for
*/
constructor(hostElement) { constructor(hostElement) {
super(hostElement) super(hostElement)
this.onBeforeInput = this.onBeforeInput.bind(this) this.onBeforeInput = this.onBeforeInput.bind(this)
@ -825,6 +840,12 @@ class BesDOMService extends BesTreeService {
* *
*************************************************************************/ *************************************************************************/
class BesCKService extends BesTreeService { class BesCKService extends BesTreeService {
/**
* Constructs class.
*
* @param {Element} hostElement The element in DOM tree we are providing grammar-checking service for
* @param {*} ckEditorInstance CKEditor instance
*/
constructor(hostElement, ckEditorInstance) { constructor(hostElement, ckEditorInstance) {
super(hostElement) super(hostElement)
this.ckEditorInstance = ckEditorInstance this.ckEditorInstance = ckEditorInstance
@ -973,6 +994,11 @@ class BesCKService extends BesTreeService {
* *
*************************************************************************/ *************************************************************************/
class BesPlainTextService extends BesService { class BesPlainTextService extends BesService {
/**
* Constructs class.
*
* @param {Element} hostElement The element in DOM tree we are providing grammar-checking service for
*/
constructor(hostElement) { constructor(hostElement) {
super(hostElement) super(hostElement)
this.reEOP = /(\r?\n){2,}/g this.reEOP = /(\r?\n){2,}/g