File tree Expand file tree Collapse file tree 1 file changed +19
-5
lines changed Expand file tree Collapse file tree 1 file changed +19
-5
lines changed Original file line number Diff line number Diff line change
1
+ import type { ConfigurableNavigator , UseBatteryReturn } from '@vueuse/core'
2
+ import type { Reactive , SlotsType } from 'vue'
1
3
import { useBattery } from '@vueuse/core'
2
4
import { defineComponent , reactive } from 'vue'
3
5
4
- export const UseBattery = /* #__PURE__ */ defineComponent ( {
5
- name : 'UseBattery' ,
6
- setup ( props , { slots } ) {
7
- const data = reactive ( useBattery ( props ) )
6
+ interface UseBatteryProps extends ConfigurableNavigator { }
7
+ interface UseBatterySlots {
8
+ default : ( data : Reactive < UseBatteryReturn > ) => any
9
+ }
8
10
11
+ export const UseBattery = /* #__PURE__ */ defineComponent <
12
+ UseBatteryProps ,
13
+ Record < string , never > ,
14
+ string ,
15
+ SlotsType < UseBatterySlots >
16
+ > (
17
+ ( props , { slots } ) => {
18
+ const data = reactive ( useBattery ( props ) )
9
19
return ( ) => {
10
20
if ( slots . default )
11
21
return slots . default ( data )
12
22
}
13
23
} ,
14
- } )
24
+ {
25
+ name : 'UseBattery' ,
26
+ props : [ 'navigator' ] ,
27
+ } ,
28
+ )
You can’t perform that action at this time.
0 commit comments