UrlParams
Combinators
Signature
declare const append: {
(key: string, value: Coercible): (self: UrlParams) => UrlParams;
(self: UrlParams, key: string, value: Coercible): UrlParams;
};Signature
declare const appendAll: {
(input: Input): (self: UrlParams) => UrlParams;
(self: UrlParams, input: Input): UrlParams;
};Signature
declare const getAll: {
(key: string): (self: UrlParams) => readonly Array<string>;
(self: UrlParams, key: string): readonly Array<string>;
}Signature
declare const getFirst: {
(key: string): (self: UrlParams) => Option<string>;
(self: UrlParams, key: string): Option<string>;
};Signature
declare const getLast: {
(key: string): (self: UrlParams) => Option<string>;
(self: UrlParams, key: string): Option<string>;
};Signature
declare const remove: {
(key: string): (self: UrlParams) => UrlParams;
(self: UrlParams, key: string): UrlParams;
};Signature
declare const set: {
(key: string, value: Coercible): (self: UrlParams) => UrlParams;
(self: UrlParams, key: string, value: Coercible): UrlParams;
};Signature
declare const setAll: {
(input: Input): (self: UrlParams) => UrlParams;
(self: UrlParams, input: Input): UrlParams;
};Constructors
Conversions
Signature
declare function makeUrl(url: string, params: UrlParams, hash: Option<string>): Either<URL, Error>;Signature
declare function toRecord(self: UrlParams): Record<string, string | Arr.NonEmptyArray<string>>;Signature
declare function toString(self: UrlParams): string;Models
Signature
type Coercible = string | number | bigint | boolean | null | undefined;CoercibleRecord interface
Added in v1.0.0
Source
Signature
interface CoercibleRecord {
[key: string]: CoercibleRecord | Coercible | readonly Array<Coercible>;
}Signature
type Input = CoercibleRecord | Iterable<readonly [string, Coercible]> | URLSearchParams;Signature
interface UrlParams extends ReadonlyArray<readonly [string, string]> {
[n: number]: readonly [string, string];
}Schema
schemaFromString
Added in v1.0.0
Source
Signature
declare const schemaFromString: Schema.Schema<UrlParams, string>;schemaJson
Added in v1.0.0
Source
Signature
declare function schemaJson<A, I, R>(
schema: any,
options?: ParseOptions,
): {
(field: string): (self: UrlParams) => Effect<A, ParseError, R>;
(self: UrlParams, field: string): Effect<A, ParseError, R>;
};schemaParse
Added in v1.0.0
Source
Signature
declare function schemaParse<A, I extends Record<string, string | readonly Array<string> | undefined>, R>(schema: any): anyschemaRecord
Added in v1.0.0
Source
Signature
declare function schemaRecord<A, I extends Record<string, string | readonly Array<string> | undefined>, R>(schema: any): anyschemaStruct
Added in v1.0.0
Source
Extract schema from all key-value pairs in the given UrlParams.
Signature
declare function schemaStruct<A, I extends Record<string, string | readonly Array<string> | undefined>, R>(schema: any, options?: ParseOptions): (self: UrlParams) => Effect<A, ParseError, R>Schemas
schemaFromSelf
Added in v1.0.0
Source
Signature
declare const schemaFromSelf: Schema.Schema<UrlParams>;
Builds a
Recordcontaining all the key-value pairs in the givenUrlParamsasstring(if only one value for a key) or aNonEmptyArray<string>(when more than one value for a key)