konva
Version:
HTML5 2d canvas library.
303 lines (302 loc) • 12.5 kB
TypeScript
import { Konva as Core } from './_CoreInternals.ts';
import { Arc } from './shapes/Arc.ts';
import { Arrow } from './shapes/Arrow.ts';
import { Circle } from './shapes/Circle.ts';
import { Ellipse } from './shapes/Ellipse.ts';
import { Image } from './shapes/Image.ts';
import { Label, Tag } from './shapes/Label.ts';
import { Line } from './shapes/Line.ts';
import { Path } from './shapes/Path.ts';
import { Rect } from './shapes/Rect.ts';
import { RegularPolygon } from './shapes/RegularPolygon.ts';
import { Ring } from './shapes/Ring.ts';
import { Sprite } from './shapes/Sprite.ts';
import { Star } from './shapes/Star.ts';
import { Text } from './shapes/Text.ts';
import { TextPath } from './shapes/TextPath.ts';
import { Transformer } from './shapes/Transformer.ts';
import { Wedge } from './shapes/Wedge.ts';
export declare const Konva: {
_global: any;
version: string;
isBrowser: boolean;
isUnminified: boolean;
dblClickWindow: number;
getAngle(angle: number): number;
enableTrace: boolean;
pointerEventsEnabled: boolean;
autoDrawEnabled: boolean;
hitOnDragEnabled: boolean;
capturePointerEventsEnabled: boolean;
_mouseListenClick: boolean;
_touchListenClick: boolean;
_pointerListenClick: boolean;
_mouseInDblClickWindow: boolean;
_touchInDblClickWindow: boolean;
_pointerInDblClickWindow: boolean;
_mouseDblClickPointerId: null;
_touchDblClickPointerId: null;
_pointerDblClickPointerId: null;
_renderBackend: string;
legacyTextRendering: boolean;
pixelRatio: number;
dragDistance: number;
angleDeg: boolean;
showWarnings: boolean;
dragButtons: number[];
isDragging(): boolean;
isTransforming(): boolean;
isDragReady(): boolean;
releaseCanvasOnDestroy: boolean;
document: any;
_injectGlobal(Konva: any): void;
} & {
Util: {
_isElement(obj: any): obj is Element;
_isFunction(obj: any): boolean;
_isPlainObject(obj: any): boolean;
_isArray(obj: any): obj is Array<any>;
_isNumber(obj: any): obj is number;
_isString(obj: any): obj is string;
_isBoolean(obj: any): obj is boolean;
isObject(val: any): val is object;
isValidSelector(selector: any): boolean;
_sign(number: number): 1 | -1;
requestAnimFrame(callback: Function): void;
createCanvasElement(): HTMLCanvasElement;
createImageElement(): HTMLImageElement;
_isInDocument(el: any): boolean;
_urlToImage(url: string, callback: Function): void;
_rgbToHex(r: number, g: number, b: number): string;
_hexToRgb(hex: string): import("./types.ts").RGB;
getRandomColor(): string;
getRGB(color: string): import("./types.ts").RGB;
colorToRGBA(str: string): {
r: number;
g: number;
b: number;
a: number;
} | undefined;
_namedColorToRBA(str: string): {
r: number;
g: number;
b: number;
a: number;
} | null;
_rgbColorToRGBA(str: string): {
r: number;
g: number;
b: number;
a: number;
} | undefined;
_rgbaColorToRGBA(str: string): {
r: number;
g: number;
b: number;
a: number;
} | undefined;
_hex8ColorToRGBA(str: string): {
r: number;
g: number;
b: number;
a: number;
} | undefined;
_hex6ColorToRGBA(str: string): {
r: number;
g: number;
b: number;
a: number;
} | undefined;
_hex4ColorToRGBA(str: string): {
r: number;
g: number;
b: number;
a: number;
} | undefined;
_hex3ColorToRGBA(str: string): {
r: number;
g: number;
b: number;
a: number;
} | undefined;
_hslColorToRGBA(str: string): {
r: number;
g: number;
b: number;
a: number;
} | undefined;
haveIntersection(r1: import("./types.ts").IRect, r2: import("./types.ts").IRect): boolean;
cloneObject<Any>(obj: Any): Any;
cloneArray(arr: Array<any>): any[];
degToRad(deg: number): number;
radToDeg(rad: number): number;
_degToRad(deg: number): number;
_radToDeg(rad: number): number;
_getRotation(radians: number): number;
_capitalize(str: string): string;
throw(str: string): never;
error(str: string): void;
warn(str: string): void;
each(obj: object, func: Function): void;
_inRange(val: number, left: number, right: number): boolean;
_getProjectionToSegment(x1: any, y1: any, x2: any, y2: any, x3: any, y3: any): any[];
_getProjectionToLine(pt: import("./types.ts").Vector2d, line: Array<import("./types.ts").Vector2d>, isClosed: boolean): import("./types.ts").Vector2d;
_prepareArrayForTween(startArray: any, endArray: any, isClosed: any): number[];
_prepareToStringify<T>(obj: any): T | null;
_assign<T, U>(target: T, source: U): T & U;
_getFirstPointerId(evt: any): any;
releaseCanvas(...canvases: HTMLCanvasElement[]): void;
drawRoundedRectPath(context: import("./Context.ts").Context, width: number, height: number, cornerRadius: number | number[]): void;
drawRoundedPolygonPath(context: import("./Context.ts").Context, points: import("./types.ts").Vector2d[], sides: number, radius: number, cornerRadius: number | number[]): void;
};
Transform: typeof import("./Util.ts").Transform;
Node: typeof import("./Node.ts").Node;
Container: typeof import("./Container.ts").Container;
Stage: typeof import("./Stage.ts").Stage;
stages: import("./Stage.ts").Stage[];
Layer: typeof import("./Layer.ts").Layer;
FastLayer: typeof import("./FastLayer.ts").FastLayer;
Group: typeof import("./Group.ts").Group;
DD: {
readonly isDragging: boolean;
justDragged: boolean;
readonly node: import("./Node.ts").Node<import("./Node.ts").NodeConfig> | undefined;
_dragElements: Map<number, {
node: import("./Node.ts").Node;
startPointerPos: import("./types.ts").Vector2d;
offset: import("./types.ts").Vector2d;
pointerId?: number;
dragStatus: "ready" | "dragging" | "stopped";
}>;
_drag(evt: any): void;
_endDragBefore(evt?: any): void;
_endDragAfter(evt: any): void;
};
Shape: typeof import("./Shape.ts").Shape;
shapes: {
[key: string]: import("./Shape.ts").Shape<import("./Shape.ts").ShapeConfig>;
};
Animation: typeof import("./Animation.ts").Animation;
Tween: typeof import("./Tween.ts").Tween;
Easings: {
BackEaseIn(t: any, b: any, c: any, d: any): any;
BackEaseOut(t: any, b: any, c: any, d: any): any;
BackEaseInOut(t: any, b: any, c: any, d: any): any;
ElasticEaseIn(t: any, b: any, c: any, d: any, a: any, p: any): any;
ElasticEaseOut(t: any, b: any, c: any, d: any, a: any, p: any): any;
ElasticEaseInOut(t: any, b: any, c: any, d: any, a: any, p: any): any;
BounceEaseOut(t: any, b: any, c: any, d: any): any;
BounceEaseIn(t: any, b: any, c: any, d: any): any;
BounceEaseInOut(t: any, b: any, c: any, d: any): any;
EaseIn(t: any, b: any, c: any, d: any): any;
EaseOut(t: any, b: any, c: any, d: any): any;
EaseInOut(t: any, b: any, c: any, d: any): any;
StrongEaseIn(t: any, b: any, c: any, d: any): any;
StrongEaseOut(t: any, b: any, c: any, d: any): any;
StrongEaseInOut(t: any, b: any, c: any, d: any): any;
Linear(t: any, b: any, c: any, d: any): any;
};
Context: typeof import("./Context.ts").Context;
Canvas: typeof import("./Canvas.ts").Canvas;
} & {
Arc: typeof Arc;
Arrow: typeof Arrow;
Circle: typeof Circle;
Ellipse: typeof Ellipse;
Image: typeof Image;
Label: typeof Label;
Tag: typeof Tag;
Line: typeof Line;
Path: typeof Path;
Rect: typeof Rect;
RegularPolygon: typeof RegularPolygon;
Ring: typeof Ring;
Sprite: typeof Sprite;
Star: typeof Star;
Text: typeof Text;
TextPath: typeof TextPath;
Transformer: typeof Transformer;
Wedge: typeof Wedge;
Filters: {
Blur: import("./Node.ts").Filter;
Brightness: import("./Node.ts").Filter;
Brighten: import("./Node.ts").Filter;
Contrast: import("./Node.ts").Filter;
Emboss: import("./Node.ts").Filter;
Enhance: import("./Node.ts").Filter;
Grayscale: import("./Node.ts").Filter;
HSL: import("./Node.ts").Filter;
HSV: import("./Node.ts").Filter;
Invert: import("./Node.ts").Filter;
Kaleidoscope: import("./Node.ts").Filter;
Mask: import("./Node.ts").Filter;
Noise: import("./Node.ts").Filter;
Pixelate: import("./Node.ts").Filter;
Posterize: import("./Node.ts").Filter;
RGB: import("./Node.ts").Filter;
RGBA: import("./Node.ts").Filter;
Sepia: import("./Node.ts").Filter;
Solarize: import("./Node.ts").Filter;
Threshold: import("./Node.ts").Filter;
};
};
export declare namespace Konva {
type Vector2d = Core.Vector2d;
type Node = Core.Node;
type NodeConfig = Core.NodeConfig;
type KonvaEventObject<EventType> = Core.KonvaEventObject<EventType>;
type KonvaPointerEvent = Core.KonvaPointerEvent;
type KonvaEventListener<This, EventType> = Core.KonvaEventListener<This, EventType>;
type Container = Core.Container;
type ContainerConfig = Core.ContainerConfig;
type Transform = Core.Transform;
type Context = Core.Context;
type Stage = Core.Stage;
type StageConfig = Core.StageConfig;
type Layer = Core.Layer;
type LayerConfig = Core.LayerConfig;
type FastLayer = Core.FastLayer;
type Group = Core.Group;
type GroupConfig = Core.GroupConfig;
type Shape = Core.Shape;
type ShapeConfig = Core.ShapeConfig;
type Animation = Core.Animation;
type Tween = Core.Tween;
type TweenConfig = Core.TweenConfig;
type Arc = import('./shapes/Arc.ts').Arc;
type ArcConfig = import('./shapes/Arc.ts').ArcConfig;
type Arrow = import('./shapes/Arrow.ts').Arrow;
type ArrowConfig = import('./shapes/Arrow.ts').ArrowConfig;
type Circle = import('./shapes/Circle.ts').Circle;
type CircleConfig = import('./shapes/Circle.ts').CircleConfig;
type Ellipse = import('./shapes/Ellipse.ts').Ellipse;
type EllipseConfig = import('./shapes/Ellipse.ts').EllipseConfig;
type Image = import('./shapes/Image.ts').Image;
type ImageConfig = import('./shapes/Image.ts').ImageConfig;
type Label = import('./shapes/Label.ts').Label;
type LabelConfig = import('./shapes/Label.ts').LabelConfig;
type Tag = import('./shapes/Label.ts').Tag;
type TagConfig = import('./shapes/Label.ts').TagConfig;
type Line = import('./shapes/Line.ts').Line;
type LineConfig = import('./shapes/Line.ts').LineConfig;
type Path = import('./shapes/Path.ts').Path;
type PathConfig = import('./shapes/Path.ts').PathConfig;
type Rect = import('./shapes/Rect.ts').Rect;
type RectConfig = import('./shapes/Rect.ts').RectConfig;
type RegularPolygon = import('./shapes/RegularPolygon.ts').RegularPolygon;
type RegularPolygonConfig = import('./shapes/RegularPolygon.ts').RegularPolygonConfig;
type Ring = import('./shapes/Ring.ts').Ring;
type RingConfig = import('./shapes/Ring.ts').RingConfig;
type Sprite = import('./shapes/Sprite.ts').Sprite;
type SpriteConfig = import('./shapes/Sprite.ts').SpriteConfig;
type Star = import('./shapes/Star.ts').Star;
type StarConfig = import('./shapes/Star.ts').StarConfig;
type Text = import('./shapes/Text.ts').Text;
type TextConfig = import('./shapes/Text.ts').TextConfig;
type TextPath = import('./shapes/TextPath.ts').TextPath;
type TextPathConfig = import('./shapes/TextPath.ts').TextPathConfig;
type Transformer = import('./shapes/Transformer.ts').Transformer;
type TransformerConfig = import('./shapes/Transformer.ts').TransformerConfig;
type Wedge = import('./shapes/Wedge.ts').Wedge;
type WedgeConfig = import('./shapes/Wedge.ts').WedgeConfig;
}