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

2.4.4 • Public • Published

Installation

npm install --save @types/textfit

Summary

This package contains type definitions for textfit (https://github.com/STRML/textFit).

Details

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

index.d.ts

/// <reference types="jquery" />

declare function textFit(
    els: HTMLElement | HTMLElement[] | NodeListOf<Element> | HTMLCollection | JQuery,
    options?: textFit.TextFitOption,
): void;

export = textFit;

declare namespace textFit {
    interface TextFitOption {
        /**
         *  if true, textFit will align vertically using css tables
         *  @default false
         */
        alignVert?: boolean | undefined;

        /**
         *  if true, textFit will set text-align: center
         *  @default false
         */
        alignHoriz?: boolean | undefined;

        /**
         *  if true, textFit will not set white-space: no-wrap
         *  @default false
         */
        multiLine?: boolean | undefined;

        /**
         *  disable to turn off automatic multi-line sensing
         *  @default true
         */
        detectMultiLine?: boolean | undefined;

        /**
         *  @default 6
         */
        minFontSize?: number | undefined;

        /**
         *  @default 80
         */
        maxFontSize?: number | undefined;

        /**
         *  if true, textFit will re-process already-fit nodes. Set to 'false' for better performance
         *  @default true
         */
        reProcess?: boolean | undefined;

        /**
         *  if true, textFit will fit text to element width, regardless of text height
         *  @default false
         */
        widthOnly?: boolean | undefined;

        /**
         *  if true, textFit will use flexbox for vertical alignment
         *  @default false
         */
        alignVertWithFlexbox?: boolean | undefined;
    }
}

export as namespace textFit;

Additional Details

  • Last updated: Tue, 07 Nov 2023 15:11:36 GMT
  • Dependencies: @types/jquery

Credits

These definitions were written by Muhun Kim.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/textfit

Weekly Downloads

1,359

Version

2.4.4

License

MIT

Unpacked Size

5.91 kB

Total Files

5

Last publish

Collaborators

  • types