feat(JsonEditor): update types for value, onSave, and schema props to JsonValue

feat(TabContent): refine types for onSchemasChange, onWorkflowsChange, and onLuaScriptsChange props
This commit is contained in:
2025-12-30 00:09:24 +00:00
parent 5bca85b5a9
commit d9a562f09b
2 changed files with 10 additions and 8 deletions

View File

@@ -13,6 +13,7 @@ import {
DialogTitle,
} from '@/components/ui'
import { securityScanner, type SecurityScanResult } from '@/lib/security-scanner'
import type { JsonValue } from '@/types/utility-types'
import { SchemaSection } from './json/SchemaSection'
import { Toolbar } from './json/Toolbar'
@@ -21,9 +22,9 @@ interface JsonEditorProps {
open: boolean
onClose: () => void
title: string
value: any
onSave: (value: any) => void
schema?: any
value: JsonValue
onSave: (value: JsonValue) => void
schema?: JsonValue
}
export function JsonEditor({ open, onClose, title, value, onSave, schema }: JsonEditorProps) {
@@ -41,7 +42,7 @@ export function JsonEditor({ open, onClose, title, value, onSave, schema }: Json
}
}, [open, value])
const parseJson = () => JSON.parse(jsonText)
const parseJson = (): JsonValue => JSON.parse(jsonText) as JsonValue
const handleSave = () => {
try {

View File

@@ -16,7 +16,8 @@ import { ThemeEditor } from '@/components/ThemeEditor'
import { TabsContent } from '@/components/ui'
import { UserManagement } from '@/components/UserManagement'
import { WorkflowEditor } from '@/components/WorkflowEditor'
import type { AppConfiguration, User } from '@/lib/level-types'
import type { AppConfiguration, LuaScript, User, Workflow } from '@/lib/level-types'
import type { ModelSchema } from '@/lib/types/schema-types'
import type { Level4TabConfig } from './config'
@@ -25,9 +26,9 @@ interface Level4TabContentProps {
appConfig: AppConfiguration
user: User
nerdMode: boolean
onSchemasChange: (schemas: any[]) => Promise<void>
onWorkflowsChange: (workflows: any[]) => Promise<void>
onLuaScriptsChange: (scripts: any[]) => Promise<void>
onSchemasChange: (schemas: ModelSchema[]) => Promise<void>
onWorkflowsChange: (workflows: Workflow[]) => Promise<void>
onLuaScriptsChange: (scripts: LuaScript[]) => Promise<void>
}
export function TabContent({