UNPKG

2.08 kBTypeScriptView Raw
1import { Font as FontDefinition } from './font';
2import { ParsedFont } from './font-interfaces';
3export * from './font-interfaces';
4export declare abstract class Font implements FontDefinition {
5 readonly fontFamily: string;
6 readonly fontSize: number;
7 readonly fontStyle: FontStyleType;
8 readonly fontWeight: FontWeightType;
9 readonly fontScale: number;
10 static default: any;
11 get isItalic(): boolean;
12 get isBold(): boolean;
13 protected constructor(fontFamily: string, fontSize: number, fontStyle: FontStyleType, fontWeight: FontWeightType, fontScale: number);
14 abstract getAndroidTypeface(): any;
15 abstract getUIFont(defaultFont: any): any;
16 abstract withFontFamily(family: string): Font;
17 abstract withFontStyle(style: string): Font;
18 abstract withFontWeight(weight: string): Font;
19 abstract withFontSize(size: number): Font;
20 abstract withFontScale(scale: number): Font;
21 static equals(value1: Font, value2: Font): boolean;
22}
23export declare type FontStyleType = 'normal' | 'italic';
24export declare namespace FontStyle {
25 const NORMAL = "normal";
26 const ITALIC = "italic";
27 const isValid: (value: any) => value is FontStyleType;
28 const parse: (value: any) => FontStyleType;
29}
30export declare type FontWeightType = '100' | '200' | '300' | 'normal' | '400' | '500' | '600' | 'bold' | '700' | '800' | '900';
31export declare namespace FontWeight {
32 const THIN = "100";
33 const EXTRA_LIGHT = "200";
34 const LIGHT = "300";
35 const NORMAL = "normal";
36 const MEDIUM = "500";
37 const SEMI_BOLD = "600";
38 const BOLD = "bold";
39 const EXTRA_BOLD = "800";
40 const BLACK = "900";
41 const isValid: (value: any) => value is FontWeightType;
42 const parse: (value: any) => FontWeightType;
43}
44export declare function parseFontFamily(value: string): Array<string>;
45export declare namespace genericFontFamilies {
46 const serif = "serif";
47 const sansSerif = "sans-serif";
48 const monospace = "monospace";
49 const system = "system";
50}
51export declare function parseFont(fontValue: string): ParsedFont;