Class: Type

Type(clsnon-null, typeUrlnon-null)

A type of the Protobuf message represented by its JavaScript class and type URL.

Constructor

new Type(clsnon-null, typeUrlnon-null)

Parameters:
Name Type Description
cls Class.<T> a class of the `Message` type is for
typeUrl TypeUrl.<T> a type URL of the `Message` type is for
Source:

Classes

Type

Methods

class() → (non-null) {Class.<T>}

Source:
Returns:
a JS class of a defined type
Type
Class.<T>

url() → (non-null) {TypeUrl.<T>}

Source:
Returns:
a type URL of a defined type
Type
TypeUrl.<T>

(static) forClass(clsnon-null)

Creates a new `Type` for the passed `Message` class.
Parameters:
Name Type Description
cls Class.<T> cls a class of the `Message`
Source:

(static) forMessage(messagenon-null)

Creates a new `Type` for the passed `Message`.
Parameters:
Name Type Description
message Message a Protobuf message
Source:

(static) of(clsnon-null, typeUrl) → {Type.<T>}

A static factory for creating Type instances from `Message` class and type URL.
Parameters:
Name Type Description
cls Class.<T> a class of the `Message` type is for
typeUrl string | TypeUrl.<T> a type URL of the `Message` type is for
Source:
Returns:
new Type instance
Type
Type.<T>