# `nupp.runtime.representation.spi` Implementation interfaces consumed during ordinary module initialization. Discover with nupp.spi.load; the consumer chooses the unique highest priority. Omitted priority is zero. Importing these declarations loads no implementation. ## Types ### `CastElements` _type_ ```nupp type CastElements = function(element: ctype, pointer: any): any ``` Casts storage to elements of any supplied ctype. The implementation must remain generic in T and use the target's representation; accepting one particular element type is not sufficient. ### `CstorageProvider` _interface_ ```nupp interface CstorageProvider ... ``` One coherent family of physical storage operations. `representation` is `native` for native pointers or `linear32` for 32-bit linear memory. The facade checks it against the target before publishing this table. Linear32 implementations must also supply layout, reference, integers, structs, and host. Their structs must be reference-valued. The integer facade must use the exact integer provider attached to this storage family. Allocation, descriptors, scalar codecs, and copies must agree on byte order, alignment, width, and pointer units. Decode inputs contain at least the scalar width in bytes. Borrowed views preserve source lifetimes; `borrows`, generic casts, and const views are part of the implementation contract. Opaque values in these signatures carry provider storage, not permission to change a compiled representation at runtime. #### Members | Name | Kind | Description | | --- | --- | --- | | [`priority`](#nupp.runtime.representation.spi.CstorageProvider.priority) | field | | | [`boundedCount`](#nupp.runtime.representation.spi.CstorageProvider.boundedCount) | method | Returns the requested count after any representation-specific extent check. | | [`representation`](#nupp.runtime.representation.spi.CstorageProvider.representation) | field | Target pointer/layout convention: native or linear32. | | [`integers`](#nupp.runtime.representation.spi.CstorageProvider.integers) | field | Integer operations sharing this storage representation; required for linear32. | | [`structs`](#nupp.runtime.representation.spi.CstorageProvider.structs) | field | Struct descriptors and row operations sharing this storage family. | | [`host`](#nupp.runtime.representation.spi.CstorageProvider.host) | field | Opaque memory-host operations sharing these allocations and pointers. | | [`layout`](#nupp.runtime.representation.spi.CstorageProvider.layout) | field | Returns target layout facts for a type or descriptor; required for linear32. | | [`scalar`](#nupp.runtime.representation.spi.CstorageProvider.scalar) | method | Returns the canonical descriptor for a scalar kind within this provider. | | [`descriptor`](#nupp.runtime.representation.spi.CstorageProvider.descriptor) | method | Reports layout and bounds for a provider value. | | [`reference`](#nupp.runtime.representation.spi.CstorageProvider.reference) | field | Creates a deferred descriptor reference for recursive layouts. | | [`allocateArray`](#nupp.runtime.representation.spi.CstorageProvider.allocateArray) | method | Allocates count elements of the supplied descriptor. | | [`allocateBytes`](#nupp.runtime.representation.spi.CstorageProvider.allocateBytes) | method | Allocates a writable byte region containing count bytes. | | [`borrowString`](#nupp.runtime.representation.spi.CstorageProvider.borrowString) | method | Returns a read-only byte view whose lifetime borrows the source string. | | [`castBytes`](#nupp.runtime.representation.spi.CstorageProvider.castBytes) | method | Returns a read-only byte view borrowing the pointer owner. | | [`castElements`](#nupp.runtime.representation.spi.CstorageProvider.castElements) | field | Interprets a pointer using any supplied element ctype. | | [`copy`](#nupp.runtime.representation.spi.CstorageProvider.copy) | method | Copies count bytes into destination without replacing its owner. | | [`fill`](#nupp.runtime.representation.spi.CstorageProvider.fill) | method | Fills count bytes in destination with the given byte value. | | [`sizeOf`](#nupp.runtime.representation.spi.CstorageProvider.sizeOf) | method | Returns the descriptor size in bytes. | | [`string`](#nupp.runtime.representation.spi.CstorageProvider.string) | method | Copies count source bytes into an independent Lua string. | | [`decodeUint8`](#nupp.runtime.representation.spi.CstorageProvider.decodeUint8) | method | Decodes one unsigned 8-bit integer using the target storage byte order. | | [`encodeUint8`](#nupp.runtime.representation.spi.CstorageProvider.encodeUint8) | method | Encodes one unsigned 8-bit integer using the target storage byte order. | | [`decodeInt8`](#nupp.runtime.representation.spi.CstorageProvider.decodeInt8) | method | Decodes one signed 8-bit integer using the target storage byte order. | | [`encodeInt8`](#nupp.runtime.representation.spi.CstorageProvider.encodeInt8) | method | Encodes one signed 8-bit integer using the target storage byte order. | | [`decodeUint16`](#nupp.runtime.representation.spi.CstorageProvider.decodeUint16) | method | Decodes one unsigned 16-bit integer using the target storage byte order. | | [`encodeUint16`](#nupp.runtime.representation.spi.CstorageProvider.encodeUint16) | method | Encodes one unsigned 16-bit integer using the target storage byte order. | | [`decodeInt16`](#nupp.runtime.representation.spi.CstorageProvider.decodeInt16) | method | Decodes one signed 16-bit integer using the target storage byte order. | | [`encodeInt16`](#nupp.runtime.representation.spi.CstorageProvider.encodeInt16) | method | Encodes one signed 16-bit integer using the target storage byte order. | | [`decodeUint32`](#nupp.runtime.representation.spi.CstorageProvider.decodeUint32) | method | Decodes one unsigned 32-bit integer using the target storage byte order. | | [`encodeUint32`](#nupp.runtime.representation.spi.CstorageProvider.encodeUint32) | method | Encodes one unsigned 32-bit integer using the target storage byte order. | | [`decodeInt32`](#nupp.runtime.representation.spi.CstorageProvider.decodeInt32) | method | Decodes one signed 32-bit integer using the target storage byte order. | | [`encodeInt32`](#nupp.runtime.representation.spi.CstorageProvider.encodeInt32) | method | Encodes one signed 32-bit integer using the target storage byte order. | | [`decodeUint64`](#nupp.runtime.representation.spi.CstorageProvider.decodeUint64) | method | Decodes one unsigned 64-bit integer using the target storage byte order. | | [`encodeUint64`](#nupp.runtime.representation.spi.CstorageProvider.encodeUint64) | method | Encodes one unsigned 64-bit integer using the target storage byte order. | | [`decodeInt64`](#nupp.runtime.representation.spi.CstorageProvider.decodeInt64) | method | Decodes one signed 64-bit integer using the target storage byte order. | | [`encodeInt64`](#nupp.runtime.representation.spi.CstorageProvider.encodeInt64) | method | Encodes one signed 64-bit integer using the target storage byte order. | | [`decodeFloat32`](#nupp.runtime.representation.spi.CstorageProvider.decodeFloat32) | method | Decodes one IEEE-754 binary32 value using the target storage byte order. | | [`encodeFloat32`](#nupp.runtime.representation.spi.CstorageProvider.encodeFloat32) | method | Encodes one IEEE-754 binary32 value using the target storage byte order. | | [`decodeFloat64`](#nupp.runtime.representation.spi.CstorageProvider.decodeFloat64) | method | Decodes one IEEE-754 binary64 value using the target storage byte order. | | [`encodeFloat64`](#nupp.runtime.representation.spi.CstorageProvider.encodeFloat64) | method | Encodes one IEEE-754 binary64 value using the target storage byte order. | #### `priority` _field_ ```nupp priority: integer? ``` `@readonly` #### `boundedCount` _method_ ```nupp boundedCount: function(borrows source: any, count: integer): integer ``` `@readonly` Returns the requested count after any representation-specific extent check. Callers remain responsible for valid native pointer extents. ##### Arguments | Name | Type | Description | | --- | --- | --- | | `borrows source` | `any` | | | `count` | `integer` | | ##### Returns | Type | Description | | --- | --- | | `integer` | | #### `representation` _field_ ```nupp representation: string ``` `@readonly` Target pointer/layout convention: native or linear32. #### `integers` _field_ ```nupp integers: Int64Provider? ``` `@readonly` Integer operations sharing this storage representation; required for linear32. #### `structs` _field_ ```nupp structs: StructvalueProvider? ``` `@readonly` Struct descriptors and row operations sharing this storage family. #### `host` _field_ ```nupp host: WasmProvider? ``` `@readonly` Opaque memory-host operations sharing these allocations and pointers. #### `layout` _field_ ```nupp layout: (function(subject: any): any)? ``` `@readonly` Returns target layout facts for a type or descriptor; required for linear32. #### `scalar` _method_ ```nupp scalar: function(kind: string): any ``` `@readonly` Returns the canonical descriptor for a scalar kind within this provider. ##### Arguments | Name | Type | Description | | --- | --- | --- | | `kind` | `string` | | ##### Returns | Type | Description | | --- | --- | | `any` | | #### `descriptor` _method_ ```nupp descriptor: function(value: any): any ``` `@readonly` Reports layout and bounds for a provider value. ##### Arguments | Name | Type | Description | | --- | --- | --- | | `value` | `any` | | ##### Returns | Type | Description | | --- | --- | | `any` | | #### `reference` _field_ ```nupp reference: (function(resolve: function(): any): any)? ``` `@readonly` Creates a deferred descriptor reference for recursive layouts. #### `allocateArray` _method_ ```nupp allocateArray: function(element: any, count: integer): any ``` `@readonly` Allocates count elements of the supplied descriptor. ##### Arguments | Name | Type | Description | | --- | --- | --- | | `element` | `any` | | | `count` | `integer` | | ##### Returns | Type | Description | | --- | --- | | `any` | | #### `allocateBytes` _method_ ```nupp allocateBytes: function(count: integer): uint8[?] ``` `@readonly` Allocates a writable byte region containing count bytes. ##### Arguments | Name | Type | Description | | --- | --- | --- | | `count` | `integer` | | ##### Returns | Type | Description | | --- | --- | | `uint8\[?\]` | | #### `borrowString` _method_ ```nupp borrowString: function(borrows bytes: string): const uint8[?] borrows (bytes) ``` `@readonly` Returns a read-only byte view whose lifetime borrows the source string. ##### Arguments | Name | Type | Description | | --- | --- | --- | | `borrows bytes` | `string` | | ##### Returns | Type | Description | | --- | --- | | `const uint8\[?\] borrows (bytes)` | | #### `castBytes` _method_ ```nupp castBytes: function(borrows pointer: any): const uint8[?] borrows (pointer) ``` `@readonly` Returns a read-only byte view borrowing the pointer owner. ##### Arguments | Name | Type | Description | | --- | --- | --- | | `borrows pointer` | `any` | | ##### Returns | Type | Description | | --- | --- | | `const uint8\[?\] borrows (pointer)` | | #### `castElements` _field_ ```nupp castElements: CastElements ``` `@readonly` Interprets a pointer using any supplied element ctype. #### `copy` _method_ ```nupp copy: function(borrows destination: any, borrows source: any, count: integer): nil ``` `@readonly` Copies count bytes into destination without replacing its owner. ##### Arguments | Name | Type | Description | | --- | --- | --- | | `borrows destination` | `any` | | | `borrows source` | `any` | | | `count` | `integer` | | ##### Returns | Type | Description | | --- | --- | | `nil` | | #### `fill` _method_ ```nupp fill: function(destination: any, count: integer, value: integer): nil ``` `@readonly` Fills count bytes in destination with the given byte value. ##### Arguments | Name | Type | Description | | --- | --- | --- | | `destination` | `any` | | | `count` | `integer` | | | `value` | `integer` | | ##### Returns | Type | Description | | --- | --- | | `nil` | | #### `sizeOf` _method_ ```nupp sizeOf: function(element: any): integer ``` `@readonly` Returns the descriptor size in bytes. ##### Arguments | Name | Type | Description | | --- | --- | --- | | `element` | `any` | | ##### Returns | Type | Description | | --- | --- | | `integer` | | #### `string` _method_ ```nupp string: function(borrows source: any, count: integer): string ``` `@readonly` Copies count source bytes into an independent Lua string. ##### Arguments | Name | Type | Description | | --- | --- | --- | | `borrows source` | `any` | | | `count` | `integer` | | ##### Returns | Type | Description | | --- | --- | | `string` | | #### `decodeUint8` _method_ ```nupp decodeUint8: function(bytes: string): uint32 ``` `@readonly` Decodes one unsigned 8-bit integer using the target storage byte order. ##### Arguments | Name | Type | Description | | --- | --- | --- | | `bytes` | `string` | | ##### Returns | Type | Description | | --- | --- | | `uint32` | | #### `encodeUint8` _method_ ```nupp encodeUint8: function(value: uint32): string ``` `@readonly` Encodes one unsigned 8-bit integer using the target storage byte order. ##### Arguments | Name | Type | Description | | --- | --- | --- | | `value` | `uint32` | | ##### Returns | Type | Description | | --- | --- | | `string` | | #### `decodeInt8` _method_ ```nupp decodeInt8: function(bytes: string): int32 ``` `@readonly` Decodes one signed 8-bit integer using the target storage byte order. ##### Arguments | Name | Type | Description | | --- | --- | --- | | `bytes` | `string` | | ##### Returns | Type | Description | | --- | --- | | `int32` | | #### `encodeInt8` _method_ ```nupp encodeInt8: function(value: int32): string ``` `@readonly` Encodes one signed 8-bit integer using the target storage byte order. ##### Arguments | Name | Type | Description | | --- | --- | --- | | `value` | `int32` | | ##### Returns | Type | Description | | --- | --- | | `string` | | #### `decodeUint16` _method_ ```nupp decodeUint16: function(bytes: string): uint32 ``` `@readonly` Decodes one unsigned 16-bit integer using the target storage byte order. ##### Arguments | Name | Type | Description | | --- | --- | --- | | `bytes` | `string` | | ##### Returns | Type | Description | | --- | --- | | `uint32` | | #### `encodeUint16` _method_ ```nupp encodeUint16: function(value: uint32): string ``` `@readonly` Encodes one unsigned 16-bit integer using the target storage byte order. ##### Arguments | Name | Type | Description | | --- | --- | --- | | `value` | `uint32` | | ##### Returns | Type | Description | | --- | --- | | `string` | | #### `decodeInt16` _method_ ```nupp decodeInt16: function(bytes: string): int32 ``` `@readonly` Decodes one signed 16-bit integer using the target storage byte order. ##### Arguments | Name | Type | Description | | --- | --- | --- | | `bytes` | `string` | | ##### Returns | Type | Description | | --- | --- | | `int32` | | #### `encodeInt16` _method_ ```nupp encodeInt16: function(value: int32): string ``` `@readonly` Encodes one signed 16-bit integer using the target storage byte order. ##### Arguments | Name | Type | Description | | --- | --- | --- | | `value` | `int32` | | ##### Returns | Type | Description | | --- | --- | | `string` | | #### `decodeUint32` _method_ ```nupp decodeUint32: function(bytes: string): uint32 ``` `@readonly` Decodes one unsigned 32-bit integer using the target storage byte order. ##### Arguments | Name | Type | Description | | --- | --- | --- | | `bytes` | `string` | | ##### Returns | Type | Description | | --- | --- | | `uint32` | | #### `encodeUint32` _method_ ```nupp encodeUint32: function(value: uint32): string ``` `@readonly` Encodes one unsigned 32-bit integer using the target storage byte order. ##### Arguments | Name | Type | Description | | --- | --- | --- | | `value` | `uint32` | | ##### Returns | Type | Description | | --- | --- | | `string` | | #### `decodeInt32` _method_ ```nupp decodeInt32: function(bytes: string): int32 ``` `@readonly` Decodes one signed 32-bit integer using the target storage byte order. ##### Arguments | Name | Type | Description | | --- | --- | --- | | `bytes` | `string` | | ##### Returns | Type | Description | | --- | --- | | `int32` | | #### `encodeInt32` _method_ ```nupp encodeInt32: function(value: int32): string ``` `@readonly` Encodes one signed 32-bit integer using the target storage byte order. ##### Arguments | Name | Type | Description | | --- | --- | --- | | `value` | `int32` | | ##### Returns | Type | Description | | --- | --- | | `string` | | #### `decodeUint64` _method_ ```nupp decodeUint64: function(bytes: string): uint64 ``` `@readonly` Decodes one unsigned 64-bit integer using the target storage byte order. ##### Arguments | Name | Type | Description | | --- | --- | --- | | `bytes` | `string` | | ##### Returns | Type | Description | | --- | --- | | `uint64` | | #### `encodeUint64` _method_ ```nupp encodeUint64: function(value: uint64): string ``` `@readonly` Encodes one unsigned 64-bit integer using the target storage byte order. ##### Arguments | Name | Type | Description | | --- | --- | --- | | `value` | `uint64` | | ##### Returns | Type | Description | | --- | --- | | `string` | | #### `decodeInt64` _method_ ```nupp decodeInt64: function(bytes: string): int64 ``` `@readonly` Decodes one signed 64-bit integer using the target storage byte order. ##### Arguments | Name | Type | Description | | --- | --- | --- | | `bytes` | `string` | | ##### Returns | Type | Description | | --- | --- | | `int64` | | #### `encodeInt64` _method_ ```nupp encodeInt64: function(value: int64): string ``` `@readonly` Encodes one signed 64-bit integer using the target storage byte order. ##### Arguments | Name | Type | Description | | --- | --- | --- | | `value` | `int64` | | ##### Returns | Type | Description | | --- | --- | | `string` | | #### `decodeFloat32` _method_ ```nupp decodeFloat32: function(bytes: string): float ``` `@readonly` Decodes one IEEE-754 binary32 value using the target storage byte order. ##### Arguments | Name | Type | Description | | --- | --- | --- | | `bytes` | `string` | | ##### Returns | Type | Description | | --- | --- | | `float` | | #### `encodeFloat32` _method_ ```nupp encodeFloat32: function(value: number): string ``` `@readonly` Encodes one IEEE-754 binary32 value using the target storage byte order. ##### Arguments | Name | Type | Description | | --- | --- | --- | | `value` | `number` | | ##### Returns | Type | Description | | --- | --- | | `string` | | #### `decodeFloat64` _method_ ```nupp decodeFloat64: function(bytes: string): number ``` `@readonly` Decodes one IEEE-754 binary64 value using the target storage byte order. ##### Arguments | Name | Type | Description | | --- | --- | --- | | `bytes` | `string` | | ##### Returns | Type | Description | | --- | --- | | `number` | | #### `encodeFloat64` _method_ ```nupp encodeFloat64: function(value: number): string ``` `@readonly` Encodes one IEEE-754 binary64 value using the target storage byte order. ##### Arguments | Name | Type | Description | | --- | --- | --- | | `value` | `number` | | ##### Returns | Type | Description | | --- | --- | | `string` | | ### `Int64Provider` _interface_ ```nupp interface Int64Provider ... ``` 64-bit signed and unsigned arithmetic for generated portable operations. Values must retain their full width rather than round through a Lua number. Arithmetic, comparisons, shifts, and conversions must agree with the signedness created by int64/uint64. toNumber is the explicit potentially inexact conversion. When physical storage supplies integers, this must be that same implementation. #### Members | Name | Kind | Description | | --- | --- | --- | | [`priority`](#nupp.runtime.representation.spi.Int64Provider.priority) | field | | | [`int64`](#nupp.runtime.representation.spi.Int64Provider.int64) | method | Constructs or converts a signed 64-bit value. | | [`uint64`](#nupp.runtime.representation.spi.Int64Provider.uint64) | method | Constructs or converts an unsigned 64-bit value. | | [`add`](#nupp.runtime.representation.spi.Int64Provider.add) | method | Adds two full-width values. | | [`sub`](#nupp.runtime.representation.spi.Int64Provider.sub) | method | Subtracts the right operand. | | [`mul`](#nupp.runtime.representation.spi.Int64Provider.mul) | method | Multiplies full-width values. | | [`div`](#nupp.runtime.representation.spi.Int64Provider.div) | method | Divides using the integer representation semantics. | | [`mod`](#nupp.runtime.representation.spi.Int64Provider.mod) | method | Computes the corresponding integer remainder. | | [`pow`](#nupp.runtime.representation.spi.Int64Provider.pow) | method | Raises to an integer power. | | [`neg`](#nupp.runtime.representation.spi.Int64Provider.neg) | method | Negates the value. | | [`band`](#nupp.runtime.representation.spi.Int64Provider.band) | method | Computes 64-bit conjunction. | | [`bor`](#nupp.runtime.representation.spi.Int64Provider.bor) | method | Computes 64-bit disjunction. | | [`bxor`](#nupp.runtime.representation.spi.Int64Provider.bxor) | method | Computes 64-bit exclusive-or. | | [`bnot`](#nupp.runtime.representation.spi.Int64Provider.bnot) | method | Inverts all 64 bits. | | [`lshift`](#nupp.runtime.representation.spi.Int64Provider.lshift) | method | Shifts left within the 64-bit representation. | | [`rshift`](#nupp.runtime.representation.spi.Int64Provider.rshift) | method | Shifts right with zero fill. | | [`arshift`](#nupp.runtime.representation.spi.Int64Provider.arshift) | method | Shifts right with sign extension. | | [`compare`](#nupp.runtime.representation.spi.Int64Provider.compare) | method | Returns a negative number, zero, or a positive number for ordering. | | [`toNumber`](#nupp.runtime.representation.spi.Int64Provider.toNumber) | method | Converts to a Lua number, which may lose integer precision. | | [`toString`](#nupp.runtime.representation.spi.Int64Provider.toString) | method | Returns an exact decimal representation. | #### `priority` _field_ ```nupp priority: integer? ``` `@readonly` #### `int64` _method_ ```nupp int64: function(value: any): any ``` `@readonly` Constructs or converts a signed 64-bit value. ##### Arguments | Name | Type | Description | | --- | --- | --- | | `value` | `any` | | ##### Returns | Type | Description | | --- | --- | | `any` | | #### `uint64` _method_ ```nupp uint64: function(value: any): any ``` `@readonly` Constructs or converts an unsigned 64-bit value. ##### Arguments | Name | Type | Description | | --- | --- | --- | | `value` | `any` | | ##### Returns | Type | Description | | --- | --- | | `any` | | #### `add` _method_ ```nupp add: function(left: any, right: any): any ``` `@readonly` Adds two full-width values. ##### Arguments | Name | Type | Description | | --- | --- | --- | | `left` | `any` | | | `right` | `any` | | ##### Returns | Type | Description | | --- | --- | | `any` | | #### `sub` _method_ ```nupp sub: function(left: any, right: any): any ``` `@readonly` Subtracts the right operand. ##### Arguments | Name | Type | Description | | --- | --- | --- | | `left` | `any` | | | `right` | `any` | | ##### Returns | Type | Description | | --- | --- | | `any` | | #### `mul` _method_ ```nupp mul: function(left: any, right: any): any ``` `@readonly` Multiplies full-width values. ##### Arguments | Name | Type | Description | | --- | --- | --- | | `left` | `any` | | | `right` | `any` | | ##### Returns | Type | Description | | --- | --- | | `any` | | #### `div` _method_ ```nupp div: function(left: any, right: any): any ``` `@readonly` Divides using the integer representation semantics. ##### Arguments | Name | Type | Description | | --- | --- | --- | | `left` | `any` | | | `right` | `any` | | ##### Returns | Type | Description | | --- | --- | | `any` | | #### `mod` _method_ ```nupp mod: function(left: any, right: any): any ``` `@readonly` Computes the corresponding integer remainder. ##### Arguments | Name | Type | Description | | --- | --- | --- | | `left` | `any` | | | `right` | `any` | | ##### Returns | Type | Description | | --- | --- | | `any` | | #### `pow` _method_ ```nupp pow: function(left: any, right: any): any ``` `@readonly` Raises to an integer power. ##### Arguments | Name | Type | Description | | --- | --- | --- | | `left` | `any` | | | `right` | `any` | | ##### Returns | Type | Description | | --- | --- | | `any` | | #### `neg` _method_ ```nupp neg: function(value: any): any ``` `@readonly` Negates the value. ##### Arguments | Name | Type | Description | | --- | --- | --- | | `value` | `any` | | ##### Returns | Type | Description | | --- | --- | | `any` | | #### `band` _method_ ```nupp band: function(left: any, right: any): any ``` `@readonly` Computes 64-bit conjunction. ##### Arguments | Name | Type | Description | | --- | --- | --- | | `left` | `any` | | | `right` | `any` | | ##### Returns | Type | Description | | --- | --- | | `any` | | #### `bor` _method_ ```nupp bor: function(left: any, right: any): any ``` `@readonly` Computes 64-bit disjunction. ##### Arguments | Name | Type | Description | | --- | --- | --- | | `left` | `any` | | | `right` | `any` | | ##### Returns | Type | Description | | --- | --- | | `any` | | #### `bxor` _method_ ```nupp bxor: function(left: any, right: any): any ``` `@readonly` Computes 64-bit exclusive-or. ##### Arguments | Name | Type | Description | | --- | --- | --- | | `left` | `any` | | | `right` | `any` | | ##### Returns | Type | Description | | --- | --- | | `any` | | #### `bnot` _method_ ```nupp bnot: function(value: any): any ``` `@readonly` Inverts all 64 bits. ##### Arguments | Name | Type | Description | | --- | --- | --- | | `value` | `any` | | ##### Returns | Type | Description | | --- | --- | | `any` | | #### `lshift` _method_ ```nupp lshift: function(value: any, count: number): any ``` `@readonly` Shifts left within the 64-bit representation. ##### Arguments | Name | Type | Description | | --- | --- | --- | | `value` | `any` | | | `count` | `number` | | ##### Returns | Type | Description | | --- | --- | | `any` | | #### `rshift` _method_ ```nupp rshift: function(value: any, count: number): any ``` `@readonly` Shifts right with zero fill. ##### Arguments | Name | Type | Description | | --- | --- | --- | | `value` | `any` | | | `count` | `number` | | ##### Returns | Type | Description | | --- | --- | | `any` | | #### `arshift` _method_ ```nupp arshift: function(value: any, count: number): any ``` `@readonly` Shifts right with sign extension. ##### Arguments | Name | Type | Description | | --- | --- | --- | | `value` | `any` | | | `count` | `number` | | ##### Returns | Type | Description | | --- | --- | | `any` | | #### `compare` _method_ ```nupp compare: function(left: any, right: any): number ``` `@readonly` Returns a negative number, zero, or a positive number for ordering. ##### Arguments | Name | Type | Description | | --- | --- | --- | | `left` | `any` | | | `right` | `any` | | ##### Returns | Type | Description | | --- | --- | | `number` | | #### `toNumber` _method_ ```nupp toNumber: function(value: any): number ``` `@readonly` Converts to a Lua number, which may lose integer precision. ##### Arguments | Name | Type | Description | | --- | --- | --- | | `value` | `any` | | ##### Returns | Type | Description | | --- | --- | | `number` | | #### `toString` _method_ ```nupp toString: function(value: any): string ``` `@readonly` Returns an exact decimal representation. ##### Arguments | Name | Type | Description | | --- | --- | --- | | `value` | `any` | | ##### Returns | Type | Description | | --- | --- | | `string` | | ### `StructvalueProvider` _interface_ ```nupp interface StructvalueProvider ... ``` Struct-value operations supplied as part of the storage family. Descriptors, arrays, and constructed values must agree with compiler layouts and canonical struct declarations. referenceValued reports whether a row reference addresses the underlying storage. The storage implementation supplies compatible struct operations as part of the same family. #### Members | Name | Kind | Description | | --- | --- | --- | | [`scalar`](#nupp.runtime.representation.spi.StructvalueProvider.scalar) | method | Returns a scalar descriptor accepted by define and array. | | [`array`](#nupp.runtime.representation.spi.StructvalueProvider.array) | method | Allocates count elements using this family's element descriptor. | | [`define`](#nupp.runtime.representation.spi.StructvalueProvider.define) | method | Constructs a type descriptor from a compiler layout and method table. | | [`referenceValued`](#nupp.runtime.representation.spi.StructvalueProvider.referenceValued) | field | Whether row references address their underlying storage. | #### `scalar` _method_ ```nupp scalar: function(kind: string): any ``` `@readonly` Returns a scalar descriptor accepted by define and array. ##### Arguments | Name | Type | Description | | --- | --- | --- | | `kind` | `string` | | ##### Returns | Type | Description | | --- | --- | | `any` | | #### `array` _method_ ```nupp array: function(element: any, count: integer): any ``` `@readonly` Allocates count elements using this family's element descriptor. ##### Arguments | Name | Type | Description | | --- | --- | --- | | `element` | `any` | | | `count` | `integer` | | ##### Returns | Type | Description | | --- | --- | | `any` | | #### `define` _method_ ```nupp define: function(layout: any, methods: table): any ``` `@readonly` Constructs a type descriptor from a compiler layout and method table. ##### Arguments | Name | Type | Description | | --- | --- | --- | | `layout` | `any` | | | `methods` | `table` | | ##### Returns | Type | Description | | --- | --- | | `any` | | #### `referenceValued` _field_ ```nupp referenceValued: boolean ``` `@readonly` Whether row references address their underlying storage. ### `WasmProvider` _interface_ ```nupp interface WasmProvider ... ``` Opaque linear-memory operations belonging to a storage implementation. Allocation and pointer values must refer to that implementation's memory host. Offsets and copy lengths are bytes; pointer's index/stride pair locates an element in an allocation. Loads and stores use the scalar kind's width and encoding. Bounds and owner lifetimes must remain valid across every operation. This interface is supplied through CstorageProvider.host, not a separate SPI. #### Members | Name | Kind | Description | | --- | --- | --- | | [`allocate`](#nupp.runtime.representation.spi.WasmProvider.allocate) | method | Allocates the requested number of bytes in this memory host. | | [`pointer`](#nupp.runtime.representation.spi.WasmProvider.pointer) | method | Locates a zero-based element using index and byte stride. | | [`offset`](#nupp.runtime.representation.spi.WasmProvider.offset) | method | Offsets an existing pointer by count bytes. | | [`load`](#nupp.runtime.representation.spi.WasmProvider.load) | method | Reads a scalar kind at a byte offset from the pointer. | | [`store`](#nupp.runtime.representation.spi.WasmProvider.store) | method | Writes a scalar kind at a byte offset from the pointer. | | [`copy`](#nupp.runtime.representation.spi.WasmProvider.copy) | method | Copies bytes between regions belonging to this host. | | [`descriptor`](#nupp.runtime.representation.spi.WasmProvider.descriptor) | method | Returns bounds and layout information for a host value. | #### `allocate` _method_ ```nupp allocate: function(bytes: integer): any ``` `@readonly` Allocates the requested number of bytes in this memory host. ##### Arguments | Name | Type | Description | | --- | --- | --- | | `bytes` | `integer` | | ##### Returns | Type | Description | | --- | --- | | `any` | | #### `pointer` _method_ ```nupp pointer: function(allocation: any, index: integer, stride: integer): any ``` `@readonly` Locates a zero-based element using index and byte stride. ##### Arguments | Name | Type | Description | | --- | --- | --- | | `allocation` | `any` | | | `index` | `integer` | | | `stride` | `integer` | | ##### Returns | Type | Description | | --- | --- | | `any` | | #### `offset` _method_ ```nupp offset: function(pointer: any, count: integer): any ``` `@readonly` Offsets an existing pointer by count bytes. ##### Arguments | Name | Type | Description | | --- | --- | --- | | `pointer` | `any` | | | `count` | `integer` | | ##### Returns | Type | Description | | --- | --- | | `any` | | #### `load` _method_ ```nupp load: function(pointer: any, byteOffset: integer, kind: string): any ``` `@readonly` Reads a scalar kind at a byte offset from the pointer. ##### Arguments | Name | Type | Description | | --- | --- | --- | | `pointer` | `any` | | | `byteOffset` | `integer` | | | `kind` | `string` | | ##### Returns | Type | Description | | --- | --- | | `any` | | #### `store` _method_ ```nupp store: function(pointer: any, byteOffset: integer, kind: string, value: any): nil ``` `@readonly` Writes a scalar kind at a byte offset from the pointer. ##### Arguments | Name | Type | Description | | --- | --- | --- | | `pointer` | `any` | | | `byteOffset` | `integer` | | | `kind` | `string` | | | `value` | `any` | | ##### Returns | Type | Description | | --- | --- | | `nil` | | #### `copy` _method_ ```nupp copy: function(destination: any, source: any, bytes: integer): nil ``` `@readonly` Copies bytes between regions belonging to this host. ##### Arguments | Name | Type | Description | | --- | --- | --- | | `destination` | `any` | | | `source` | `any` | | | `bytes` | `integer` | | ##### Returns | Type | Description | | --- | --- | | `nil` | | #### `descriptor` _method_ ```nupp descriptor: function(value: any): any ``` `@readonly` Returns bounds and layout information for a host value. ##### Arguments | Name | Type | Description | | --- | --- | --- | | `value` | `any` | | ##### Returns | Type | Description | | --- | --- | | `any` | |