Open Mister-Hope opened 1 month ago
Removed plugin-markdown-image.d.ts
and plugin-markdown-math.d.ts
, and migrated to types.d.ts
, as well as exported it by name.
Users can import types in the following ways:
/// <reference types="@vuepress/plugin-markdown-image/types" />
/// <reference types="@vuepress/plugin-markdown-math/types" />
export default {
markdown: {
image: {},
math: {},
}
}
I am expecting these types can be automatically loaded when users are importing those plugins.
Can we do that by importing the reference inside the node entrance?
I am expecting these types can be automatically loaded when users are importing those plugins.
Can we do that by importing the reference inside the node entrance?
Currently, this is the only way to ensure the correct extension of typescript types.
Cc @meteorlxy , So I think we might need a string unknown for markdown, or a new generic for defineUserConfig
declare module
should be allowed in a common .ts
file (not only in .d.ts
files).
Here's an example: https://github.com/mdit-vue/mdit-vue/blob/0a1eb8580499aa7d0db6ea7c14fad58717448fbb/packages/plugin-sfc/src/types.ts#L78
Pull Request Test Coverage Report for Build 9124427441
Details
💛 - Coveralls