Something went wrong. Try again.
leaflet fork for copy edit / bug fixes forked from leaflet.pub/leaflet
Something went wrong. Try again.
TypeScript
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990import { LexiconDoc, LexRefUnion } from "@atproto/lexicon";
export const PubLeafletThemeBackgroundImage = { lexicon: 1, id: "pub.leaflet.theme.backgroundImage", defs: { main: { type: "object", required: ["image"], properties: { image: { type: "blob", accept: ["image/*"], maxSize: 1000000, }, width: { type: "integer" }, repeat: { type: "boolean" }, }, }, },};export const PubLeafletThemeWordmark = { lexicon: 1, id: "pub.leaflet.theme.wordmark", defs: { main: { type: "object", required: ["image"], properties: { image: { type: "blob", accept: ["image/*"], maxSize: 1000000, }, width: { type: "integer" }, aspectRatio: { type: "ref", ref: "#aspectRatio", }, }, }, aspectRatio: { type: "object", required: ["width", "height"], properties: { width: { type: "integer" }, height: { type: "integer" }, }, }, },};export const PubLeafletThemeColor: LexiconDoc = { lexicon: 1, id: "pub.leaflet.theme.color", defs: { rgba: { type: "object", required: ["r", "g", "b", "a"], properties: { r: { type: "integer", maximum: 255, minimum: 0 }, g: { type: "integer", maximum: 255, minimum: 0 }, b: { type: "integer", maximum: 255, minimum: 0 }, a: { type: "integer", maximum: 100, minimum: 0 }, }, }, rgb: { type: "object", required: ["r", "g", "b"], properties: { r: { type: "integer", maximum: 255, minimum: 0 }, g: { type: "integer", maximum: 255, minimum: 0 }, b: { type: "integer", maximum: 255, minimum: 0 }, }, }, },};
export const ThemeLexicons = [ PubLeafletThemeBackgroundImage, PubLeafletThemeWordmark, PubLeafletThemeColor,];
export const ColorUnion: LexRefUnion = { type: "union", refs: Object.keys(PubLeafletThemeColor.defs).map( (key) => `${PubLeafletThemeColor.id}#${key}`, ),};