2024-01-22 06:08:01 -05:00
|
|
|
// 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" />
|
|
|
|
|
2024-05-05 21:56:55 -04:00
|
|
|
/** @category Canvas */
|
2024-01-22 06:08:01 -05:00
|
|
|
declare type ColorSpaceConversion = "default" | "none";
|
|
|
|
|
2024-05-05 21:56:55 -04:00
|
|
|
/** @category Canvas */
|
2024-01-22 06:08:01 -05:00
|
|
|
declare type ImageOrientation = "flipY" | "from-image" | "none";
|
|
|
|
|
2024-05-05 21:56:55 -04:00
|
|
|
/** @category Canvas */
|
2024-01-22 06:08:01 -05:00
|
|
|
declare type PremultiplyAlpha = "default" | "none" | "premultiply";
|
|
|
|
|
2024-05-05 21:56:55 -04:00
|
|
|
/** @category Canvas */
|
2024-01-22 06:08:01 -05:00
|
|
|
declare type ResizeQuality = "high" | "low" | "medium" | "pixelated";
|
|
|
|
|
2024-05-05 21:56:55 -04:00
|
|
|
/** @category Canvas */
|
2024-01-22 06:08:01 -05:00
|
|
|
declare type ImageBitmapSource = Blob | ImageData;
|
|
|
|
|
2024-05-05 21:56:55 -04:00
|
|
|
/** @category Canvas */
|
2024-04-26 12:04:29 -04:00
|
|
|
declare interface ImageBitmapOptions {
|
2024-01-22 06:08:01 -05:00
|
|
|
colorSpaceConversion?: ColorSpaceConversion;
|
|
|
|
imageOrientation?: ImageOrientation;
|
|
|
|
premultiplyAlpha?: PremultiplyAlpha;
|
|
|
|
resizeHeight?: number;
|
|
|
|
resizeQuality?: ResizeQuality;
|
|
|
|
resizeWidth?: number;
|
|
|
|
}
|
|
|
|
|
2024-05-05 21:56:55 -04:00
|
|
|
/** @category Canvas */
|
2024-01-22 06:08:01 -05:00
|
|
|
declare function createImageBitmap(
|
|
|
|
image: ImageBitmapSource,
|
|
|
|
options?: ImageBitmapOptions,
|
|
|
|
): Promise<ImageBitmap>;
|
2024-05-05 21:56:55 -04:00
|
|
|
/** @category Canvas */
|
2024-01-22 06:08:01 -05:00
|
|
|
declare function createImageBitmap(
|
|
|
|
image: ImageBitmapSource,
|
|
|
|
sx: number,
|
|
|
|
sy: number,
|
|
|
|
sw: number,
|
|
|
|
sh: number,
|
|
|
|
options?: ImageBitmapOptions,
|
|
|
|
): Promise<ImageBitmap>;
|
|
|
|
|
2024-05-05 21:56:55 -04:00
|
|
|
/** @category Canvas */
|
2024-04-26 12:04:29 -04:00
|
|
|
declare interface ImageBitmap {
|
2024-01-22 06:08:01 -05:00
|
|
|
readonly height: number;
|
|
|
|
readonly width: number;
|
|
|
|
close(): void;
|
|
|
|
}
|
|
|
|
|
2024-05-05 21:56:55 -04:00
|
|
|
/** @category Canvas */
|
2024-01-22 06:08:01 -05:00
|
|
|
declare var ImageBitmap: {
|
|
|
|
prototype: ImageBitmap;
|
|
|
|
new (): ImageBitmap;
|
|
|
|
};
|