@types/react-avatar-editor
TypeScript icon, indicating that this package has built-in type declarations

13.0.3 • Public • Published

Installation

npm install --save @types/react-avatar-editor

Summary

This package contains type definitions for react-avatar-editor (https://github.com/mosch/react-avatar-editor).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-avatar-editor.

import * as React from "react";

declare namespace AvatarEditor {
    interface Position {
        x: number;
        y: number;
    }

    interface CroppedRect extends Position {
        width: number;
        height: number;
    }

    interface ImageState extends CroppedRect {
        resource: ImageData;
    }

    interface AvatarEditorProps {
        className?: string | undefined;
        image: string | File;
        width?: number | undefined;
        height?: number | undefined;
        backgroundColor?: string | undefined;
        border?: number | number[] | undefined;
        borderRadius?: number | undefined;
        color?: number[] | undefined;
        style?: object | undefined;
        scale?: number | undefined;
        position?: Position | undefined;
        rotate?: number | undefined;
        crossOrigin?: string | undefined;
        disableBoundaryChecks?: boolean | undefined;
        disableHiDPIScaling?: boolean | undefined;
        disableCanvasRotation?: boolean | undefined;
        onLoadFailure?(event: Event): void;
        onLoadSuccess?(imgInfo: ImageState): void;
        onImageReady?(event: Event): void;
        onMouseUp?(): void;
        onMouseMove?(event: Event): void;
        onImageChange?(): void;
        onPositionChange?(position: Position): void;
    }
}

declare class AvatarEditor extends React.Component<AvatarEditor.AvatarEditorProps, any> {
    getImage(): HTMLCanvasElement;
    getImageScaledToCanvas(): HTMLCanvasElement;
    getCroppingRect(): AvatarEditor.CroppedRect;
}

export = AvatarEditor;

Additional Details

  • Last updated: Mon, 26 Aug 2024 15:07:39 GMT
  • Dependencies: @types/react

Credits

These definitions were written by Diogo Corrêa, Gabriel Prates, Laurent Senta, David Spiess, John Grisham, and Joshua Hintze.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/react-avatar-editor

Weekly Downloads

102,505

Version

13.0.3

License

MIT

Unpacked Size

6.86 kB

Total Files

5

Last publish

Collaborators

  • types