mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-10-18 04:21:32 +08:00
refactor: katex.d.ts -> typings-external.ts
This way the .d.ts will not be deleted when filse are deleted through rimraf
This commit is contained in:
parent
7bd6a7f57c
commit
8b7c6354ea
@ -1,4 +1,4 @@
|
||||
import type { KatexOptions } from './katex';
|
||||
import type { KatexOptions } from './typings-external';
|
||||
|
||||
declare module '@ckeditor/ckeditor5-core' {
|
||||
interface EditorConfig {
|
||||
|
@ -1,14 +1,17 @@
|
||||
interface MathJax3 {
|
||||
/**
|
||||
* Basic typings for third party, external libraries (KaTeX, MathJax).
|
||||
*/
|
||||
export interface MathJax3 {
|
||||
version: string;
|
||||
tex2chtmlPromise?: ( input: string, options: { display: boolean } ) => Promise<HTMLElement>;
|
||||
tex2svgPromise?: ( input: string, options: { display: boolean } ) => Promise<HTMLElement>;
|
||||
}
|
||||
|
||||
interface MathJax2 {
|
||||
export interface MathJax2 {
|
||||
Hub: { Queue: ( callback: [string, MathJax2['Hub'], string | HTMLElement] | ( () => void ) ) => void };
|
||||
}
|
||||
|
||||
interface Katex {
|
||||
export interface Katex {
|
||||
render( equation: string, el: HTMLElement, options: KatexOptions ): void;
|
||||
}
|
||||
|
@ -16,7 +16,7 @@ import { Locale, FocusTracker, KeystrokeHandler } from 'ckeditor5/src/utils';
|
||||
import { extractDelimiters, hasDelimiters } from '../utils';
|
||||
import MathView from './mathview';
|
||||
import '../../theme/mathform.css';
|
||||
import type { KatexOptions } from '../katex';
|
||||
import type { KatexOptions } from '../typings-external';
|
||||
|
||||
const { check: checkIcon, cancel: cancelIcon } = icons;
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { View } from 'ckeditor5/src/ui';
|
||||
import type { KatexOptions } from '../typings-external';
|
||||
import { renderEquation } from '../utils';
|
||||
import type { Locale } from 'ckeditor5/src/utils';
|
||||
import type { KatexOptions } from '../katex';
|
||||
|
||||
export default class MathView extends View {
|
||||
public value: string;
|
||||
|
@ -5,7 +5,7 @@ import type {
|
||||
} from 'ckeditor5/src/engine';
|
||||
import { BalloonPanelView } from 'ckeditor5/src/ui';
|
||||
import { CKEditorError, type PositioningFunction } from 'ckeditor5/src/utils';
|
||||
import type { KatexOptions, MathJax2, MathJax3 } from './katex';
|
||||
import type { KatexOptions, MathJax2, MathJax3 } from './typings-external';
|
||||
|
||||
export function getSelectedMathModelWidget(
|
||||
selection: DocumentSelection
|
||||
|
Loading…
x
Reference in New Issue
Block a user