TypeTags .TextDecoder

Overview

⚠️

Experimental: This is an experimental technology

The TextDecoder interface represents a decoder for a specific text encoding, such as UTF-8, ISO-8859-2, KOI8-R, GBK, etc. A decoder takes a stream of bytes as input and emits a stream of code points.

Usage

import { TypeTags } from 'typetags'
let decoder = new TextDecoder() // defaults to 'utf-8' or 'utf8'
let u8arr = new Uint8Array([240, 160, 174, 183])
console.log(decoder.decode(u8arr))
// expected output: 𠮷
console.log(TypeTags.TextDecoder)
// → [object TextDecoder]

Metadata (TType)

MetadataValue
.typeTextDecoder
.tag[object TextDecoder]
.builtin()undefined
.getTag()[object TextDecoder]
.hasSpecialArgs()false
.instance()undefined
.instanceTypeOf()object
.info()see more
.isAvailable()true
.isConstructor()true
.isFactory()false
.isFunction()true
.isGlobal()true
.isIterator()false
.isNested()false
.isObject()false
.isPrimitive()false
.isStringifiable()true
.isSyntatic()false
.isTypedArray()false
.ownKeys()[length, prototype, name]
.toString()function toString() { [native code] }
.typeOf()function

Signature

declare type ITypeTags = {
[key in Types | NestedTypes]: Tags
}
declare interface Predicate {
predicate(value: any): boolean
}

See MDN Web Docs