# @types/typography

> TypeScript definitions for typography

Latest version **0.16.9** (published 2025-12-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/typography
pnpm add @types/typography
yarn add @types/typography
bun add @types/typography
```

## Health

**Score 65/100 (B)** — status: stable.

Positive: has types; no vulnerabilities; high maintenance score; popular repo; extremely popular.

Warnings: low downloads; no esm support; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.16.9 |
| Published | 2025-12-01 |
| First published | 2018-09-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 6.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51445 |
| Maintainers | types |

## Links

- npm: https://www.npmjs.com/package/@types/typography
- Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
- Homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/typography
- npm.io page: https://npm.io/package/@types/typography

## Recent versions

- 0.16.9 (latest) — 2025-12-01
- 0.16.8 (ts4.8) — 2024-08-26
- 0.16.7 (ts4.5) — 2023-11-07
- 0.16.5 (ts4.3) — 2023-09-12
- 0.16.4 (ts4.2) — 2021-07-02
- 0.16.3 (ts3.2) — 2019-09-04
- 0.16.6 — 2023-10-18
- 0.16.2 — 2019-01-07
- 0.16.1 — 2018-12-20
- 0.16.0 — 2018-09-10

## README

# Installation
> `npm install --save @types/typography`

# Summary
This package contains type definitions for typography (https://github.com/KyleAMathews/typography.js).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/typography.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/typography/index.d.ts)
````ts
export interface BaseLine {
    fontSize: string;
    lineHeight: string;
}

export interface VerticalRhythm {
    rhythm: (value: number) => string;
    scale: (value: number) => BaseLine;
    adjustFontSizeTo: (value?: number | string) => object;
    linesForFontSize: (fontSize: number) => number;
    establishBaseline: () => BaseLine;
}

export interface GoogleFont {
    name: string;
    styles: string[];
}

export interface TypographyOptions {
    baseFontSize?: string | undefined;
    baseLineHeight?: number | undefined;
    scaleRatio?: number | undefined;
    googleFonts?: GoogleFont[] | undefined;
    headerFontFamily?: string[] | undefined;
    headerLineHeight?: number | undefined;
    bodyFontFamily?: string[] | undefined;
    headerColor?: string | undefined;
    bodyColor?: string | undefined;
    headerWeight?: number | string | undefined;
    bodyWeight?: number | string | undefined;
    boldWeight?: number | string | undefined;
    blockMarginBottom?: number | undefined;
    includeNormalize?: boolean | undefined;
    overrideStyles?:
        | ((
            VerticalRhythm: VerticalRhythm,
            options: TypographyOptions,
            styles: any,
        ) => object)
        | undefined;
    overrideThemeStyles?:
        | ((
            VerticalRhythm: VerticalRhythm,
            options: TypographyOptions,
            styles: any,
        ) => object)
        | undefined;
    plugins?: any[] | undefined;
}

declare class Typography {
    constructor(opts: TypographyOptions);
    options: TypographyOptions;
    createStyles(): string;
    toJSON(): object;
    injectStyles(): void;
    rhythm: VerticalRhythm["rhythm"];
    scale: VerticalRhythm["scale"];
    adjustFontSizeTo: VerticalRhythm["adjustFontSizeTo"];
    linesForFontSize: VerticalRhythm["linesForFontSize"];
    establishBaseline: VerticalRhythm["establishBaseline"];
}

export default Typography;

````

### Additional Details
 * Last updated: Mon, 01 Dec 2025 20:02:16 GMT
 * Dependencies: none

# Credits
These definitions were written by [Dominic Fallows](https://github.com/dominicfallows).

---
_Source: https://npm.io/package/@types/typography · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
