Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v22
v25
4 changes: 2 additions & 2 deletions src/Common/ClipboardButton/ClipboardButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export const ClipboardButton = ({
size,
}: ClipboardProps) => {
const [copied, setCopied] = useState<boolean>(false)
const setCopiedFalseTimeoutRef = useRef<ReturnType<typeof setTimeout>>(-1)
const setCopiedFalseTimeoutRef = useRef<ReturnType<typeof setTimeout> | number>(-1)

const handleTriggerCopy = () => {
setCopied(true)
Expand Down Expand Up @@ -90,7 +90,7 @@ export const ClipboardButton = ({

useEffect(
() => () => {
if (setCopiedFalseTimeoutRef.current > -1) {
if ((setCopiedFalseTimeoutRef.current as number) > -1) {
clearTimeout(setCopiedFalseTimeoutRef.current)
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const UseRegisterShortcutProvider = ({
const disableShortcutsRef = useRef<boolean>(false)
const shortcutsRef = useRef<Record<string, ShortcutType>>({})
const keysDownRef = useRef<Set<Uppercase<string>>>(new Set())
const keyDownTimeoutRef = useRef<ReturnType<typeof setTimeout>>(-1)
const keyDownTimeoutRef = useRef<ReturnType<typeof setTimeout> | number>(-1)
const ignoredTags = ignoreTags ?? IGNORE_TAGS_FALLBACK

const registerShortcut: UseRegisterShortcutContextType['registerShortcut'] = useCallback(
Expand Down Expand Up @@ -113,7 +113,7 @@ const UseRegisterShortcutProvider = ({

keysDownRef.current.clear()

if (keyDownTimeoutRef.current > -1) {
if ((keyDownTimeoutRef.current as number) > -1) {
clearTimeout(keyDownTimeoutRef.current)
keyDownTimeoutRef.current = -1
}
Expand Down Expand Up @@ -178,7 +178,7 @@ const UseRegisterShortcutProvider = ({
window.removeEventListener('keyup', handleKeyupEvent)
window.removeEventListener('blur', handleBlur)

if (keyDownTimeoutRef.current > -1) {
if ((keyDownTimeoutRef.current as number) > -1) {
clearTimeout(keyDownTimeoutRef.current)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@ const BulkOperations = ({
try {
setApiCallInProgress(true)

let timeout = -1
let timeout: ReturnType<typeof setTimeout> | number = -1

const triggerUpdate = () => {
if (timeout >= 0) {
if ((timeout as number) >= 0) {
return
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ const createTooltip = (view: EditorView): Tooltip => {
// Plugin to show and remove tooltip on keypress
const keypressTooltipPlugin = ViewPlugin.fromClass(
class {
private timeoutId: number | null = null
private timeoutId: ReturnType<typeof setTimeout> | number | null = null

constructor(public view: EditorView) {
this.view.dom.addEventListener('keydown', this.handleKeyPress)
Expand Down
2 changes: 1 addition & 1 deletion src/Shared/Components/Table/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ export type ConfigurableColumnsConfigType<
> = Record<string, ConfigurableColumnsType<RowData, FilterVariant, AdditionalProps>['visibleColumns']>

export interface GetFilteringPromiseProps<RowData extends unknown> {
searchSortTimeoutRef: React.MutableRefObject<number>
searchSortTimeoutRef: React.MutableRefObject<ReturnType<typeof setTimeout> | number>
callback: () => Promise<RowsType<RowData>> | RowsType<RowData>
}

Expand Down
Loading