This is the latest docs version
Quick Links
  • -Overview
  • -Language Features
  • -JS Interop
  • -Build System
Documentation
Language Manual
Reference for all language features
ReScript & React
First class bindings for ReactJS
GenType
Seamless TypeScript integration
Reanalyze
Dead Code & Termination analysis
Exploration
Packages
Explore third party libraries and bindings
Syntax Lookup
Discover all syntax constructs
APIPlaygroundBlogCommunity
  • Playground
  • Blog
  • Twitter
  • GitHub
  • Forum
Core Module
Overview
Core
submodules
  • Array
  • ArrayBuffer
  • AsyncIterator
  • BigInt
  • BigInt64Array
    • Constants
    BigUint64Array
    • Constants
  • Console
  • DataView
  • Date
    • UTC
  • Dict
  • Error
    • URIError
    • TypeError
    • SyntaxError
    • ReferenceError
    • RangeError
    • EvalError
  • Exn
  • Float
    • Constants
    Float32Array
    • Constants
    Float64Array
    • Constants
    Int
    • Constants
    Int16Array
    • t
      t
    • v
      fromArray
    • v
      fromBuffer
    • v
      fromBufferToEnd
    • v
      fromBufferWithRange
    • v
      fromLength
    • v
      fromArrayLikeOrIterable
    • v
      fromArrayLikeOrIterableWithMap
    • Constants
    Int32Array
    • Constants
    Int8Array
    • Constants
  • Internal
  • Intl
    • Segments
    • Segmenter
    • RelativeTimeFormat
    • PluralRules
    • NumberFormat
      • Grouping
    • Locale
    • ListFormat
    • DateTimeFormat
    • Collator
    • Common
  • Iterator
  • JSON
    • Decode
    • Encode
    • Classify
  • List
  • Map
  • MapperRt
  • Math
    • Int
    • Constants
  • Null
  • Nullable
  • Object
  • Option
  • Ordering
  • Promise
  • Re
    • Result
    RegExp
    • Result
  • Result
  • Set
  • String
  • Symbol
  • Type
    • Classify
  • TypedArray
  • Uint16Array
    • Constants
    Uint32Array
    • Constants
    Uint8Array
    • Constants
    Uint8ClampedArray
    • Constants
  • WeakMap
  • WeakSet
  • API / Core / Int16array

    Int16Array

    t

    RESCRIPT
    type t = Core__TypedArray.t<int>

    The Int16Array typed array represents an array of twos-complement 16-bit signed integers in platform byte order. See Int16Array on MDN

    fromArray

    RESCRIPT
    let fromArray: array<int> => t

    fromArray creates a Int16Array from an array of values. See TypedArray constructor on MDN

    fromBuffer

    RESCRIPT
    let fromBuffer: Core__ArrayBuffer.t => t

    fromBuffer creates a Int16Array from an ArrayBuffer.t. See TypedArray constructor on MDN

    Note: This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds.

    fromBufferToEnd

    RESCRIPT
    let fromBufferToEnd: (Core__ArrayBuffer.t, ~byteOffset: int) => t

    fromBufferToEnd creates a Int16Array from an ArrayBuffer.t, starting at a particular offset and continuing through to the end. See TypedArray constructor on MDN

    Note: This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds.

    fromBufferWithRange

    RESCRIPT
    let fromBufferWithRange: (Core__ArrayBuffer.t, ~byteOffset: int, ~length: int) => t

    fromBufferWithRange creates a Int16Array from an ArrayBuffer.t, starting at a particular offset and consuming length bytes. See TypedArray constructor on MDN

    Note: This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds.

    fromLength

    RESCRIPT
    let fromLength: int => t

    fromLength creates a zero-initialized Int16Array to hold the specified count of numbers; this is not a byte length. See TypedArray constructor on MDN

    Note: This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds.

    fromArrayLikeOrIterable

    RESCRIPT
    let fromArrayLikeOrIterable: 'a => t

    fromArrayLikeOrIterable creates a Int16Array from an array-like or iterable object. See TypedArray.from on MDN

    fromArrayLikeOrIterableWithMap

    RESCRIPT
    let fromArrayLikeOrIterableWithMap: ('a, ('b, int) => int) => t

    fromArrayLikeOrIterableWithMap creates a Int16Array from an array-like or iterable object and applies the mapping function to each item. The mapping function expects (value, index). See TypedArray.from on MDN

    Types and values
    • t
      t
    • v
      fromArray
    • v
      fromBuffer
    • v
      fromBufferToEnd
    • v
      fromBufferWithRange
    • v
      fromLength
    • v
      fromArrayLikeOrIterable
    • v
      fromArrayLikeOrIterableWithMap

    © 2024 The ReScript Project

    Software and assets distribution powered by KeyCDN.

    About
    • Community
    • ReScript Association
    Find us on