11// Copilot - Pending review
2- import type { ComputedRef , Ref } from 'vue' ;
2+ import { ComputedRef } from 'vue' ;
33
44export interface LotteryAuditsComposable {
55 hasAudits : ComputedRef < boolean > ;
@@ -13,9 +13,9 @@ export interface LotteryAuditsComposable {
1313 initAuditTimestamp : ComputedRef < number | null > ;
1414}
1515
16- export function useLotteryAudits (
16+ export const useLotteryAudits = (
1717 lottery : ComputedRef < Lottery > | Ref < Lottery > ,
18- ) : LotteryAuditsComposable {
18+ ) : LotteryAuditsComposable => {
1919 const lotteryValue = isRef ( lottery ) ? lottery : computed ( ( ) => lottery . value ) ;
2020
2121 // Check if there are any audits
@@ -25,17 +25,17 @@ export function useLotteryAudits(
2525
2626 // Check if there's a failure audit
2727 const hasFailure = computed ( ( ) => {
28- return ! ! lotteryValue . value ?. audits ?. some ( ( audit ) => audit . type === 'failure' ) ;
28+ return ! ! lotteryValue . value ?. audits ?. some ( ( audit : LotteryAudit ) => audit . type === 'failure' ) ;
2929 } ) ;
3030
3131 // Get the failure audit (most recent one if multiple)
3232 const failureAudit = computed ( ( ) => {
33- return lotteryValue . value ?. audits ?. find ( ( audit ) => audit . type === 'failure' ) ;
33+ return lotteryValue . value ?. audits ?. find ( ( audit : LotteryAudit ) => audit . type === 'failure' ) ;
3434 } ) ;
3535
3636 // Get init audit for timestamp
3737 const initAudit = computed ( ( ) => {
38- return lotteryValue . value ?. audits ?. find ( ( audit ) => audit . type === 'init' ) ;
38+ return lotteryValue . value ?. audits ?. find ( ( audit : LotteryAudit ) => audit . type === 'init' ) ;
3939 } ) ;
4040
4141 // Get timestamp from init audit (in milliseconds)
@@ -79,7 +79,7 @@ export function useLotteryAudits(
7979 if ( ! lotteryValue . value ?. audits ) return 0 ;
8080
8181 const groupExecutions = lotteryValue . value . audits . filter (
82- ( audit ) => audit . type === 'group_execution' ,
82+ ( audit : LotteryAudit ) => audit . type === 'group_execution' ,
8383 ) ;
8484
8585 return groupExecutions . length ;
0 commit comments