Skip to main content
Module

x/steam_trader/types/protobuf.d.ts>NamespaceBase

https://deno.land/x/steam_trader
Latest
class NamespaceBase
Abstract
import { NamespaceBase } from "https://deno.land/x/steam_trader@v0.4.0/types/protobuf.d.ts";

Base class of all reflection objects containing nested objects. This is not an actual class but here for the sake of having consistent type definitions.

Properties

optional
nested: { [k: string]: ReflectionObject; }

Nested objects by name.

readonly
nestedArray: ReflectionObject[]

Nested objects of this namespace as an array for iteration.

Methods

Adds a nested object to this namespace.

addJSON(nestedJson: { [k: string]: AnyNestedObject; }): Namespace

Adds nested objects to this namespace from nested object descriptors.

define(path: (string | string[]), json?: any): Namespace

Defines additial namespaces within this one if not yet existing.

get(name: string): (ReflectionObject | null)

Gets the nested object of the specified name.

getEnum(name: string): { [k: string]: number; }

Gets the values of the nested enum of the specified name. This methods differs from Namespace#get | get in that it returns an enum's values directly and throws instead of returning null.

lookup(
path: (string | string[]),
filterTypes: (any | any[]),
parentAlreadyChecked?: boolean,
): (ReflectionObject | null)

Recursively looks up the reflection object matching the specified path in the scope of this namespace.

lookup(path: (string | string[]), parentAlreadyChecked?: boolean): (ReflectionObject | null)

Looks up the reflection object at the specified path, relative to this namespace.

lookupEnum(path: (string | string[])): Enum

Looks up the values of the enum at the specified path, relative to this namespace. Besides its signature, this methods differs from Namespace#lookup | lookup in that it throws instead of returning null.

lookupService(path: (string | string[])): Service

Looks up the service at the specified path, relative to this namespace. Besides its signature, this methods differs from Namespace#lookup | lookup in that it throws instead of returning null.

lookupType(path: (string | string[])): Type

Looks up the type at the specified path, relative to this namespace. Besides its signature, this methods differs from Namespace#lookup | lookup in that it throws instead of returning null.

lookupTypeOrEnum(path: (string | string[])): Type

Looks up the type or enum at the specified path, relative to this namespace. Besides its signature, this methods differs from Namespace#lookup | lookup in that it throws instead of returning null.

Removes a nested object from this namespace.

Resolves this namespace's and all its nested objects' type references. Useful to validate a reflection tree, but comes at a cost.

toJSON(toJSONOptions?: IToJSONOptions): INamespace

Converts this namespace to a namespace descriptor.