@@ -4,7 +4,7 @@ import { Buffer } from "node:buffer";
4
4
import { log , Logger } from "../logging" ;
5
5
import { validateColumnName , validateTableName } from "../validation" ;
6
6
import { SenderOptions } from "../options" ;
7
- import { isInteger , timestampToMicros , timestampToNanos } from "../utils" ;
7
+ import { isInteger , timestampToMicros , timestampToNanos , TimestampUnit } from "../utils" ;
8
8
9
9
const DEFAULT_MAX_NAME_LENGTH = 127 ;
10
10
@@ -262,11 +262,7 @@ class SenderBuffer {
262
262
* @param {string } [unit=us] - Timestamp unit. Supported values: 'ns' - nanoseconds, 'us' - microseconds, 'ms' - milliseconds. Defaults to 'us'.
263
263
* @return {Sender } Returns with a reference to this sender.
264
264
*/
265
- timestampColumn (
266
- name : string ,
267
- value : number | bigint ,
268
- unit : "ns" | "us" | "ms" = "us" ,
269
- ) : SenderBuffer {
265
+ timestampColumn ( name : string , value : number | bigint , unit : TimestampUnit = "us" ) : SenderBuffer {
270
266
if ( typeof value !== "bigint" && ! Number . isInteger ( value ) ) {
271
267
throw new Error ( `Value must be an integer or BigInt, received ${ value } ` ) ;
272
268
}
@@ -286,7 +282,7 @@ class SenderBuffer {
286
282
* @param {number | bigint } timestamp - Designated epoch timestamp, accepts numbers or BigInts.
287
283
* @param {string } [unit=us] - Timestamp unit. Supported values: 'ns' - nanoseconds, 'us' - microseconds, 'ms' - milliseconds. Defaults to 'us'.
288
284
*/
289
- at ( timestamp : number | bigint , unit : "ns" | "us" | "ms" = "us" ) {
285
+ at ( timestamp : number | bigint , unit : TimestampUnit = "us" ) {
290
286
if ( ! this . hasSymbols && ! this . hasColumns ) {
291
287
throw new Error ( "The row must have a symbol or column set before it is closed" ) ;
292
288
}
0 commit comments