Skip to content

Commit 0cad014

Browse files
committed
add typedef for User object
1 parent 00fbf1d commit 0cad014

1 file changed

Lines changed: 15 additions & 9 deletions

File tree

packages/super-editor/src/core/Editor.js

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,16 @@ import DocxZipper from '@core/DocxZipper.js';
3232

3333
/**
3434
* Editor main class.
35-
*
35+
*
3636
* Expects a config object.
3737
* @class
3838
*/
39+
/**
40+
* @typedef {Object} User The current user of this superdoc
41+
* @property {string} name The user's name
42+
* @property {string} email The user's email
43+
* @property {string | null} image The user's photo
44+
*/
3945
/**
4046
* @typedef {Object} EditorOptions
4147
* @property {HTMLElement} [element] - The container element for the editor
@@ -44,8 +50,8 @@ import DocxZipper from '@core/DocxZipper.js';
4450
* @property {Document} [mockDocument] - Mock document for testing
4551
* @property {Window} [mockWindow] - Mock window for testing
4652
* @property {string} [content=''] - XML content
47-
* @property {Object} [user] - Current user information
48-
* @property {Array} [users=[]] - List of users for collaboration
53+
* @property {User} [user] - Current user information
54+
* @property {Array.<User>} [users=[]] - List of users for collaboration
4955
* @property {Object} [media={}] - Media configuration
5056
* @property {Object} [mediaFiles={}] - Media files
5157
* @property {Object} [fonts={}] - Font configuration
@@ -448,7 +454,7 @@ export class Editor extends EventEmitter {
448454

449455
/**
450456
* Get possible users of the editor.
451-
* @returns {Array.<Object>} List of users
457+
* @returns {Array.<User>} List of users
452458
*/
453459
get users() {
454460
return this.options.users;
@@ -1504,12 +1510,12 @@ export class Editor extends EventEmitter {
15041510
}
15051511

15061512
/**
1507-
* A command to prepare the editor to receive annotations. This will
1513+
* A command to prepare the editor to receive annotations. This will
15081514
* pre-process the document as needed prior to running in the annotator.
1509-
*
1515+
*
15101516
* Currently this is only used for table generation but additional pre-processing can be done here.
1511-
*
1512-
* @param {FieldValue[]} annotationValues
1517+
*
1518+
* @param {FieldValue[]} annotationValues
15131519
* @returns {void}
15141520
*/
15151521
prepareForAnnotations(annotationValues = []) {
@@ -1521,7 +1527,7 @@ export class Editor extends EventEmitter {
15211527

15221528
/**
15231529
* Annotate the document with the given annotation values.
1524-
*
1530+
*
15251531
* @param {FieldValue[]} annotationValues List of field values to apply.
15261532
* @param {String[]} hiddenIds List of field ids to remove from the document.
15271533
* @returns {void}

0 commit comments

Comments
 (0)