Skip to content

Commit

Permalink
Export Token and State types from index.d.ts
Browse files Browse the repository at this point in the history
This makes it possible to accurately declare callback functions that take these types.
  • Loading branch information
nex3 authored Sep 4, 2024
1 parent b10a72e commit 4e6b760
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions types/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import MarkdownIt from 'markdown-it';
import Token from 'markdown-it/lib/token.mjs';
import State from 'markdown-it/lib/rules_core/state_core.mjs';
import Token as JSToken from 'markdown-it/lib/token.mjs';
import State as JSState from 'markdown-it/lib/rules_core/state_core.mjs';

declare namespace anchor {
export type Token = JSToken;
export type State = JSState;
export type RenderHref = (slug: string, state: State) => string;
export type RenderAttrs = (slug: string, state: State) => Record<string, string | number>;

Expand Down

0 comments on commit 4e6b760

Please sign in to comment.