Skip to content

IDecoderHelpers

[<Interface>]
type IDecoderHelpers<'JsonValue> =
    abstract member anyToString ('JsonValue) : string
    abstract member asArray ('JsonValue) : 'JsonValue array
    abstract member asBoolean ('JsonValue) : bool
    abstract member asFloat ('JsonValue) : float
    abstract member asFloat32 ('JsonValue) : float32
    abstract member asInt ('JsonValue) : int
    abstract member asString ('JsonValue) : string
    abstract member getProperties ('JsonValue) : string seq
    abstract member getProperty (string, 'JsonValue) : 'JsonValue
    abstract member hasProperty (string) ('JsonValue) : bool
    abstract member isArray ('JsonValue) : bool
    abstract member isBoolean ('JsonValue) : bool
    abstract member isIntegralValue ('JsonValue) : bool
    abstract member isNullValue ('JsonValue) : bool
    abstract member isNumber ('JsonValue) : bool
    abstract member isObject ('JsonValue) : bool
    abstract member isString ('JsonValue) : bool
    abstract member numberToString ('JsonValue) : string
AssemblyRanvier.Wire

Reads and tests a JSON value of the runtime's own type.

Implemented once per runtime package. A decoder goes through it so that the same decoder works on every runtime.

Methods

abstract member anyToString ('JsonValue) : string

The value as JSON text, for the error messages.

abstract member asArray ('JsonValue) : 'JsonValue array

The elements of the array.

abstract member asBoolean ('JsonValue) : bool

The value as a boolean.

abstract member asFloat ('JsonValue) : float

The value as a float.

abstract member asFloat32 ('JsonValue) : float32

The value as a float32.

abstract member asInt ('JsonValue) : int

The value as an int.

abstract member asString ('JsonValue) : string

The value as a string.

abstract member getProperties ('JsonValue) : string seq

The property names of the object.

abstract member getProperty (string, 'JsonValue) : 'JsonValue

The value of the object property under the given name.

abstract member hasProperty (string) ('JsonValue) : bool

Whether the object has a property under the given name.

abstract member isArray ('JsonValue) : bool

Whether the value is a JSON array.

abstract member isBoolean ('JsonValue) : bool

Whether the value is a JSON boolean.

abstract member isIntegralValue ('JsonValue) : bool

Whether the number has no fractional part.

abstract member isNullValue ('JsonValue) : bool

Whether the value is null.

abstract member isNumber ('JsonValue) : bool

Whether the value is a JSON number.

abstract member isObject ('JsonValue) : bool

Whether the value is a JSON object.

abstract member isString ('JsonValue) : bool

Whether the value is a JSON string.

abstract member numberToString ('JsonValue) : string

The number as text, without the runtime's own formatting.