this repo has no description

tessera-geotessera-jsoo: scaffold with sync XHR fetch

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

+79
+13
tessera-geotessera-jsoo/dune-project
···
··· 1 + (lang dune 3.17) 2 + (name tessera-geotessera-jsoo) 3 + (generate_opam_files true) 4 + (license ISC) 5 + (package 6 + (name tessera-geotessera-jsoo) 7 + (synopsis "Browser fetch for tessera-geotessera") 8 + (description "Synchronous XHR-based fetch for GeoTessera tile retrieval in web workers.") 9 + (depends 10 + (ocaml (>= 5.2)) 11 + (tessera-geotessera (>= 0.1)) 12 + (js_of_ocaml (>= 5.0)) 13 + (js_of_ocaml-ppx (>= 5.0))))
+5
tessera-geotessera-jsoo/lib/dune
···
··· 1 + (library 2 + (name geotessera_jsoo) 3 + (public_name tessera-geotessera-jsoo) 4 + (libraries tessera-geotessera js_of_ocaml) 5 + (preprocess (pps js_of_ocaml-ppx)))
+18
tessera-geotessera-jsoo/lib/geotessera_jsoo.ml
···
··· 1 + open Js_of_ocaml 2 + 3 + let fetch url = 4 + let x = XmlHttpRequest.create () in 5 + x##.responseType := Js.string "arraybuffer"; 6 + x##_open (Js.string "GET") (Js.string url) Js._false; 7 + x##send Js.null; 8 + match x##.status with 9 + | 200 -> 10 + Js.Opt.case 11 + (File.CoerceTo.arrayBuffer x##.response) 12 + (fun () -> failwith ("Failed to read response from " ^ url)) 13 + (fun b -> Typed_array.String.of_arrayBuffer b) 14 + | code -> 15 + failwith (Printf.sprintf "HTTP %d fetching %s" code url) 16 + 17 + let fetch_mosaic ?base_url ?version ~year bbox = 18 + Geotessera.fetch_mosaic_sync ~fetch ?base_url ?version ~year bbox
+15
tessera-geotessera-jsoo/lib/geotessera_jsoo.mli
···
··· 1 + (** Browser-compatible fetch for GeoTessera tiles. 2 + 3 + Provides synchronous HTTP GET via XMLHttpRequest for use in web workers, 4 + and a convenience wrapper around {!Geotessera.fetch_mosaic_sync}. *) 5 + 6 + val fetch : string -> string 7 + (** Synchronous HTTP GET via XMLHttpRequest. 8 + Returns the response body as a string. 9 + @raise Failure on non-200 status or if response cannot be read. *) 10 + 11 + val fetch_mosaic : ?base_url:string -> ?version:string -> year:int -> 12 + Geotessera.bbox -> Linalg.mat * int * int 13 + (** Fetch and assemble tiles for a bounding box using browser XHR. 14 + Convenience wrapper around {!Geotessera.fetch_mosaic_sync} 15 + with {!fetch} as the fetch function. *)
+28
tessera-geotessera-jsoo/tessera-geotessera-jsoo.opam
···
··· 1 + # This file is generated by dune, edit dune-project instead 2 + opam-version: "2.0" 3 + synopsis: "Browser fetch for tessera-geotessera" 4 + description: 5 + "Synchronous XHR-based fetch for GeoTessera tile retrieval in web workers." 6 + license: "ISC" 7 + depends: [ 8 + "dune" {>= "3.17"} 9 + "ocaml" {>= "5.2"} 10 + "tessera-geotessera" {>= "0.1"} 11 + "js_of_ocaml" {>= "5.0"} 12 + "js_of_ocaml-ppx" {>= "5.0"} 13 + "odoc" {with-doc} 14 + ] 15 + build: [ 16 + ["dune" "subst"] {dev} 17 + [ 18 + "dune" 19 + "build" 20 + "-p" 21 + name 22 + "-j" 23 + jobs 24 + "@install" 25 + "@runtest" {with-test} 26 + "@doc" {with-doc} 27 + ] 28 + ]