3 import CommonBase from './CommonBase';
4 import * as bindings from '../bindings' // TODO: figure out location
8 export default class PositiveTimestamp extends CommonBase {
9 constructor(_dummy: object, ptr: number) {
14 protected finalize() {
18 bindings.PositiveTimestamp_free(this.ptr);
21 public boolean eq(PositiveTimestamp b) {
22 boolean ret = bindings.PositiveTimestamp_eq(this.ptr, b == null ? 0 : b.ptr & ~1);
27 public number clone_ptr() {
28 number ret = bindings.PositiveTimestamp_clone_ptr(this.ptr);
32 public PositiveTimestamp clone() {
33 number ret = bindings.PositiveTimestamp_clone(this.ptr);
34 const ret_hu_conv: PositiveTimestamp = new PositiveTimestamp(null, ret);
35 ret_hu_conv.ptrs_to.add(this);
39 public static Result_PositiveTimestampCreationErrorZ constructor_from_unix_timestamp(number unix_seconds) {
40 number ret = bindings.PositiveTimestamp_from_unix_timestamp(unix_seconds);
41 Result_PositiveTimestampCreationErrorZ ret_hu_conv = Result_PositiveTimestampCreationErrorZ.constr_from_ptr(ret);
45 public static Result_PositiveTimestampCreationErrorZ constructor_from_system_time(number time) {
46 number ret = bindings.PositiveTimestamp_from_system_time(time);
47 Result_PositiveTimestampCreationErrorZ ret_hu_conv = Result_PositiveTimestampCreationErrorZ.constr_from_ptr(ret);
51 public number as_unix_timestamp() {
52 number ret = bindings.PositiveTimestamp_as_unix_timestamp(this.ptr);
56 public number as_time() {
57 number ret = bindings.PositiveTimestamp_as_time(this.ptr);