mirror of
https://github.com/AykutSarac/jsoncrack.com.git
synced 2025-01-27 15:22:56 +08:00
improve type
This commit is contained in:
parent
f85e32b9c5
commit
e8496f9ead
@ -2,6 +2,7 @@ import type { EditorProps } from "@monaco-editor/react";
|
||||
|
||||
export const editorOptions: EditorProps["options"] = {
|
||||
formatOnPaste: true,
|
||||
formatOnType: true,
|
||||
stopRenderingLineAfter: -1,
|
||||
minimap: { enabled: false },
|
||||
stickyScroll: { enabled: false },
|
||||
|
@ -14,9 +14,7 @@ loader.config({
|
||||
const editorOptions: EditorProps["options"] = {
|
||||
formatOnPaste: true,
|
||||
formatOnType: true,
|
||||
minimap: {
|
||||
enabled: false,
|
||||
},
|
||||
minimap: { enabled: false },
|
||||
scrollBeyondLastLine: false,
|
||||
};
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
import React from "react";
|
||||
import { Box, Button, Container, Flex, Paper, Title, Text } from "@mantine/core";
|
||||
import { Editor } from "@monaco-editor/react";
|
||||
import { Editor, type OnMount } from "@monaco-editor/react";
|
||||
import { JSONSchemaFaker } from "json-schema-faker";
|
||||
import { LuCheck, LuXCircle } from "react-icons/lu";
|
||||
import { editorOptions } from "src/containers/ConverterLayout/options";
|
||||
@ -10,7 +10,7 @@ import { generateType } from "src/lib/utils/generateType";
|
||||
import { jsonToContent } from "src/lib/utils/jsonAdapter";
|
||||
|
||||
const JSONSchemaTool = () => {
|
||||
const monacoRef = React.useRef<any>(null);
|
||||
const monacoRef = React.useRef<Parameters<OnMount>[1] | null>(null);
|
||||
const [jsonError, setJsonError] = React.useState(false);
|
||||
const [jsonSchemaError, setJsonSchemaError] = React.useState(false);
|
||||
const [json, setJson] = React.useState("");
|
||||
|
Loading…
x
Reference in New Issue
Block a user