Skip to content

Commit 0ab12b0

Browse files
refactor: convert useProvideFilterbox.js to TypeScript #127
1 parent de8eb38 commit 0ab12b0

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/composables/useProvideFilterbox.js renamed to src/composables/useProvideFilterbox.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,20 @@ import { computed, inject, provide } from 'vue'
22
import { getSort } from '../helper/utilities'
33
const filterBoxKey = Symbol('filterBox')
44

5-
export function provideFilterBox(props) {
5+
interface ProvideFilterBoxProps {
6+
languagePack: Record<string, any>
7+
locale: string
8+
sorters: Record<string, any>
9+
menuLimit: number
10+
[key: string]: any
11+
}
12+
13+
export function provideFilterBox(props: ProvideFilterBoxProps) {
614
const localeStrings = computed(
715
() => props.languagePack[props.locale].localeStrings
816
)
917
const sorters = computed(() => props.sorters)
10-
const sorter = (x) => getSort(sorters.value, x)
18+
const sorter = (x: string) => getSort(sorters.value, x)
1119
const menuLimit = computed(() => props.menuLimit)
1220
provide(filterBoxKey, {
1321
localeStrings,

0 commit comments

Comments
 (0)