@graphql-hive/laboratory
Version:
[Hive](https://the-guild.dev/graphql/hive) is a fully open-source schema registry, analytics, metrics and gateway for [GraphQL federation](https://the-guild.dev/graphql/hive/federation) and other GraphQL APIs.
136 lines (135 loc) • 5.99 kB
JavaScript
import { Wu as e, m as t } from "./editor.api-HRp2tMTX.js";
// ../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/language/typescript/monaco.contribution.js
var n = /* @__PURE__ */ e({}), r = Object.defineProperty, i = Object.getOwnPropertyDescriptor, a = Object.getOwnPropertyNames, o = Object.prototype.hasOwnProperty, s = (e, t, n, s) => {
if (t && typeof t == "object" || typeof t == "function") for (let c of a(t)) !o.call(e, c) && c !== n && r(e, c, {
get: () => t[c],
enumerable: !(s = i(t, c)) || s.enumerable
});
return e;
}, c = (e, t, n) => (s(e, t, "default"), n && s(n, t, "default")), l = "5.4.5", u = {};
c(u, t);
var d = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.CommonJS = 1] = "CommonJS", e[e.AMD = 2] = "AMD", e[e.UMD = 3] = "UMD", e[e.System = 4] = "System", e[e.ES2015 = 5] = "ES2015", e[e.ESNext = 99] = "ESNext", e))(d || {}), f = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.Preserve = 1] = "Preserve", e[e.React = 2] = "React", e[e.ReactNative = 3] = "ReactNative", e[e.ReactJSX = 4] = "ReactJSX", e[e.ReactJSXDev = 5] = "ReactJSXDev", e))(f || {}), p = /* @__PURE__ */ ((e) => (e[e.CarriageReturnLineFeed = 0] = "CarriageReturnLineFeed", e[e.LineFeed = 1] = "LineFeed", e))(p || {}), m = /* @__PURE__ */ ((e) => (e[e.ES3 = 0] = "ES3", e[e.ES5 = 1] = "ES5", e[e.ES2015 = 2] = "ES2015", e[e.ES2016 = 3] = "ES2016", e[e.ES2017 = 4] = "ES2017", e[e.ES2018 = 5] = "ES2018", e[e.ES2019 = 6] = "ES2019", e[e.ES2020 = 7] = "ES2020", e[e.ESNext = 99] = "ESNext", e[e.JSON = 100] = "JSON", e[e.Latest = 99] = "Latest", e))(m || {}), h = /* @__PURE__ */ ((e) => (e[e.Classic = 1] = "Classic", e[e.NodeJs = 2] = "NodeJs", e))(h || {}), g = class {
constructor(e, t, n, r, i) {
this._onDidChange = new u.Emitter(), this._onDidExtraLibsChange = new u.Emitter(), this._extraLibs = /* @__PURE__ */ Object.create(null), this._removedExtraLibs = /* @__PURE__ */ Object.create(null), this._eagerModelSync = !1, this.setCompilerOptions(e), this.setDiagnosticsOptions(t), this.setWorkerOptions(n), this.setInlayHintsOptions(r), this.setModeConfiguration(i), this._onDidExtraLibsChangeTimeout = -1;
}
get onDidChange() {
return this._onDidChange.event;
}
get onDidExtraLibsChange() {
return this._onDidExtraLibsChange.event;
}
get modeConfiguration() {
return this._modeConfiguration;
}
get workerOptions() {
return this._workerOptions;
}
get inlayHintsOptions() {
return this._inlayHintsOptions;
}
getExtraLibs() {
return this._extraLibs;
}
addExtraLib(e, t) {
let n;
if (n = t === void 0 ? `ts:extralib-${Math.random().toString(36).substring(2, 15)}` : t, this._extraLibs[n] && this._extraLibs[n].content === e) return { dispose: () => {} };
let r = 1;
return this._removedExtraLibs[n] && (r = this._removedExtraLibs[n] + 1), this._extraLibs[n] && (r = this._extraLibs[n].version + 1), this._extraLibs[n] = {
content: e,
version: r
}, this._fireOnDidExtraLibsChangeSoon(), { dispose: () => {
let e = this._extraLibs[n];
e && e.version === r && (delete this._extraLibs[n], this._removedExtraLibs[n] = r, this._fireOnDidExtraLibsChangeSoon());
} };
}
setExtraLibs(e) {
for (let e in this._extraLibs) this._removedExtraLibs[e] = this._extraLibs[e].version;
if (this._extraLibs = /* @__PURE__ */ Object.create(null), e && e.length > 0) for (let t of e) {
let e = t.filePath || `ts:extralib-${Math.random().toString(36).substring(2, 15)}`, n = t.content, r = 1;
this._removedExtraLibs[e] && (r = this._removedExtraLibs[e] + 1), this._extraLibs[e] = {
content: n,
version: r
};
}
this._fireOnDidExtraLibsChangeSoon();
}
_fireOnDidExtraLibsChangeSoon() {
this._onDidExtraLibsChangeTimeout === -1 && (this._onDidExtraLibsChangeTimeout = window.setTimeout(() => {
this._onDidExtraLibsChangeTimeout = -1, this._onDidExtraLibsChange.fire(void 0);
}, 0));
}
getCompilerOptions() {
return this._compilerOptions;
}
setCompilerOptions(e) {
this._compilerOptions = e || /* @__PURE__ */ Object.create(null), this._onDidChange.fire(void 0);
}
getDiagnosticsOptions() {
return this._diagnosticsOptions;
}
setDiagnosticsOptions(e) {
this._diagnosticsOptions = e || /* @__PURE__ */ Object.create(null), this._onDidChange.fire(void 0);
}
setWorkerOptions(e) {
this._workerOptions = e || /* @__PURE__ */ Object.create(null), this._onDidChange.fire(void 0);
}
setInlayHintsOptions(e) {
this._inlayHintsOptions = e || /* @__PURE__ */ Object.create(null), this._onDidChange.fire(void 0);
}
setMaximumWorkerIdleTime(e) {}
setEagerModelSync(e) {
this._eagerModelSync = e;
}
getEagerModelSync() {
return this._eagerModelSync;
}
setModeConfiguration(e) {
this._modeConfiguration = e || /* @__PURE__ */ Object.create(null), this._onDidChange.fire(void 0);
}
}, _ = l, v = {
completionItems: !0,
hovers: !0,
documentSymbols: !0,
definitions: !0,
references: !0,
documentHighlights: !0,
rename: !0,
diagnostics: !0,
documentRangeFormattingEdits: !0,
signatureHelp: !0,
onTypeFormattingEdits: !0,
codeActions: !0,
inlayHints: !0
}, y = new g({
allowNonTsExtensions: !0,
target: 99
}, {
noSemanticValidation: !1,
noSyntaxValidation: !1,
onlyVisible: !1
}, {}, {}, v), b = new g({
allowNonTsExtensions: !0,
allowJs: !0,
target: 99
}, {
noSemanticValidation: !0,
noSyntaxValidation: !1,
onlyVisible: !1
}, {}, {}, v), x = () => C().then((e) => e.getTypeScriptWorker()), S = () => C().then((e) => e.getJavaScriptWorker());
u.languages.typescript = {
ModuleKind: d,
JsxEmit: f,
NewLineKind: p,
ScriptTarget: m,
ModuleResolutionKind: h,
typescriptVersion: _,
typescriptDefaults: y,
javascriptDefaults: b,
getTypeScriptWorker: x,
getJavaScriptWorker: S
};
function C() {
return import("./tsMode-CmpVH90L.js");
}
u.languages.onLanguage("typescript", () => C().then((e) => e.setupTypeScript(y))), u.languages.onLanguage("javascript", () => C().then((e) => e.setupJavaScript(b)));
export { y as n, n as t };