mirror of
https://github.com/konvajs/konva.git
synced 2026-01-24 05:45:14 +08:00
feature: add native context types
This commit is contained in:
@@ -86,7 +86,7 @@ var CONTEXT_PROPERTIES = [
|
||||
'globalAlpha',
|
||||
'globalCompositeOperation',
|
||||
'imageSmoothingEnabled',
|
||||
];
|
||||
] as const;
|
||||
|
||||
const traceArrMax = 100;
|
||||
/**
|
||||
@@ -701,6 +701,11 @@ export class Context {
|
||||
}
|
||||
}
|
||||
|
||||
// supported context properties
|
||||
type CanvasContextProps = Pick<CanvasRenderingContext2D, typeof CONTEXT_PROPERTIES[number]>;
|
||||
|
||||
export interface Context extends CanvasContextProps {};
|
||||
|
||||
CONTEXT_PROPERTIES.forEach(function (prop) {
|
||||
Object.defineProperty(Context.prototype, prop, {
|
||||
get() {
|
||||
|
||||
Reference in New Issue
Block a user