Skip to content

Commit

Permalink
Updated settings schema methods with examples + removed internal jsdoc
Browse files Browse the repository at this point in the history
  • Loading branch information
kpal81xd committed Aug 13, 2024
1 parent 51eda0a commit c554bb1
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions src/schema/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,6 @@ class SettingsSchema {
this._schema = this._schemaApi._schema.settings;
}

/**
* @private
* @param {*} obj - The object to get the default data from
* @param {string} scope - The field scope
* @returns {*} - The default data
*/
_getDefaultData(obj, scope) {
const result = {};
for (const key in obj) {
Expand All @@ -48,6 +42,10 @@ class SettingsSchema {
* Get the default settings for the project
*
* @returns {*} The default settings for the project
* @example
* ```javascript
* const modelData = editor.schema.settings.getDefaultProjectSettings();
* ```
*/
getDefaultProjectSettings() {
return this._getDefaultData(this._schema, 'project');
Expand All @@ -57,15 +55,23 @@ class SettingsSchema {
* Get the default settings for the user
*
* @returns {*} The default settings for the user
* @example
* ```javascript
* const modelData = editor.schema.settings.getDefaultUserSettings();
* ```
*/
getDefaultUserSettings() {
return this._getDefaultData(this._schema, 'user');
}

/**
* Get the default settings for the project user
* Get the default settings for the user in the project
*
* @returns {*} The default settings for the user in the project
* @example
* ```javascript
* const modelData = editor.schema.settings.getDefaultProjectUserSettings();
* ```
*/
getDefaultProjectUserSettings() {
return this._getDefaultData(this._schema, 'projectUser');
Expand Down

0 comments on commit c554bb1

Please sign in to comment.