1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-29 16:30:56 -05:00
denoland-deno/ext/canvas/lib.deno_canvas.d.ts

60 lines
1.4 KiB
TypeScript
Raw Normal View History

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" />
/** @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;
};