import { IConversionOptions } from "protobufjs"; import { Evidence } from "./evidence"; import { Link } from "./link"; import { stratumn } from "./proto/chainscript_pb"; /** * Deserialize a segment. * @param segmentBytes encoded bytes. * @returns the deserialized segment. */ export declare function deserialize(segmentBytes: Uint8Array): Segment; /** * Convert an plain object to a segment. * @param segment plain object. */ export declare function fromObject(segment: any): Segment; /** * A segment describes an atomic step in your process. */ export declare class Segment { private pbLink; private pbSegment; constructor(pbSegment: stratumn.chainscript.Segment); /** * The segment can be enriched with evidence that the link was saved * immutably somewhere. * @param e evidence. */ addEvidence(e: Evidence): void; /** * Return all the evidences in this segment. * @returns evidences. */ evidences(): Evidence[]; /** * Return all the evidences of a specific backend. * @param backend of the expected evidences. * @returns evidences. */ findEvidences(backend: string): Evidence[]; /** * Retrieve the evidence for the given backend and provider (if one exists). * @param backend evidence backend. * @param provider evidence backend instance. * @returns the evidence or null. */ getEvidence(backend: string, provider: string): Evidence | null; /** * The segment's link is its immutable part. * @returns the segment's link. */ link(): Link; /** * Get the hash of the segment's link. * @returns the link's hash. */ linkHash(): Uint8Array; /** * Serialize the segment. * @returns segment bytes. */ serialize(): Uint8Array; /** * Convert to a plain object. * @argument conversionOpts specify how to convert certain types * @returns a plain object. */ toObject(conversionOpts?: IConversionOptions): any; /** * Validate checks for errors in a segment. */ validate(): void; } //# sourceMappingURL=segment.d.ts.map