mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
feat: allow avif
, jfif
, webp
, bmp
, ico
image types (#6500
* feat: allow `avif`, `jfif`, `webp`, `bmp`, `ico` image types * dedupe for SSOT * more SSOT
This commit is contained in:
parent
2a4799d8c8
commit
fee760d38c
5 changed files with 28 additions and 36 deletions
|
@ -29,9 +29,9 @@ import { isOverScrollBars } from "./scene";
|
|||
import { MaybeTransformHandleType } from "./element/transformHandles";
|
||||
import Library from "./data/library";
|
||||
import type { FileSystemHandle } from "./data/filesystem";
|
||||
import type { ALLOWED_IMAGE_MIME_TYPES, MIME_TYPES } from "./constants";
|
||||
import type { IMAGE_MIME_TYPES, MIME_TYPES } from "./constants";
|
||||
import { ContextMenuItems } from "./components/ContextMenu";
|
||||
import { Merge, ForwardRef } from "./utility-types";
|
||||
import { Merge, ForwardRef, ValueOf } from "./utility-types";
|
||||
import React from "react";
|
||||
|
||||
export type Point = Readonly<RoughPoint>;
|
||||
|
@ -60,7 +60,7 @@ export type DataURL = string & { _brand: "DataURL" };
|
|||
|
||||
export type BinaryFileData = {
|
||||
mimeType:
|
||||
| typeof ALLOWED_IMAGE_MIME_TYPES[number]
|
||||
| ValueOf<typeof IMAGE_MIME_TYPES>
|
||||
// future user or unknown file type
|
||||
| typeof MIME_TYPES.binary;
|
||||
id: FileId;
|
||||
|
@ -419,7 +419,7 @@ export type AppClassProperties = {
|
|||
FileId,
|
||||
{
|
||||
image: HTMLImageElement | Promise<HTMLImageElement>;
|
||||
mimeType: typeof ALLOWED_IMAGE_MIME_TYPES[number];
|
||||
mimeType: ValueOf<typeof IMAGE_MIME_TYPES>;
|
||||
}
|
||||
>;
|
||||
files: BinaryFiles;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue