@uppy/utils
Advanced tools
Comparing version 5.5.1 to 5.5.2
{ | ||
"name": "@uppy/utils", | ||
"description": "Shared utility functions for Uppy Core and plugins maintained by the Uppy team.", | ||
"version": "5.5.1", | ||
"version": "5.5.2", | ||
"license": "MIT", | ||
@@ -6,0 +6,0 @@ "types": "types/index.d.ts", |
@@ -12,7 +12,7 @@ declare module '@uppy/utils/lib/Translator' { | ||
class Translator { | ||
constructor (opts: Translator.Locale | Translator.Locale[]) | ||
constructor(opts: Translator.Locale | Translator.Locale[]) | ||
translate (key: string, options: Record<string, unknown>): string | ||
translate(key: string, options: Record<string, unknown>): string | ||
translateArray (key: string, options: Record<string, unknown>): any[] | ||
translateArray(key: string, options: Record<string, unknown>): any[] | ||
} | ||
@@ -33,7 +33,7 @@ | ||
class EventManager { | ||
constructor (emitter: EventManager.Emitter) | ||
constructor(emitter: EventManager.Emitter) | ||
on (event: string, handler: EventManager.EventHandler): void | ||
on(event: string, handler: EventManager.EventHandler): void | ||
remove (): void | ||
remove(): void | ||
} | ||
@@ -46,7 +46,7 @@ | ||
class ProgressTimeout { | ||
constructor (timeout: number, timeoutHandler: () => void) | ||
constructor(timeout: number, timeoutHandler: () => void) | ||
progress (): void | ||
progress(): void | ||
done (): void | ||
done(): void | ||
} | ||
@@ -64,4 +64,4 @@ export default ProgressTimeout | ||
export type QueueEntry = { | ||
abort: () => void, | ||
done: () => void, | ||
abort: () => void | ||
done: () => void | ||
} | ||
@@ -80,3 +80,3 @@ export type QueueOptions = { | ||
fn: () => RateLimitedQueue.AbortFunction, | ||
queueOptions?: RateLimitedQueue.QueueOptions | ||
queueOptions?: RateLimitedQueue.QueueOptions, | ||
): RateLimitedQueue.QueueEntry | ||
@@ -92,3 +92,3 @@ | ||
fn: () => (...args: any[]) => Promise<any>, | ||
queueOptions?: RateLimitedQueue.QueueOptions | ||
queueOptions?: RateLimitedQueue.QueueOptions, | ||
): (...args: any[]) => RateLimitedQueue.AbortablePromise<any> | ||
@@ -101,6 +101,6 @@ } | ||
declare module '@uppy/utils/lib/canvasToBlob' { | ||
function canvasToBlob ( | ||
function canvasToBlob( | ||
canvas: HTMLCanvasElement, | ||
type: string, | ||
quality?: number | ||
quality?: number, | ||
): Promise<Blob> | ||
@@ -111,5 +111,5 @@ export default canvasToBlob | ||
declare module '@uppy/utils/lib/dataURItoBlob' { | ||
function dataURItoBlob ( | ||
function dataURItoBlob( | ||
dataURI: string, | ||
opts: { mimeType?: string; name?: string } | ||
opts: { mimeType?: string; name?: string }, | ||
): Blob | ||
@@ -120,5 +120,5 @@ export default dataURItoBlob | ||
declare module '@uppy/utils/lib/dataURItoFile' { | ||
function dataURItoFile ( | ||
function dataURItoFile( | ||
dataURI: string, | ||
opts: { mimeType?: string; name?: string } | ||
opts: { mimeType?: string; name?: string }, | ||
): File | ||
@@ -137,6 +137,6 @@ export default dataURItoFile | ||
function emitSocketProgress ( | ||
function emitSocketProgress( | ||
uploader: unknown, | ||
progressData: ProgressData, | ||
file: UppyFile | ||
file: UppyFile, | ||
): void | ||
@@ -147,3 +147,3 @@ export default emitSocketProgress | ||
declare module '@uppy/utils/lib/findAllDOMElements' { | ||
function findAllDOMElements (element: string | HTMLElement): HTMLElement[] | ||
function findAllDOMElements(element: string | HTMLElement): HTMLElement[] | ||
export default findAllDOMElements | ||
@@ -153,3 +153,3 @@ } | ||
declare module '@uppy/utils/lib/findDOMElement' { | ||
function findDOMElement (element: string | HTMLElement): HTMLElement | null | ||
function findDOMElement(element: string | HTMLElement): HTMLElement | null | ||
export default findDOMElement | ||
@@ -161,3 +161,3 @@ } | ||
function generateFileID (file: UppyFile): string | ||
function generateFileID(file: UppyFile): string | ||
export default generateFileID | ||
@@ -167,3 +167,3 @@ } | ||
declare module '@uppy/utils/lib/getBytesRemaining' { | ||
function getBytesRemaining (progress: { | ||
function getBytesRemaining(progress: { | ||
bytesTotal: number | ||
@@ -176,3 +176,3 @@ bytesUploaded: number | ||
declare module '@uppy/utils/lib/getETA' { | ||
function getETA (progress: unknown): number | ||
function getETA(progress: unknown): number | ||
export default getETA | ||
@@ -182,5 +182,6 @@ } | ||
declare module '@uppy/utils/lib/getFileNameAndExtension' { | ||
function getFileNameAndExtension( | ||
filename: string | ||
): { name: string, extension: string | undefined } | ||
function getFileNameAndExtension(filename: string): { | ||
name: string | ||
extension: string | undefined | ||
} | ||
export default getFileNameAndExtension | ||
@@ -192,3 +193,3 @@ } | ||
function getFileType (file: UppyFile): string | ||
function getFileType(file: UppyFile): string | ||
export default getFileType | ||
@@ -198,3 +199,3 @@ } | ||
declare module '@uppy/utils/lib/getFileTypeExtension' { | ||
function getFileTypeExtension (mime: string): string | ||
function getFileTypeExtension(mime: string): string | ||
export default getFileTypeExtension | ||
@@ -204,3 +205,3 @@ } | ||
declare module '@uppy/utils/lib/getSocketHost' { | ||
function getSocketHost (url: string): string | ||
function getSocketHost(url: string): string | ||
export default getSocketHost | ||
@@ -210,3 +211,3 @@ } | ||
declare module '@uppy/utils/lib/getSpeed' { | ||
function getSpeed (progress: { | ||
function getSpeed(progress: { | ||
bytesUploaded: number | ||
@@ -219,3 +220,3 @@ uploadStarted: number | ||
declare module '@uppy/utils/lib/getTimeStamp' { | ||
function getTimeStamp (): string | ||
function getTimeStamp(): string | ||
export default getTimeStamp | ||
@@ -225,3 +226,3 @@ } | ||
declare module '@uppy/utils/lib/isDOMElement' { | ||
function isDOMElement (element: any): boolean | ||
function isDOMElement(element: any): boolean | ||
export default isDOMElement | ||
@@ -231,3 +232,3 @@ } | ||
declare module '@uppy/utils/lib/isObjectURL' { | ||
function isObjectURL (url: string): boolean | ||
function isObjectURL(url: string): boolean | ||
export default isObjectURL | ||
@@ -237,3 +238,3 @@ } | ||
declare module '@uppy/utils/lib/isDragDropSupported' { | ||
function isDragDropSupported (): boolean | ||
function isDragDropSupported(): boolean | ||
export default isDragDropSupported | ||
@@ -243,3 +244,3 @@ } | ||
declare module '@uppy/utils/lib/isPreviewSupported' { | ||
function isPreviewSupported (mime: string): boolean | ||
function isPreviewSupported(mime: string): boolean | ||
export default isPreviewSupported | ||
@@ -249,3 +250,3 @@ } | ||
declare module '@uppy/utils/lib/isTouchDevice' { | ||
function isTouchDevice (): boolean | ||
function isTouchDevice(): boolean | ||
export default isTouchDevice | ||
@@ -255,3 +256,3 @@ } | ||
declare module '@uppy/utils/lib/prettyETA' { | ||
function prettyETA (seconds: number): string | ||
function prettyETA(seconds: number): string | ||
export default prettyETA | ||
@@ -261,3 +262,3 @@ } | ||
declare module '@uppy/utils/lib/secondsToTime' { | ||
function secondsToTime (seconds: number): string | ||
function secondsToTime(seconds: number): string | ||
export default secondsToTime | ||
@@ -267,4 +268,4 @@ } | ||
declare module '@uppy/utils/lib/settle' { | ||
function settle<T> ( | ||
promises: Promise<T>[] | ||
function settle<T>( | ||
promises: Promise<T>[], | ||
): Promise<{ successful: T[]; failed: any[] }> | ||
@@ -275,3 +276,3 @@ export default settle | ||
declare module '@uppy/utils/lib/toArray' { | ||
function toArray (list: any): any[] | ||
function toArray(list: any): any[] | ||
export default toArray | ||
@@ -285,9 +286,12 @@ } | ||
export const AbortSignal: typeof globalThis.AbortSignal | ||
export function createAbortError(message?: string, options?: ErrorOptions): DOMException | ||
export function createAbortError( | ||
message?: string, | ||
options?: ErrorOptions, | ||
): DOMException | ||
} | ||
declare module '@uppy/utils/lib/getDroppedFiles' { | ||
function getDroppedFiles ( | ||
function getDroppedFiles( | ||
dataTransfer: DataTransfer, | ||
options?: Record<string, unknown> | ||
options?: Record<string, unknown>, | ||
): Promise<File[]> | ||
@@ -298,3 +302,3 @@ export default getDroppedFiles | ||
declare module '@uppy/utils/lib/getTextDirection' { | ||
function getTextDirection (element: Node): string|undefined | ||
function getTextDirection(element: Node): string | undefined | ||
export default getTextDirection | ||
@@ -304,4 +308,3 @@ } | ||
declare module '@uppy/utils/lib/isNetworkError' { | ||
export default function isNetworkError (xhr: any): boolean | ||
export default function isNetworkError(xhr: any): boolean | ||
} | ||
@@ -317,3 +320,3 @@ | ||
constructor (error: any, xhr?: XMLHttpRequest) | ||
constructor(error: any, xhr?: XMLHttpRequest) | ||
} | ||
@@ -330,11 +333,18 @@ | ||
declare module '@uppy/utils/lib/truncateString' { | ||
export default function truncateString (string: string, maxLength: number): string | ||
export default function truncateString( | ||
string: string, | ||
maxLength: number, | ||
): string | ||
} | ||
declare module '@uppy/utils/lib/remoteFileObjToLocal' { | ||
export default function remoteFileObjToLocal (file: object): Record<string, unknown> | ||
export default function remoteFileObjToLocal( | ||
file: object, | ||
): Record<string, unknown> | ||
} | ||
declare module '@uppy/utils/lib/fetchWithNetworkError' { | ||
export default function fetchWithNetworkError (...options: unknown[]): Promise<Response> | ||
export default function fetchWithNetworkError( | ||
...options: unknown[] | ||
): Promise<Response> | ||
} | ||
@@ -344,3 +354,3 @@ | ||
interface ErrorOptions { | ||
cause?: unknown; | ||
cause?: unknown | ||
} | ||
@@ -353,3 +363,3 @@ | ||
constructor (message: string, options?: ErrorOptions) | ||
constructor(message: string, options?: ErrorOptions) | ||
} | ||
@@ -359,7 +369,10 @@ } | ||
declare module '@uppy/utils/lib/delay' { | ||
export default function delay (ms:number, opts?: {signal: AbortSignal}): Promise<void> | ||
export default function delay( | ||
ms: number, | ||
opts?: { signal: AbortSignal }, | ||
): Promise<void> | ||
} | ||
declare module '@uppy/utils/lib/hasProperty' { | ||
export default function has (object: any, key: string): boolean | ||
export default function has(object: any, key: string): boolean | ||
} | ||
@@ -378,3 +391,3 @@ | ||
export type InternalMetadata = { name: string; type?: string } | ||
export interface FileProgress { | ||
export interface FileProgress { | ||
uploadStarted: number | null | ||
@@ -388,3 +401,3 @@ uploadComplete: boolean | ||
TMeta = IndexedObject<any>, | ||
TBody = IndexedObject<any> | ||
TBody = IndexedObject<any>, | ||
> { | ||
@@ -415,6 +428,6 @@ data: Blob | File | ||
export interface Store { | ||
getState (): Record<string, unknown> | ||
setState (patch: Record<string, unknown>): void | ||
subscribe (listener: any): () => void | ||
getState(): Record<string, unknown> | ||
setState(patch: Record<string, unknown>): void | ||
subscribe(listener: any): () => void | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
291643
3904