-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Temporarily use manually defined types
* rename setTextBlock method to setText * Prepare 1.0.3 release
- Loading branch information
1 parent
70ddde6
commit 449ffd7
Showing
6 changed files
with
56 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import type { Canvas as NodeCanvas } from "canvas"; | ||
|
||
export = CanvasTextBlock; | ||
|
||
declare class CanvasTextBlock { | ||
/** | ||
* Create a text block instance | ||
* | ||
* @param canvas The canvas element | ||
* @param x The x-axis position in pixels where the text block should start | ||
* @param y The y-axis position in pixels where the text block should start | ||
* @param width The width of the text block in pixels | ||
* @param height The height of the text block in pixels | ||
* @param options | ||
*/ | ||
constructor( | ||
canvas: HTMLCanvasElement | NodeCanvas, | ||
x: number, | ||
y: number, | ||
width: number, | ||
height: number, | ||
options: CanvasTextBlock.CanvasTextBlockOptions | ||
); | ||
|
||
/** | ||
* Set the text of the text block instance. | ||
* | ||
* @param text | ||
*/ | ||
setText(text: string): void; | ||
} | ||
|
||
declare namespace CanvasTextBlock { | ||
export interface CanvasTextBlockOptions { | ||
color?: string; | ||
backgroundColor?: string; | ||
fontFamily?: string; | ||
fontSize?: number; | ||
lineHeight?: number; | ||
weight?: string; | ||
ellipsis?: boolean; | ||
overflow?: boolean; | ||
} | ||
} |