mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-22 23:53:48 +01:00
working with monaco anys
This commit is contained in:
parent
0c07dddb36
commit
dfadfe6eb2
@ -58,7 +58,7 @@ export interface IPlayer extends IPerson {
|
||||
moneySourceB: MoneySourceTracker;
|
||||
playtimeSinceLastAug: number;
|
||||
playtimeSinceLastBitnode: number;
|
||||
purchasedServers: any[];
|
||||
purchasedServers: string[];
|
||||
queuedAugmentations: IPlayerOwnedAugmentation[];
|
||||
scriptProdSinceLastAug: number;
|
||||
sleeves: Sleeve[];
|
||||
|
@ -1,6 +1,7 @@
|
||||
import React, { useState, useEffect, useRef, useMemo } from "react";
|
||||
import Editor, { Monaco } from "@monaco-editor/react";
|
||||
import Editor from "@monaco-editor/react";
|
||||
import * as monaco from "monaco-editor";
|
||||
import type { Monaco } from "@monaco-editor/react";
|
||||
|
||||
type IStandaloneCodeEditor = monaco.editor.IStandaloneCodeEditor;
|
||||
type ITextModel = monaco.editor.ITextModel;
|
||||
@ -195,7 +196,6 @@ export function Root(props: IProps): React.ReactElement {
|
||||
try {
|
||||
// @ts-expect-error
|
||||
window.require(["monaco-vim"], function (MonacoVim: any) {
|
||||
console.log(MonacoVim);
|
||||
setVimEditor(MonacoVim.initVimMode(editor, vimStatusRef.current));
|
||||
MonacoVim.VimMode.Vim.defineEx("write", "w", function () {
|
||||
// your own implementation on what you want to do when :w is pressed
|
||||
|
@ -1,6 +1,9 @@
|
||||
import * as monaco from "monaco-editor";
|
||||
import type { Monaco } from "@monaco-editor/react";
|
||||
|
||||
export interface IScriptEditorTheme {
|
||||
[key: string]: any;
|
||||
base: string;
|
||||
base: "vs" | "vs-dark" | "hc-black";
|
||||
inherit: boolean;
|
||||
common: {
|
||||
[key: string]: string;
|
||||
@ -85,7 +88,7 @@ export const sanitizeTheme = (theme: IScriptEditorTheme): void => {
|
||||
continue;
|
||||
}
|
||||
|
||||
const repairBlock = (block: { [key: string]: any }): void => {
|
||||
const repairBlock = (block: { [key: string]: object | string }): void => {
|
||||
for (const [k, v] of Object.entries(block)) {
|
||||
if (typeof v === "object") {
|
||||
repairBlock(v as { [key: string]: string });
|
||||
@ -96,7 +99,7 @@ export const sanitizeTheme = (theme: IScriptEditorTheme): void => {
|
||||
}
|
||||
};
|
||||
|
||||
export function makeTheme(theme: IScriptEditorTheme): any {
|
||||
export function makeTheme(theme: IScriptEditorTheme): monaco.editor.IStandaloneThemeData {
|
||||
const themeRules = [
|
||||
{
|
||||
token: "",
|
||||
@ -211,7 +214,7 @@ export function makeTheme(theme: IScriptEditorTheme): any {
|
||||
return { base: theme.base, inherit: theme.inherit, rules: themeRules, colors: themeColors };
|
||||
}
|
||||
|
||||
export async function loadThemes(monaco: { editor: any }): Promise<void> {
|
||||
export async function loadThemes(monaco: Monaco): Promise<void> {
|
||||
monaco.editor.defineTheme("monokai", {
|
||||
base: "vs-dark",
|
||||
inherit: true,
|
||||
|
Loading…
Reference in New Issue
Block a user