@@ -21,7 +21,7 @@ interface Job {
2121 queue : string
2222 created : string
2323 updated : string
24- data ?: Record < string , any >
24+ data ?: any
2525}
2626
2727interface QueueStats {
@@ -33,7 +33,7 @@ interface QueueStats {
3333 processingRate : number // jobs per minute
3434}
3535
36- export const useQueueStore = defineStore ( 'queue' , ( ) => {
36+ export const useQueueStore : ReturnType < typeof defineStore < 'queue' , any > > = defineStore ( 'queue' , ( ) => {
3737 // Data
3838 const queues = ref < Queue [ ] > ( [ ] )
3939 const jobs = ref < Job [ ] > ( [ ] )
@@ -89,7 +89,7 @@ export const useQueueStore = defineStore('queue', () => {
8989 }
9090
9191 // Fetch only if needed or forced
92- async function fetchQueues ( forceRefresh = false ) {
92+ async function fetchQueues ( forceRefresh : boolean = false ) : Promise < Queue [ ] > {
9393 if ( ! forceRefresh && hasQueues . value && ! needsRefresh ( queuesFetchedAt . value ) ) {
9494 return queues . value
9595 }
@@ -189,7 +189,7 @@ export const useQueueStore = defineStore('queue', () => {
189189 }
190190 }
191191
192- async function fetchJobs ( forceRefresh = false ) {
192+ async function fetchJobs ( forceRefresh : boolean = false ) : Promise < Job [ ] > {
193193 if ( ! forceRefresh && hasJobs . value && ! needsRefresh ( jobsFetchedAt . value ) ) {
194194 return jobs . value
195195 }
@@ -378,7 +378,7 @@ export const useQueueStore = defineStore('queue', () => {
378378 }
379379 }
380380
381- async function fetchQueueStats ( forceRefresh = false ) {
381+ async function fetchQueueStats ( forceRefresh : boolean = false ) : Promise < QueueStats > {
382382 if ( ! forceRefresh && hasStats . value && ! needsRefresh ( statsFetchedAt . value ) ) {
383383 return stats . value
384384 }
@@ -414,7 +414,7 @@ export const useQueueStore = defineStore('queue', () => {
414414 }
415415 }
416416
417- async function fetchMetrics ( timeRange = '24h' , forceRefresh = false ) {
417+ async function fetchMetrics ( timeRange : string = '24h' , forceRefresh : boolean = false ) : Promise < unknown > {
418418 if ( ! forceRefresh && metricsFetchedAt . value && ! needsRefresh ( metricsFetchedAt . value ) ) {
419419 return metrics . value
420420 }
@@ -513,7 +513,7 @@ export const useQueueStore = defineStore('queue', () => {
513513 }
514514
515515 // Fetch job groups
516- async function fetchJobGroups ( forceRefresh = false ) {
516+ async function fetchJobGroups ( forceRefresh : boolean = false ) : Promise < JobGroup [ ] > {
517517 if ( ! forceRefresh && hasJobGroups . value && ! needsRefresh ( jobGroupsFetchedAt . value ) ) {
518518 return jobGroups . value
519519 }
@@ -599,7 +599,7 @@ export const useQueueStore = defineStore('queue', () => {
599599 }
600600
601601 // Clear stored data (for logout, etc)
602- function clearData ( ) {
602+ function clearData ( ) : void {
603603 queues . value = [ ]
604604 jobs . value = [ ]
605605 jobGroups . value = [ ]
0 commit comments