1.3.3 • Published 7 months ago

@types/fitfont v1.3.3

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

Installation

npm install --save @types/fitfont

Summary

This package contains type definitions for fitfont (https://github.com/gregoiresage/fitfont).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/fitfont.

index.d.ts

// Type definitions for fitfont 1.3
// Project: https://github.com/gregoiresage/fitfont
// Definitions by: Jérémy Jeanson <https://github.com/JeremyJeanson>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

/**
 * Horizontal alignment
 */
export type HorizontalAlign = "start" | "middle" | "end";

/**
 * Vertical alignment
 */
export type VerticalAlign = "top" | "middle" | "bottom" | "baseline";

/**
 * Option to initialize a fitfont class
 */
export interface Options {
    /**
     * Id fo the symbol or the Element to use
     */
    id: string | object;
    /**
     * name of the generated font folder
     */
    font: string;
    /**
     * Horizontal alignment
     */
    halign?: HorizontalAlign | undefined;
    /**
     * Vertical alignment
     */
    valign?: VerticalAlign | undefined;
    /**
     * Letter spacing
     */
    letterspacing?: number | undefined;
}

/**
 * Fitfont class to use cutom fonts
 */
export class FitFont {
    constructor(options: Options);

    /**
     * Force the redraw
     */
    redraw(): void;

    /**
     * Text to show
     */
    text: string;

    /**
     * Horizontal alignment
     */
    halign: HorizontalAlign;

    /**
     * Vertical alignment
     */
    valign: VerticalAlign;

    /**
     * Letter spacing
     */
    letterspacing: number;

    /**
     * With (read only)
     */
    readonly width: number;
}

Additional Details

  • Last updated: Thu, 08 Jul 2021 12:01:39 GMT
  • Dependencies: none
  • Global values: none

Credits

These definitions were written by Jérémy Jeanson.