1414 * See the License for the specific language governing permissions and
1515 * limitations under the License.
1616 */
17+ import { CasInput } from '@cbjsdev/shared' ;
18+
19+ import { CppCasInput } from './binding.js' ;
1720import type { AnyCollection } from './clusterTypes/index.js' ;
1821import type { Collection } from './collection.js' ;
1922import { CounterResult , MutationResult } from './crudoptypes.js' ;
@@ -32,9 +35,15 @@ export interface IncrementOptions {
3235 initial ?: number ;
3336
3437 /**
35- * The expiry time that should be set for the document, expressed in seconds.
38+ * Specifies the expiry time for the document.
39+ *
40+ * The expiry can be provided as:
41+ * - A `number` of seconds relative to the current time.
42+ * - A `Date` object for an absolute expiry time.
43+ *
44+ * **IMPORTANT:** To use a Unix timestamp for expiry, construct a Date from it ( new Date(UNIX_TIMESTAMP * 1000) ).
3645 */
37- expiry ?: number ;
46+ expiry ?: number | Date ;
3847
3948 /**
4049 * Specifies the level of synchronous durability for this operation.
@@ -73,9 +82,15 @@ export interface DecrementOptions {
7382 initial ?: number ;
7483
7584 /**
76- * The expiry time that should be set for the document, expressed in seconds.
85+ * Specifies the expiry time for the document.
86+ *
87+ * The expiry can be provided as:
88+ * - A `number` of seconds relative to the current time.
89+ * - A `Date` object for an absolute expiry time.
90+ *
91+ * **IMPORTANT:** To use a Unix timestamp for expiry, construct a Date from it ( new Date(UNIX_TIMESTAMP * 1000) ).
7792 */
78- expiry ?: number ;
93+ expiry ?: number | Date ;
7994
8095 /**
8196 * Specifies the level of synchronous durability for this operation.
@@ -129,6 +144,12 @@ export interface AppendOptions {
129144 * The timeout for this operation, represented in milliseconds.
130145 */
131146 timeout ?: number ;
147+
148+ /**
149+ * If specified, indicates that operation should be failed if the CAS
150+ * has changed from this value, indicating that the document has changed.
151+ */
152+ cas ?: CasInput ;
132153}
133154
134155/**
@@ -158,6 +179,12 @@ export interface PrependOptions {
158179 * The timeout for this operation, represented in milliseconds.
159180 */
160181 timeout ?: number ;
182+
183+ /**
184+ * If specified, indicates that operation should be failed if the CAS
185+ * has changed from this value, indicating that the document has changed.
186+ */
187+ cas ?: CasInput ;
161188}
162189
163190/**
0 commit comments