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

3.0.3 • Public • Published

Installation

npm install --save @types/text-metrics

Summary

This package contains type definitions for text-metrics (https://github.com/bezoerb/text-metrics).

Details

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

index.d.ts

export type Styles = Record<string, any>;

export function init(
    htmlElement: Node | Styles | null,
    styleOverwrites?: Styles,
): TextMetrics;

export interface Options {
    multiline: boolean;
}

export interface TextMetrics {
    parseArgs: (
        textOrOptions?: string | Options,
        optionsOrStyleOverwrites?: Options | Styles,
        styleOverwrites?: Styles,
    ) => {
        text: string;
        options: Options;
        styleOverwrites: Styles;
        styles: Styles;
    };
    width: (
        textOrOptions?: string | Options,
        optionsOrStyleOverwrites?: Options | Styles,
        styleOverwrites?: Styles,
    ) => number;
    height: (
        textOrOptions?: string | Options,
        optionsOrStyleOverwrites?: Options | Styles,
        styleOverwrites?: Styles,
    ) => number;
    lines: (
        textOrOptions?: string | Options,
        optionsOrStyleOverwrites?: Options | Styles,
        styleOverwrites?: Styles,
    ) => string[];
    maxFontSize: (
        textOrOptions?: string | Options,
        optionsOrStyleOverwrites?: Options | Styles,
        styleOverwrites?: Styles,
    ) => string | undefined;
}

Additional Details

  • Last updated: Tue, 07 Nov 2023 15:11:36 GMT
  • Dependencies: none

Credits

These definitions were written by Wunmi Sogunle, and Jose Fort.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/text-metrics

Weekly Downloads

294

Version

3.0.3

License

MIT

Unpacked Size

5.1 kB

Total Files

5

Last publish

Collaborators

  • types