stream-monaco 0.0.2 → 0.0.4
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/README.md +114 -0
- package/README.zh-CN.md +75 -0
- package/dist/index.cjs +822 -118
- package/dist/index.d.cts +6 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +822 -118
- package/package.json +5 -5
package/dist/index.d.cts
CHANGED
|
@@ -210,6 +210,7 @@ declare function registerMonacoThemes(themes: (ThemeInput | string | SpecialThem
|
|
|
210
210
|
* getEditorView: () => monaco.editor.IStandaloneCodeEditor | null,
|
|
211
211
|
* getDiffEditorView: () => monaco.editor.IStandaloneDiffEditor | null,
|
|
212
212
|
* getDiffModels: () => { original: monaco.editor.ITextModel | null, modified: monaco.editor.ITextModel | null },
|
|
213
|
+
* getCode: () => string | { original: string, modified: string } | null,
|
|
213
214
|
* }} 返回对象包含以下方法和属性:
|
|
214
215
|
*
|
|
215
216
|
* @property {Function} createEditor - 创建并挂载 Monaco 编辑器到指定容器
|
|
@@ -229,6 +230,7 @@ declare function registerMonacoThemes(themes: (ThemeInput | string | SpecialThem
|
|
|
229
230
|
* @property {Function} getEditorView - 获取当前编辑器实例
|
|
230
231
|
* @property {Function} getDiffEditorView - 获取当前 Diff 编辑器实例
|
|
231
232
|
* @property {Function} getDiffModels - 获取 Diff 的 original/modified 两个模型
|
|
233
|
+
* @property {Function} getCode - 获取当前编辑器或 Diff 编辑器中的代码内容
|
|
232
234
|
*
|
|
233
235
|
* @throws {Error} 当主题数组不是数组或长度小于2时抛出错误
|
|
234
236
|
*
|
|
@@ -277,6 +279,10 @@ declare function useMonaco(monacoOptions?: MonacoOptions): {
|
|
|
277
279
|
getMonacoInstance(): typeof monaco_shim_d_exports;
|
|
278
280
|
setUpdateThrottleMs: (ms: number) => void;
|
|
279
281
|
getUpdateThrottleMs: () => number;
|
|
282
|
+
getCode(): string | {
|
|
283
|
+
original: string;
|
|
284
|
+
modified: string;
|
|
285
|
+
} | null;
|
|
280
286
|
};
|
|
281
287
|
//#endregion
|
|
282
288
|
export { MonacoDiffEditorInstance, MonacoEditorInstance, MonacoLanguage, MonacoOptions, MonacoTheme, RevealStrategy, ShikiHighlighter, clearHighlighterCache, defaultRevealDebounceMs, detectLanguage, getOrCreateHighlighter, isDark, preloadMonacoWorkers, registerMonacoThemes, useMonaco };
|
package/dist/index.d.ts
CHANGED
|
@@ -209,6 +209,7 @@ declare function registerMonacoThemes(themes: (ThemeInput | string | SpecialThem
|
|
|
209
209
|
* getEditorView: () => monaco.editor.IStandaloneCodeEditor | null,
|
|
210
210
|
* getDiffEditorView: () => monaco.editor.IStandaloneDiffEditor | null,
|
|
211
211
|
* getDiffModels: () => { original: monaco.editor.ITextModel | null, modified: monaco.editor.ITextModel | null },
|
|
212
|
+
* getCode: () => string | { original: string, modified: string } | null,
|
|
212
213
|
* }} 返回对象包含以下方法和属性:
|
|
213
214
|
*
|
|
214
215
|
* @property {Function} createEditor - 创建并挂载 Monaco 编辑器到指定容器
|
|
@@ -228,6 +229,7 @@ declare function registerMonacoThemes(themes: (ThemeInput | string | SpecialThem
|
|
|
228
229
|
* @property {Function} getEditorView - 获取当前编辑器实例
|
|
229
230
|
* @property {Function} getDiffEditorView - 获取当前 Diff 编辑器实例
|
|
230
231
|
* @property {Function} getDiffModels - 获取 Diff 的 original/modified 两个模型
|
|
232
|
+
* @property {Function} getCode - 获取当前编辑器或 Diff 编辑器中的代码内容
|
|
231
233
|
*
|
|
232
234
|
* @throws {Error} 当主题数组不是数组或长度小于2时抛出错误
|
|
233
235
|
*
|
|
@@ -276,6 +278,10 @@ declare function useMonaco(monacoOptions?: MonacoOptions): {
|
|
|
276
278
|
getMonacoInstance(): typeof monaco_shim_d_exports;
|
|
277
279
|
setUpdateThrottleMs: (ms: number) => void;
|
|
278
280
|
getUpdateThrottleMs: () => number;
|
|
281
|
+
getCode(): string | {
|
|
282
|
+
original: string;
|
|
283
|
+
modified: string;
|
|
284
|
+
} | null;
|
|
279
285
|
};
|
|
280
286
|
//#endregion
|
|
281
287
|
export { MonacoDiffEditorInstance, MonacoEditorInstance, MonacoLanguage, MonacoOptions, MonacoTheme, RevealStrategy, ShikiHighlighter, clearHighlighterCache, defaultRevealDebounceMs, detectLanguage, getOrCreateHighlighter, isDark, preloadMonacoWorkers, registerMonacoThemes, useMonaco };
|