diff --git a/types/index.d.ts b/types/index.d.ts index bb6d58a..7658832 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -1,10 +1,8 @@ -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 MarkdownIt, {StateCore, Token} from 'markdown-it'; declare namespace anchor { - export type RenderHref = (slug: string, state: State) => string; - export type RenderAttrs = (slug: string, state: State) => Record; + export type RenderHref = (slug: string, state: StateCore) => string; + export type RenderAttrs = (slug: string, state: StateCore) => Record; export interface PermalinkOptions { class?: string, @@ -37,7 +35,7 @@ declare namespace anchor { placement?: 'before' | 'after' } - export type PermalinkGenerator = (slug: string, opts: PermalinkOptions, state: State, index: number) => void; + export type PermalinkGenerator = (slug: string, opts: PermalinkOptions, state: StateCore, index: number) => void; export interface AnchorInfo { slug: string; @@ -48,7 +46,7 @@ declare namespace anchor { level?: number | number[]; slugify?(str: string): string; - slugifyWithState?(str: string, state: State): string; + slugifyWithStateCore?(str: string, state: StateCore): string; getTokensText?(tokens: Token[]): string; uniqueSlugStartIndex?: number;