UNPKG

synapse-react-client

Version:

[![npm version](https://badge.fury.io/js/synapse-react-client.svg)](https://badge.fury.io/js/synapse-react-client) [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettie

25 lines 2.21 kB
import { SynapseClientError } from '@sage-bionetworks/synapse-client/util/SynapseClientError'; import { BatchFileRequest, BatchFileResult, FileHandle, FileHandleAssociation } from '@sage-bionetworks/synapse-types'; import { UseQueryOptions, UseQueryResult } from '@tanstack/react-query'; export type StablePresignedUrl = { dataUrl?: string; queryResult: UseQueryResult<Blob, SynapseClientError>; }; export declare function useGetStablePresignedUrl(fileHandleAssociation: FileHandleAssociation, forceAnonymous?: boolean, options?: Partial<Omit<UseQueryOptions<Blob, SynapseClientError>, 'staleTime'>>): StablePresignedUrl | undefined; export declare function useGetPresignedUrlContent(fileHandle: FileHandle, request: BatchFileRequest, maxFileSizeBytes?: number, options?: Partial<Omit<UseQueryOptions<string, SynapseClientError>, 'staleTime'>>): UseQueryResult<string, SynapseClientError>; export declare function useGetPresignedUrlContentFromFHA(fileHandleAssociation: FileHandleAssociation, forceAnonymous?: boolean, options?: Partial<Omit<UseQueryOptions<string, SynapseClientError>, 'staleTime'>>): UseQueryResult<string, SynapseClientError>; /** * Get a blob containing the image data for the avatar of a Synapse user. Returns null if the user does not have a profile image. */ export declare function useGetProfileImage(userId: string, options?: Partial<Omit<UseQueryOptions<Blob | null, SynapseClientError>, 'staleTime'>>): UseQueryResult<Blob | null, SynapseClientError>; /** * Get a batch of file handle data from the backend. * * This hook does not support fetching pre-signed URLs. In most web UI cases, you will want to either request the presigned * URL upon an invoked action (e.g. a "download" button is clicked) or use {@link SynapseClient#getPortalFileHandleServletUrl} * @param request * @param options */ export declare function useGetFileBatch(request: BatchFileRequest, options?: Partial<UseQueryOptions<BatchFileResult, SynapseClientError>>): UseQueryResult<BatchFileResult, SynapseClientError>; export declare function useFileContent(fileURL: string, options?: Partial<UseQueryOptions<string>>): UseQueryResult<string, Error>; //# sourceMappingURL=useFiles.d.ts.map