@lvce-editor/api 9.20.0 → 9.21.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/README.md +8 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/parts/Platform/Platform.d.ts +1 -0
- package/dist/parts/Platform/Platform.js +3 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -22,6 +22,14 @@ export const main = () => {
|
|
|
22
22
|
|
|
23
23
|
The package is published as unbundled ESM with TypeScript declaration files, so extensions can bundle it with their own build tooling.
|
|
24
24
|
|
|
25
|
+
Extensions running on Electron or a remote host can request the editor's user data directory as a `file:` URI. The call throws on the web platform.
|
|
26
|
+
|
|
27
|
+
```ts
|
|
28
|
+
import { getUserDataDir } from '@lvce-editor/api'
|
|
29
|
+
|
|
30
|
+
const userDataDir = await getUserDataDir()
|
|
31
|
+
```
|
|
32
|
+
|
|
25
33
|
Electron extensions can create an off-screen web contents view. It stays hidden for the lifetime of the handle, and disposing the handle destroys its web contents.
|
|
26
34
|
|
|
27
35
|
```ts
|
package/dist/index.d.ts
CHANGED
|
@@ -18,7 +18,7 @@ export { executeFileSystemProviderGetPathSeparator, executeFileSystemProviderIsR
|
|
|
18
18
|
export { closeUri, confirm, getRecentlyOpenedWorkspaceUris, getWorkspaceFolder, getWorkspaceUri, handleWorkspaceRefresh, openUri, setWorkspaceUri, showNotification, type NotificationType, } from './parts/Host/Host.ts';
|
|
19
19
|
export { executeHoverProvider, getHoverProviderRegistrySnapshot, registerHoverProvider, resetHoverProviderRegistry } from './parts/Hover/Hover.ts';
|
|
20
20
|
export { executeSignatureHelpProvider, getSignatureHelpProviderRegistrySnapshot, registerSignatureHelpProvider, resetSignatureHelpProviderRegistry, } from './parts/SignatureHelp/SignatureHelp.ts';
|
|
21
|
-
export { getPlatform, type Platform } from './parts/Platform/Platform.ts';
|
|
21
|
+
export { getPlatform, getUserDataDir, type Platform } from './parts/Platform/Platform.ts';
|
|
22
22
|
export { focusNextTab, focusPreviousTab } from './parts/MainArea/MainArea.ts';
|
|
23
23
|
export { openProcessExplorer } from './parts/ProcessExplorer/ProcessExplorer.ts';
|
|
24
24
|
export { openDebugConsole, openOutputView, openProblemsView, type OpenDebugConsoleOptions, type OpenOutputViewOptions, type OpenProblemsViewOptions, } from './parts/Panel/Panel.ts';
|
package/dist/index.js
CHANGED
|
@@ -18,7 +18,7 @@ export { executeFileSystemProviderGetPathSeparator, executeFileSystemProviderIsR
|
|
|
18
18
|
export { closeUri, confirm, getRecentlyOpenedWorkspaceUris, getWorkspaceFolder, getWorkspaceUri, handleWorkspaceRefresh, openUri, setWorkspaceUri, showNotification, } from "./parts/Host/Host.js";
|
|
19
19
|
export { executeHoverProvider, getHoverProviderRegistrySnapshot, registerHoverProvider, resetHoverProviderRegistry } from "./parts/Hover/Hover.js";
|
|
20
20
|
export { executeSignatureHelpProvider, getSignatureHelpProviderRegistrySnapshot, registerSignatureHelpProvider, resetSignatureHelpProviderRegistry, } from "./parts/SignatureHelp/SignatureHelp.js";
|
|
21
|
-
export { getPlatform } from "./parts/Platform/Platform.js";
|
|
21
|
+
export { getPlatform, getUserDataDir } from "./parts/Platform/Platform.js";
|
|
22
22
|
export { focusNextTab, focusPreviousTab } from "./parts/MainArea/MainArea.js";
|
|
23
23
|
export { openProcessExplorer } from "./parts/ProcessExplorer/ProcessExplorer.js";
|
|
24
24
|
export { openDebugConsole, openOutputView, openProblemsView, } from "./parts/Panel/Panel.js";
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { executeCommand } from "../ExecuteCommand/ExecuteCommand.js";
|
|
2
|
+
export const getUserDataDir = async () => {
|
|
3
|
+
return (await executeCommand('Platform.getUserDataDir'));
|
|
4
|
+
};
|
|
2
5
|
export const getPlatform = async () => {
|
|
3
6
|
const platform = await executeCommand('Layout.getPlatform');
|
|
4
7
|
switch (platform) {
|