Module Service_worker.Clients

Clients objects.

type query_opts

The type for query options.

val query_opts : ?⁠include_uncontrolled:bool -> ?⁠type':Client.Type.t -> unit -> query_opts

query_opts ~include_uncontrolled ~type' () are query options with the given properties.

type t

The type for Clients objects.

val get : t -> Jstr.t -> Client.t option Fut.or_error

get cs id is a client matching id (if any).

val match_all : ?⁠query_opts:query_opts -> t -> Client.t list Fut.or_error

match_all cs ~query_opts are clients matching query_opts.

val open_window : t -> Jstr.t -> Client.Window.t option Fut.or_error

open_window cs uri opens a window on uri.

val claim : t -> unit Fut.or_error

claim cs sets the calling service worker as a controller for all clients in its scope.