UNPKG

graphics-ts

Version:

A porting of purescript-{canvas, free-canvas, drawing} featuring fp-ts

106 lines (105 loc) 2.77 kB
import * as O from 'fp-ts/lib/Option' import * as S from 'fp-ts/lib/Show' /** * Represents the `font-family` CSS property. * * The `font-family` CSS property specifies a prioritized list of one or more * font family names and/or generic family names for the selected element. * * @category model * @since 1.0.0 */ export declare type FontFamily = string /** * Represents optional values for modifying the style of a font. * * @see https://developer.mozilla.org/en-US/docs/Web/CSS/font * * @category model * @since 1.0.0 */ export interface FontOptions { /** * Represents the `font-style` CSS property. * * The `font-style` CSS property sets whether a font should be styled with a normal, * italic, or oblique face from its * font-family. */ readonly style: O.Option<string> /** * Represents the `font-variant` CSS property. * * The `font-variant` CSS property is a shorthand for the longhand properties `font-variant-caps`, * `font-variant-numeric`, `font-variant-alternates`, `font-variant-ligatures`, and `font-variant-east-asian`. */ readonly variant: O.Option<string> /** * Represnts the `font-weight` CSS property. * * The `font-weight` CSS property sets the weight (or boldness) of the font. */ readonly weight: O.Option<string> } /** * Represents the `font` CSS property. * * @see https://developer.mozilla.org/en-US/docs/Web/CSS/font * * @category model * @since 1.0.0 */ export interface Font { /** * Represents the `font-family` CSS property. * * The `font-family` CSS property specifies a prioritized list of one or more * font family names and/or generic family names for the selected element. */ readonly fontFamily: FontFamily /** * Represents the `font-size` CSS property. * * The `font-size` CSS property sets the size of the font. */ readonly size: number /** * Represents optional values for modifying the style of a font. */ readonly fontOptions: FontOptions } /** * Constructs a new `FontOptions` object. * * @category constructors * @since 1.0.0 */ export declare const fontOptions: ({ style, variant, weight }: { readonly style?: string | undefined readonly variant?: string | undefined readonly weight?: string | undefined }) => FontOptions /** * Constructs a new `Font`. * * @category constructors * @since 1.0.0 */ export declare const font: (fontFamily: FontFamily, size: number, options?: FontOptions | undefined) => Font /** * The `Show` instance for `FontOptions`. * * @category instances * @since 1.0.0 */ export declare const showFontOptions: S.Show<FontOptions> /** * The `Show` instance for `Font`. * * @category instances * @since 1.0.0 */ export declare const showFont: S.Show<Font>