Base
module Base| Assembly | Fable.UrlParser |
Declared inside
Helpers | |
ParseFailure | |
ParserError | |
ParserState | |
Query | |
UrlContext | |
UrlParser |
Functions and values
apply<'a> (UrlParser<'a>) (context: UrlContext) : Result<ParserState<'a>,ParseFailure>custom<'A, 'Output> (typeName: string) (tryParse: string -> 'A option) (innerParser: UrlParser<('A -> 'Output)>) : UrlParser<'Output>
custom<'A, 'Output> (typeName: string) (tryParse: string -> 'A option) (innerParser: UrlParser<('A -> 'Output)>) : UrlParser<'Output>Consume the next path segment and parse it with a custom conversion function.
This function will fail if:
- There are no remaining segments to consume.
tryParsereturnsNonefor the segment value.
| Parameter | |
|---|---|
typeName | Name reported in the error message when conversion fails, e.g. "Guid" |
tryParse | Function attempting to convert the segment string into 'A |
innerParser | Parser to apply |
Returns. The converted value of the consumed segment
int<'Output> (innerParser: UrlParser<(int -> 'Output)>) : UrlParser<'Output>
int<'Output> (innerParser: UrlParser<(int -> 'Output)>) : UrlParser<'Output>Consume the next path segment and parse it as an integer.
This function will fail if:
- There are no remaining segments to consume.
- The next segment cannot be parsed as a valid integer.
| Parameter | |
|---|---|
innerParser | Parser to apply |
Returns. The integer value of the consumed segment
makeError<'a> (depth: int) (error: ParserError) : Result<'a,ParseFailure>parse<'Output> (parsers: UrlParser<'Output> list) (context: UrlContext) : Result<'Output,ParserError>pathToUrlContext (path: string) : UrlContextsegment<'Output> (expected: string) (innerParser: UrlParser<'Output>) : UrlParser<'Output>
segment<'Output> (expected: string) (innerParser: UrlParser<'Output>) : UrlParser<'Output>Match a literal path segment.
This function will fail if:
- There are no remaining segments to consume.
- The next segment does not match
expected.
| Parameter | |
|---|---|
expected | The literal segment value to match |
innerParser | Parser to apply |
succeed<'Output> (output: 'Output) : UrlParser<'Output>