open Js_of_ocaml.Js module TypedObject : sig type 'a t val get : 'a t -> Jv.prop -> 'a option val get' : 'a t -> Jv.prop' -> 'a option val set : 'a t -> Jv.prop -> 'a -> unit val set' : 'a t -> Jv.prop' -> 'a -> unit end = struct type 'a t = Jv.t let get : 'a t -> Jv.prop -> 'a = fun t prop -> Jv.to_option Jv.Id.of_jv (Jv.get t prop) let get' : 'a t -> Jv.prop' -> 'a = fun t prop -> Jv.to_option Jv.Id.of_jv (Jv.get' t prop) let set : 'a t -> Jv.prop -> 'a -> unit = fun o prop v -> Jv.set o prop (Jv.Id.to_jv v) let set' : 'a t -> Jv.prop' -> 'a -> unit = fun o prop v -> Jv.set' o prop (Jv.Id.to_jv v) end class type ['a] ordered_map = object ('this) method get: Jstr.t -> 'a t opt meth method update: Jstr.t -> 'a t -> Jstr.t opt -> 'this meth method remove: Jstr.t -> 'this meth method addToStart: Jstr.t -> 'a t -> 'this meth method addToEnd: Jstr.t -> 'a t -> 'this meth end module Model = struct type domOutputSpec class type _node_props = object ('this) method inlineContent: bool readonly_prop (** True if this node type has inline content. *) method isBlock: bool readonly_prop method isText: bool readonly_prop method isInline: bool readonly_prop method isTextblock: bool readonly_prop method isLeaf: bool readonly_prop method isAtom: bool readonly_prop end class type mark = object ('this) method eq: 'this t -> bool t meth method isInSet: mark t js_array t -> mark t opt meth end type node_spec type content_match type slice type depth = int opt class type resolved_pos = object ('this) method pos: int readonly_prop method depth: int readonly_prop method parent: node t readonly_prop method doc: node t readonly_prop method node: depth -> node t meth method index: depth -> int meth method after: depth -> int meth method nodeAfter: node t opt readonly_prop method nodeBefore: node t opt readonly_prop method marks: unit -> mark t js_array t meth method sameParent: 'this -> bool t meth method max: 'this -> 'this t meth method min: 'this -> 'this t meth end and mark_spec = object ('this) method toDOM: (node t -> domOutputSpec t) callback prop method inclusive: bool t prop method spanning: bool t prop end and schema_spec = object ('this) method nodes: node_spec ordered_map t readonly_prop method marks: mark_spec ordered_map t readonly_prop method topNode: Jstr.t opt readonly_prop end and schema = object ('this) method spec: schema_spec t prop method nodes: node_type t TypedObject.t readonly_prop method marks: mark_type t TypedObject.t readonly_prop method typoNodeType: node_type t readonly_prop method text: Jstr.t -> node t meth method node: Jstr.t -> < .. > t opt -> fragment t opt -> mark t js_array t opt -> node t meth method mark_type: mark_type t -> < .. > t opt -> mark t meth end and node_type = object ('this) inherit _node_props method name: Jstr.t readonly_prop method schema: schema t readonly_prop method spec: node_spec t readonly_prop method contentMatch: content_match t readonly_prop method hasRequiredAttrs: unit -> bool t meth method create_withFragment: < .. > t -> fragment t opt -> mark t opt -> node t meth end (** Signature for MarkType class https://prosemirror.net/docs/ref/#model.MarkType *) and mark_type = object ('this) method name: Jstr.t readonly_prop method schema: schema t readonly_prop method spec: mark_spec t readonly_prop method isInSet: mark t js_array t -> mark t opt meth end (** Common signature between fragment and node *) and _element = object ('this) method childCount: int readonly_prop (** The number of children that the node has. *) method child: int -> node t meth (** Get the child node at the given index. Raise an error when the index is out of range. *) method maybeChild: int -> node t opt meth (** Get the child node at the given index, if it exists. *) method eq: 'this t -> bool t meth (** Compare this element to another one. *) method cut: int -> int opt -> 'this meth (** Cut out the element between the two given positions. *) method toString: unit -> Jstr.t meth (** Return a debugging string that describes this element. *) method forEach: (node t -> int -> int) -> unit meth end and fragment = object ('this) inherit _element method size: int readonly_prop (** The size of the fragment, which is the total of the size of its content nodes. *) method append: 'this t -> 'this t meth method lastChild: node t opt readonly_prop method firstChild: node t opt readonly_prop end and node = object ('this) inherit _element inherit _node_props method _type: node_type t readonly_prop method attrs: < .. > t prop method content: fragment t prop method copy: fragment t -> 'this t meth method resolve: int -> resolved_pos t meth method nodeAt: int -> 'this t opt meth method marks: mark t js_array t readonly_prop method sameMarkupd: node t -> bool t meth method text: Jstr.t opt prop end end module Transform = struct type step_result class type step = object ('this) end class type replace_step = object ('this) inherit step end class type replace_around_step = object ('this) inherit step end class type add_mark_step = object ('this) inherit step end class type transform = object ('this) method doc: Model.node t readonly_prop method steps: step t js_array t readonly_prop method docs: Model.node t js_array t readonly_prop method step: step t -> 'this t meth method addMark: from:int -> to_:int -> Model.mark t -> 'this t meth method delete: from:int -> to_:int -> 'this t meth method insert: pos:int -> Model.node t -> 'this t meth method replaceRangeWith: from:int -> to_:int -> Model.node t -> 'this t meth method setBlockType: from:int -> to_:int -> Model.node_type t -> < .. > t -> 'this t meth end end module Classes = struct (** View *) class type editor_props = object ('this) method editable: (editor_state t -> bool t) callback prop end and direct_editor_props = object ('this) inherit editor_props method state: editor_state t writeonly_prop (** The call back is called with this = instance of editor_view *) method dispatchTransaction: (editor_view t, transaction t -> unit) meth_callback writeonly_prop end and editor_view = object ('this) method state: editor_state t readonly_prop method dom: Brr.El.t readonly_prop prop method editable: bool t readonly_prop method props: direct_editor_props t readonly_prop method update: direct_editor_props t -> unit meth method setProps: direct_editor_props t -> unit meth method updateState: editor_state t -> unit meth method posAtCoords: < left: float prop ; top: float prop > t -> < pos: int prop; inside: int prop> t meth method coordsAtPos: int -> int opt -> < left: float prop; right: float prop; top: float prop; bottom: float prop > t meth method dispatch: transaction t -> unit meth end (** State *) and plugin = object ('this) method props : editor_props t opt prop method view: (editor_view t -> < .. > t) callback opt prop method filterTransaction: (transaction t -> editor_state t -> bool t) opt prop end and selection = object ('this) method from: int readonly_prop method _to: int readonly_prop method empty: bool t readonly_prop method eq: 'this t -> bool t meth method content: unit -> Model.slice t meth method replace: transaction t -> Model.slice t -> unit meth method replaceWith: transaction t -> Model.node t -> unit meth end and text_selection = object ('this) inherit selection end and node_selection = object ('this) inherit selection end and transaction = object ('this) inherit Transform.transform method time: int readonly_prop method setTime: int -> 'this t meth method storedMarks: Model.mark t js_array t opt readonly_prop method setStoredMarks: Model.mark t js_array t opt -> 'this t meth method addStoredMark: Model.mark t -> 'this t meth method removeStoredMark_mark: Model.mark t -> 'this t meth method removeStoredMark_marktype: Model.mark_type t -> 'this t meth method ensureMarks: Model.mark t js_array t -> 'this t meth method storedMarksSet: bool readonly_prop method selection: selection t readonly_prop method setSelection: selection t -> 'this t meth method deleteSelection: 'this t meth method replaceSelection: Model.slice t -> 'this t meth method replaceSelectionWith: Model.node t -> bool t -> 'this t meth method selectionSet: bool readonly_prop method before: Model.node t readonly_prop method insertText: Jstr.t -> from:int opt -> to_:int opt -> 'this t meth method scrollIntoView : unit -> 'this t meth end and configuration_prop = object ('this) method schema: Model.schema t opt prop method plugins: plugin t js_array t opt prop end and creation_prop = object ('this) inherit configuration_prop method doc: Model.node t opt prop method selection: selection t opt prop method storedMarks: Model.mark t js_array t opt prop end and editor_state = object ('this) method doc : Model.node t readonly_prop method selection: selection t readonly_prop method storedMarks: Model.mark t js_array t opt readonly_prop method schema: Model.schema t readonly_prop method plugins: plugin t js_array t readonly_prop method apply: transaction t -> 'this t meth method tr: transaction t readonly_prop method reconfigure: configuration_prop t meth method toJSON: unit -> Brr.Json.t meth end end module State = struct class type plugin = Classes.plugin class type selection = Classes.selection class type text_selection = Classes.text_selection class type node_selection = Classes.node_selection class type transaction = Classes.transaction class type configuration_prop = Classes.configuration_prop class type creation_prop = Classes.creation_prop class type editor_state = Classes.editor_state type dispatch = (Classes.transaction t -> unit) end module View = struct class type editor_props = Classes.editor_props class type direct_editor_props = Classes.direct_editor_props class type editor_view = Classes.editor_view end module History = struct class type history_prop = object ('this) method depth: int opt prop method newGroupDelay: int opt prop end end module SchemaBasic = struct class type nodes = object ('this) method doc: Model.node_spec t prop method paragraph: Model.node_spec t prop method blockquote: Model.node_spec t prop method horizontal_rule: Model.node_spec t prop method heading: Model.node_spec t prop method code_block: Model.node_spec t prop method text: Model.node_spec t prop method image: Model.node_spec t prop method hard_break: Model.node_spec t prop end class type marks = object ('this) method link: Model.mark_spec t prop method em: Model.mark_spec t prop method strong: Model.mark_spec t prop method code: Model.mark_spec t prop end end module Example = struct class type options = object ('this) method schema: Model.schema t prop method menuBar: bool t opt prop method floatingMenu: bool t opt prop method history: bool t opt prop end end