forked from fable-compiler/fable-browser
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBrowser.Url.fs
More file actions
62 lines (50 loc) · 2.3 KB
/
Browser.Url.fs
File metadata and controls
62 lines (50 loc) · 2.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
namespace Browser.Types
open System
open Fable.Core
type [<Global;AllowNullLiteral>] URLSearchParams =
/// Appends a specified key/value pair as a new search parameter.
abstract append: name: string * value: string -> unit
/// Deletes the given search parameter, and its associated value, from the list of all search parameters.
abstract delete: name: string -> unit
/// Returns the first value associated to the given search parameter.
abstract get: name: string -> string option
/// Returns all the values association with a given search parameter.
abstract getAll: name: string -> array<string>
/// Returns a Boolean indicating if such a search parameter exists.
abstract has: name: string -> bool
/// Sets the value associated to a given search parameter to the given value. If there were several values, delete the others.
abstract set: name: string * value: string -> unit
type [<AllowNullLiteral>] URLSearchParamsType =
[<Emit("new $0($1...)")>]
abstract Create: arg: obj -> URLSearchParams
type [<Global;AllowNullLiteral>] URL =
abstract hash: string with get, set
abstract host: string with get, set
abstract hostname: string with get, set
abstract href: string with get, set
abstract origin: string
abstract password: string with get, set
abstract pathname: string with get, set
abstract port: string with get, set
abstract protocol: string with get, set
abstract search: string with get, set
abstract username: string with get, set
abstract searchParams: URLSearchParams
abstract toString: unit -> string
abstract toJSON: unit -> string
type [<AllowNullLiteral>] URLType =
[<Emit("new $0($1...)")>]
abstract Create: url: string * ?``base``: string -> URL
/// Returns a DOMString containing a unique blob URL, that is a URL with blob: as its scheme, followed by an opaque string uniquely identifying the object in the browser.
abstract createObjectURL: obj -> string
/// Revokes an object URL previously created using URL.createObjectURL().
abstract revokeObjectURL: string -> unit
namespace Browser
open Fable.Core
open Browser.Types
[<AutoOpen>]
module Url =
let [<Global>] URL: URLType =
jsNative
let [<Global>] URLSearchParams: URLSearchParamsType =
jsNative