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 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:517
Allows manipulation and formatting of text strings and determination and location of substrings within strings.
Accessors
encodedLength
getencodedLength(): number
Defined in Text.ts:47
description: The length of the value when encoded as a Uint8Array
Returns: number
length
getlength(): number
Overrides String.length
Defined in Text.ts:54
description: The length of the value
Returns: number
Methods
toHex
▸ toHex(): string
Defined in Text.ts:62
description: Returns a hex string representation of the value
Returns: string
toJSON
▸ toJSON(): any
Implementation of Codec.toJSON
Defined in Text.ts:69
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 Text.ts:76
description: Returns the string representation of the value
Returns: string
toU8a
▸ toU8a(isBare?: undefined | false | true): Uint8Array
Defined in Text.ts:85
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