import { Link } from "./link"; import { LinkReference } from "./ref"; /** * ILinkBuilder makes it easy to create links that adhere to the ChainScript * spec. * It provides valid default values for required fields and allows the user * to set fields to valid values. */ export interface ILinkBuilder { /** * Set the link action. * The action is what caused the link to be created. * @param action friendly name of the action. */ withAction(action: string): ILinkBuilder; /** * Set the link data (custom object containing business logic details). * @param data link details. */ withData(data: any): ILinkBuilder; /** * Set the maximum number of children a link is allowed to have. * By default this is set to -1 to allow any number of children. * @param d degree of the link. */ withDegree(d: number): ILinkBuilder; /** * Set the link metadata (custom object containing business logic details). * @param data link metadata. */ withMetadata(data: any): ILinkBuilder; /** * Set the link's parent. * @param linkHash parent's link hash. */ withParent(linkHash: Uint8Array): ILinkBuilder; /** * Set the link's priority. The priority is used to order links. * @param priority a positive float. */ withPriority(priority: number): ILinkBuilder; /** * (Optional) Set the link process' state. * The process can be in a specific state depending on the actions taken. * @param state process state after the link action. */ withProcessState(state: string): ILinkBuilder; /** * (Optional) A link can reference other links, even if they are from other * processes. * @param refs references to relevant links. */ withRefs(refs: LinkReference[]): ILinkBuilder; /** * (Optional) Set the link's process step. * It can be used to help deserialize link data or filter link search results. * @param step link process step. */ withStep(step: string): ILinkBuilder; /** * (Optional) A link can be tagged. * Tags are useful to filter link search results. * @param tags link tags. */ withTags(tags: string[]): ILinkBuilder; /** build the link. */ build(): Link; } /** * LinkBuilder makes it easy to create links that adhere to the ChainScript * spec. * It provides valid default values for required fields and allows the user * to set fields to valid values. */ export declare class LinkBuilder implements ILinkBuilder { private link; private linkData; private linkMetadata; constructor(process: string, mapId: string); withAction(action: string): ILinkBuilder; withData(data: any): ILinkBuilder; withDegree(d: number): ILinkBuilder; withMetadata(data: any): ILinkBuilder; withParent(linkHash: Uint8Array): ILinkBuilder; withPriority(priority: number): ILinkBuilder; withProcessState(state: string): ILinkBuilder; withRefs(refs: LinkReference[]): ILinkBuilder; withStep(step: string): ILinkBuilder; withTags(tags: string[]): ILinkBuilder; build(): Link; } //# sourceMappingURL=link_builder.d.ts.map