Polkadot JS APIGlobals"primitive/Text"Text

# Class: Text

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

# Implements

# Indexable

  • [ index: number]: string

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.

# Index

# Constructors

# Properties

# Accessors

# Methods

# Constructors

# constructor

+ new Text(registry: Registry, value: Text | string | AnyU8a | object): Text

Defined in packages/types/src/primitive/Text.ts:53

Parameters:

Name Type Default
registry Registry -
value Text | string | AnyU8a | object ""

Returns: Text

# Properties

# Readonly registry

registry: Registry

Implementation of Codec.registry

Defined in packages/types/src/primitive/Text.ts:51


# Static String

String: StringConstructor

Defined in 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 packages/types/src/primitive/Text.ts:64

description The length of the value when encoded as a Uint8Array

Returns: number


# hash

get hash(): H256

Defined in packages/types/src/primitive/Text.ts:71

description returns a hash of the contents

Returns: H256


# isEmpty

get isEmpty(): boolean

Defined in packages/types/src/primitive/Text.ts:78

description Checks if the value is an empty value

Returns: boolean


# length

get length(): number

Overrides RegistryMetadataText.length

Defined in packages/types/src/primitive/Text.ts:85

description The length of the value

Returns: number

# Methods

# eq

eq(other?: unknown): boolean

Implementation of Codec

Defined in packages/types/src/primitive/Text.ts:93

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

Parameters:

Name Type
other? unknown

Returns: boolean


# setOverride

setOverride(override: string): void

Defined in packages/types/src/primitive/Text.ts:102

description Set an override value for this

Parameters:

Name Type
override string

Returns: void


# toHex

toHex(): string

Defined in packages/types/src/primitive/Text.ts:109

description Returns a hex string representation of the value

Returns: string


# toHuman

toHuman(): string

Defined in packages/types/src/primitive/Text.ts:118

description Converts the Object to to a human-friendly JSON, with additional fields, expansion and formatting of information

Returns: string


# toJSON

toJSON(): string

Implementation of Codec

Defined in packages/types/src/primitive/Text.ts:125

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

Returns: string


# toRawType

toRawType(): string

Implementation of Codec

Defined in packages/types/src/primitive/Text.ts:132

description Returns the base runtime type name for this instance

Returns: string


# toString

toString(): string

Implementation of Codec

Overrides RegistryMetadataText.toString

Defined in packages/types/src/primitive/Text.ts:139

description Returns the string representation of the value

Returns: string


# toU8a

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

Defined in packages/types/src/primitive/Text.ts:147

description Encodes the value as a Uint8Array as per the SCALE specifications

Parameters:

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

Returns: Uint8Array