# @types/react-avatar-editor

> TypeScript definitions for react-avatar-editor

Latest version **13.0.4** (published 2025-02-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/react-avatar-editor
pnpm add @types/react-avatar-editor
yarn add @types/react-avatar-editor
bun add @types/react-avatar-editor
```

## Health

**Score 55/100 (C)** — status: stable.

Positive: has types; no vulnerabilities; high maintenance score; popular repo; extremely popular.

Warnings: low downloads; no esm support.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 13.0.4 |
| Published | 2025-02-25 |
| First published | 2018-03-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 6.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51483 |
| Maintainers | types |

## Links

- npm: https://www.npmjs.com/package/@types/react-avatar-editor
- Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
- Homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-avatar-editor
- npm.io page: https://npm.io/package/@types/react-avatar-editor

## Dependencies (1)

- [@types/react](https://npm.io/package/@types/react.md) *

## Recent versions

- 13.0.4 (latest) — 2025-02-25
- 13.0.3 (ts4.9) — 2024-08-26
- 13.0.2 (ts4.6) — 2023-11-07
- 13.0.0 (ts4.4) — 2022-08-05
- 12.0.0 (ts3.9) — 2022-03-02
- 10.3.6 (ts3.6) — 2021-07-07
- 10.3.5 (ts3.3) — 2019-10-30
- 10.3.1 (ts2.7) — 2018-03-15
- 13.0.1 — 2023-10-18
- 10.3.4 — 2019-02-25
- 10.3.3 — 2019-02-11
- 10.3.2 — 2018-08-04
- 10.3.0 — 2018-03-09

## README

# 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.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-avatar-editor/index.d.ts)
````ts
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: Tue, 25 Feb 2025 00:03:48 GMT
 * Dependencies: [@types/react](https://npmjs.com/package/@types/react)

# Credits
These definitions were written by [Diogo Corrêa](https://github.com/diogocorrea), [Gabriel Prates](https://github.com/gabsprates), [Laurent Senta](https://github.com/lsenta), [David Spiess](https://github.com/davidspiess), and [John Grisham](https://github.com/JohnGrisham).

---
_Source: https://npm.io/package/@types/react-avatar-editor · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
