@@ -10,6 +10,7 @@ declare module 'canvas-constructor' {
1010 public changeCanvasWidth ( width : number ) : this;
1111 public changeCanvasHeigth ( heigth : number ) : this;
1212 public save ( ) : this;
13+ public restore ( ) : this;
1314 public rotate ( angle : number ) : this;
1415 public scale ( x : number , y : number ) : this;
1516 public traslate ( x : number , y : number ) : this;
@@ -20,6 +21,7 @@ declare module 'canvas-constructor' {
2021 public fill ( path : any , fillRule ?: fillRuleType ) : this;
2122 public addText ( text : string , x : number , y : number , maxWidth ?: number ) : this;
2223 public addResponsiveText ( text : string , x : number , y : number , maxWidth : number ) : this;
24+ public addMultilineText ( text : string , x : number , y : number , maxWidth : number , lineHeight : number ) : this;
2325 public stroke ( path ?: any ) : this;
2426 public addStrokeRect ( x : number , y : number , width : number , height : number ) : this;
2527 public addStrokeText ( text : string , x : number , y : number ) : this;
@@ -80,32 +82,97 @@ declare module 'canvas-constructor' {
8082 public toBufferAsync ( ) : Promise < Buffer > ;
8183
8284 public static getCanvas ( ) : NodeCanvas ;
83- public static registerFont ( path : string , family : string ) ;
84- public static registerFont ( path : string , family : fontFaceType ) ;
85+ public static registerFont ( path : string , family : string | fontFaceType ) ;
8586
8687 }
8788
88- export type CanvasType = 'pdf' | 'svg' ;
89- export type fillRuleType = 'nonzero' | 'evenodd' ;
90- export type lineJoinValue = 'bevel' | 'round' | 'miter' ;
91- export type lineCapValue = 'butt' | 'round' | 'square' ;
89+ export type CanvasType = 'pdf'
90+ | 'svg' ;
91+ export type fillRuleType = 'nonzero'
92+ | 'evenodd' ;
93+ export type lineCapValue = 'butt'
94+ | 'round'
95+ | 'square' ;
96+ export type lineJoinValue = 'bevel'
97+ | 'round'
98+ | 'miter' ;
9299 export type addImageOptions = {
93- radius : number ;
94- type : roundType ;
100+ radius ?: number ;
101+ type ?: roundType ;
102+ restore ?: boolean ;
95103 } ;
96- export type roundType = 'round' | 'bevel' ;
97- export type textAlignType = 'left' | 'center' | 'right' | 'start' | 'end' ;
98- export type textBaselineType = 'top' | 'hanging' | 'middle' | 'alphabetic' | 'ideographic' | 'bottom' ;
99- export type patternRepetition = 'repeat' | 'repeat-x' | 'repeat-y' | 'no-repeat' ;
100- export type patternQuality = 'fast' | 'good' | 'best' | 'nearest' | 'bilinear' ;
101- export type textDrawingMode = 'path' | 'glyph' ;
102- export type antialiasType = 'default' | 'none' | 'gray' | 'subpixel' ;
103- export type globalCompositeOperation = 'source-over' | 'source-in' | 'source-out' | 'source-atop' | 'destination-over' | 'destination-in' | 'destination-out' | 'destination-atop' | 'lighter' | 'copy' | 'xor' | 'darken' | 'lighten' | 'color-dodge' | 'color-burn' | 'difference' | 'exclusion' | 'hue' | 'saturation' | 'color' | 'luminosity' | 'multiply' | 'screen' | 'overlay' | 'hard-light' | 'soft-light' | 'hsl-hue' | 'hsl-saturation' | 'hsl-color' | 'hsl-luminosity' ;
104+
105+ export type antialiasType = 'default'
106+ | 'none'
107+ | 'gray'
108+ | 'subpixel' ;
109+
110+ export type patternQuality = 'fast'
111+ | 'good'
112+ | 'best'
113+ | 'nearest'
114+ | 'bilinear' ;
115+
116+ export type patternRepetition = 'repeat'
117+ | 'repeat-x'
118+ | 'repeat-y'
119+ | 'no-repeat' ;
120+
121+ export type roundType = 'round'
122+ | 'bevel' ;
123+
124+ export type textAlignType = 'left'
125+ | 'center'
126+ | 'right'
127+ | 'start'
128+ | 'end' ;
129+
130+ export type textBaselineType = 'alphabetic'
131+ | 'bottom'
132+ | 'hanging'
133+ | 'ideographic'
134+ | 'middle'
135+ | 'top' ;
136+
137+ export type textDrawingMode = 'path'
138+ | 'glyph' ;
139+
140+ export type globalCompositeOperation = 'color-burn'
141+ | 'color-dodge'
142+ | 'color'
143+ | 'copy'
144+ | 'darken'
145+ | 'destination-atop'
146+ | 'destination-in'
147+ | 'destination-out'
148+ | 'destination-over'
149+ | 'difference'
150+ | 'exclusion'
151+ | 'hard-light'
152+ | 'hsl-color'
153+ | 'hsl-hue'
154+ | 'hsl-luminosity'
155+ | 'hsl-saturation'
156+ | 'hue'
157+ | 'lighten'
158+ | 'lighter'
159+ | 'luminosity'
160+ | 'multiply'
161+ | 'overlay'
162+ | 'saturation'
163+ | 'screen'
164+ | 'soft-light'
165+ | 'source-atop'
166+ | 'source-in'
167+ | 'source-out'
168+ | 'source-over'
169+ | 'xor' ;
170+
104171 export type fontFaceType = {
105172 family : string ;
106- weight ?: string ;
107173 style ?: string ;
108- }
174+ weight ?: string ;
175+ } ;
109176
110177 export type GradientStep = {
111178 position : number ;
0 commit comments