react-use-downloader
Advanced tools
Comparing version 1.2.1 to 1.2.2
/// <reference types="node" /> | ||
/// <reference types="react-scripts" /> | ||
import { IResolverProps, IUseDownloader, UseDownloaderOptions } from './types'; | ||
export declare const resolver: ({ setSize, setControllerCallback, setPercentageCallback, setErrorCallback, }: IResolverProps) => (response: Response) => Response; | ||
import { ResolverProps, UseDownloader, UseDownloaderOptions } from './types'; | ||
export declare const resolver: ({ setSize, setControllerCallback, setPercentageCallback, setErrorCallback, }: ResolverProps) => (response: Response) => Response; | ||
export declare const jsDownload: (data: Blob, filename: string, mime?: string | undefined) => boolean | NodeJS.Timeout; | ||
export default function useDownloader(options?: UseDownloaderOptions): IUseDownloader; | ||
export default function useDownloader(options?: UseDownloaderOptions): UseDownloader; |
/// <reference types="node" /> | ||
import { SetStateAction } from 'react'; | ||
export declare type TError = { | ||
export declare type ErrorMessage = { | ||
errorMessage: string; | ||
@@ -17,3 +17,3 @@ } | null; | ||
timeout?: number) => Promise<void | null>; | ||
export interface IUseDownloader { | ||
export interface UseDownloader { | ||
/** Size in bytes */ | ||
@@ -34,7 +34,7 @@ size: number; | ||
/** Error object from the request */ | ||
error: TError; | ||
error: ErrorMessage; | ||
/** Boolean denoting download status */ | ||
isInProgress: boolean; | ||
} | ||
export interface IResolverProps { | ||
export interface ResolverProps { | ||
setSize: (value: SetStateAction<number>) => void; | ||
@@ -51,3 +51,3 @@ setControllerCallback: (controller: ReadableStreamController<Uint8Array>) => void; | ||
} | ||
export interface IWindowDownloaderEmbedded extends Window { | ||
export interface WindowDownloaderEmbedded extends Window { | ||
navigator: CustomNavigator; | ||
@@ -54,0 +54,0 @@ } |
{ | ||
"name": "react-use-downloader", | ||
"version": "1.2.1", | ||
"version": "1.2.2", | ||
"description": "Creates a download handler function and gives progress information", | ||
@@ -5,0 +5,0 @@ "author": "Olavo Parno", |
@@ -1,6 +0,1 @@ | ||
<img align="right" alt="traffic" src="https://pv-badge.herokuapp.com/total.svg?repo_id=olavoparno-react-use-downloader"/> | ||
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section --> | ||
[![All Contributors](https://img.shields.io/badge/all_contributors-3-orange.svg?style=flat-square)](#contributors-) | ||
<!-- ALL-CONTRIBUTORS-BADGE:END --> | ||
# react-use-downloader | ||
@@ -7,0 +2,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
62912
9
145