Any
Any: { decode: any; encode: any; fromJSON: any; fromPartial: any; toJSON: any }
Type declaration
-
decode: function
- decode(input: Uint8Array | Reader, length?: number): Any
-
Parameters
-
input: Uint8Array | Reader
-
Optional length: number
Returns Any
-
encode: function
- encode(message: Any, writer?: Writer): Writer
-
Parameters
-
message: Any
-
writer: Writer = ...
Returns Writer
-
fromJSON: function
- fromJSON(object: any): Any
-
fromPartial: function
- fromPartial(object: { typeUrl?: string; value?: Uint8Array }): Any
-
Parameters
-
object: { typeUrl?: string; value?: Uint8Array }
-
Optional typeUrl?: string
-
Optional value?: Uint8Array
Returns Any
-
toJSON: function
- toJSON(message: Any): unknown
-
Parameters
Returns unknown
A URL/resource name that uniquely identifies the type of the serialized protocol buffer message. This string must contain at least one "/" character. The last segment of the URL's path must represent the fully qualified name of the type (as in
path/google.protobuf.Duration
). The name should be in a canonical form (e.g., leading "." is not accepted).In practice, teams usually precompile into the binary all types that they expect it to use in the context of Any. However, for URLs which use the scheme
http
,https
, or no scheme, one can optionally set up a type server that maps type URLs to message definitions as follows:https
is assumed.Note: this functionality is not currently available in the official protobuf release, and it is not used for type URLs beginning with type.googleapis.com.
Schemes other than
http
,https
(or the empty scheme) might be used with implementation specific semantics.