2.0.3 • Published 5 months ago

@atcute/bluesky-richtext-builder v2.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

@atcute/bluesky-richtext-builder

builder pattern for Bluesky's rich text facets.

import RichtextBuilder from '@atcute/bluesky-richtext-builder';

const { text, facets } = new RichtextBuilder()
	.addText(`hello, `)
	.addMention(`@user`, 'did:plc:ia76kvnndjutgedggx2ibrem')
	.addText(`! please visit my`)
	.addLink(`website`, 'https://example.com');

text;
// ^? `hello, @user! please visit my website`

facets;
// ^? [{ index: { byteStart: 7, byteEnd: 12 }, ... }, { index: { byteStart: 30, byteEnd: 37 }, ... }];
2.0.3

5 months ago

1.0.2

11 months ago

2.0.2

5 months ago

2.0.1

5 months ago

2.0.0

6 months ago

1.0.1

1 year ago

1.0.0

1 year ago