Instance accessors

Public

Wrapped.prototype.closing

The get accessor gets the closing of the wrap.

wrapped.class.ts
public get closing(): Closing {
  return this.#closing;
}

Returns

The return value is the wrap closing of a generic type variable Closing.

Wrapped.prototype.opening

The get accessor gets the opening of the wrap.

wrapped.class.ts
public get opening(): Opening {
  return this.#opening;
}

Returns

The return value is the wrap opening of a generic type variable Opening.

Wrapped.prototype.text

The get accessor gets the text.

wrapped.class.ts
public get text(): Text {
  return this.#text;
}

Returns

The return value is the text of a generic type variable Text.

Wrapped.prototype.value

The get accessor gets the wrapped text primitive value of a specified object.

wrapped.class.ts
public get value(): `${Opening}${Text}${Closing}` {
  return this.valueOf();
}

Returns

The return value is the text of a generic type variable in order Opening, Text, Closing on the template.

[Symbol.toStringTag]

The property, with the help of toStringTag of Symbol, changes the default object tag to wrapped for an instance of the Wrapped.

Good to know: The property can be read by the typeOf() function of the type package.

wrapped.class.ts
public get [Symbol.toStringTag](): string {
  return 'wrapped';
}

Example usage

// Example usage.
import { Wrap, Wrapped } from '@angular-package/text';
import { typeOf } from '@angular-package/type';

// Define the Wrapped<"[Oh no, I am wrapped]", "[", "]">.
const wrapped = new Wrapped(`[Oh no, I am wrapped]`, new Wrap('[', ']'));

// Returns 'wrapped'.
typeOf(wrapped);

Last updated