Skip to content

Commit cac9954

Browse files
committed
fix: type of watchSource option
1 parent 1d123f3 commit cac9954

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

packages/core/src/composables/useTreeView.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
import type { MaybeRefOrGetter, WatchSource } from '@reactive-vscode/reactivity'
1+
import type { MaybeRefOrGetter } from '@reactive-vscode/reactivity'
22
import { toValue, watch } from '@reactive-vscode/reactivity'
33
import type { TreeDataProvider, TreeItem, TreeView, TreeViewOptions, ViewBadge } from 'vscode'
44
import { window } from 'vscode'
5+
import type { AnyWatchSource } from '../utils'
56
import { createKeyedComposable } from '../utils'
67
import { useDisposable } from './useDisposable'
78
import { useEventEmitter } from './useEventEmitter'
@@ -22,7 +23,7 @@ export type UseTreeViewOptions<T> =
2223
/**
2324
* Additional watch source to trigger a change event. Useful when `treeItem` is a promise.
2425
*/
25-
watchSource?: WatchSource<any>
26+
watchSource?: AnyWatchSource
2627
}
2728

2829
/**

packages/core/src/utils/types.ts

+3
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,6 @@ export type Nullable<T> = T | null | undefined
55
export type MaybeNullableRefOrGetter<T> = T | Ref<Nullable<T>> | (() => Nullable<T>)
66

77
export type Awaitable<T> = T | Promise<T>
8+
9+
// Should be `WatchSource | ... | any`
10+
export type AnyWatchSource = any

0 commit comments

Comments
 (0)