diff options
Diffstat (limited to 'src/client/documents/Documents.ts')
-rw-r--r-- | src/client/documents/Documents.ts | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/client/documents/Documents.ts b/src/client/documents/Documents.ts index 1b0c422da..9b1f64a36 100644 --- a/src/client/documents/Documents.ts +++ b/src/client/documents/Documents.ts @@ -969,6 +969,24 @@ export namespace Docs { ); } + export function LinkDocument(source: Doc, target: Doc, options: DocumentOptions = {}, id?: string) { + const linkDoc = InstanceFromProto( + Prototypes.get(DocumentType.LINK), + undefined, + { + link_anchor_1: source, + link_anchor_2: target, + ...options, + }, + id, + 'link' + ); + + Doc.AddLink(linkDoc); + + return linkDoc; + } + export function InkDocument(points: PointData[], options: DocumentOptions = {}, strokeWidth: number, color: string, strokeBezier: string, fillColor: string, arrowStart: string, arrowEnd: string, dash: string, isInkMask: boolean) { const ink = InstanceFromProto(Prototypes.get(DocumentType.INK), '', { title: 'ink', ...options }); ink.$color = color; |