1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-24 15:19:26 -05:00
denoland-deno/ext/canvas/lib.deno_canvas.d.ts
Leo Kettmeir 1007358768
refactor: move ImageData to web extension (#22295)
Signed-off-by: Leo Kettmeir <crowlkats@toaxl.com>
2024-02-07 01:11:15 +01:00

59 lines
1.4 KiB
TypeScript

// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
// deno-lint-ignore-file no-var
/// <reference no-default-lib="true" />
/// <reference lib="esnext" />
/** @category Web APIs */
declare type ColorSpaceConversion = "default" | "none";
/** @category Web APIs */
declare type ImageOrientation = "flipY" | "from-image" | "none";
/** @category Web APIs */
declare type PremultiplyAlpha = "default" | "none" | "premultiply";
/** @category Web APIs */
declare type ResizeQuality = "high" | "low" | "medium" | "pixelated";
/** @category Web APIs */
declare type ImageBitmapSource = Blob | ImageData;
/** @category Web APIs */
interface ImageBitmapOptions {
colorSpaceConversion?: ColorSpaceConversion;
imageOrientation?: ImageOrientation;
premultiplyAlpha?: PremultiplyAlpha;
resizeHeight?: number;
resizeQuality?: ResizeQuality;
resizeWidth?: number;
}
/** @category Web APIs */
declare function createImageBitmap(
image: ImageBitmapSource,
options?: ImageBitmapOptions,
): Promise<ImageBitmap>;
/** @category Web APIs */
declare function createImageBitmap(
image: ImageBitmapSource,
sx: number,
sy: number,
sw: number,
sh: number,
options?: ImageBitmapOptions,
): Promise<ImageBitmap>;
/** @category Web APIs */
interface ImageBitmap {
readonly height: number;
readonly width: number;
close(): void;
}
/** @category Web APIs */
declare var ImageBitmap: {
prototype: ImageBitmap;
new (): ImageBitmap;
};