Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions components/bin/build
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@ function processGlobal() {
);
makeDir('');
fs.writeFileSync(path.join(LIB, COMPONENT + '.js'), lines.join('\n') + '\n');
fs.writeFileSync(path.join(LIB, COMPONENT + '.d.ts'), 'export {};\n');
}

/**
Expand Down
8 changes: 8 additions & 0 deletions components/bin/pack
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,14 @@ async function webpackLib(dir) {
.concat(list.filter(a => a.slice(2, 4) !== './').sort())
.join('\n')
);
if (!config.noDTS) {
const dts = config.dist
? path.resolve(dir, config.dist, path.basename(config.name) + '.d.ts')
: path.resolve(jsPath, '..', bundle, config.name + '.d.ts');
if (!fs.existsSync(dts)) {
fs.writeFileSync(dts, `export {}`);
}
}
} catch (err) {
console.error(err);
}
Expand Down
2 changes: 2 additions & 0 deletions components/json.d.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export function json(file: string): any;
export function require(file: string): any;
2 changes: 2 additions & 0 deletions components/json.d.cts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export function json(file: string): any;
export function require(file: string): any;
1 change: 1 addition & 0 deletions components/mjs/a11y/assistive-mml/assistive-mml.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
1 change: 1 addition & 0 deletions components/mjs/a11y/complexity/complexity.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
1 change: 1 addition & 0 deletions components/mjs/a11y/explorer/explorer.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
1 change: 1 addition & 0 deletions components/mjs/a11y/semantic-enrich/semantic-enrich.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
1 change: 1 addition & 0 deletions components/mjs/a11y/speech/speech.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
1 change: 1 addition & 0 deletions components/mjs/a11y/sre/sre.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
1 change: 1 addition & 0 deletions components/mjs/a11y/sre/worker/speech-worker.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
1 change: 1 addition & 0 deletions components/mjs/a11y/util.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
1 change: 1 addition & 0 deletions components/mjs/adaptors/jsdom/jsdom.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
1 change: 1 addition & 0 deletions components/mjs/adaptors/linkedom/linkedom.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
1 change: 1 addition & 0 deletions components/mjs/adaptors/liteDOM/liteDOM.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
1 change: 1 addition & 0 deletions components/mjs/core/core.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
1 change: 1 addition & 0 deletions components/mjs/core/locale.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
12 changes: 12 additions & 0 deletions components/mjs/dependencies.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
export const dependencies: {
[component: string]: string[];
};
export const paths: {
[path: string]: string;
};
export const provides: {
[component: string]: string[];
};
export const compatibility: {
[component: string]: string;
};
1 change: 1 addition & 0 deletions components/mjs/input/asciimath/asciimath.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
1 change: 1 addition & 0 deletions components/mjs/input/mml/entities/entities.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
1 change: 1 addition & 0 deletions components/mjs/input/mml/extensions/mml3/mml3.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
2 changes: 2 additions & 0 deletions components/mjs/input/mml/init.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import {MathML} from '@mathjax/src/mjs/input/mathml.js';
export {MathML};
1 change: 1 addition & 0 deletions components/mjs/input/mml/mml.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
1 change: 1 addition & 0 deletions components/mjs/input/tex-base/tex-base.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
1 change: 1 addition & 0 deletions components/mjs/input/tex/extension.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export function fontExtension(id: string, name: string, pkg?: string): void;
1 change: 1 addition & 0 deletions components/mjs/input/tex/extensions/action/action.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
1 change: 1 addition & 0 deletions components/mjs/input/tex/extensions/ams/ams.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
1 change: 1 addition & 0 deletions components/mjs/input/tex/extensions/amscd/amscd.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
1 change: 1 addition & 0 deletions components/mjs/input/tex/extensions/autoload/autoload.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
1 change: 1 addition & 0 deletions components/mjs/input/tex/extensions/bbm/bbm.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
1 change: 1 addition & 0 deletions components/mjs/input/tex/extensions/bboldx/bboldx.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
1 change: 1 addition & 0 deletions components/mjs/input/tex/extensions/bbox/bbox.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
1 change: 1 addition & 0 deletions components/mjs/input/tex/extensions/braket/braket.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
1 change: 1 addition & 0 deletions components/mjs/input/tex/extensions/cancel/cancel.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
1 change: 1 addition & 0 deletions components/mjs/input/tex/extensions/cases/cases.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
1 change: 1 addition & 0 deletions components/mjs/input/tex/extensions/color/color.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
1 change: 1 addition & 0 deletions components/mjs/input/tex/extensions/colortbl/colortbl.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
1 change: 1 addition & 0 deletions components/mjs/input/tex/extensions/colorv2/colorv2.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
1 change: 1 addition & 0 deletions components/mjs/input/tex/extensions/dsfont/dsfont.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
1 change: 1 addition & 0 deletions components/mjs/input/tex/extensions/empheq/empheq.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
1 change: 1 addition & 0 deletions components/mjs/input/tex/extensions/enclose/enclose.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
1 change: 1 addition & 0 deletions components/mjs/input/tex/extensions/extpfeil/extpfeil.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
1 change: 1 addition & 0 deletions components/mjs/input/tex/extensions/gensymb/gensymb.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
1 change: 1 addition & 0 deletions components/mjs/input/tex/extensions/html/html.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
1 change: 1 addition & 0 deletions components/mjs/input/tex/extensions/mhchem/mhchem.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
1 change: 1 addition & 0 deletions components/mjs/input/tex/extensions/noerrors/noerrors.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
1 change: 1 addition & 0 deletions components/mjs/input/tex/extensions/physics/physics.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
1 change: 1 addition & 0 deletions components/mjs/input/tex/extensions/require/require.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
1 change: 1 addition & 0 deletions components/mjs/input/tex/extensions/texhtml/texhtml.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
1 change: 1 addition & 0 deletions components/mjs/input/tex/extensions/textcomp/textcomp.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
1 change: 1 addition & 0 deletions components/mjs/input/tex/extensions/unicode/unicode.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
1 change: 1 addition & 0 deletions components/mjs/input/tex/extensions/units/units.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
1 change: 1 addition & 0 deletions components/mjs/input/tex/extensions/upgreek/upgreek.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
1 change: 1 addition & 0 deletions components/mjs/input/tex/extensions/verb/verb.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
1 change: 1 addition & 0 deletions components/mjs/input/tex/register.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export function registerTex(packageList?: string[], tex?: boolean): void;
1 change: 1 addition & 0 deletions components/mjs/input/tex/tex.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
1 change: 1 addition & 0 deletions components/mjs/loader/loader.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
1 change: 1 addition & 0 deletions components/mjs/mml-chtml-nofont/mml-chtml-nofont.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
1 change: 1 addition & 0 deletions components/mjs/mml-chtml/mml-chtml.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
1 change: 1 addition & 0 deletions components/mjs/mml-svg-nofont/mml-svg-nofont.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
1 change: 1 addition & 0 deletions components/mjs/mml-svg/mml-svg.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
7 changes: 5 additions & 2 deletions components/mjs/node-main/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@
"copy": [
"node-main.mjs",
"node-main.cjs",
"node-main-setup.cjs"
"node-main-setup.cjs",
"node-main.d.mts",
"node-main.d.cts"
]
},
"webpack": {
"name": "node-main"
"name": "node-main",
"noDTS": true
}
}
7 changes: 7 additions & 0 deletions components/mjs/node-main/node-main.d.cts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { EMPTY } from '@mathjax/src/mjs/types/Types.js';
import { COMPONENT_LIST } from '@mathjax/src/mjs/types/mjx.js';
import { LITE_DOM, MATHJAX_CONFIG, MATHJAX_OBJECT } from '@mathjax/src/mjs/types/dom/lite.js';

export function init<T extends COMPONENT_LIST<LITE_DOM> = EMPTY>(
config: MATHJAX_CONFIG<T | 'startup'>
): Promise<MATHJAX_OBJECT<T | 'startup'>>;
7 changes: 7 additions & 0 deletions components/mjs/node-main/node-main.d.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { EMPTY } from '@mathjax/src/mjs/types/Types.js';
import { COMPONENT_LIST } from '@mathjax/src/mjs/types/mjx.js';
import { LITE_DOM, MATHJAX_CONFIG, MATHJAX_OBJECT } from '@mathjax/src/mjs/types/dom/lite.js';

export function init<T extends COMPONENT_LIST<LITE_DOM> = EMPTY>(
config: MATHJAX_CONFIG<T | 'startup'>
): Promise<MATHJAX_OBJECT<T | 'startup'>>;
1 change: 1 addition & 0 deletions components/mjs/output/chtml/chtml.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export function loadFont(startup: (ready: () => void) => Promise<void>, preload: boolean): Promise<void>;
1 change: 0 additions & 1 deletion components/mjs/output/chtml/chtml.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,3 @@ OutputUtil.config('chtml', CHTML, fontName, DefaultFont);
export function loadFont(startup, preload) {
return OutputUtil.loadFont(startup, 'chtml', fontName, preload);
}

1 change: 1 addition & 0 deletions components/mjs/output/svg/svg.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export function loadFont(startup: (ready: () => void) => Promise<void>, preload: boolean): Promise<void>;
1 change: 0 additions & 1 deletion components/mjs/output/svg/svg.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,3 @@ OutputUtil.config('svg', SVG, fontName, DefaultFont);
export function loadFont(startup, preload) {
return OutputUtil.loadFont(startup, 'svg', fontName, preload);
}

35 changes: 35 additions & 0 deletions components/mjs/output/util.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { OutputJax } from '@mathjax/src/mjs/core/OutputJax.js';
import { Font } from '@mathjax/src/mjs/output/common/FontData.js';

export function configFont(
font: string,
jax: string,
config: { fontPath?: string },
extension?: string,
): string;

export function configExtensions(
jax: string,
config: {
fontExtensions?: string[];
fontPath?: string;
},
): string[];

export const OutputUtil: {

config<N = any, T = any, D = any>(
jax: string,
jaxClass: OutputJax<N, T, D>,
defaultFont: Font,
fontClass: any,
): void,

loadFont(
startup: (ready: () => void) => Promise<void>,
jax: string,
font: string,
preloaded?: boolean,
): Promise<void>;

};
4 changes: 3 additions & 1 deletion components/mjs/require/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
"from": "../..",
"copy": [
"require.mjs",
"json.cjs"
"require.d.mts",
"json.cjs",
"json.d.cts"
]
}
}
3 changes: 3 additions & 0 deletions components/mjs/source.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export const source: {
[component: string]: string;
}
1 change: 1 addition & 0 deletions components/mjs/startup/hasown.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
1 change: 1 addition & 0 deletions components/mjs/startup/init.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export function startup(ready: () => Promise<void>): Promise<void>;
1 change: 1 addition & 0 deletions components/mjs/startup/startup.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
1 change: 1 addition & 0 deletions components/mjs/tex-chtml-nofont/tex-chtml-nofont.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
1 change: 1 addition & 0 deletions components/mjs/tex-chtml/tex-chtml.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
1 change: 1 addition & 0 deletions components/mjs/tex-mml-chtml/tex-mml-chtml.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
1 change: 1 addition & 0 deletions components/mjs/tex-mml-svg-nofont/tex-mml-svg-nofont.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
1 change: 1 addition & 0 deletions components/mjs/tex-mml-svg/tex-mml-svg.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
1 change: 1 addition & 0 deletions components/mjs/tex-svg-nofont/tex-svg-nofont.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
1 change: 1 addition & 0 deletions components/mjs/tex-svg/tex-svg.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
1 change: 1 addition & 0 deletions components/mjs/ui/lazy/lazy.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
1 change: 1 addition & 0 deletions components/mjs/ui/menu/menu.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
1 change: 1 addition & 0 deletions components/mjs/ui/no-dark-mode/no-dark-mode.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
1 change: 1 addition & 0 deletions components/mjs/ui/safe/safe.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
4 changes: 2 additions & 2 deletions testsuite/src/setupTex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ export function setupTex(
Locale.setLocale();
const html = new HTMLDocument('', adaptor, { InputJax: tex });
convert = (expr: string, display: boolean) =>
toMathML(html.convert(expr, { display: display, end: STATE.CONVERT }));
toMathML(html.convert(expr, { display: display, end: STATE.CONVERT }) as MmlNode);
}

/**
Expand Down Expand Up @@ -235,7 +235,7 @@ export function setupTexWithOutput(
const visitor = new SerializedMmlVisitor();
const toMathML = (node: MmlNode) => visitor.visitTree(node);
convert = (expr: string, display: boolean) =>
toMathML(html.convert(expr, { display: display, end: STATE.CONVERT }));
toMathML(html.convert(expr, { display: display, end: STATE.CONVERT }) as MmlNode);
}

/*********************************************************************/
Expand Down
Loading