20 lines
907 B
TypeScript
20 lines
907 B
TypeScript
import { IImageData } from '../index';
|
|
export type GetArrTypeUnion<T extends any[]> = T extends (infer I)[] ? I : never;
|
|
export type IImageLoadData = {
|
|
imageInstance: HTMLImageElement;
|
|
data: Event;
|
|
imageType: IImageTypeInfo | null;
|
|
};
|
|
export interface IImageTypeInfo {
|
|
ext: string;
|
|
mime: string;
|
|
}
|
|
export interface IGetImageParams {
|
|
src?: string;
|
|
crossOrigin?: '' | 'anonymous' | 'use-credentials';
|
|
}
|
|
export declare const getImageInfo: (params: IGetImageParams) => Promise<IImageData>;
|
|
export declare const getImageType: (imageBufferData: ArrayBuffer) => Promise<IImageTypeInfo | null>;
|
|
export declare const loadImage: (params: IGetImageParams) => Promise<IImageLoadData>;
|
|
export declare const transformImageData2ArrayBuffer: (image: HTMLImageElement) => ArrayBufferLike;
|
|
export declare const getImageBufferFromRemote: (url?: string) => Promise<ArrayBuffer>;
|