mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
1 parent
e810eab39f
commit
b7974827d2
786 files changed
+14567
-24066
No files matched your search
Vendored
+44
@@ -0,0 +1,44 @@
|
||||
// https://www.w3.org/TR/css-font-loading/
|
||||
// https://developer.mozilla.org/en-US/docs/Web/API/FontFace
|
||||
export {}
|
||||
|
||||
declare global {
|
||||
const FontFace: FontFace;
|
||||
|
||||
interface Document {
|
||||
fonts: FontFaceSet
|
||||
}
|
||||
|
||||
type CSSOMString = string;
|
||||
type FontFaceLoadStatus = 'unloaded' | 'loading' | 'loaded' | 'error';
|
||||
type FontFaceSetStatus = 'loading' | 'loaded';
|
||||
|
||||
interface FontFace extends FontFaceDescriptors {
|
||||
new(family: string, source: string | ArrayBuffer, descriptors?: FontFaceDescriptors): FontFace;
|
||||
readonly status: FontFaceLoadStatus;
|
||||
readonly loaded: Promise<FontFace>;
|
||||
variationSettings: CSSOMString;
|
||||
display: CSSOMString;
|
||||
load(): Promise<FontFace>;
|
||||
}
|
||||
|
||||
interface FontFaceDescriptors {
|
||||
family: CSSOMString;
|
||||
style: CSSOMString;
|
||||
weight: CSSOMString;
|
||||
stretch: CSSOMString;
|
||||
unicodeRange: CSSOMString;
|
||||
variant: CSSOMString;
|
||||
featureSettings: CSSOMString;
|
||||
}
|
||||
|
||||
interface FontFaceSet extends Iterable<FontFace> {
|
||||
readonly status: FontFaceSetStatus;
|
||||
readonly ready: Promise<FontFaceSet>;
|
||||
add(font: FontFace): void;
|
||||
check(font: string, text?: string): Boolean; // might not work, throws exception
|
||||
load(font: string, text?: string): Promise<FontFace[]>
|
||||
delete(font: FontFace): void;
|
||||
clear(): void;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user