Back to Pocketbase

Interface JSONMap<T>

static/jsvm/interfaces/types.JSONMap.html

latest2.2 KB
Original Source

Interface JSONMap<T>

JSONMap defines a map that is safe for json and db read/write.

Type Parameters

T

Hierarchy

Index

Methods

getmarshalJSONscansetstringvalue

Methods

get

  • get(key): T

Get retrieves a single value from the current JSONMap[T].

This helper was added primarily to assist the goja integration since custom map types don't have direct access to the map keys (https://pkg.go.dev/github.com/dop251/goja#hdr-Maps_with_methods).

Parameters

key: string

Returns T

marshalJSON

  • marshalJSON(): string | number[]

MarshalJSON implements the [json.Marshaler] interface.

Returns string | number[]

scan

  • scan(value): void

Scan implements [sql.Scanner] interface to scan the provided value into the current JSONMap[T] instance.

Parameters

value: any

Returns void

set

  • set(key, value): void

Set sets a single value in the current JSONMap[T].

This helper was added primarily to assist the goja integration since custom map types don't have direct access to the map keys (https://pkg.go.dev/github.com/dop251/goja#hdr-Maps_with_methods).

Parameters

key: string
value: T

Returns void

string

  • string(): string

String returns the string representation of the current json map.

Returns string

value

  • value(): any

Value implements the [driver.Valuer] interface.

Returns any

Settings

Member Visibility

  • Inherited

Theme

OSLightDark

On This Page

Generated using TypeDoc