mirror of
https://github.com/suitenumerique/meet.git
synced 2026-07-26 11:58:53 +00:00
⬆️(frontend) replace NodeJS.Timeout with ReturnType<typeof setTimeout>
Removes Node.js type dependency from browser/React code by substituting the non-portable `NodeJS.Timeout` type with the standard `ReturnType<typeof setTimeout>` equivalent across all affected files. Also replaces `process.env.NODE_ENV` in Icon.tsx with `import.meta.env.MODE` for Vite compatibility.
This commit is contained in:
committed by
aleb_the_flash
parent
553df5070e
commit
27ebc2f2e3
Generated
+4
-5
@@ -44,7 +44,6 @@
|
||||
"@tanstack/eslint-plugin-query": "5.100.14",
|
||||
"@tanstack/react-query-devtools": "5.100.14",
|
||||
"@types/humanize-duration": "3.27.4",
|
||||
"@types/node": "24.12.4",
|
||||
"@types/react": "18.3.12",
|
||||
"@types/react-dom": "18.3.1",
|
||||
"@vitejs/plugin-react": "6.0.2",
|
||||
@@ -58,7 +57,7 @@
|
||||
"postcss": "8.5.15",
|
||||
"prettier": "3.8.3",
|
||||
"rollup-plugin-visualizer": "7.0.1",
|
||||
"typescript": "5.8.3",
|
||||
"typescript": "6.0.3",
|
||||
"typescript-eslint": "8.60.1",
|
||||
"vite": "8.0.14",
|
||||
"vite-plugin-svgr": "5.2.0",
|
||||
@@ -12611,9 +12610,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/typescript": {
|
||||
"version": "5.8.3",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.3.tgz",
|
||||
"integrity": "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==",
|
||||
"version": "6.0.3",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-6.0.3.tgz",
|
||||
"integrity": "sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw==",
|
||||
"devOptional": true,
|
||||
"license": "Apache-2.0",
|
||||
"bin": {
|
||||
|
||||
@@ -51,7 +51,6 @@
|
||||
"@tanstack/eslint-plugin-query": "5.100.14",
|
||||
"@tanstack/react-query-devtools": "5.100.14",
|
||||
"@types/humanize-duration": "3.27.4",
|
||||
"@types/node": "24.12.4",
|
||||
"@types/react": "18.3.12",
|
||||
"@types/react-dom": "18.3.1",
|
||||
"@vitejs/plugin-react": "6.0.2",
|
||||
@@ -65,7 +64,7 @@
|
||||
"postcss": "8.5.15",
|
||||
"prettier": "3.8.3",
|
||||
"rollup-plugin-visualizer": "7.0.1",
|
||||
"typescript": "5.8.3",
|
||||
"typescript": "6.0.3",
|
||||
"typescript-eslint": "8.60.1",
|
||||
"vite": "8.0.14",
|
||||
"vite-plugin-svgr": "5.2.0",
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ export const WaitingParticipantNotification = () => {
|
||||
keyPrefix: 'waitingParticipants',
|
||||
})
|
||||
|
||||
const timerRef = useRef<NodeJS.Timeout | null>(null)
|
||||
const timerRef = useRef<ReturnType<typeof setTimeout> | null>(null)
|
||||
const { isParticipantsOpen, toggleParticipants } = useSidePanel()
|
||||
const [showQuickActionsMessage, setShowQuickActionsMessage] = useState(false)
|
||||
const { waitingParticipants, handleParticipantEntry } =
|
||||
|
||||
@@ -57,7 +57,7 @@ export const ControlsButton = ({
|
||||
const isRoomConnected = room.state == ConnectionState.Connected
|
||||
|
||||
const [showSaving, setShowSaving] = useState(false)
|
||||
const timeoutRef = useRef<NodeJS.Timeout>()
|
||||
const timeoutRef = useRef<ReturnType<typeof setTimeout>>()
|
||||
|
||||
const isSaving = statuses.isSaving || isPendingToStop
|
||||
const isDisabled = !isRoomConnected || statuses.isAnotherModeStarted
|
||||
|
||||
@@ -19,7 +19,7 @@ export const RequestRecording = ({
|
||||
handleRequest,
|
||||
}: RequestRecordingProps) => {
|
||||
const [isDisabled, setIsDisabled] = useState(false)
|
||||
const timeoutRef = useRef<NodeJS.Timeout>()
|
||||
const timeoutRef = useRef<ReturnType<typeof setTimeout>>()
|
||||
|
||||
useEffect(() => {
|
||||
return () => {
|
||||
|
||||
@@ -20,7 +20,7 @@ export const useLobby = ({
|
||||
onAccepted: (e: ApiRequestEntry) => void
|
||||
}) => {
|
||||
const [status, setStatus] = useState(ApiLobbyStatus.IDLE)
|
||||
const waitingTimeoutRef = useRef<NodeJS.Timeout | null>(null)
|
||||
const waitingTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null)
|
||||
|
||||
const clearWaitingTimeout = useCallback(() => {
|
||||
if (waitingTimeoutRef.current) {
|
||||
|
||||
@@ -7,7 +7,7 @@ const POLLING_TIME = 500
|
||||
export const useWatchPermissions = () => {
|
||||
useEffect(() => {
|
||||
let cleanup: (() => void) | undefined
|
||||
let intervalId: NodeJS.Timeout | undefined
|
||||
let intervalId: ReturnType<typeof setTimeout> | undefined
|
||||
let isCancelled = false
|
||||
|
||||
const checkPermissions = async () => {
|
||||
|
||||
@@ -22,7 +22,7 @@ export const HandToggle = () => {
|
||||
})
|
||||
|
||||
const isSpeaking = room.localParticipant.isSpeaking
|
||||
const speakingTimerRef = useRef<NodeJS.Timeout | null>(null)
|
||||
const speakingTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null)
|
||||
const [hasShownToast, setHasShownToast] = useState(false)
|
||||
|
||||
const resetToastState = () => {
|
||||
|
||||
@@ -14,7 +14,9 @@ export default function useRateLimiter<T extends (...args: any[]) => any>({
|
||||
windowMs = 1000,
|
||||
}: RateLimiterProps<T>) {
|
||||
const callsCountRef = useRef(0)
|
||||
const resetTimeoutRef = useRef<NodeJS.Timeout | undefined>(undefined)
|
||||
const resetTimeoutRef = useRef<ReturnType<typeof setTimeout> | undefined>(
|
||||
undefined
|
||||
)
|
||||
|
||||
const rateLimitedFn = useCallback(
|
||||
(...args: Parameters<T>) => {
|
||||
|
||||
@@ -8,7 +8,7 @@ import { useEffect, useRef, useState } from 'react'
|
||||
*/
|
||||
export function useSyncAfterDelay<T>(value: T, waitFor: number = 300) {
|
||||
const valueRef = useRef(value)
|
||||
const timeoutRef = useRef<NodeJS.Timeout>()
|
||||
const timeoutRef = useRef<ReturnType<typeof setTimeout>>()
|
||||
const [syncValue, setSyncValue] = useState<T>()
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
@@ -56,7 +56,7 @@ export const Icon = ({ name, ...props }: IconProps) => {
|
||||
const SvgIcon = icons[name]
|
||||
|
||||
if (!SvgIcon) {
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
if (import.meta.env.NODE_ENV !== 'production') {
|
||||
console.warn(
|
||||
`[Icon] Unknown icon name: "${name}". Available: ${Object.keys(icons).join(', ')}`
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user