@@ -23,7 +23,7 @@ import { CommandType } from "./Commands/CommandData";
2323import { TypeUtil } from "../Utility/TypeUtil" ;
2424import { IDisposable } from "../Types/Contracts" ;
2525import { TypedTimeSeriesEntry } from "./Session/TimeSeries/TypedTimeSeriesEntry" ;
26- import { ClassConstructor } from "../Types" ;
26+ import { ClassConstructor , EntityConstructor } from "../Types" ;
2727import { TimeSeriesOperations } from "./TimeSeries/TimeSeriesOperations" ;
2828import { TimeSeriesValuesHelper } from "./Session/TimeSeries/TimeSeriesValuesHelper" ;
2929
@@ -397,18 +397,18 @@ export class BulkInsertOperation {
397397 return new BulkInsertOperation . _attachmentsBulkInsertClass ( this , id ) ;
398398 }
399399
400- public timeSeriesFor ( id : string , name ) ;
401- public timeSeriesFor < T extends object > ( clazz : ClassConstructor < T > , id : string )
402- public timeSeriesFor < T extends object > ( clazz : ClassConstructor < T > , id : string , name : string )
403- public timeSeriesFor < T extends object > ( classOrId : ClassConstructor < T > | string , idOrName : string , name ?: string ) {
400+ public timeSeriesFor ( id : string , name ) : ITimeSeriesBulkInsert ;
401+ public timeSeriesFor < T extends object > ( clazz : EntityConstructor < T > , id : string ) : ITypedTimeSeriesBulkInsert < T > ;
402+ public timeSeriesFor < T extends object > ( clazz : EntityConstructor < T > , id : string , name : string ) : ITypedTimeSeriesBulkInsert < T > ;
403+ public timeSeriesFor < T extends object > ( classOrId : EntityConstructor < T > | string , idOrName : string , name ?: string ) {
404404 if ( TypeUtil . isString ( classOrId ) ) {
405405 return this . _timeSeriesFor ( classOrId , idOrName ) ;
406406 } else {
407407 return this . _typedTimeSeriesFor ( classOrId , idOrName , name ) ;
408408 }
409409 }
410410
411- private _typedTimeSeriesFor < T extends object > ( clazz : ClassConstructor < T > , id : string , name : string = null ) {
411+ private _typedTimeSeriesFor < T extends object > ( clazz : EntityConstructor < T > , id : string , name : string = null ) {
412412 if ( StringUtil . isNullOrEmpty ( id ) ) {
413413 throwError ( "InvalidArgumentException" , "Document id cannot be null or empty" ) ;
414414 }
@@ -616,7 +616,7 @@ export class BulkInsertOperation {
616616 }
617617
618618 firstValue = false ;
619- this . _operation . _currentWriter . push ( value . toString ( ) ) ;
619+ this . _operation . _currentWriter . push ( ( value ?? 0 ) . toString ( ) ) ;
620620 }
621621
622622 if ( tag ) {
0 commit comments