@@ -87,10 +87,6 @@ interface Table extends RayObject {
8787 toRows ( ) : Record < string , unknown > [ ] ;
8888}
8989
90- interface RayforceGlobal {
91- init ( options ?: { wasmPath ?: string ; locateFile ?: ( file : string ) => string } ) : Promise < RayforceSDK > ;
92- Types : typeof Types ;
93- }
9490
9591// IPC header constants (from rayforce/core/serde.h)
9692// Header: prefix(4) version(1) flags(1) endian(1) msgtype(1) size(8) = 16 bytes
@@ -109,7 +105,7 @@ export interface RayforceResult {
109105 source ?: 'local' | 'remote' ;
110106
111107 /** Get column as TypedArray (zero-copy) */
112- getColumn ?: ( name : string ) => Float64Array | Int32Array | BigInt64Array | Uint8Array | null ;
108+ getColumn ?: ( name : string ) => ArrayBufferView | null ;
113109 /** Convert to JS (use sparingly, triggers full copy) */
114110 toJS ?: ( ) => unknown ;
115111}
@@ -166,7 +162,6 @@ export class RayforceClient {
166162 private pendingRequests : Map < number , { resolve : ( value : RayforceResult ) => void ; reject : ( error : Error ) => void } > = new Map ( ) ;
167163 private requestId = 0 ;
168164 private sdk : RayforceSDK | null = null ;
169- private wasmModule : EmscriptenModule | null = null ;
170165
171166 constructor ( ) {
172167 // SDK loaded on demand
@@ -189,7 +184,6 @@ export class RayforceClient {
189184 }
190185
191186 this . sdk = sdk ;
192- this . wasmModule = sdk . _wasm ;
193187
194188 logInfo ( 'Rayforce' , `SDK loaded, version: ${ this . sdk . version } ` ) ;
195189 }
@@ -429,7 +423,6 @@ export class RayforceClient {
429423 setTimeout ( ( ) => {
430424 if ( this . pendingRequests . has ( id ) ) {
431425 this . pendingRequests . delete ( id ) ;
432- const execTime = performance . now ( ) - startTime ;
433426 logError ( 'Query' , `[REMOTE] Timeout after ${ timeout } ms` ) ;
434427 reject ( new Error ( `Query timeout after ${ timeout } ms` ) ) ;
435428 }
@@ -600,7 +593,7 @@ export class RayforceClient {
600593 }
601594
602595 private parseVector ( view : DataView , offset : number , type : number ) : RayforceResult {
603- const attrs = view . getUint8 ( offset ) ;
596+ // Skip attrs byte
604597 offset += 1 ;
605598 const len = Number ( view . getBigInt64 ( offset , true ) ) ;
606599 offset += 8 ;
@@ -693,7 +686,7 @@ export class RayforceClient {
693686 columns,
694687 rowCount,
695688 toJS : ( ) => rows ,
696- getColumn : ( name : string ) => wasmTable . col ( name ) ?. toTypedArray ?. ( ) || null ,
689+ getColumn : ( name : string ) => wasmTable . col ( name ) ?. typedArray || null ,
697690 } ;
698691 } catch {
699692 // Fall back to JS-only result
@@ -725,7 +718,7 @@ export class RayforceClient {
725718 // Simple dict: parse keys and values
726719 const { data : keys , bytesRead : keyBytes } = this . parseAnyWithSize ( view , offset ) ;
727720 offset += keyBytes ;
728- const { data : values , bytesRead : valBytes } = this . parseAnyWithSize ( view , offset ) ;
721+ const { data : values } = this . parseAnyWithSize ( view , offset ) ;
729722
730723 // If keys are symbols and values are vectors, create a table-like structure
731724 if ( Array . isArray ( keys ) && Array . isArray ( values ) ) {
@@ -994,7 +987,6 @@ export class RayforceClient {
994987 }
995988
996989 const type = Math . abs ( obj . type ) ;
997- const sdk = this . sdk ! ;
998990
999991 // Table
1000992 if ( type === Types . TABLE ) {
@@ -1011,7 +1003,7 @@ export class RayforceClient {
10111003 getColumn : ( name : string ) => {
10121004 const col = table . col ( name ) ;
10131005 if ( ! col ) return null ;
1014- return col . toTypedArray ?. ( ) || null ;
1006+ return col . typedArray || null ;
10151007 } ,
10161008 // Lazy JS conversion
10171009 toJS : ( ) => table . toRows ( ) ,
@@ -1020,11 +1012,12 @@ export class RayforceClient {
10201012
10211013 // Vector
10221014 if ( obj . isVector ) {
1015+ const vec = obj as Vector ;
10231016 return {
10241017 type : 'vector' ,
10251018 rayObject : obj ,
10261019 // Zero-copy access for numeric vectors
1027- getColumn : ( ) => obj . toTypedArray ?. ( ) || null ,
1020+ getColumn : ( ) => vec . typedArray || null ,
10281021 toJS : ( ) => obj . toJS ( ) ,
10291022 } ;
10301023 }
0 commit comments