New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@atcute/leaflet

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@atcute/leaflet

Leaflet (pub.leaflet.*) schema definitions

latest
Source
npmnpm
Version
1.0.21
Version published
Maintainers
1
Created
Source

@atcute/leaflet

Leaflet (pub.leaflet.*) schema definitions

npm install @atcute/leaflet

usage

import { PubLeafletDocument } from '@atcute/leaflet';
import { is } from '@atcute/lexicons';

const document: PubLeafletDocument.Main = {
	$type: 'pub.leaflet.document',
	title: 'Article title',
	author: 'did:plc:ia76kvnndjutgedggx2ibrem',
	description: 'Article description',
	publication: 'at://did:plc:ia76kvnndjutgedggx2ibrem/pub.leaflet.publication/3lpyvgcwc722m',
	publishedAt: '2025-05-25T14:44:37.870Z',
	pages: [
		{
			$type: 'pub.leaflet.pages.linearDocument',
			blocks: [
				{
					$type: 'pub.leaflet.pages.linearDocument#block',
					block: {
						$type: 'pub.leaflet.blocks.text',
						facets: [{ index: { byteEnd: 12, byteStart: 0 }, features: [] }],
						plaintext: 'Hello world!',
					},
				},
				{
					$type: 'pub.leaflet.pages.linearDocument#block',
					block: {
						$type: 'pub.leaflet.blocks.text',
						facets: [
							{
								index: { byteEnd: 9, byteStart: 0 },
								features: [{ $type: 'pub.leaflet.richtext.facet#bold' }],
							},
						],
						plaintext: 'Bold text',
					},
				},
				{
					$type: 'pub.leaflet.pages.linearDocument#block',
					block: {
						$type: 'pub.leaflet.blocks.text',
						facets: [
							{
								index: { byteEnd: 11, byteStart: 0 },
								features: [{ $type: 'pub.leaflet.richtext.facet#italic' }],
							},
						],
						plaintext: 'Italic text',
					},
				},
				{
					$type: 'pub.leaflet.pages.linearDocument#block',
					block: {
						$type: 'pub.leaflet.blocks.text',
						facets: [
							{
								index: { byteEnd: 16, byteStart: 0 },
								features: [
									{ $type: 'pub.leaflet.richtext.facet#bold' },
									{ $type: 'pub.leaflet.richtext.facet#italic' },
								],
							},
						],
						plaintext: 'Bold italic text',
					},
				},
				{
					$type: 'pub.leaflet.pages.linearDocument#block',
					block: { $type: 'pub.leaflet.blocks.text', facets: [], plaintext: '' },
				},
			],
		},
	],
};

is(PubLeafletDocument.mainSchema, document);
// -> true

with @atcute/client

pick either one of these 3 options to register the ambient declarations

// tsconfig.json
{
	"compilerOptions": {
		"types": ["@atcute/leaflet"],
	},
}
// env.d.ts
/// <reference types="@atcute/leaflet" />
// index.ts
import type {} from '@atcute/leaflet';

now all the XRPC operations should be visible in the client

with @atcute/lex-cli

when building your own lexicons that reference Leaflet types, configure lex-cli to import from this package:

// file: lex.config.js
import { defineLexiconConfig } from '@atcute/lex-cli';

export default defineLexiconConfig({
	files: ['lexicons/**/*.json'],
	outdir: 'src/lexicons/',
	imports: ['@atcute/leaflet'],
});

Keywords

atcute

FAQs

Package last updated on 09 Mar 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts