1 | import { Token } from '@lumino/coreutils';
|
2 | import { CommandRegistry } from '@lumino/commands';
|
3 | import { ICommandPalette } from '@jupyterlab/apputils';
|
4 | import { ISignal } from '@lumino/signaling';
|
5 | import { INotebookTracker, NotebookPanel } from '@jupyterlab/notebook';
|
6 | import { Menu } from '@lumino/widgets';
|
7 | import * as SCHEMA from './schema';
|
8 | import '../style/index.css';
|
9 | export declare type Scope = 'global' | 'notebook';
|
10 | export declare enum TextKind {
|
11 | code = "code",
|
12 | content = "content"
|
13 | }
|
14 | export declare const KIND_LABELS: {
|
15 | [key in TextKind]: string;
|
16 | };
|
17 | export declare enum FontFormat {
|
18 | woff2 = "woff2",
|
19 | woff = "woff"
|
20 | }
|
21 | export declare type TFontMimeTypes = {
|
22 | [key in FontFormat]: string;
|
23 | };
|
24 | export declare const FONT_FORMATS: {
|
25 | woff2: string;
|
26 | woff: string;
|
27 | };
|
28 | export declare type TextProperty = 'font-family' | 'font-size' | 'line-height';
|
29 | export interface IFontCallback {
|
30 | (): Promise<SCHEMA.IFontFacePrimitive[]>;
|
31 | }
|
32 | export interface IFontLicense {
|
33 | name: string;
|
34 | spdx: string;
|
35 | text: () => Promise<string>;
|
36 | holders: string[];
|
37 | }
|
38 | export interface IFontFaceOptions {
|
39 | name: string;
|
40 | faces: IFontCallback;
|
41 | license: IFontLicense;
|
42 | }
|
43 | export declare const CMD: {
|
44 | code: {
|
45 | fontSize: string;
|
46 | fontFamily: string;
|
47 | lineHeight: string;
|
48 | };
|
49 | content: {
|
50 | fontSize: string;
|
51 | fontFamily: string;
|
52 | lineHeight: string;
|
53 | };
|
54 | editFonts: string;
|
55 | customFonts: {
|
56 | disable: string;
|
57 | enable: string;
|
58 | };
|
59 | };
|
60 | export declare const ROOT = ":root";
|
61 | export declare type ICSSVars = {
|
62 | [key in TextKind]: {
|
63 | [key in TextProperty]: SCHEMA.ICSSOM;
|
64 | };
|
65 | };
|
66 | export declare const CSS: ICSSVars;
|
67 | export declare type ICSSTextOptions = {
|
68 | [key in TextProperty]: (manager: IFontManager) => SCHEMA.ICSSOM[];
|
69 | };
|
70 | export declare const TEXT_OPTIONS: ICSSTextOptions;
|
71 | export declare type ICSSTextLabels = {
|
72 | [key in TextProperty]: string;
|
73 | };
|
74 | export declare const TEXT_LABELS: ICSSTextLabels;
|
75 | export declare const DEFAULT: {
|
76 | code: {
|
77 | fontSize: string;
|
78 | lineHeight: string;
|
79 | fontFamily: string;
|
80 | };
|
81 | };
|
82 | export declare const PACKAGE_NAME: string;
|
83 | export declare const CONFIGURED_CLASS = "jp-fonts-configured";
|
84 | export declare const IFontManager: Token<IFontManager>;
|
85 | export interface IFontManagerConstructor {
|
86 | new (commands: CommandRegistry, palette: ICommandPalette, notebooks: INotebookTracker): IFontManager;
|
87 | }
|
88 | export interface IFontManager {
|
89 | ready: Promise<void>;
|
90 | registerFontFace(options: IFontFaceOptions): void;
|
91 | licensePaneRequested: ISignal<IFontManager, any>;
|
92 | requestLicensePane(font: any): void;
|
93 | fonts: Map<string, IFontFaceOptions>;
|
94 | stylesheets: HTMLStyleElement[];
|
95 | menu: Menu;
|
96 | getVarName(property: TextProperty, options: ITextStyleOptions): SCHEMA.ICSSOM | null;
|
97 | getTextStyle(property: TextProperty, options: ITextStyleOptions): SCHEMA.ICSSOM | null;
|
98 | setTextStyle(property: TextProperty, value: SCHEMA.ICSSOM | null, options: ITextStyleOptions): void;
|
99 | dataURISrc(url: string, format: FontFormat): Promise<string>;
|
100 | }
|
101 | export interface ITextStyleOptions {
|
102 | kind: TextKind;
|
103 | scope?: Scope;
|
104 | notebook?: NotebookPanel;
|
105 | }
|