import { composeDisposeBody } from '.'
import { isObject } from '../../utils/types'
import { Trashbox } from '../trashbox/types'

type TrashboxDispose = Omit<Trashbox, 'Categories'> & { Category: string }

type DisposeParams = Parameters<typeof composeDisposeBody>

type DisposeAnnParams = DisposeParams extends [ann_id: number, ...args: infer P] ? P : never

type DisposeResponse = {
    Success: boolean,
}

const isDisposeResponse = (obj: unknown): obj is DisposeResponse => (
    isObject(obj, {
        'Success': 'boolean',
    })
)

export type { TrashboxDispose, DisposeParams, DisposeAnnParams, DisposeResponse }

export { isDisposeResponse }
