Skip to content

Commit

Permalink
Fix types for defaultOptions and fingerprint (#670)
Browse files Browse the repository at this point in the history
* fix: types incorrectly flag values as potentially null

* lint

* Update lib/index.d.ts
  • Loading branch information
aduh95 committed Feb 21, 2024
1 parent 95ca566 commit 30bfd28
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

export const isSupported: boolean
export const canStoreURLs: boolean
export const defaultOptions: UploadOptions
export const defaultOptions: UploadOptions &
Required<Pick<UploadOptions, 'httpStack' | 'fileReader' | 'urlStorage' | 'fingerprint'>>

// TODO: Consider using { read: () => Promise<{ done: boolean; value?: any; }>; } as type
export class Upload {
Expand All @@ -25,7 +26,7 @@ interface UploadOptions {

uploadUrl?: string | null
metadata?: { [key: string]: string }
fingerprint?: (file: File, options?: UploadOptions) => Promise<string>
fingerprint?: (file: File, options: UploadOptions) => Promise<string>
uploadSize?: number | null

onProgress?: ((bytesSent: number, bytesTotal: number) => void) | null
Expand Down

0 comments on commit 30bfd28

Please sign in to comment.