Module External_ffi_types

type module_bind_name =
  1. | Phint_name of string
  2. | Phint_nothing
type external_module_name = {
  1. bundle : string;
  2. module_bind_name : module_bind_name;
}
type pipe = bool
type arg_type = External_arg_spec.attr
type arg_label = External_arg_spec.label
type external_spec =
  1. | Js_var of {
    1. name : string;
    2. external_module_name : external_module_name option;
    3. scopes : string list;
    }
  2. | Js_module_as_var of external_module_name
  3. | Js_module_as_fn of {
    1. external_module_name : external_module_name;
    2. splice : bool;
    }
  4. | Js_module_as_class of external_module_name
  5. | Js_call of {
    1. name : string;
    2. external_module_name : external_module_name option;
    3. splice : bool;
    4. scopes : string list;
    }
  6. | Js_send of {
    1. name : string;
    2. splice : bool;
    3. pipe : pipe;
    4. js_send_scopes : string list;
    }
  7. | Js_new of {
    1. name : string;
    2. external_module_name : external_module_name option;
    3. splice : bool;
    4. scopes : string list;
    }
  8. | Js_set of {
    1. js_set_name : string;
    2. js_set_scopes : string list;
    }
  9. | Js_get of {
    1. js_get_name : string;
    2. js_get_scopes : string list;
    }
  10. | Js_get_index of {
    1. js_get_index_scopes : string list;
    }
  11. | Js_set_index of {
    1. js_set_index_scopes : string list;
    }
type return_wrapper =
  1. | Return_unset
  2. | Return_identity
  3. | Return_undefined_to_opt
  4. | Return_null_to_opt
  5. | Return_null_undefined_to_opt
  6. | Return_replaced_with_unit
type params =
  1. | Params of External_arg_spec.params
  2. | Param_number of int
type t = private
  1. | Ffi_bs of params * return_wrapper * external_spec
  2. | Ffi_obj_create of External_arg_spec.obj_params
  3. | Ffi_inline_const of Lam_constant.t
  4. | Ffi_normal
val check_ffi : ?loc:Melange_compiler_libs.Location.t -> external_spec -> bool
val to_string : t -> string
val from_string : string -> t

Note

val inline_string_primitive : string -> string option -> string list
val inline_bool_primitive : bool -> string list
val inline_int_primitive : int32 -> string list
val inline_int64_primitive : int64 -> string list
val inline_float_primitive : string -> string list
val ffi_bs_as_prims : External_arg_spec.params -> return_wrapper -> external_spec -> string list
val ffi_obj_create : External_arg_spec.obj_params -> t
val ffi_obj_as_prims : External_arg_spec.obj_params -> string list