mirror of
https://github.com/denoland/deno.git
synced 2024-11-24 15:19:26 -05:00
1007358768
Signed-off-by: Leo Kettmeir <crowlkats@toaxl.com>
59 lines
1.4 KiB
TypeScript
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;
|
|
};
|