1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-22 23:34:47 -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 Canvas */
2024-01-22 06:08:01 -05:00
declare type ColorSpaceConversion = "default" | "none";
/** @category Canvas */
2024-01-22 06:08:01 -05:00
declare type ImageOrientation = "flipY" | "from-image" | "none";
/** @category Canvas */
2024-01-22 06:08:01 -05:00
declare type PremultiplyAlpha = "default" | "none" | "premultiply";
/** @category Canvas */
2024-01-22 06:08:01 -05:00
declare type ResizeQuality = "high" | "low" | "medium" | "pixelated";
/** @category Canvas */
2024-01-22 06:08:01 -05:00
declare type ImageBitmapSource = Blob | ImageData;
/** @category Canvas */
declare interface ImageBitmapOptions {
2024-01-22 06:08:01 -05:00
colorSpaceConversion?: ColorSpaceConversion;
imageOrientation?: ImageOrientation;
premultiplyAlpha?: PremultiplyAlpha;
resizeHeight?: number;
resizeQuality?: ResizeQuality;
resizeWidth?: number;
}
/** @category Canvas */
2024-01-22 06:08:01 -05:00
declare function createImageBitmap(
image: ImageBitmapSource,
options?: ImageBitmapOptions,
): Promise<ImageBitmap>;
/** @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>;
/** @category Canvas */
declare interface ImageBitmap {
2024-01-22 06:08:01 -05:00
readonly height: number;
readonly width: number;
close(): void;
}
/** @category Canvas */
2024-01-22 06:08:01 -05:00
declare var ImageBitmap: {
prototype: ImageBitmap;
new (): ImageBitmap;
};