mirror of
https://github.com/Nezumi-2711/onedrive-vercel-index.git
synced 2026-09-22 13:38:45 +00:00
defining all available types (files and folders)
This commit is contained in:
Vendored
+39
-34
@@ -1,47 +1,52 @@
|
||||
export type OdFileObject = {
|
||||
// API response object for /api?path=<path_to_file_or_folder>, this may return either a file or a folder.
|
||||
// Pagination is also declared here with the 'next' parameter.
|
||||
export declare type OdAPIResponse = { file?: OdFileObject; folder?: OdFolderObject; next?: string }
|
||||
// A folder object returned from the OneDrive API. This contains the parameter 'value', which is an array of items
|
||||
// inside the folder. The items may also be either files or folders.
|
||||
export declare type OdFolderObject = {
|
||||
'@odata.count': number
|
||||
'@odata.context': string
|
||||
'@odata.nextLink'?: string
|
||||
value: Array<{
|
||||
'@microsoft.graph.downloadUrl': string
|
||||
id: string
|
||||
name: string
|
||||
size: number
|
||||
lastModifiedDateTime: string
|
||||
file?: { mimeType: string; hashes: { quickXorHash: string; sha1Hash?: string; sha256Hash?: string } }
|
||||
folder?: { childCount: number; view: { sortBy: string; sortOrder: 'ascending'; viewType: 'thumbnails' } }
|
||||
video?: OdVideoFile
|
||||
}>
|
||||
}
|
||||
// A file object returned from the OneDrive API. This object may contain 'video' if the file is a video.
|
||||
export declare type OdFileObject = {
|
||||
'@microsoft.graph.downloadUrl': string
|
||||
'@odata.context': string
|
||||
name: string
|
||||
size: number
|
||||
id: string
|
||||
lastModifiedDateTime: string
|
||||
file: {
|
||||
mimeType: string
|
||||
hashes: {
|
||||
quickXorHash: string
|
||||
sha1Hash: string
|
||||
sha256Hash: string
|
||||
}
|
||||
},
|
||||
video: any // Check if field exists only currently
|
||||
file: { mimeType: string; hashes: { quickXorHash: string; sha1Hash?: string; sha256Hash?: string } }
|
||||
video?: OdVideoFile
|
||||
}
|
||||
|
||||
export type OdFolderObject = {
|
||||
'@odata.count': number
|
||||
value: Array<{
|
||||
id: string
|
||||
name: string
|
||||
lastModifiedDateTime: string
|
||||
size: number
|
||||
folder: {
|
||||
childCount: number
|
||||
view: {
|
||||
sortBy: 'name'
|
||||
sortOrder: 'ascending'
|
||||
viewType: 'thumbnails'
|
||||
}
|
||||
}
|
||||
}>
|
||||
// A representation of a OneDrive video file. All fields are declared here, but we mainly use 'width' and 'height'.
|
||||
export declare type OdVideoFile = {
|
||||
width: number
|
||||
height: number
|
||||
duration: number
|
||||
bitrate: number
|
||||
frameRate: number
|
||||
audioBitsPerSample: number
|
||||
audioChannels: number
|
||||
audioFormat: string
|
||||
audioSamplesPerSecond: number
|
||||
}
|
||||
|
||||
export type OdSearchResult = Array<{
|
||||
// API response object for /api/search?q=<query>. Likewise, this array of items may also contain either files or folders.
|
||||
export declare type OdSearchResult = Array<{
|
||||
id: string
|
||||
name: string
|
||||
file?: OdFileObject
|
||||
folder?: OdFolderObject
|
||||
path: string
|
||||
parentReference: {
|
||||
id: string
|
||||
name: string
|
||||
path: string
|
||||
}
|
||||
parentReference: { id: string; name: string; path?: string }
|
||||
}>
|
||||
|
||||
Reference in New Issue
Block a user