@codingame/monaco-vscode-policy-service-override 24.2.0 → 25.0.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/index.d.ts +8 -3
- package/index.js +14 -4
- package/package.json +2 -2
package/index.d.ts
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import type { PolicyName } from "@codingame/monaco-vscode-api/vscode/vs/base/common/policy";
|
|
2
2
|
import type { IEditorOverrideServices } from "@codingame/monaco-vscode-api/vscode/vs/editor/standalone/browser/standaloneServices";
|
|
3
|
-
import { type PolicyValue } from "@codingame/monaco-vscode-api/vscode/vs/platform/policy/common/policy";
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
import { AbstractPolicyService, type PolicyValue } from "@codingame/monaco-vscode-api/vscode/vs/platform/policy/common/policy";
|
|
4
|
+
declare class PolicyService extends AbstractPolicyService {
|
|
5
|
+
constructor(defaultPolicies: Map<PolicyName, PolicyValue>);
|
|
6
|
+
updatePolicy(name: PolicyName, value: PolicyValue | undefined): void;
|
|
7
|
+
protected _updatePolicyDefinitions(): Promise<void>;
|
|
8
|
+
}
|
|
9
|
+
export default function getServiceOverride(defaultPolicies: Map<PolicyName, PolicyValue>): IEditorOverrideServices;
|
|
10
|
+
export type { PolicyName, PolicyValue, PolicyService };
|
package/index.js
CHANGED
|
@@ -4,15 +4,25 @@ import { AbstractPolicyService } from '@codingame/monaco-vscode-api/vscode/vs/pl
|
|
|
4
4
|
import { IPolicyService } from '@codingame/monaco-vscode-api/vscode/vs/platform/policy/common/policy.service';
|
|
5
5
|
|
|
6
6
|
class PolicyService extends AbstractPolicyService {
|
|
7
|
-
constructor(
|
|
7
|
+
constructor(defaultPolicies) {
|
|
8
8
|
super();
|
|
9
|
-
this.policies =
|
|
9
|
+
this.policies = new Map(defaultPolicies);
|
|
10
|
+
this._onDidChange.fire([]);
|
|
11
|
+
}
|
|
12
|
+
updatePolicy(name, value) {
|
|
13
|
+
if (value == null) {
|
|
14
|
+
this.policies.delete(name);
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
this.policies.set(name, value);
|
|
18
|
+
}
|
|
19
|
+
this._onDidChange.fire([name]);
|
|
10
20
|
}
|
|
11
21
|
async _updatePolicyDefinitions() { }
|
|
12
22
|
}
|
|
13
|
-
function getServiceOverride(
|
|
23
|
+
function getServiceOverride(defaultPolicies) {
|
|
14
24
|
return {
|
|
15
|
-
[IPolicyService.toString()]: new SyncDescriptor(PolicyService, [
|
|
25
|
+
[IPolicyService.toString()]: new SyncDescriptor(PolicyService, [defaultPolicies], true)
|
|
16
26
|
};
|
|
17
27
|
}
|
|
18
28
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-policy-service-override",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "25.0.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "VSCode public API plugged on the monaco editor - policy service-override",
|
|
6
6
|
"keywords": [],
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
},
|
|
16
16
|
"type": "module",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@codingame/monaco-vscode-api": "
|
|
18
|
+
"@codingame/monaco-vscode-api": "25.0.0"
|
|
19
19
|
},
|
|
20
20
|
"main": "index.js",
|
|
21
21
|
"module": "index.js",
|