synapse-react-client
Version:
[](https://badge.fury.io/js/synapse-react-client) [](https://github.com/prettier/prettie
18 lines • 769 B
TypeScript
import { FileHandleAssociateType } from '@sage-bionetworks/synapse-types';
type DirectDownloadHandlerProps = {
fileHandleId: string;
associatedObjectId: string;
associatedObjectType: FileHandleAssociateType;
};
/**
* Returns a 'downloadFile' function that fetches a presigned URL for a file
* handle and opens it in the browser to trigger a direct download.
*
* To bypass Safari's popup blocker, this function must be invoked
* within a user-triggered event handler (ex, inside an onClick callback).
*/
export declare function useDirectDownloadHandler(): {
downloadFile: ({ fileHandleId, associatedObjectId, associatedObjectType, }: DirectDownloadHandlerProps) => Promise<void>;
};
export {};
//# sourceMappingURL=useDirectDownloadHandler.d.ts.map