@vscode/l10n
Advanced tools
Comparing version 0.0.6 to 0.0.7
/** | ||
* @public | ||
* Must be run as soon as possible. Loads the bundle from the given URI or contents. | ||
* @param config - The uri or contents of the bundle. | ||
* Loads the bundle from the given contents. Must be run before the first call to any `l10n.t()` variant. | ||
* **Note** The best way to set this is to pass the value of the VS Code API `vscode.l10n.contents` | ||
* to the process that uses `@vscode/l10n`. | ||
* @param config - An object that contains one property, contents, which should contain the contents of the bundle. | ||
*/ | ||
export declare function config(config: { | ||
uri: string | URL; | ||
} | { | ||
contents: string | l10nJsonFormat; | ||
@@ -14,2 +14,27 @@ }): void; | ||
* @public | ||
* Loads the bundle from the given fsPath. Must be run before the first call to any `l10n.t()` variant. | ||
* **Warning** This is not implemented in the browser and will throw an Error. | ||
* **Note** The best way to set this is to pass the value of the VS Code API `vscode.l10n.uri.fsPath` | ||
* to the process that uses `@vscode/l10n`. | ||
* @param config - An object that contains one property, fsPath, which should be a path to a file that contains the bundle. | ||
*/ | ||
export declare function config(config: { | ||
fsPath: string; | ||
}): void; | ||
/** | ||
* @public | ||
* Loads the bundle from the given URI using an asynchronous fetch request. | ||
* **Warning** Since this is an asynchronous API, you need to ensure that it resolves before | ||
* the first call to any `l10n.t()` variant. | ||
* **Note** The best way to set this is to pass the value of the VS Code API `vscode.l10n.uri.toString()` | ||
* to the process that uses `@vscode/l10n`. | ||
* @param config - An object that contains one property, uri, which should be a URL to the bundle. | ||
*/ | ||
export declare function config(config: { | ||
uri: string | URL; | ||
}): Promise<void>; | ||
/** | ||
* @public | ||
* The format of package.nls.json and l10n bundle files. | ||
@@ -16,0 +41,0 @@ */ |
{ | ||
"name": "@vscode/l10n", | ||
"version": "0.0.6", | ||
"version": "0.0.7", | ||
"description": "A helper library to assist in localizing subprocesses spun up by VS Code extensions", | ||
@@ -15,2 +15,5 @@ "author": "Microsoft Corporation", | ||
"main": "dist/main.js", | ||
"browser": { | ||
"./src/node/reader": "./src/browser/reader" | ||
}, | ||
"types": "dist/main.d.ts", | ||
@@ -25,2 +28,3 @@ "files": [ | ||
"@types/node": "^18.7.8", | ||
"@types/node-fetch": "^2.6.2", | ||
"@typescript-eslint/eslint-plugin": "^4.28.0", | ||
@@ -33,2 +37,3 @@ "@typescript-eslint/parser": "^4.28.0", | ||
"mock-fs": "^5.1.4", | ||
"node-fetch": "^2.6.7", | ||
"rimraf": "^3.0.2", | ||
@@ -35,0 +40,0 @@ "ts-node": "^10.9.1", |
@@ -5,3 +5,5 @@ # @vscode/l10n | ||
> NOTE: You should _NOT_ use this library in your extension's main process. The translations are loaded into the main process by VS Code itself. | ||
> **Note** | ||
> | ||
> You should _NOT_ use this library in your extension's main process. The translations are loaded into the main process by VS Code itself. | ||
@@ -8,0 +10,0 @@ ## Usage |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 3 instances in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
318080
6
1320
32
16
2
4