improve type

This commit is contained in:
AykutSarac 2024-11-15 15:44:39 +03:00
parent f85e32b9c5
commit e8496f9ead
No known key found for this signature in database
3 changed files with 4 additions and 5 deletions

View File

@ -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 },

View File

@ -14,9 +14,7 @@ loader.config({
const editorOptions: EditorProps["options"] = {
formatOnPaste: true,
formatOnType: true,
minimap: {
enabled: false,
},
minimap: { enabled: false },
scrollBeyondLastLine: false,
};

View File

@ -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("");