Module Media.Prop

Media objects properties, capabilities and constraints.

Ranges and constraints

module Bool : sig ... end

bool constraints.

module Int : sig ... end

int ranges and constraints.

module Float : sig ... end

float ranges and constraints.

module Jstr : sig ... end

Jstr constraints.

Properties

type ('a, 'b, 'c) t

The type for properties of type 'a whose capabilities are described by 'b and which are constrained by 'c.

type bool_t = (bool, bool list, Bool.Constraint.t) t

The type for boolean properties.

val bool : Jstr.t -> bool_t

bool n is a bool property named n.

type int_t = (int, Int.Range.t, Int.Constraint.t) t

The type for integer properties.

val int : Jstr.t -> int_t

int n is an integer property named n.

type float_t = (float, Float.Range.t, Float.Constraint.t) t

The type for floating point properties.

val float : Jstr.t -> float_t

float n is a float property named n.

type jstr_t = (Jstr.t, Jstr.t, Jstr.Constraint.t) t

The type for string properties.

val jstr : Jstr.t -> jstr_t

jstr n is a string property named n.

type jstr_enum_t = (Jstr.t, Jstr.t list, Jstr.Constraint.t) t

The type for string enumeration properties.

val jstr_enum : Jstr.t -> jstr_enum_t

jstr n is a string enumeration property named n.

Low-level interface

type 'a conv = ('a -> Jv.t) * (Jv.t -> 'a)

'a conv specifies encoding and decoding functions for JavaScript.

val v : Jstr.t -> 'a conv -> 'b conv -> 'c conv -> ('a, 'b, 'c) t

v v_conv cap_conv constr_conv n is a new property named n whose values are converted with v_conv, capabilities with cap_conv and constraints with constr_conv.

val name : ('a, 'b, 'c) t -> Jstr.t

name p is the name of the property.

val value_of_jv : ('a, 'b, 'c) t -> Jv.t -> 'a

of_jv p jv is the property value of p from jv.

val value_to_jv : ('a, 'b, 'c) t -> 'a -> Jv.t

to_jv p v is the JavaScript value of p for v.

val cap_of_jv : ('a, 'b, 'c) t -> Jv.t -> 'b

cap_of_jv p jv is the property capability of p from jv.

val cap_to_jv : ('a, 'b, 'c) t -> 'b -> Jv.t

cap_jv p v is the capability value of p for v.

val constr_of_jv : ('a, 'b, 'c) t -> Jv.t -> 'c

cap_of_jv p jv is the property constraint of p from jv.

val constr_to_jv : ('a, 'b, 'c) t -> 'c -> Jv.t

cap_jv p v is the cosntraint value of p for v.