Skip to content

Commit ef51386

Browse files
committed
Plugins: Add setting.globalValues and deprecate setting.globalValue
1 parent d07f3b5 commit ef51386

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

packages/lib/services/plugins/api/JoplinSettings.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,11 +177,23 @@ export default class JoplinSettings {
177177
}
178178

179179
/**
180-
* Gets a global setting value, including app-specific settings and those set by other plugins.
180+
* Gets global setting values, including app-specific settings and those set by other plugins.
181181
*
182182
* The list of available settings is not documented yet, but can be found by looking at the source code:
183183
*
184-
* https://github.com/laurent22/joplin/blob/dev/packages/lib/models/Setting.ts#L142
184+
* https://github.com/laurent22/joplin/blob/dev/packages/lib/models/settings/builtInMetadata.ts
185+
*/
186+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
187+
public async globalValues(keys: string[]): Promise<any[]> {
188+
const output: (string|number|boolean)[] = [];
189+
for (const key of keys) {
190+
output.push(Setting.value(key));
191+
}
192+
return output;
193+
}
194+
195+
/**
196+
* @deprecated Use joplin.settings.globalValues()
185197
*/
186198
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
187199
public async globalValue(key: string): Promise<any> {

0 commit comments

Comments
 (0)