@@ -86,8 +86,8 @@ export class BaseData<T extends DataType = DataType> implements VectorLike {
86
86
}
87
87
return nullCount ;
88
88
}
89
- public clone < R extends T > ( type : R , length = this . length , offset = this . offset , nullCount = this . _nullCount ) {
90
- return new BaseData ( type , length , offset , nullCount ) ;
89
+ public clone < R extends T > ( type : R , length = this . length , offset = this . offset , nullCount = this . _nullCount ) : Data < R > {
90
+ return new BaseData ( type , length , offset , nullCount ) as any ;
91
91
}
92
92
public slice ( offset : number , length : number ) {
93
93
return length <= 0 ? this : this . sliceInternal ( this . clone (
@@ -180,8 +180,8 @@ export class NestedData<T extends NestedType = NestedType> extends BaseData<T> {
180
180
this . childData = childData ;
181
181
this [ VectorType . VALIDITY ] = toTypedArray ( Uint8Array , nullBitmap ) ;
182
182
}
183
- public clone < R extends T > ( type : R , length = this . length , offset = this . offset , nullCount = this . _nullCount ) {
184
- return new NestedData < R > ( type , length , this [ VectorType . VALIDITY ] , this . childData , offset , nullCount ) ;
183
+ public clone < R extends T > ( type : R , length = this . length , offset = this . offset , nullCount = this . _nullCount ) : Data < R > {
184
+ return new NestedData < R > ( type , length , this [ VectorType . VALIDITY ] , this . childData , offset , nullCount ) as any ;
185
185
}
186
186
protected sliceInternal ( clone : this, offset : number , length : number ) {
187
187
if ( ! this [ VectorType . OFFSET ] ) {
@@ -208,8 +208,8 @@ export class ListData<T extends ListType> extends SingleNestedData<T> {
208
208
super ( type , length , nullBitmap , valueChildData , offset , nullCount ) ;
209
209
this [ VectorType . OFFSET ] = toTypedArray ( Int32Array , valueOffsets ) ;
210
210
}
211
- public clone < R extends T > ( type : R , length = this . length , offset = this . offset , nullCount = this . _nullCount ) {
212
- return new ListData < R > ( type , length , this [ VectorType . VALIDITY ] , this [ VectorType . OFFSET ] , this . _valuesData as any , offset , nullCount ) ;
211
+ public clone < R extends T > ( type : R , length = this . length , offset = this . offset , nullCount = this . _nullCount ) : Data < R > {
212
+ return new ListData ( type , length , this [ VectorType . VALIDITY ] , this [ VectorType . OFFSET ] , this . _valuesData as any , offset , nullCount ) as any ;
213
213
}
214
214
}
215
215
@@ -224,24 +224,24 @@ export class UnionData<T extends (DenseUnion | SparseUnion) = any> extends Neste
224
224
return ( typeIdToChildIndex [ typeId ] = idx ) && typeIdToChildIndex || typeIdToChildIndex ;
225
225
} , Object . create ( null ) as { [ key : number ] : number } ) ;
226
226
}
227
- public clone < R extends T > ( type : R , length = this . length , offset = this . offset , nullCount = this . _nullCount ) {
228
- return new UnionData < R > ( type , length , this [ VectorType . VALIDITY ] , this [ VectorType . TYPE ] , this . childData , offset , nullCount ) ;
227
+ public clone < R extends T > ( type : R , length = this . length , offset = this . offset , nullCount = this . _nullCount ) : Data < R > {
228
+ return new UnionData < R > ( type , length , this [ VectorType . VALIDITY ] , this [ VectorType . TYPE ] , this . childData , offset , nullCount ) as any ;
229
229
}
230
230
}
231
231
232
232
export class SparseUnionData extends UnionData < SparseUnion > {
233
233
constructor ( type : SparseUnion , length : number , nullBitmap : Uint8Array | null | undefined , typeIds : Iterable < number > , childData : Data < any > [ ] , offset ?: number , nullCount ?: number ) {
234
234
super ( type , length , nullBitmap , typeIds , childData , offset , nullCount ) ;
235
235
}
236
- public clone < R extends SparseUnion > ( type : R , length = this . length , offset = this . offset , nullCount = this . _nullCount ) {
236
+ public clone < R extends SparseUnion > ( type : R , length = this . length , offset = this . offset , nullCount = this . _nullCount ) : Data < R > {
237
237
return new SparseUnionData (
238
238
type ,
239
239
length ,
240
240
this [ VectorType . VALIDITY ] ,
241
241
this [ VectorType . TYPE ] ,
242
242
this . childData ,
243
243
offset , nullCount
244
- ) as any as UnionData < R > ;
244
+ ) as any ;
245
245
}
246
246
}
247
247
@@ -252,7 +252,7 @@ export class DenseUnionData extends UnionData<DenseUnion> {
252
252
super ( type , length , nullBitmap , typeIds , childData , offset , nullCount ) ;
253
253
this [ VectorType . OFFSET ] = toTypedArray ( Int32Array , valueOffsets ) ;
254
254
}
255
- public clone < R extends DenseUnion > ( type : R , length = this . length , offset = this . offset , nullCount = this . _nullCount ) {
255
+ public clone < R extends DenseUnion > ( type : R , length = this . length , offset = this . offset , nullCount = this . _nullCount ) : Data < R > {
256
256
return new DenseUnionData (
257
257
type ,
258
258
length ,
@@ -261,7 +261,7 @@ export class DenseUnionData extends UnionData<DenseUnion> {
261
261
this [ VectorType . OFFSET ] ,
262
262
this . childData ,
263
263
offset , nullCount
264
- ) as any as UnionData < R > ;
264
+ ) as any ;
265
265
}
266
266
}
267
267
@@ -288,12 +288,12 @@ export class ChunkedData<T extends DataType> extends BaseData<T> {
288
288
}
289
289
return nullCount ;
290
290
}
291
- public clone < R extends T > ( type : R , length = this . length , offset = this . offset , nullCount = this . _nullCount ) {
292
- return new ChunkedData < R > (
291
+ public clone < R extends T > ( type : R , length = this . length , offset = this . offset , nullCount = this . _nullCount ) : Data < R > {
292
+ return new ChunkedData (
293
293
type , length ,
294
294
this . _chunkVectors . map ( ( vec ) => vec . clone ( vec . data . clone ( type ) ) ) as any ,
295
295
offset , nullCount , this . _chunkOffsets
296
- ) ;
296
+ ) as any ;
297
297
}
298
298
protected sliceInternal ( clone : this, offset : number , length : number ) {
299
299
const chunks = this . _chunkVectors ;
0 commit comments