mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-08-20 12:00:53 +08:00
Updated code to align to best practices
Removed optional members in callbacks Removed explicit type inference for DT tests
This commit is contained in:
@@ -37,7 +37,7 @@ browserClient.authenticate((error:any, client:Dropbox.Client) => {
|
||||
alert(data); // data has the file's contents
|
||||
});
|
||||
|
||||
client.readdir("/", (err: Dropbox.ApiError, filenames: string[], stat: Dropbox.File.Stat, folderEntries?: Dropbox.File.Stat[]) => {
|
||||
client.readdir("/", (err: Dropbox.ApiError, filenames: string[], stat: Dropbox.File.Stat, folderEntries: Dropbox.File.Stat[]) => {
|
||||
if (error) {
|
||||
alert(error); // Something went wrong.
|
||||
}
|
||||
@@ -46,7 +46,7 @@ browserClient.authenticate((error:any, client:Dropbox.Client) => {
|
||||
});
|
||||
});
|
||||
|
||||
var serverClient:Dropbox.Client = new Dropbox.Client({
|
||||
var serverClient = new Dropbox.Client({
|
||||
key: "your-key-here",
|
||||
secret: "your-secret-here"
|
||||
});
|
||||
|
||||
Vendored
+6
-6
@@ -455,12 +455,12 @@ declare module Dropbox {
|
||||
resumableUploadStep(data: any, cursor: Http.UploadCursor, callback: ResumableUploadStepCallback): XMLHttpRequest;
|
||||
resumableUploadFinish(path: string, cursor: Http.UploadCursor, callback: ClientFileWriteCallback): XMLHttpRequest;
|
||||
resumableUploadFinish(path: string, cursor: Http.UploadCursor, options: ClientFileWriteOptions, callback: ClientFileWriteCallback): XMLHttpRequest;
|
||||
stat(path: string, callback: (err: ApiError, stat: File.Stat, folderEntries?: File.Stat[]) => void): XMLHttpRequest;
|
||||
stat(path: string, options: File.StatOptions, callback: (err: ApiError, stat: File.Stat, folderEntries?: File.Stat[]) => void): XMLHttpRequest;
|
||||
readdir(path: string, callback: (err: ApiError, filenames: string[], stat: File.Stat, folderEntries?: File.Stat[]) => void): XMLHttpRequest;
|
||||
readdir(path: string, options: ReadDirOptions, callback: (err: ApiError, filenames: string[], stat: File.Stat, folderEntries?: File.Stat[]) => void): XMLHttpRequest;
|
||||
metadata(path: string, callback: (err: ApiError, stat: File.Stat, folderEntries?: File.Stat[]) => void): void;
|
||||
metadata(path: string, options: File.StatOptions, callback: (err: ApiError, stat: File.Stat, folderEntries?: File.Stat[]) => void): void;
|
||||
stat(path: string, callback: (err: ApiError, stat: File.Stat, folderEntries: File.Stat[]) => void): XMLHttpRequest;
|
||||
stat(path: string, options: File.StatOptions, callback: (err: ApiError, stat: File.Stat, folderEntries: File.Stat[]) => void): XMLHttpRequest;
|
||||
readdir(path: string, callback: (err: ApiError, filenames: string[], stat: File.Stat, folderEntries: File.Stat[]) => void): XMLHttpRequest;
|
||||
readdir(path: string, options: ReadDirOptions, callback: (err: ApiError, filenames: string[], stat: File.Stat, folderEntries: File.Stat[]) => void): XMLHttpRequest;
|
||||
metadata(path: string, callback: (err: ApiError, stat: File.Stat, folderEntries: File.Stat[]) => void): void;
|
||||
metadata(path: string, options: File.StatOptions, callback: (err: ApiError, stat: File.Stat, folderEntries: File.Stat[]) => void): void;
|
||||
makeUrl(path: string, callback: (err: ApiError, shareUrl: File.ShareUrl) => void): XMLHttpRequest;
|
||||
makeUrl(path: string, options: MakeURLOptions, callback: (err: ApiError, shareUrl: File.ShareUrl) => void): XMLHttpRequest;
|
||||
history(path: string, callback: (err: ApiError, fileVersions: File.Stat[]) => void): XMLHttpRequest;
|
||||
|
||||
Reference in New Issue
Block a user