Skip to content

Commit f20e014

Browse files
committed
feat(plugin): getSettings pluginId param
1 parent ea1db04 commit f20e014

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

packages/api/src/api/api.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export interface DevtoolsPluginApi<TSettings> {
1818
getComponentInstances (app: App): Promise<ComponentInstance[]>
1919
highlightElement (instance: ComponentInstance): void
2020
unhighlightElement (): void
21-
getSettings (): TSettings
21+
getSettings (pluginId?: string): TSettings
2222
/**
2323
* @private Not implemented yet
2424
*/

packages/app-backend-api/src/api.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -356,12 +356,12 @@ export class DevtoolsPluginApiInstance<TSettings = any> implements DevtoolsPlugi
356356
return true
357357
}
358358

359-
getSettings () {
360-
return getPluginSettings(this.plugin.descriptor.id, this.defaultSettings)
359+
getSettings (pluginId?: string) {
360+
return getPluginSettings(pluginId ?? this.plugin.descriptor.id, this.defaultSettings)
361361
}
362362

363-
setSettings (value: TSettings) {
364-
setPluginSettings(this.plugin.descriptor.id, value)
363+
setSettings (value: TSettings, pluginId?: string) {
364+
setPluginSettings(pluginId ?? this.plugin.descriptor.id, value)
365365
}
366366

367367
private get enabled () {

0 commit comments

Comments
 (0)