-
-
Notifications
You must be signed in to change notification settings - Fork 84
Expand file tree
/
Copy pathAnyMap.ts
More file actions
27 lines (25 loc) · 727 Bytes
/
AnyMap.ts
File metadata and controls
27 lines (25 loc) · 727 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import type { Int64 } from './Int64'
/**
* Represents a single value inside an untyped map.
*/
export type ValueType =
| string
| number
| boolean
| Int64
| null
| ValueType[]
| { [k: string]: ValueType }
/**
* Represents an untyped map, similar to a JSON structure.
* Supported types:
* - Primitives (`string`, `number`, `boolean`, `Int64`, `null`)
* - Arrays of primitives (`ValueType[]`)
* - Objects of primitives (`Record<string, ValueType>`)
* - Arrays of arrays or objects
* - Objects of arrays or objects
*
* @note It is recommended to always use typed `interface`s instead of `AnyMap` for
* both type safety, as well as better performance.
*/
export type AnyMap = Record<string, ValueType>