@incremark/react 0.3.0 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +7 -2
- package/dist/index.js +1146 -289
- package/package.json +9 -6
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IncremarkParserOptions, AnimationEffect, TransformerPlugin, ParsedBlock, Root, IncrementalUpdate, IncremarkParser, SourceBlock, TransformerOptions, DisplayBlock, BlockTransformer } from '@incremark/core';
|
|
2
2
|
export { AnimationEffect, BlockTransformer, DisplayBlock, IncrementalUpdate, ParsedBlock, ParserOptions, Root, RootContent, SourceBlock, TransformerOptions, TransformerPlugin, TransformerState, allPlugins, cloneNode, codeBlockPlugin, countChars, createBlockTransformer, createPlugin, defaultPlugins, imagePlugin, mathPlugin, mermaidPlugin, sliceAst, thematicBreakPlugin } from '@incremark/core';
|
|
3
3
|
import React$1, { ReactNode, ComponentType } from 'react';
|
|
4
4
|
import { Definition, FootnoteDefinition, RootContent, PhrasingContent } from 'mdast';
|
|
@@ -110,7 +110,7 @@ interface TypewriterOptions {
|
|
|
110
110
|
/** 自定义插件 */
|
|
111
111
|
plugins?: TransformerPlugin[];
|
|
112
112
|
}
|
|
113
|
-
interface UseIncremarkOptions extends
|
|
113
|
+
interface UseIncremarkOptions extends IncremarkParserOptions {
|
|
114
114
|
/** 打字机配置,传入即创建 transformer(可通过 enabled 控制是否启用) */
|
|
115
115
|
typewriter?: TypewriterOptions;
|
|
116
116
|
}
|
|
@@ -199,6 +199,8 @@ declare function useIncremark(options?: UseIncremarkOptions): {
|
|
|
199
199
|
reset: () => void;
|
|
200
200
|
/** 一次性渲染(reset + append + finalize) */
|
|
201
201
|
render: (content: string) => IncrementalUpdate;
|
|
202
|
+
/** 更新解析器配置(动态更新,不需要重建实例) */
|
|
203
|
+
updateOptions: (newOptions: Partial<IncremarkParserOptions>) => void;
|
|
202
204
|
/** 解析器实例 */
|
|
203
205
|
parser: IncremarkParser;
|
|
204
206
|
/** 打字机控制 */
|
|
@@ -303,6 +305,9 @@ interface UseLocaleReturn {
|
|
|
303
305
|
/** 翻译函数 */
|
|
304
306
|
t: (key: string) => string;
|
|
305
307
|
}
|
|
308
|
+
/**
|
|
309
|
+
* 使用 locale
|
|
310
|
+
*/
|
|
306
311
|
declare function useLocale(): UseLocaleReturn;
|
|
307
312
|
|
|
308
313
|
type ComponentMap = Partial<Record<string, ComponentType<{
|