Skip to content

Commit 6fcd435

Browse files
authored
refactor: type improvements of multi files that doesn't modify functionality (RooCodeInc#2878)
1 parent 9de6af5 commit 6fcd435

File tree

5 files changed

+9
-6
lines changed

5 files changed

+9
-6
lines changed

src/extension.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ export function activate(context: vscode.ExtensionContext) {
381381

382382
// Register the command handler
383383
context.subscriptions.push(
384-
vscode.commands.registerCommand("cline.fixWithCline", async (range: vscode.Range, diagnostics: any[]) => {
384+
vscode.commands.registerCommand("cline.fixWithCline", async (range: vscode.Range, diagnostics: vscode.Diagnostic[]) => {
385385
const editor = vscode.window.activeTextEditor
386386
if (!editor) {
387387
return

src/services/telemetry/TelemetryService.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import * as vscode from "vscode"
33
import { version as extensionVersion } from "../../../package.json"
44

55
import type { TaskFeedbackType } from "../../shared/WebviewMessage"
6+
import type { BrowserSettings } from "../../shared/BrowserSettings"
67

78
/**
89
* PostHogClient handles telemetry event tracking for the Cline extension
@@ -474,7 +475,7 @@ class PostHogClient {
474475
* @param taskId Unique identifier for the task
475476
* @param browserSettings The browser settings being used
476477
*/
477-
public captureBrowserToolStart(taskId: string, browserSettings: any) {
478+
public captureBrowserToolStart(taskId: string, browserSettings: BrowserSettings) {
478479
this.capture({
479480
event: PostHogClient.EVENTS.TASK.BROWSER_TOOL_START,
480481
properties: {

webview-ui/src/components/common/MarkdownBlock.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { useRemark } from "react-remark"
44
import rehypeHighlight, { Options } from "rehype-highlight"
55
import styled from "styled-components"
66
import { visit } from "unist-util-visit"
7+
import type { Node } from "unist"
78
import { useExtensionState } from "@/context/ExtensionStateContext"
89
import { CODE_BLOCK_BG_COLOR } from "@/components/common/CodeBlock"
910
import MermaidBlock from "@/components/common/MermaidBlock"
@@ -21,7 +22,7 @@ interface MarkdownBlockProps {
2122
* This caused the entire content to disappear because the structure became invalid.
2223
*/
2324
const remarkUrlToLink = () => {
24-
return (tree: any) => {
25+
return (tree: Node) => {
2526
// Visit all "text" nodes in the markdown AST (Abstract Syntax Tree)
2627
visit(tree, "text", (node: any, index, parent) => {
2728
const urlRegex = /https?:\/\/[^\s<>)"]+/g

webview-ui/src/context/ExtensionStateContext.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import { TelemetrySetting } from "@shared/TelemetrySetting"
2121
interface ExtensionStateContextType extends ExtensionState {
2222
didHydrateState: boolean
2323
showWelcome: boolean
24-
theme: any
24+
theme: Record<string, string> | undefined
2525
openRouterModels: Record<string, ModelInfo>
2626
openAiModels: string[]
2727
requestyModels: Record<string, ModelInfo>
@@ -56,7 +56,7 @@ export const ExtensionStateContextProvider: React.FC<{
5656
})
5757
const [didHydrateState, setDidHydrateState] = useState(false)
5858
const [showWelcome, setShowWelcome] = useState(false)
59-
const [theme, setTheme] = useState<any>(undefined)
59+
const [theme, setTheme] = useState<Record<string, string>>()
6060
const [filePaths, setFilePaths] = useState<string[]>([])
6161
const [openRouterModels, setOpenRouterModels] = useState<Record<string, ModelInfo>>({
6262
[openRouterDefaultModelId]: openRouterDefaultModelInfo,

webview-ui/src/utils/useDebounceEffect.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
import { useEffect, useRef } from "react"
2+
import type { DependencyList } from "react"
23

34
type VoidFn = () => void
45

56
/**
67
* Runs `effectRef.current()` after `delay` ms whenever any of the `deps` change,
78
* but cancels/re-schedules if they change again before the delay.
89
*/
9-
export function useDebounceEffect(effect: VoidFn, delay: number, deps: any[]) {
10+
export function useDebounceEffect(effect: VoidFn, delay: number, deps: DependencyList) {
1011
const callbackRef = useRef<VoidFn>(effect)
1112
const timeoutRef = useRef<NodeJS.Timeout | null>(null)
1213

0 commit comments

Comments
 (0)