codemirror-editor-vue3
Advanced tools
Comparing version
@@ -74,3 +74,3 @@ import type { Ref, PropType } from "vue"; | ||
onCursorActivity: ((instance: Editor) => any) | undefined; | ||
onKeyHandled: ((instance: Editor, name: string, event: Event) => any) | undefined; | ||
onKeyHandled: ((instance: Editor, name: string, eventObj: Event) => any) | undefined; | ||
onInputRead: ((instance: Editor, changeObj: import("codemirror").EditorChange) => any) | undefined; | ||
@@ -83,8 +83,8 @@ onElectricInput: ((instance: Editor, line: number) => any) | undefined; | ||
onGutterContextMenu: ((instance: Editor, line: number, gutter: string, contextMenuEvent: MouseEvent) => any) | undefined; | ||
onFocus: ((instance: Editor, event: FocusEvent) => any) | undefined; | ||
onBlur: ((instance: Editor, event: FocusEvent) => any) | undefined; | ||
onFocus: ((instance: Editor, eventObj: FocusEvent) => any) | undefined; | ||
onBlur: ((instance: Editor, eventObj: FocusEvent) => any) | undefined; | ||
onScroll: ((instance: Editor) => any) | undefined; | ||
onRefresh: ((instance: Editor) => any) | undefined; | ||
onOptionChange: ((instance: Editor, option: keyof EditorConfiguration) => any) | undefined; | ||
onScrollCursorIntoView: ((instance: Editor, event: Event) => any) | undefined; | ||
onScrollCursorIntoView: ((instance: Editor, eventObj: Event) => any) | undefined; | ||
onUpdate: ((instance: Editor) => any) | undefined; | ||
@@ -110,3 +110,3 @@ onRenderLine: ((instance: Editor, lineHandle: import("codemirror").LineHandle, element: HTMLElement) => any) | undefined; | ||
}>; | ||
emit: ((event: "change", value: string, cm: Editor) => void) & ((event: "changes", instance: Editor, changes: import("codemirror").EditorChange[]) => void) & ((event: "beforeChange", instance: Editor, changeObj: import("codemirror").EditorChangeCancellable) => void) & ((event: "cursorActivity", instance: Editor) => void) & ((event: "keyHandled", instance: Editor, name: string, event: Event) => void) & ((event: "inputRead", instance: Editor, changeObj: import("codemirror").EditorChange) => void) & ((event: "electricInput", instance: Editor, line: number) => void) & ((event: "beforeSelectionChange", instance: Editor, obj: import("codemirror").EditorSelectionChange) => void) & ((event: "viewportChange", instance: Editor, from: number, to: number) => void) & ((event: "swapDoc", instance: Editor, oldDoc: import("codemirror").Doc) => void) & ((event: "gutterClick", instance: Editor, line: number, gutter: string, clickEvent: Event) => void) & ((event: "gutterContextMenu", instance: Editor, line: number, gutter: string, contextMenuEvent: MouseEvent) => void) & ((event: "focus", instance: Editor, event: FocusEvent) => void) & ((event: "blur", instance: Editor, event: FocusEvent) => void) & ((event: "scroll", instance: Editor) => void) & ((event: "refresh", instance: Editor) => void) & ((event: "optionChange", instance: Editor, option: keyof EditorConfiguration) => void) & ((event: "scrollCursorIntoView", instance: Editor, event: Event) => void) & ((event: "update", instance: Editor) => void) & ((event: "renderLine", instance: Editor, lineHandle: import("codemirror").LineHandle, element: HTMLElement) => void) & ((event: "overwriteToggle", instance: Editor, overwrite: boolean) => void) & ((event: "update:value", value: string) => void) & ((event: "input", value: string) => void) & ((event: "ready", cm: Editor) => void); | ||
emit: ((event: "change", value: string, cm: Editor) => void) & ((event: "changes", instance: Editor, changes: import("codemirror").EditorChange[]) => void) & ((event: "beforeChange", instance: Editor, changeObj: import("codemirror").EditorChangeCancellable) => void) & ((event: "cursorActivity", instance: Editor) => void) & ((event: "keyHandled", instance: Editor, name: string, eventObj: Event) => void) & ((event: "inputRead", instance: Editor, changeObj: import("codemirror").EditorChange) => void) & ((event: "electricInput", instance: Editor, line: number) => void) & ((event: "beforeSelectionChange", instance: Editor, obj: import("codemirror").EditorSelectionChange) => void) & ((event: "viewportChange", instance: Editor, from: number, to: number) => void) & ((event: "swapDoc", instance: Editor, oldDoc: import("codemirror").Doc) => void) & ((event: "gutterClick", instance: Editor, line: number, gutter: string, clickEvent: Event) => void) & ((event: "gutterContextMenu", instance: Editor, line: number, gutter: string, contextMenuEvent: MouseEvent) => void) & ((event: "focus", instance: Editor, eventObj: FocusEvent) => void) & ((event: "blur", instance: Editor, eventObj: FocusEvent) => void) & ((event: "scroll", instance: Editor) => void) & ((event: "refresh", instance: Editor) => void) & ((event: "optionChange", instance: Editor, option: keyof EditorConfiguration) => void) & ((event: "scrollCursorIntoView", instance: Editor, eventObj: Event) => void) & ((event: "update", instance: Editor) => void) & ((event: "renderLine", instance: Editor, lineHandle: import("codemirror").LineHandle, element: HTMLElement) => void) & ((event: "overwriteToggle", instance: Editor, overwrite: boolean) => void) & ((event: "update:value", value: string) => void) & ((event: "input", value: string) => void) & ((event: "ready", cm: Editor) => void); | ||
cminstance: Ref<{ | ||
@@ -632,3 +632,3 @@ hasFocus: () => boolean; | ||
destroy: () => void; | ||
containerHeight: Ref<Nullable<string>>; | ||
containerHeight: Ref<string | null>; | ||
reviseStyle: () => void; | ||
@@ -644,3 +644,3 @@ listenerEvents: () => void; | ||
cursorActivity: (instance: Editor) => void; | ||
keyHandled: (instance: Editor, name: string, event: Event) => void; | ||
keyHandled: (instance: Editor, name: string, eventObj: Event) => void; | ||
inputRead: (instance: Editor, changeObj: import("codemirror").EditorChange) => void; | ||
@@ -653,8 +653,8 @@ electricInput: (instance: Editor, line: number) => void; | ||
gutterContextMenu: (instance: Editor, line: number, gutter: string, contextMenuEvent: MouseEvent) => void; | ||
focus: (instance: Editor, event: FocusEvent) => void; | ||
blur: (instance: Editor, event: FocusEvent) => void; | ||
focus: (instance: Editor, eventObj: FocusEvent) => void; | ||
blur: (instance: Editor, eventObj: FocusEvent) => void; | ||
scroll: (instance: Editor) => void; | ||
refresh: (instance: Editor) => void; | ||
optionChange: (instance: Editor, option: keyof EditorConfiguration) => void; | ||
scrollCursorIntoView: (instance: Editor, event: Event) => void; | ||
scrollCursorIntoView: (instance: Editor, eventObj: Event) => void; | ||
update: (instance: Editor) => void; | ||
@@ -703,3 +703,3 @@ renderLine: (instance: Editor, lineHandle: import("codemirror").LineHandle, element: HTMLElement) => void; | ||
onCursorActivity?: ((instance: Editor) => any) | undefined; | ||
onKeyHandled?: ((instance: Editor, name: string, event: Event) => any) | undefined; | ||
onKeyHandled?: ((instance: Editor, name: string, eventObj: Event) => any) | undefined; | ||
onInputRead?: ((instance: Editor, changeObj: import("codemirror").EditorChange) => any) | undefined; | ||
@@ -712,8 +712,8 @@ onElectricInput?: ((instance: Editor, line: number) => any) | undefined; | ||
onGutterContextMenu?: ((instance: Editor, line: number, gutter: string, contextMenuEvent: MouseEvent) => any) | undefined; | ||
onFocus?: ((instance: Editor, event: FocusEvent) => any) | undefined; | ||
onBlur?: ((instance: Editor, event: FocusEvent) => any) | undefined; | ||
onFocus?: ((instance: Editor, eventObj: FocusEvent) => any) | undefined; | ||
onBlur?: ((instance: Editor, eventObj: FocusEvent) => any) | undefined; | ||
onScroll?: ((instance: Editor) => any) | undefined; | ||
onRefresh?: ((instance: Editor) => any) | undefined; | ||
onOptionChange?: ((instance: Editor, option: keyof EditorConfiguration) => any) | undefined; | ||
onScrollCursorIntoView?: ((instance: Editor, event: Event) => any) | undefined; | ||
onScrollCursorIntoView?: ((instance: Editor, eventObj: Event) => any) | undefined; | ||
onUpdate?: ((instance: Editor) => any) | undefined; | ||
@@ -720,0 +720,0 @@ onRenderLine?: ((instance: Editor, lineHandle: import("codemirror").LineHandle, element: HTMLElement) => any) | undefined; |
@@ -21,3 +21,3 @@ import type { PropType } from "vue"; | ||
cminstance: { | ||
type: PropType<Nullable<Editor>>; | ||
type: PropType<Editor | null>; | ||
default: () => null; | ||
@@ -33,4 +33,4 @@ }; | ||
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, { | ||
ready: (instance: Editor) => Nullable<Editor>; | ||
"update:cminstance": (instance: Editor) => Nullable<Editor>; | ||
ready: (instance: Editor) => Editor | null; | ||
"update:cminstance": (instance: Editor) => Editor | null; | ||
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{ | ||
@@ -49,3 +49,3 @@ name?: unknown; | ||
content: string; | ||
cminstance: Nullable<Editor>; | ||
cminstance: Editor | null; | ||
} & {}> & { | ||
@@ -60,4 +60,4 @@ onReady?: ((instance: Editor) => any) | undefined; | ||
content: string; | ||
cminstance: Nullable<Editor>; | ||
cminstance: Editor | null; | ||
}>; | ||
export default _default; |
@@ -17,3 +17,3 @@ import type { PropType } from "vue"; | ||
cminstance: { | ||
type: PropType<Nullable<Editor>>; | ||
type: PropType<Editor | null>; | ||
default: () => {}; | ||
@@ -39,3 +39,3 @@ }; | ||
name: string; | ||
cminstance: Nullable<Editor>; | ||
cminstance: Editor | null; | ||
} & {}> & { | ||
@@ -49,4 +49,4 @@ onReady?: ((...args: any[]) => any) | undefined; | ||
name: string; | ||
cminstance: Nullable<Editor>; | ||
cminstance: Editor | null; | ||
}>; | ||
export default _default; |
@@ -9,3 +9,3 @@ import type { Editor, EditorConfiguration } from "codemirror"; | ||
cminstance: { | ||
type: PropType<Nullable<Editor>>; | ||
type: PropType<Editor | null>; | ||
default: () => {}; | ||
@@ -21,3 +21,3 @@ }; | ||
options: EditorConfiguration; | ||
cminstance: Nullable<Editor>; | ||
cminstance: Editor | null; | ||
} & {}> & { | ||
@@ -28,4 +28,4 @@ onReady?: ((...args: any[]) => any) | undefined; | ||
options: EditorConfiguration; | ||
cminstance: Nullable<Editor>; | ||
cminstance: Editor | null; | ||
}>; | ||
export default _default; |
import { Editor, EditorEventMap } from "codemirror"; | ||
export declare type EditorEventNames = Exclude<keyof EditorEventMap, "change">; | ||
interface EditorEventMapWithChange extends EditorEventMap { | ||
keyHandled: (instance: Editor, name: string, eventObj: Event) => void; | ||
focus: (instance: Editor, eventObj: FocusEvent) => void; | ||
blur: (instance: Editor, eventObj: FocusEvent) => void; | ||
scrollCursorIntoView: (instance: Editor, eventObj: Event) => void; | ||
} | ||
export interface ComponentEventMap { | ||
@@ -14,3 +20,3 @@ "update:value": (value: string) => string; | ||
export declare const cmEvts: EditorEventNames[]; | ||
export declare const getCmEvts: () => Pick<EditorEventMap, Exclude<keyof EditorEventMap, "change">>; | ||
export declare const getCmEvts: () => Pick<EditorEventMapWithChange, EditorEventNames>; | ||
export declare const emitOptions: { | ||
@@ -20,3 +26,3 @@ changes: (instance: Editor, changes: import("codemirror").EditorChange[]) => void; | ||
cursorActivity: (instance: Editor) => void; | ||
keyHandled: (instance: Editor, name: string, event: Event) => void; | ||
keyHandled: (instance: Editor, name: string, eventObj: Event) => void; | ||
inputRead: (instance: Editor, changeObj: import("codemirror").EditorChange) => void; | ||
@@ -29,8 +35,8 @@ electricInput: (instance: Editor, line: number) => void; | ||
gutterContextMenu: (instance: Editor, line: number, gutter: string, contextMenuEvent: MouseEvent) => void; | ||
focus: (instance: Editor, event: FocusEvent) => void; | ||
blur: (instance: Editor, event: FocusEvent) => void; | ||
focus: (instance: Editor, eventObj: FocusEvent) => void; | ||
blur: (instance: Editor, eventObj: FocusEvent) => void; | ||
scroll: (instance: Editor) => void; | ||
refresh: (instance: Editor) => void; | ||
optionChange: (instance: Editor, option: keyof import("codemirror").EditorConfiguration) => void; | ||
scrollCursorIntoView: (instance: Editor, event: Event) => void; | ||
scrollCursorIntoView: (instance: Editor, eventObj: Event) => void; | ||
update: (instance: Editor) => void; | ||
@@ -54,1 +60,2 @@ renderLine: (instance: Editor, lineHandle: import("codemirror").LineHandle, element: HTMLElement) => void; | ||
}; | ||
export {}; |
@@ -9,3 +9,3 @@ import type { Editor } from "codemirror"; | ||
emit: ((event: "ready", cm: Editor) => void) & ((event: "update:value", value: string) => void) & ((event: "change", value: string, cm: Editor) => void) & ((event: "input", value: string) => void) & ((event: string, ...args: any[]) => void); | ||
internalInstance: Nullable<ComponentInternalInstance>; | ||
internalInstance: ComponentInternalInstance | null; | ||
content: Ref<string>; | ||
@@ -12,0 +12,0 @@ }; |
@@ -7,6 +7,6 @@ import type { Ref } from "vue"; | ||
props: CmProps; | ||
cminstance: Ref<Nullable<Editor | MergeView>>; | ||
presetRef: Ref<Nullable<{ | ||
cminstance: Ref<Editor | MergeView | null>; | ||
presetRef: Ref<{ | ||
initialize: () => void; | ||
}>>; | ||
} | null>; | ||
}; | ||
@@ -18,4 +18,4 @@ export declare function useViewControl({ props, cminstance, presetRef, }: UseViewControlParams): { | ||
destroy: () => void; | ||
containerHeight: Ref<Nullable<string>>; | ||
containerHeight: Ref<string | null>; | ||
reviseStyle: () => void; | ||
}; |
import { EditorConfiguration } from "codemirror"; | ||
export declare interface CmProps { | ||
value: string; | ||
options?: EditorConfiguration; | ||
globalOptions?: EditorConfiguration; | ||
placeholder?: string; | ||
border?: boolean; | ||
width: string | number | null; | ||
height: string | number | null; | ||
keepCursorInEnd: boolean; | ||
merge?: boolean; | ||
name?: string; | ||
marker?: () => HTMLElement; | ||
/* Consult: https://codemirror.net/doc/manual.html#option_gutters */ | ||
unseenLines?: Array<any>; | ||
value: string; | ||
options?: EditorConfiguration; | ||
globalOptions?: EditorConfiguration; | ||
placeholder?: string; | ||
border?: boolean; | ||
width: string | number | null; | ||
height: string | number | null; | ||
keepCursorInEnd: boolean; | ||
merge?: boolean; | ||
name?: string; | ||
marker?: () => HTMLElement; | ||
unseenLines?: Array<any>; | ||
} |
{ | ||
"name": "codemirror-editor-vue3", | ||
"description": "CodeMirror component for Vue3", | ||
"version": "2.1.4", | ||
"version": "2.1.5", | ||
"license": "MIT", | ||
@@ -6,0 +6,0 @@ "files": [ |
98171
0.3%1984
0.3%