mirror of https://github.com/langgenius/dify.git
Fix type error (#27217)
This commit is contained in:
parent
523da66134
commit
bebb4ffbaa
|
|
@ -237,7 +237,7 @@ const ChatWrapper = () => {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Chat
|
<Chat
|
||||||
appData={appData}
|
appData={appData || undefined}
|
||||||
config={appConfig}
|
config={appConfig}
|
||||||
chatList={messageList}
|
chatList={messageList}
|
||||||
isResponding={respondingState}
|
isResponding={respondingState}
|
||||||
|
|
|
||||||
|
|
@ -122,7 +122,7 @@ const Flowchart = (props: FlowchartProps) => {
|
||||||
const containerRef = useRef<HTMLDivElement>(null)
|
const containerRef = useRef<HTMLDivElement>(null)
|
||||||
const chartId = useRef(`mermaid-chart-${Math.random().toString(36).slice(2, 11)}`).current
|
const chartId = useRef(`mermaid-chart-${Math.random().toString(36).slice(2, 11)}`).current
|
||||||
const [isLoading, setIsLoading] = useState(true)
|
const [isLoading, setIsLoading] = useState(true)
|
||||||
const renderTimeoutRef = useRef<NodeJS.Timeout>()
|
const renderTimeoutRef = useRef<NodeJS.Timeout | undefined>(undefined)
|
||||||
const [errMsg, setErrMsg] = useState('')
|
const [errMsg, setErrMsg] = useState('')
|
||||||
const [imagePreviewUrl, setImagePreviewUrl] = useState('')
|
const [imagePreviewUrl, setImagePreviewUrl] = useState('')
|
||||||
|
|
||||||
|
|
@ -187,7 +187,7 @@ const Flowchart = (props: FlowchartProps) => {
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
// Update theme when prop changes, but allow internal override.
|
// Update theme when prop changes, but allow internal override.
|
||||||
const prevThemeRef = useRef<string>()
|
const prevThemeRef = useRef<string | undefined>(undefined)
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
// Only react if the theme prop from the outside has actually changed.
|
// Only react if the theme prop from the outside has actually changed.
|
||||||
if (props.theme && props.theme !== prevThemeRef.current) {
|
if (props.theme && props.theme !== prevThemeRef.current) {
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ export enum Priority {
|
||||||
topPriority = 'top-priority',
|
topPriority = 'top-priority',
|
||||||
}
|
}
|
||||||
|
|
||||||
export type BasicPlan = Plan.sandbox | Plan.professional | Plan.team | Plan.enterprise
|
export type BasicPlan = Plan.sandbox | Plan.professional | Plan.team
|
||||||
|
|
||||||
export type PlanInfo = {
|
export type PlanInfo = {
|
||||||
level: number
|
level: number
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,6 @@ import {
|
||||||
} from '@/app/components/header/account-setting/model-provider-page/declarations'
|
} from '@/app/components/header/account-setting/model-provider-page/declarations'
|
||||||
import type { Model, ModelProvider } from '@/app/components/header/account-setting/model-provider-page/declarations'
|
import type { Model, ModelProvider } from '@/app/components/header/account-setting/model-provider-page/declarations'
|
||||||
import type { RETRIEVE_METHOD } from '@/types/app'
|
import type { RETRIEVE_METHOD } from '@/types/app'
|
||||||
import type { BasicPlan } from '@/app/components/billing/type'
|
|
||||||
import { Plan, type UsagePlanInfo } from '@/app/components/billing/type'
|
import { Plan, type UsagePlanInfo } from '@/app/components/billing/type'
|
||||||
import { fetchCurrentPlanInfo } from '@/service/billing'
|
import { fetchCurrentPlanInfo } from '@/service/billing'
|
||||||
import { parseCurrentPlan } from '@/app/components/billing/utils'
|
import { parseCurrentPlan } from '@/app/components/billing/utils'
|
||||||
|
|
@ -37,7 +36,7 @@ type ProviderContextState = {
|
||||||
supportRetrievalMethods: RETRIEVE_METHOD[]
|
supportRetrievalMethods: RETRIEVE_METHOD[]
|
||||||
isAPIKeySet: boolean
|
isAPIKeySet: boolean
|
||||||
plan: {
|
plan: {
|
||||||
type: BasicPlan
|
type: Plan
|
||||||
usage: UsagePlanInfo
|
usage: UsagePlanInfo
|
||||||
total: UsagePlanInfo
|
total: UsagePlanInfo
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,36 @@
|
||||||
|
declare module 'lamejs' {
|
||||||
|
export class Mp3Encoder {
|
||||||
|
constructor(channels: number, sampleRate: number, bitRate: number)
|
||||||
|
encodeBuffer(left: Int16Array, right?: Int16Array | null): Int8Array
|
||||||
|
flush(): Int8Array
|
||||||
|
}
|
||||||
|
|
||||||
|
export class WavHeader {
|
||||||
|
static readHeader(data: DataView): {
|
||||||
|
channels: number
|
||||||
|
sampleRate: number
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const lamejs: {
|
||||||
|
Mp3Encoder: typeof Mp3Encoder
|
||||||
|
WavHeader: typeof WavHeader
|
||||||
|
}
|
||||||
|
|
||||||
|
export default lamejs
|
||||||
|
}
|
||||||
|
|
||||||
|
declare module 'lamejs/src/js/MPEGMode' {
|
||||||
|
const MPEGMode: any
|
||||||
|
export default MPEGMode
|
||||||
|
}
|
||||||
|
|
||||||
|
declare module 'lamejs/src/js/Lame' {
|
||||||
|
const Lame: any
|
||||||
|
export default Lame
|
||||||
|
}
|
||||||
|
|
||||||
|
declare module 'lamejs/src/js/BitStream' {
|
||||||
|
const BitStream: any
|
||||||
|
export default BitStream
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
declare module 'react-18-input-autosize' {
|
||||||
|
import type { CSSProperties, ChangeEvent, FocusEvent, KeyboardEvent } from 'react'
|
||||||
|
|
||||||
|
export type AutosizeInputProps = {
|
||||||
|
value?: string | number
|
||||||
|
defaultValue?: string | number
|
||||||
|
onChange?: (event: ChangeEvent<HTMLInputElement>) => void
|
||||||
|
onFocus?: (event: FocusEvent<HTMLInputElement>) => void
|
||||||
|
onBlur?: (event: FocusEvent<HTMLInputElement>) => void
|
||||||
|
onKeyDown?: (event: KeyboardEvent<HTMLInputElement>) => void
|
||||||
|
placeholder?: string
|
||||||
|
className?: string
|
||||||
|
inputClassName?: string
|
||||||
|
style?: CSSProperties
|
||||||
|
inputStyle?: CSSProperties
|
||||||
|
minWidth?: number | string
|
||||||
|
maxWidth?: number | string
|
||||||
|
[key: string]: any
|
||||||
|
}
|
||||||
|
|
||||||
|
const AutosizeInput: React.FC<AutosizeInputProps>
|
||||||
|
export default AutosizeInput
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue