Files
vscode/build/lib/policies/stringPolicy.js
Matt Bierner fe8fc75455 Pick up latest TS native preview
Fixes the emit for copyright headers
2025-10-28 09:18:27 -07:00

48 lines
2.0 KiB
JavaScript

"use strict";
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.StringPolicy = void 0;
const basePolicy_1 = require("./basePolicy");
const render_1 = require("./render");
const types_1 = require("./types");
class StringPolicy extends basePolicy_1.BasePolicy {
static from(category, policy) {
const { type, name, minimumVersion, localization } = policy;
if (type !== 'string') {
return undefined;
}
return new StringPolicy(name, { moduleName: '', name: { nlsKey: category.name.key, value: category.name.value } }, minimumVersion, { nlsKey: localization.description.key, value: localization.description.value }, '');
}
constructor(name, category, minimumVersion, description, moduleName) {
super(types_1.PolicyType.String, name, category, minimumVersion, description, moduleName);
}
renderADMXElements() {
return [`<text id="${this.name}" valueName="${this.name}" required="true" />`];
}
renderJsonValue() {
return '';
}
renderADMLPresentationContents() {
return `<textBox refId="${this.name}"><label>${this.name}:</label></textBox>`;
}
renderProfileValue() {
return `<string></string>`;
}
renderProfileManifestValue(translations) {
return `<key>pfm_default</key>
<string></string>
<key>pfm_description</key>
<string>${(0, render_1.renderProfileString)(this.name, this.moduleName, this.description, translations)}</string>
<key>pfm_name</key>
<string>${this.name}</string>
<key>pfm_title</key>
<string>${this.name}</string>
<key>pfm_type</key>
<string>string</string>`;
}
}
exports.StringPolicy = StringPolicy;
//# sourceMappingURL=stringPolicy.js.map