Skip to content

Commit 0751b9b

Browse files
committed
Annotate return types to fix tsc warnings
1 parent ece0d59 commit 0751b9b

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/attachment.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,15 @@ export default class Attachment {
4343
return ['image/gif', 'image/png', 'image/jpg', 'image/jpeg'].indexOf(this.file.type) > -1
4444
}
4545

46-
saving(percent: number) {
46+
saving(percent: number): void {
4747
if (this.state !== 'pending' && this.state !== 'saving') {
4848
throw new Error(`Unexpected transition from ${this.state} to saving`)
4949
}
5050
this.state = 'saving'
5151
this.percent = percent
5252
}
5353

54-
saved(attributes?: {id?: string | null; href?: string | null; name?: string | null}) {
54+
saved(attributes?: {id?: string | null; href?: string | null; name?: string | null}): void {
5555
if (this.state !== 'pending' && this.state !== 'saving') {
5656
throw new Error(`Unexpected transition from ${this.state} to saved`)
5757
}

src/file-attachment-element.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export default class FileAttachmentElement extends HTMLElement {
2323
}
2424
}
2525

26-
async attach(transferred: File[] | Attachment[] | FileList | DataTransfer) {
26+
async attach(transferred: File[] | Attachment[] | FileList | DataTransfer): Promise<void> {
2727
const attachments =
2828
transferred instanceof DataTransfer
2929
? await Attachment.traverse(transferred, this.directory)

0 commit comments

Comments
 (0)