Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(type): Add type definitions #19

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/**
* @param fonts - Mapbox GL Style fontstack or single font, e.g. `['Open Sans Regular', 'Arial Unicode MS Regular']` or `'Open Sans Regular'`.
* @param size - Font size in pixels.
* @param lineHeight - Line height as css line-height.
* @returns CSS font definition, e.g. `'normal 400 16px/1.2 "Open Sans"'`.
*/
function parseFont(
font: string | string[],
size: number,
lineHeight?: number | string,
): string;

export default parseFont;
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "2.4.5",
"description": "Utility to convert Mapbox GL Style font names to CSS font definitions",
"main": "index.js",
"types": "index.d.js",
"repository": {
"type": "git",
"url": "git://github.com/openlayers/mapbox-to-css-font.git"
Expand Down