konva.d.ts fixes. close #127

This commit is contained in:
Anton Lavrenov 2016-03-02 08:28:00 +08:00
parent 9ba6ff21fe
commit a2887e2904
2 changed files with 8 additions and 30 deletions

View File

@ -8,6 +8,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
- repair `cancelBubble` event property behaviour - repair `cancelBubble` event property behaviour
- fix wrong `Path` `getClientRect()` calculation - fix wrong `Path` `getClientRect()` calculation
- better HDPI support - better HDPI support
- better typescript definitions
### Changed ### Changed
- more universal stage container selector - more universal stage container selector

37
resources/konva.d.ts vendored
View File

@ -231,7 +231,7 @@ declare module Konva {
setAttr(attr: string, val : any): Node; setAttr(attr: string, val : any): Node;
setAttrs(attrs: NodeConfig) : void; setAttrs(attrs: NodeConfig) : void;
setId(id: string) : Node; setId(id: string) : Node;
setSize(size: any, width: number, height: number) : Node; setSize(size: {width:number; height: number}) : Node;
setZIndex(zIndex: number): void; setZIndex(zIndex: number): void;
shouldDrawHit() : boolean; shouldDrawHit() : boolean;
show() : Node; show() : Node;
@ -292,9 +292,6 @@ declare module Konva {
interface ShapeConfig extends NodeConfig { interface ShapeConfig extends NodeConfig {
fill?: string; fill?: string;
fillRed?: number;
fillGreen?: number;
fillBlue?: number;
fillPatternImage?: HTMLImageElement; fillPatternImage?: HTMLImageElement;
fillPatternX?: number; fillPatternX?: number;
fillPatternY?: number; fillPatternY?: number;
@ -325,9 +322,6 @@ declare module Konva {
fillEnabled?: boolean; fillEnabled?: boolean;
fillPriority?: string; fillPriority?: string;
stroke?: string; stroke?: string;
strokeRed?: number;
strokeGreen?: number;
strokeBlue?: number;
strokeWidth?: number; strokeWidth?: number;
strokeScaleEnabled?: boolean; strokeScaleEnabled?: boolean;
strokeEnabled?: boolean; strokeEnabled?: boolean;
@ -337,9 +331,6 @@ declare module Konva {
hitFunc? : (con : Context) => void; hitFunc? : (con : Context) => void;
drawFunc? : (con : Context) => void; drawFunc? : (con : Context) => void;
shadowColor?: string; shadowColor?: string;
shadowColorRed?: number;
shadowColorGreen?: number;
shadowColorBlue?: number;
shadowBlur?: number; shadowBlur?: number;
shadowOffset? : Vector2d; shadowOffset? : Vector2d;
shadowOffsetX? : number; shadowOffsetX? : number;
@ -359,12 +350,8 @@ declare module Konva {
drawHitFromCache(alphaThreshold: number): Shape; drawHitFromCache(alphaThreshold: number): Shape;
fill() : string; fill() : string;
fill(fill: string): Shape; fill(fill: string): Shape;
fillBlue() : number;
fillBlue(fillBlue: number): Shape;
fillEnabled() : boolean; fillEnabled() : boolean;
fillEnabled(fillEnabled: boolean): Shape; fillEnabled(fillEnabled: boolean): Shape;
fillGreen() : number;
fillGreen(fillGreen: number): Shape;
fillLinearGradientColorStops() : string[]; fillLinearGradientColorStops() : string[];
fillLinearGradientColorStops(colors: string[]): Shape; fillLinearGradientColorStops(colors: string[]): Shape;
fillLinearGradientStartPoint(): Vector2d; fillLinearGradientStartPoint(): Vector2d;
@ -421,8 +408,6 @@ declare module Konva {
fillPatternY(y: number): Shape; fillPatternY(y: number): Shape;
fillPriority(): string; fillPriority(): string;
fillPriority(priority: string): Shape; fillPriority(priority: string): Shape;
fillRed() : number;
fillRed(fillRed: number): Shape;
hasFill(): boolean; hasFill(): boolean;
hasShadow(): boolean; hasShadow(): boolean;
hasStroke(): boolean; hasStroke(): boolean;
@ -435,14 +420,10 @@ declare module Konva {
lineJoin(lineJoin: string): Shape; lineJoin(lineJoin: string): Shape;
sceneFunc(): Function; sceneFunc(): Function;
sceneFunc(func: (con : Context) => {}): Shape; sceneFunc(func: (con : Context) => {}): Shape;
shadowBlue() : number;
shadowBlue(shadowBlue: number): Shape;
shadowColor() : string; shadowColor() : string;
shadowColor(shadowColor: string): Shape; shadowColor(shadowColor: string): Shape;
shadowEnabled() : boolean; shadowEnabled() : boolean;
shadowEnabled(shadowEnabled: boolean): Shape; shadowEnabled(shadowEnabled: boolean): Shape;
shadowGreen() : number;
shadowGreen(shadowGreen: number): Shape;
shadowOffset() : Vector2d; shadowOffset() : Vector2d;
shadowOffset(shadowOffset: Vector2d): Shape; shadowOffset(shadowOffset: Vector2d): Shape;
shadowOffsetX() : number; shadowOffsetX() : number;
@ -451,16 +432,10 @@ declare module Konva {
shadowOffsetY(shadowOffsetY: number): Shape; shadowOffsetY(shadowOffsetY: number): Shape;
shadowOpacity() : number; shadowOpacity() : number;
shadowOpacity(shadowOpacity: number): Shape; shadowOpacity(shadowOpacity: number): Shape;
shadowRed() : number; shadowBlur() : number;
shadowRed(shadowRed: number): Shape; shadowBlur(blur: number): Shape;
stroke() : string; stroke() : string;
stroke(stroke: string): Shape; stroke(stroke: string): Shape;
strokeBlue() : number;
strokeBlue(strokeBlue: number): Shape;
strokeRed() : number;
strokeRed(strokeRed: number): Shape;
strokeGreen() : number;
strokeGreen(strokeGreen: number): Shape;
strokeEnabled() : boolean; strokeEnabled() : boolean;
strokeEnabled(strokeEnabled: boolean): Shape; strokeEnabled(strokeEnabled: boolean): Shape;
strokeScaleEnabled() : boolean; strokeScaleEnabled() : boolean;
@ -522,10 +497,10 @@ declare module Konva {
getContext(): CanvasRenderingContext2D; getContext(): CanvasRenderingContext2D;
getHeight(): number; getHeight(): number;
getWidth(): number; getWidth(): number;
getPixelRation(): number; getPixelRatio(): number;
setHeight(val: number) : void; setHeight(val: number) : void;
setWidth(val: number) : void ; setWidth(val: number) : void ;
setPixelRation(val: number) : void; setPixelRatio(val: number) : void;
setSize(size: {width:number; height: number}) : void; setSize(size: {width:number; height: number}) : void;
toDataURL(mimeType: string, quality: number) : string; toDataURL(mimeType: string, quality: number) : string;
public _canvas : HTMLElement; public _canvas : HTMLElement;
@ -703,6 +678,8 @@ declare module Konva {
fontSize(fontSize: number): Text; fontSize(fontSize: number): Text;
fontStyle(): string; fontStyle(): string;
fontStyle(fontStyle: string): Text; fontStyle(fontStyle: string): Text;
fontVariant(): string;
fontVariant(fontVariant: string): Text;
align(): string; align(): string;
align(align: string): Text; align(align: string): Text;
padding(): number; padding(): number;