@types/typography
TypeScript definitions for typography
Last updated 7 years ago by types .
MIT · Repository · Original npm · Tarball · package.json
$ cnpm install @types/typography 
SYNC missed versions from official npm registry.

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

// Type definitions for typography 0.16
// Project: https://github.com/KyleAMathews/typography.js
// Definitions by: Boye <https://github.com/boyeborg>
//                 Krzysztof Żuraw <https://github.com/krzysztofzuraw>
//                 Dominic Fallows <https://github.com/dominicfallows>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2

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: Fri, 02 Jul 2021 19:37:29 GMT
  • Dependencies: none
  • Global values: none

Credits

These definitions were written by Boye, Krzysztof Żuraw, and Dominic Fallows.

Current Tags

  • 0.16.4                                ...           latest (5 years ago)
  • 0.16.3                                ...           ts2.2 (7 years ago)
  • 0.16.3                                ...           ts2.3 (7 years ago)
  • 0.16.3                                ...           ts2.4 (7 years ago)
  • 0.16.3                                ...           ts2.5 (7 years ago)
  • 0.16.3                                ...           ts2.6 (7 years ago)
  • 0.16.3                                ...           ts2.7 (7 years ago)
  • 0.16.3                                ...           ts2.8 (7 years ago)
  • 0.16.3                                ...           ts2.9 (7 years ago)
  • 0.16.3                                ...           ts3.0 (7 years ago)
  • 0.16.3                                ...           ts3.1 (7 years ago)
  • 0.16.3                                ...           ts3.2 (7 years ago)
  • 0.16.3                                ...           ts3.3 (7 years ago)
  • 0.16.3                                ...           ts3.4 (7 years ago)
  • 0.16.3                                ...           ts3.5 (7 years ago)
  • 0.16.4                                ...           ts3.6 (5 years ago)
  • 0.16.4                                ...           ts3.7 (5 years ago)
  • 0.16.4                                ...           ts3.8 (5 years ago)
  • 0.16.4                                ...           ts3.9 (5 years ago)
  • 0.16.4                                ...           ts4.0 (5 years ago)
  • 0.16.4                                ...           ts4.1 (5 years ago)
  • 0.16.4                                ...           ts4.2 (5 years ago)
  • 0.16.4                                ...           ts4.3 (5 years ago)
  • 0.16.4                                ...           ts4.4 (5 years ago)
  • 0.16.4                                ...           ts4.5 (5 years ago)
  • 0.16.4                                ...           ts4.6 (5 years ago)
  • 0.16.4                                ...           ts4.7 (5 years ago)
  • 0.16.4                                ...           ts4.8 (5 years ago)
  • 0.16.4                                ...           ts4.9 (5 years ago)

5 Versions

  • 0.16.4                                ...           5 years ago
  • 0.16.3                                ...           7 years ago
  • 0.16.2                                ...           7 years ago
  • 0.16.1                                ...           7 years ago
  • 0.16.0                                ...           8 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (0)
None
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |