Type Alias: Parser<T>
ts
type Parser<T> = object;Defined in: parser/parsers.ts:31
Turns the string a source holds into a value and back. It determines the type of the ref a composable returns.
Type Parameters
| Type Parameter |
|---|
T |
Properties
parse
ts
parse: (raw) => T | null;Defined in: parser/parsers.ts:33
Returns the value, or null for a string the parser does not accept.
Parameters
| Parameter | Type |
|---|---|
raw | string |
Returns
T | null
serialize
ts
serialize: (value) => string;Defined in: parser/parsers.ts:35
Returns the string the source holds.
Parameters
| Parameter | Type |
|---|---|
value | T |
Returns
string
withDefault
ts
withDefault: (value) => ParserWithDefault<T>;Defined in: parser/parsers.ts:40
Returns a new parser with a default, so the ref never reads the missing value. The default applies to a missing value and to a string the parser does not accept.
Parameters
| Parameter | Type |
|---|---|
value | DefaultValue<T> |