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:
@ -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;
|
||||
|
Reference in New Issue
Block a user