@lvce-editor/api 9.26.0 → 9.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export { getAccessToken, type GetAccessTokenOptions } from './parts/Authenticati
|
|
|
3
3
|
export { createElectronWebContentsView } from './parts/ElectronWebContentsView/ElectronWebContentsView.ts';
|
|
4
4
|
export { executeCommand } from './parts/ExecuteCommand/ExecuteCommand.ts';
|
|
5
5
|
export { showFileQuickPick, showQuickInput, showQuickPick } from './parts/QuickPick/QuickPick.ts';
|
|
6
|
-
export { getPreference, openSettings, setPreference, setSettingsSearchValue } from './parts/Preferences/Preferences.ts';
|
|
6
|
+
export { getConfigurationDefinitions, getPreference, openSettings, setPreference, setSettingsSearchValue, type ConfigurationDefinition, } from './parts/Preferences/Preferences.ts';
|
|
7
7
|
export { deleteSecret, getSecret, storeSecret } from './parts/SecretStorage/SecretStorage.ts';
|
|
8
8
|
export { registerCommand } from './parts/CommandRegistry/CommandRegistry.ts';
|
|
9
9
|
export { registerDebugProvider, resetDebugProviderRegistry } from './parts/Debug/Debug.ts';
|
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@ export { getAccessToken } from "./parts/Authentication/Authentication.js";
|
|
|
3
3
|
export { createElectronWebContentsView } from "./parts/ElectronWebContentsView/ElectronWebContentsView.js";
|
|
4
4
|
export { executeCommand } from "./parts/ExecuteCommand/ExecuteCommand.js";
|
|
5
5
|
export { showFileQuickPick, showQuickInput, showQuickPick } from "./parts/QuickPick/QuickPick.js";
|
|
6
|
-
export { getPreference, openSettings, setPreference, setSettingsSearchValue } from "./parts/Preferences/Preferences.js";
|
|
6
|
+
export { getConfigurationDefinitions, getPreference, openSettings, setPreference, setSettingsSearchValue, } from "./parts/Preferences/Preferences.js";
|
|
7
7
|
export { deleteSecret, getSecret, storeSecret } from "./parts/SecretStorage/SecretStorage.js";
|
|
8
8
|
export { registerCommand } from "./parts/CommandRegistry/CommandRegistry.js";
|
|
9
9
|
export { registerDebugProvider, resetDebugProviderRegistry } from "./parts/Debug/Debug.js";
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
export interface ConfigurationDefinition {
|
|
2
|
+
readonly default?: unknown;
|
|
3
|
+
readonly description?: string;
|
|
4
|
+
readonly enum?: readonly string[];
|
|
5
|
+
readonly maximum?: number;
|
|
6
|
+
readonly minimum?: number;
|
|
7
|
+
readonly type?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const getConfigurationDefinitions: () => Promise<Readonly<Record<string, ConfigurationDefinition>>>;
|
|
1
10
|
export declare const getPreference: (key: string) => Promise<unknown>;
|
|
2
11
|
export declare const openSettings: () => Promise<void>;
|
|
3
12
|
export declare const setSettingsSearchValue: (value: string) => Promise<void>;
|
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
import { ExtensionManagementWorker } from '@lvce-editor/rpc-registry';
|
|
2
2
|
import { executeCommand } from "../ExecuteCommand/ExecuteCommand.js";
|
|
3
3
|
const ScriptInputSource = 2;
|
|
4
|
+
const getConfigurationEntries = (extension) => {
|
|
5
|
+
if (extension.disabled || !extension.configuration || typeof extension.configuration !== 'object') {
|
|
6
|
+
return [];
|
|
7
|
+
}
|
|
8
|
+
return Object.entries(extension.configuration);
|
|
9
|
+
};
|
|
10
|
+
export const getConfigurationDefinitions = async () => {
|
|
11
|
+
const platform = (await executeCommand('Layout.getPlatform'));
|
|
12
|
+
const extensions = (await ExtensionManagementWorker.invoke('Extensions.getAllExtensions', '', platform));
|
|
13
|
+
return Object.fromEntries(extensions.flatMap(getConfigurationEntries));
|
|
14
|
+
};
|
|
4
15
|
export const getPreference = async (key) => {
|
|
5
16
|
return ExtensionManagementWorker.invoke('Extensions.getPreference', key);
|
|
6
17
|
};
|