Skip to main content
Glama
y-range.js770 B
import * as Y from 'yjs' /** * Defines a range on text using relative positions that can be transformed back to * absolute positions. (https://docs.yjs.dev/api/relative-positions) */ export class YRange { /** * @param {Y.RelativePosition} yanchor * @param {Y.RelativePosition} yhead */ constructor (yanchor, yhead) { this.yanchor = yanchor this.yhead = yhead } /** * @returns {any} */ toJSON () { return { yanchor: Y.relativePositionToJSON(this.yanchor), yhead: Y.relativePositionToJSON(this.yhead) } } /** * @param {any} json * @return {YRange} */ static fromJSON (json) { return new YRange(Y.createRelativePositionFromJSON(json.yanchor), Y.createRelativePositionFromJSON(json.yhead)) } }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/systeminit/si'

If you have feedback or need assistance with the MCP directory API, please join our Discord server