name: Text

description: This is a string wrapper, along with the length. It is used both for strings as well as items such as documentation. It simply extends the standard JS String built-in object, inheriting all methods exposed from String.

Hierarchy

String

↳ Text

↳ Type

Implements

Indexable

[index: number]: string

Constructors

constructor

⊕ new Text(value?: Text | string | AnyU8a | object): Text

Defined in primitive/Text.ts:23

Parameters:

Name Type Default value
Default value value Text | string | AnyU8a | object ""

Returns: Text


Properties

<Static> String

● String: StringConstructor

Defined in /home/travis/build/polkadot-js/api/node_modules/typescript/lib/lib.es5.d.ts:527

Allows manipulation and formatting of text strings and determination and location of substrings within strings.


Accessors

encodedLength

get encodedLength(): number

Defined in primitive/Text.ts:45

description: The length of the value when encoded as a Uint8Array

Returns: number


isEmpty

get isEmpty(): boolean

Defined in primitive/Text.ts:52

description: Checks if the value is an empty value

Returns: boolean


length

get length(): number

Overrides String.length

Defined in primitive/Text.ts:59

description: The length of the value

Returns: number


Methods

eq

▸ eq(other?: any): boolean

Implementation of Codec.eq

Defined in primitive/Text.ts:67

description: Compares the value of the input to see if there is a match

Parameters:

Name Type
Optional other any

Returns: boolean


toHex

▸ toHex(): string

Implementation of Codec.toHex

Defined in primitive/Text.ts:76

description: Returns a hex string representation of the value

Returns: string


toJSON

▸ toJSON(): any

Implementation of Codec.toJSON

Defined in primitive/Text.ts:83

description: Converts the Object to JSON, typically used for RPC transfers

Returns: any


toString

▸ toString(): string

Implementation of Codec.toString

Overrides String.toString

Defined in primitive/Text.ts:90

description: Returns the string representation of the value

Returns: string


toU8a

▸ toU8a(isBare?: undefined | false | true): Uint8Array

Implementation of Codec.toU8a

Defined in primitive/Text.ts:99

description: Encodes the value as a Uint8Array as per the parity-codec specifications

Parameters:

Name Type Description
Optional isBare undefined | false | true true when the value has none of the type-specific prefixes (internal)

Returns: Uint8Array


Last Updated: 2/25/2019, 4:39:16 PM