type statement = {sid : int;text : string;children : statement list;
}type t = {statements : statement list;next_sid : int;
}val of_outline : (int * string) list -> tval number : t -> int -> string optionval name_of : string -> string optionval find : t -> string -> int optiontype where = | After| Down| Up
val insert : t -> target:int -> where -> string -> t * intval set_text : t -> int -> string -> tval delete : t -> int -> tval move : t -> int -> target:int -> where -> t optionval copy : t -> int -> target:int -> where -> t optionval visible : t -> levels:int option -> (statement * int) listval links : string -> (int * int * string) listval word_at : string -> int -> (int * int) option