char/avril
(wip) why'd you have to go and make things so complicaaaaated?
git clone https://git.t4t.associates/char/avril
bf382b3
main
1declare module"ext:core/ops" { 2export type URLParts = [ 3href :string , 4origin :string , 5protocol :string , 6username :string , 7password :string , 8host :string , 9hostname :string , 10port :string , 11pathname :string , 12search :string , 13hash :string , 14]; 15export type URLComponent = 16| "href" 17| "protocol" 18| "username" 19| "password" 20| "host" 21| "hostname" 22| "port" 23| "pathname" 24| "search" 25| "hash" ; 26export type SearchPair = [ name :string , value :string ]; 27 28export function op_url_parse ( args :[ input :string , base :string | null ]) :URLParts | null ; 29// Non-href setters retain the original URL when a component cannot be changed. 30export function op_url_set ( args :[ href :string , component :Exclude < URLComponent , "href" >, value :string ]) :URLParts ; 31export function op_url_set ( args :[ href :string , component :URLComponent , value :string ]) :URLParts | null ; 32export function op_url_search_parse ( query :string ) :SearchPair []; 33export function op_url_search_serialize ( pairs :readonly SearchPair []) :string ; 34}