Skip to content

Add TrustContext type to TypeScript definitions - #132

Open
Mathias-S wants to merge 1 commit into
ronkok:mainfrom
Mathias-S:add-TrustContext-type
Open

Add TrustContext type to TypeScript definitions#132
Mathias-S wants to merge 1 commit into
ronkok:mainfrom
Mathias-S:add-TrustContext-type

Conversation

@Mathias-S

@Mathias-S Mathias-S commented May 22, 2026

Copy link
Copy Markdown

Thank you for a very useful library!

This PR replaces the any type in the trust option callback with a proper discriminated union TrustContext type covering all supported commands (\class, \id, \style, \data, \includegraphics).

The type name and definition mirrors KaTeX's TrustContext type: https://github.com/KaTeX/KaTeX/blob/main/types/katex.d.ts

Replaces the `any` type in the `trust` option callback with a proper
discriminated union `TrustContext` type covering all supported
commands (`\class`, `\id`, `\style`, `\data`, `\includegraphics`).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant