Created
August 5, 2021 18:08
-
-
Save sergeyt/a7f3e0ed904d08e085008d4a9c147bce to your computer and use it in GitHub Desktop.
Drive abstraction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export type ItemType = "file" | "folder"; | |
export interface Item { | |
type: ItemType; | |
id: string; | |
name: string; | |
path: string; | |
driveId: string; | |
} | |
export interface File extends Item { | |
size: number; | |
createdAt: Date; | |
url?: string; | |
download?: () => Promise<any>; | |
} | |
export interface Drive { | |
options: any; | |
provider: string; | |
getItems(folderId?: string): Promise<Item[]>; | |
deleteFile(fileId: string): Promise<void>; | |
deleteFolder(folderId: string): Promise<void>; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment