@types/node-canvas-text
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

Installation

npm install --save @types/node-canvas-text

Summary

This package contains type definitions for node-canvas-text (https://github.com/kaivi/node-canvas-text#readme).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node-canvas-text.

index.d.ts

import { Font } from "opentype.js";

export interface DrawOptions {
    drawRect: boolean;
    fitMethod: "baseline" | "box";
    fillPadding: number;
    granularity: number;
    hAlign: "center" | "left" | "right";
    maxSize: number;
    minSize: number;
    rectFillOnlyText: boolean;
    rectFillStyle: string;
    textFillStyle: string;
    textPadding: number;
    vAlign: "bottom" | "center" | "top";
}

export interface DrawRectangle {
    height: number;
    width: number;
    x: number;
    y: number;
}

export default function drawText(
    ctx: CanvasRenderingContext2D,
    text: string,
    font: Font,
    rect?: DrawRectangle,
    options?: Partial<DrawOptions>,
): void;

Additional Details

Credits

These definitions were written by Gabriel Fournier.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/node-canvas-text

Weekly Downloads

44

Version

1.0.3

License

MIT

Unpacked Size

4.1 kB

Total Files

5

Last publish

Collaborators

  • types