1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

jsdom, checker: add more methods for CanvasRenderingContext2D, fix interop check for JS methods (#12372)

This commit is contained in:
playX
2021-11-03 17:54:28 +03:00
committed by GitHub
parent c4e282a0c8
commit 2b4154910c
8 changed files with 235 additions and 80 deletions

34
vlib/jsdom/context.v Normal file
View File

@@ -0,0 +1,34 @@
// Wrapper around 2d context and WebGL APIs
module jsdom
pub struct ContextAttributes {
pub:
alpha bool
desynchronized bool
}
pub enum PowerPreference {
default_
high_performance
low_performance
}
pub struct WebGLAttributes {
pub:
alpha bool
desynchronized bool
antialias bool
depth bool
fail_if_major_perf_caveat bool
power_preference PowerPreference
premultiplied_alpha bool
preserve_drawing_buffer bool
stencil bool
}
pub struct NoneContext {}
pub type ContextResult = CanvasRenderingContext2D | NoneContext | WebGLRenderingContext
pub struct JS.CanvasGradient {}