sig
type json = Data.json
type kind = [ `EXEC | `GET | `SET ]
module type Input =
sig
type t
val syntax : Syntax.t
val of_json : Request.json -> Request.Input.t
end
module type Output =
sig
type t
val syntax : Syntax.t
val to_json : Request.Output.t -> Request.json
end
type 'a input = (module Request.Input with type t = 'a)
type 'b output = (module Request.Output with type t = 'b)
val register :
page:Doc.page ->
kind:Request.kind ->
name:string ->
descr:Markdown.text ->
?details:Markdown.block ->
input:'a Request.input -> output:'b Request.output -> ('a -> 'b) -> unit
type ('a, 'b) signature
val signature :
page:Doc.page ->
kind:Request.kind ->
name:string ->
descr:Markdown.text ->
?details:Markdown.block ->
?input:'a Request.input ->
?output:'b Request.output -> unit -> ('a, 'b) Request.signature
type rq
type 'a param = Request.rq -> 'a
type 'b result = Request.rq -> 'b -> unit
val register_sig :
('a, 'b) Request.signature -> (Request.rq -> 'a -> 'b) -> unit
val param :
(unit, 'b) Request.signature ->
name:string ->
descr:Markdown.text ->
?default:'a -> 'a Request.input -> 'a Request.param
val param_opt :
(unit, 'b) Request.signature ->
name:string ->
descr:Markdown.text -> 'a Request.input -> 'a option Request.param
val result :
('a, unit) Request.signature ->
name:string ->
descr:Markdown.text ->
?default:'b -> 'b Request.output -> 'b Request.result
val result_opt :
('a, unit) Request.signature ->
name:string ->
descr:Markdown.text -> 'b Request.output -> 'b option Request.result
end