this repo has no description
1(** Lightweight findlib for the browser.
2
3 Parses META files fetched over HTTP and manages package loading
4 for the js_of_ocaml toplevel worker. *)
5
6(** Opaque type representing a loaded set of findlib libraries. *)
7type t
8
9(** Initialize findlib by fetching and parsing a findlib_index file.
10 Follows universe links to transitively load all META files. *)
11val init :
12 (string -> (string, [ `Msg of string ]) result Lwt.t) ->
13 string ->
14 t Lwt.t
15
16(** Fetch dynamic CMI information from the given URL. *)
17val fetch_dynamic_cmis :
18 (string -> string option) ->
19 string ->
20 (Js_top_worker.Impl.dynamic_cmis, [ `Msg of string ]) result
21
22(** Load the named packages and their transitive dependencies.
23 Returns the dynamic CMI descriptors for all newly loaded packages. *)
24val require :
25 import_scripts:(string list -> unit) ->
26 (string -> string option) ->
27 bool ->
28 t ->
29 string list ->
30 Js_top_worker.Impl.dynamic_cmis list
31
32(** Find the dynamic_cmis.json URL for a named package.
33 Returns [None] if the package is not in the library list. *)
34val find_dcs_url : t -> string -> string option
35
36(** Raised when a package's modules are all present in the Symtable
37 but their CRCs don't match the universe version. *)
38exception Crc_mismatch of string
39
40(** Check whether a package is already linked into the worker binary
41 by testing its toplevel modules against the Symtable.
42
43 @raise Crc_mismatch if the package is linked but CRCs don't match. *)
44val is_package_preloaded : Js_top_worker.Impl.dynamic_cmis -> bool