import { Attestation } from '../models/simplestamp/v1/attestation'; import { SimpleStamp } from '../models/simplestamp/v1/timestamp'; import { Calendar } from './calendar'; export declare class Timestamp { /** @internal */ timestamp_: SimpleStamp; /** @internal */ calendar_: Calendar; constructor(hash: Buffer); /** Parse a serialized binary representation of an existing Timestamp. */ static fromBinary(binary: Buffer): Timestamp; /** * Add an Attestation to this Timestamp's list. * Returns false if one with the same calendar URL already exists. */ addAttestation(attestation: Attestation): boolean; /** * Search attestations for one matching the calendar key. */ getAttestationsByKey(calendarKey: Buffer): Attestation; /** Get a readable label for an AttestationStatus value. */ static getAttestationStatusLabel(status: number): string; /** * Compute the digest hash: SHA256(SHA256(hash + nonce [+ source] [+ identity] [+ location])) */ getDigestHash(): Buffer; /** Get a readable label for an OperationType value. */ static getOperationTypeLabel(type: number): string; /** Get attestations in the pending state. */ getPending(): Attestation[]; /** Whether there are attestations with pending updates. */ hasPending(): boolean; /** * Take the binary response from calling /digest, process it, and merge into attestations. */ importDigestResponse(binary: Buffer): boolean; /** Whether this Timestamp has been stamped (has attestations). */ isStamped(): boolean; /** Set the free-form description field. */ setDescription(description: string): void; /** Set identity information. Throws if already stamped. */ setIdentity(countryCode: string, state: string, city: string, organization: string, section: string, commonName: string, email: string, fullName: string): void; /** Set location and trajectory. Throws if already stamped. */ setLocation(latitude: number, longitude?: number, altitude?: number, accuracy?: number, direction?: number, velocity?: number): void; /** Override the random nonce value (mostly useful for testing). */ setNonce(nonce: Buffer): void; /** Set the source field (file name, URL, etc.). */ setSource(source: string): void; /** Call /digest on all calendars. Returns the number of successful stamps. */ stamp(optUrls?: string[]): Promise; /** Serialize to a portable binary representation. */ toBinary(): Buffer; /** JSON representation for inspecting/debugging. Not meant for re-importing. */ toJSON(): Record; /** Nicer string representation. Not meant for re-importing. */ toString(): string; /** Compute updates from the calendar server. */ update(): Promise; /** * Find the attestation by calendar key, attach new operations, and execute them. */ upgradeAttestation(calendarKey: Buffer, binary: Buffer): boolean; /** Utility method for UNIX timestamp in seconds. @internal */ static getNow_(): number; } //# sourceMappingURL=timestamp.d.ts.map