mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
chore: format
This commit is contained in:
92
nativescript-core/ui/styling/font.d.ts
vendored
92
nativescript-core/ui/styling/font.d.ts
vendored
@@ -1,61 +1,77 @@
|
||||
export class Font {
|
||||
public static default: Font;
|
||||
public static default: Font;
|
||||
|
||||
public fontFamily: string;
|
||||
public fontStyle: FontStyle;
|
||||
public fontWeight: FontWeight;
|
||||
public fontSize: number;
|
||||
public fontFamily: string;
|
||||
public fontStyle: FontStyle;
|
||||
public fontWeight: FontWeight;
|
||||
public fontSize: number;
|
||||
|
||||
public isBold: boolean;
|
||||
public isItalic: boolean;
|
||||
public isBold: boolean;
|
||||
public isItalic: boolean;
|
||||
|
||||
constructor(family: string, size: number, style: FontStyle, weight: FontWeight);
|
||||
constructor(
|
||||
family: string,
|
||||
size: number,
|
||||
style: FontStyle,
|
||||
weight: FontWeight
|
||||
);
|
||||
|
||||
public getAndroidTypeface(): any /* android.graphics.Typeface */;
|
||||
public getUIFont(defaultFont: any /* UIFont */): any /* UIFont */;
|
||||
public getAndroidTypeface(): any /* android.graphics.Typeface */;
|
||||
public getUIFont(defaultFont: any /* UIFont */): any /* UIFont */;
|
||||
|
||||
public withFontFamily(family: string): Font;
|
||||
public withFontStyle(style: string): Font;
|
||||
public withFontWeight(weight: string): Font;
|
||||
public withFontSize(size: number): Font;
|
||||
public withFontFamily(family: string): Font;
|
||||
public withFontStyle(style: string): Font;
|
||||
public withFontWeight(weight: string): Font;
|
||||
public withFontSize(size: number): Font;
|
||||
|
||||
public static equals(value1: Font, value2: Font): boolean;
|
||||
public static equals(value1: Font, value2: Font): boolean;
|
||||
}
|
||||
|
||||
export type FontStyle = "normal" | "italic";
|
||||
export namespace FontStyle {
|
||||
export const NORMAL: "normal";
|
||||
export const ITALIC: "italic";
|
||||
export function isValid(value: any): boolean;
|
||||
export function parse(value: string): FontStyle;
|
||||
export const NORMAL: "normal";
|
||||
export const ITALIC: "italic";
|
||||
export function isValid(value: any): boolean;
|
||||
export function parse(value: string): FontStyle;
|
||||
}
|
||||
|
||||
export type FontWeight = "100" | "200" | "300" | "normal" | "400" | "500" | "600" | "bold" | "700" | "800" | "900";
|
||||
export type FontWeight =
|
||||
| "100"
|
||||
| "200"
|
||||
| "300"
|
||||
| "normal"
|
||||
| "400"
|
||||
| "500"
|
||||
| "600"
|
||||
| "bold"
|
||||
| "700"
|
||||
| "800"
|
||||
| "900";
|
||||
export namespace FontWeight {
|
||||
export const THIN: "100";
|
||||
export const EXTRA_LIGHT: "200";
|
||||
export const LIGHT: "300";
|
||||
export const NORMAL: "normal";
|
||||
export const MEDIUM: "500";
|
||||
export const SEMI_BOLD: "600";
|
||||
export const BOLD: "bold";
|
||||
export const EXTRA_BOLD: "800";
|
||||
export const BLACK: "900";
|
||||
export function isValid(value: any): boolean;
|
||||
export function parse(value: string): FontWeight;
|
||||
export const THIN: "100";
|
||||
export const EXTRA_LIGHT: "200";
|
||||
export const LIGHT: "300";
|
||||
export const NORMAL: "normal";
|
||||
export const MEDIUM: "500";
|
||||
export const SEMI_BOLD: "600";
|
||||
export const BOLD: "bold";
|
||||
export const EXTRA_BOLD: "800";
|
||||
export const BLACK: "900";
|
||||
export function isValid(value: any): boolean;
|
||||
export function parse(value: string): FontWeight;
|
||||
}
|
||||
|
||||
export interface ParsedFont {
|
||||
fontStyle?: FontStyle;
|
||||
fontVariant?: string;
|
||||
fontWeight?: FontWeight,
|
||||
lineHeight?: string,
|
||||
fontSize?: string,
|
||||
fontFamily?: string
|
||||
fontStyle?: FontStyle;
|
||||
fontVariant?: string;
|
||||
fontWeight?: FontWeight;
|
||||
lineHeight?: string;
|
||||
fontSize?: string;
|
||||
fontFamily?: string;
|
||||
}
|
||||
|
||||
export function parseFont(fontValue: string): ParsedFont;
|
||||
|
||||
export module ios {
|
||||
export function registerFont(fontFile: string);
|
||||
export function registerFont(fontFile: string);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user