Skip to content

Commit

Permalink
fix: improve types
Browse files Browse the repository at this point in the history
  • Loading branch information
sidwebworks committed Jun 13, 2022
1 parent 4385329 commit eb77b70
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,26 @@
*/

import { Sheet2JSONOpts } from "xlsx"
import type { ZodIssue } from "zod"

export type Result = {}
type Resource = {
issues: ZodIssue[]
isValid: boolean
data: Record<string, any>
}

export type Result = {
valid: Resource[]
invalid: Resource[]
}

export interface ValidatorOptions {
header?: Sheet2JSONOpts["header"]
sheetName?: string
blankrows?: Sheet2JSONOpts["blankrows"]
skipHidden?: Sheet2JSONOpts["skipHidden"]
onValid?: (data: any) => void
onInvalid?: (data: any) => void
}

/**
Expand Down

0 comments on commit eb77b70

Please sign in to comment.