From f4a59ed2811d4dca2daad58d083078c01488dd11 Mon Sep 17 00:00:00 2001 From: Sébastien Dailly Date: Mon, 7 Feb 2022 15:54:32 +0100 Subject: Added prosemirror deps --- editor/prosemirror/bindings.ml | 98 ++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 94 insertions(+), 4 deletions(-) (limited to 'editor/prosemirror/bindings.ml') diff --git a/editor/prosemirror/bindings.ml b/editor/prosemirror/bindings.ml index d2ef2e6..08db819 100755 --- a/editor/prosemirror/bindings.ml +++ b/editor/prosemirror/bindings.ml @@ -1,14 +1,53 @@ open Js_of_ocaml.Js +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 mark - type schema + type node_spec + + type mark_spec - type content_match + class type schema_spec = object ('this) - type node_spec + 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 + + class type schema = object ('this) + + method spec: + schema_spec t prop + + end + + type content_match type slice @@ -43,7 +82,7 @@ module Model = struct inherit _node_props method name: - string readonly_prop + Jstr.t readonly_prop method schema: schema t readonly_prop @@ -363,6 +402,57 @@ module View = struct 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 History = struct class type history_prop = object ('this) -- cgit v1.2.3