@@ -357,46 +357,47 @@ <h1 class="page-title">Source: src/sender.js</h1>
357357 checkCapacity(this, [valueStr], 1 + valueStr.length);
358358 write(this, valueStr);
359359 write(this, 'i');
360- }, "number" );
360+ });
361361 return this;
362362 }
363363
364364 /**
365365 * Write a timestamp column with its value into the buffer of the sender.
366366 *
367367 * @param {string} name - Column name.
368- * @param {number} value - Column value , accepts only number objects .
368+ * @param {number | bigint } value - Epoch timestamp in microseconds , accepts only numbers or BigInts .
369369 * @return {Sender} Returns with a reference to this sender.
370370 */
371371 timestampColumn(name, value) {
372- if (!Number.isInteger(value)) {
373- throw new Error(`Value must be an integer, received ${value}`);
372+ if (typeof value !== "bigint" && !Number.isInteger(value)) {
373+ throw new Error(`Value must be an integer or BigInt , received ${value}`);
374374 }
375375 writeColumn(this, name, value, () => {
376376 const valueStr = value.toString();
377377 checkCapacity(this, [valueStr], 1 + valueStr.length);
378378 write(this, valueStr);
379379 write(this, 't');
380- }, "number" );
380+ });
381381 return this;
382382 }
383383
384384 /**
385385 * Closing the row after writing the designated timestamp into the buffer of the sender.
386386 *
387- * @param {string} timestamp - A string represents the designated timestamp in nanoseconds.
387+ * @param {string | bigint } timestamp - A string or BigInt that represents the designated timestamp in epoch nanoseconds.
388388 */
389389 at(timestamp) {
390390 if (!this.hasSymbols && !this.hasColumns) {
391391 throw new Error("The row must have a symbol or column set before it is closed");
392392 }
393- if (typeof timestamp !== "string") {
394- throw new Error(`The designated timestamp must be of type string, received ${typeof timestamp}`);
393+ if (typeof timestamp !== "string" && typeof timestamp !== "bigint" ) {
394+ throw new Error(`The designated timestamp must be of type string or BigInt , received ${typeof timestamp}`);
395395 }
396396 validateDesignatedTimestamp(timestamp);
397- checkCapacity(this, [], 2 + timestamp.length);
397+ const timestampStr = timestamp.toString();
398+ checkCapacity(this, [], 2 + timestampStr.length);
398399 write(this, ' ');
399- write(this, timestamp );
400+ write(this, timestampStr );
400401 write(this, '\n');
401402 startNewRow(this);
402403 }
@@ -469,7 +470,7 @@ <h1 class="page-title">Source: src/sender.js</h1>
469470 if (typeof name !== "string") {
470471 throw new Error(`Column name must be a string, received ${typeof name}`);
471472 }
472- if (typeof value !== valueType) {
473+ if (valueType != null && typeof value !== valueType) {
473474 throw new Error(`Column value must be of type ${valueType}, received ${typeof value}`);
474475 }
475476 if (!sender.hasTable) {
@@ -529,7 +530,7 @@ <h1 class="page-title">Source: src/sender.js</h1>
529530}
530531
531532exports.Sender = Sender;
532- exports.DEFAULT_BUFFER_SIZE = DEFAULT_BUFFER_SIZE
533+ exports.DEFAULT_BUFFER_SIZE = DEFAULT_BUFFER_SIZE;
533534</ code > </ pre >
534535 </ article >
535536 </ section >
@@ -546,7 +547,7 @@ <h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-@q
546547< br class ="clear ">
547548
548549< footer >
549- Documentation generated by < a href ="https://github.com/jsdoc/jsdoc "> JSDoc 3.6.11</ a > on Fri May 26 2023 10:30:37 GMT+0100 (British Summer Time)
550+ Documentation generated by < a href ="https://github.com/jsdoc/jsdoc "> JSDoc 3.6.11</ a > on Mon Sep 18 2023 15:34:51 GMT+0100 (British Summer Time)
550551</ footer >
551552
552553< script > prettyPrint ( ) ; </ script >
0 commit comments