Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: types incorrectly flag values as potentially null #670

Merged
merged 3 commits into from
Feb 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading