mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-11 12:30:18 +00:00
fix(@types/croppie): do not export Croppie as default export (#22574)
This commit is contained in:
committed by
Mohamed Hegazy
parent
d9f51eae65
commit
634718d6f2
@@ -1,4 +1,4 @@
|
||||
import Croppie from 'croppie';
|
||||
import * as Croppie from 'croppie';
|
||||
|
||||
const c = new Croppie(document.getElementById('item'), {
|
||||
boundary: { width: 300, height: 300 },
|
||||
|
||||
Vendored
+33
-27
@@ -5,8 +5,12 @@
|
||||
// Sarun Intaralawan <https://github.com/sarunint>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export default class Croppie {
|
||||
constructor(container: HTMLElement, options?: CroppieOptions);
|
||||
export as namespace Croppie;
|
||||
|
||||
export = Croppie;
|
||||
|
||||
declare class Croppie {
|
||||
constructor(container: HTMLElement, options?: Croppie.CroppieOptions);
|
||||
|
||||
bind(options: {
|
||||
url: string,
|
||||
@@ -16,11 +20,11 @@ export default class Croppie {
|
||||
useCanvas?: boolean,
|
||||
}): Promise<void>;
|
||||
|
||||
result(options: ResultOptions & { type: 'base64' | 'canvas' }): Promise<string>;
|
||||
result(options: ResultOptions & { type: 'html' }): Promise<HTMLElement>;
|
||||
result(options: ResultOptions & { type: 'blob' }): Promise<Blob>;
|
||||
result(options: ResultOptions & { type: 'rawcanvas' }): Promise<HTMLCanvasElement>;
|
||||
result(options?: ResultOptions): Promise<HTMLCanvasElement>;
|
||||
result(options: Croppie.ResultOptions & { type: 'base64' | 'canvas' }): Promise<string>;
|
||||
result(options: Croppie.ResultOptions & { type: 'html' }): Promise<HTMLElement>;
|
||||
result(options: Croppie.ResultOptions & { type: 'blob' }): Promise<Blob>;
|
||||
result(options: Croppie.ResultOptions & { type: 'rawcanvas' }): Promise<HTMLCanvasElement>;
|
||||
result(options?: Croppie.ResultOptions): Promise<HTMLCanvasElement>;
|
||||
|
||||
rotate(degrees: 90 | 180 | 270 | -90 | -180 | -270): void;
|
||||
|
||||
@@ -29,28 +33,30 @@ export default class Croppie {
|
||||
destroy(): void;
|
||||
}
|
||||
|
||||
export type CropType = 'square' | 'circle';
|
||||
declare namespace Croppie {
|
||||
type CropType = 'square' | 'circle';
|
||||
|
||||
export type Format = 'jpeg' | 'png' | 'webp';
|
||||
type Format = 'jpeg' | 'png' | 'webp';
|
||||
|
||||
export type Type = 'canvas' | 'base64' | 'html' | 'blob' | 'rawcanvas';
|
||||
type Type = 'canvas' | 'base64' | 'html' | 'blob' | 'rawcanvas';
|
||||
|
||||
export interface ResultOptions {
|
||||
type?: Type;
|
||||
size?: 'viewport' | 'original' | { width: number, height: number };
|
||||
format?: Format;
|
||||
quality?: number;
|
||||
circle?: boolean;
|
||||
}
|
||||
interface ResultOptions {
|
||||
type?: Type;
|
||||
size?: 'viewport' | 'original' | { width: number, height: number };
|
||||
format?: Format;
|
||||
quality?: number;
|
||||
circle?: boolean;
|
||||
}
|
||||
|
||||
export interface CroppieOptions {
|
||||
boundary?: { width: number, height: number };
|
||||
customClass?: string;
|
||||
enableExif?: boolean;
|
||||
enableOrientation?: boolean;
|
||||
enableZoom?: boolean;
|
||||
enforceBoundary?: boolean;
|
||||
mouseWheelZoom?: boolean;
|
||||
showZoomer?: boolean;
|
||||
viewport?: { width: number, height: number, type?: CropType };
|
||||
interface CroppieOptions {
|
||||
boundary?: { width: number, height: number };
|
||||
customClass?: string;
|
||||
enableExif?: boolean;
|
||||
enableOrientation?: boolean;
|
||||
enableZoom?: boolean;
|
||||
enforceBoundary?: boolean;
|
||||
mouseWheelZoom?: boolean;
|
||||
showZoomer?: boolean;
|
||||
viewport?: { width: number, height: number, type?: CropType };
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user