mirror of
https://github.com/fofolee/uTools-quickcommand.git
synced 2025-09-28 07:05:03 +08:00
添加javascript的声明文件
This commit is contained in:
@@ -130,6 +130,11 @@
|
||||
import globalVars from "components/GlobalVars";
|
||||
import * as monaco from "monaco-editor";
|
||||
import { toRaw } from "vue";
|
||||
import utoolsApi from "!raw-loader!../types/utools.api.d.ts";
|
||||
import quickcommandApi from "!raw-loader!../types/quickcommand.api.d.ts";
|
||||
import electronApi from "!raw-loader!../types/electron.d.ts";
|
||||
import nodeApi from "!raw-loader!../types/node.api.d.ts";
|
||||
import commonApi from "!raw-loader!../types/common.d.ts";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
@@ -181,6 +186,20 @@ export default {
|
||||
that.runCurrentCommand();
|
||||
}
|
||||
);
|
||||
monaco.languages.typescript.javascriptDefaults.setDiagnosticsOptions({
|
||||
noSemanticValidation: true,
|
||||
noSyntaxValidation: false,
|
||||
});
|
||||
monaco.languages.typescript.javascriptDefaults.setCompilerOptions({
|
||||
target: monaco.languages.typescript.ScriptTarget.ES6,
|
||||
allowNonTsExtensions: true,
|
||||
allowJs: true,
|
||||
lib: [],
|
||||
});
|
||||
monaco.languages.typescript.javascriptDefaults.addExtraLib(
|
||||
quickcommandApi + utoolsApi + electronApi + nodeApi + commonApi,
|
||||
"api.d.ts"
|
||||
);
|
||||
},
|
||||
getEditorValue() {
|
||||
return toRaw(this.editor).getValue();
|
||||
|
Reference in New Issue
Block a user