dropbox-sdk-js
dropbox-sdk-js copied to clipboard
TypeScript compiler did not support the import sdk
import { Dropbox } from 'dropbox';
const dbx = new Dropbox({ accessToken });
dbx.filesSearch({
path: '',
query: filename,
start: nextPageToken,
max_results: pageSize,
mode: 'filename'
})
The mode type here is string which is not assignable to the type definition: SearchMode. However, it is unclear how to import the type
(method) DropboxTypes.Dropbox.filesSearch(arg: DropboxTypes.files.SearchArg): Promise<DropboxTypes.files.SearchResult>

Thanks for writing this up! I'm afraid I don't have a sample of how to do this with the SDK in TypeScript. I'll ask the team to look into this and follow up here when I have more information on this.
To set search mode, you'll need to make the object like this:
mode: {'.tag': 'filename'},
I'll ask the team to update the SDK to support using the actual types instead in the future.
@greg-db Great. thanks for the workaround