JSR's score docked "module docs in all entrypoints" and "docs for most
symbols" (0% documented). This adds:
- `@module` doc comments to `src/index.ts` and `src/elements/index.ts`
- JSDoc on every top-level exported symbol reachable from those entrypoints:
all `props.ts` types + codec factories, the `WithProps` mixin and its
types, the `register.ts` events and `emit*` helpers, the `shared-props.ts`
fragments and structural interfaces, every `event-types.ts` family, and all
25 `Leaflet*Element` classes
- field-level docs on the `PropDef` and `LeafletElement` interfaces
Existing `//` explanations were converted in place; no behaviour change.
`jsr publish --dry-run` still clean; typecheck / lint / test / build pass.
// Attribute name. Defaults to the kebab-cased property name. A function
/** Attribute name; defaults to the kebab-cased property name. A function receives the property name and returns the attribute (see {@link disabled}). */
// receives the property name and returns the attribute (see `disabled`).
attribute?: string|((name: string)=>string);
attribute?: string|((name: string)=>string);
// The property value when the attribute is absent. Keep this equal to
/** The value when the attribute is absent. Keep it equal to Leaflet's own default — an absent attribute is omitted from the options object entirely. */
// Leaflet's own default: an absent attribute is left out of the options
// object entirely, so it is Leaflet's default that actually takes effect.
default:T;
default:T;
// Set through `positional()` for values the Leaflet constructor takes as an
/** Set (to `false`) by {@link positional} for values the Leaflet constructor takes as an argument rather than an option. */
// argument (coordinates, urls, bounds) rather than as an option.
option?: false;
option?: false;
/** Parse the raw attribute string into the value. */
decode(raw: string):T;
decode(raw: string):T;
// Returning null removes the attribute, which restores Leaflet's default.
/** Serialise the value back to an attribute string; return `null` to remove the attribute (restoring Leaflet's default). */
encode(value: T):string|null;
encode(value: T):string|null;
// Pushes a new value into the Leaflet object. Defaults to calling the
/** Push a new value into the live Leaflet object. Defaults to the matching setter (`opacity` → `setOpacity`) when the object has one. */
// matching setter when the object has one (`opacity` -> `setOpacity`).
set?(obj: TObj,value: T,el: HTMLElement):void;
set?(obj: TObj,value: T,el: HTMLElement):void;
// Reads the live value back out of the Leaflet object. Used by the property
/** Read the live value back out of the object — backs the property getter and the `event` write-back. */
// getter, and by `event` below to write the value back to the attribute.
get?(obj: TObj):T|undefined;
get?(obj: TObj):T|undefined;
// Leaflet event after which `get` is re-read and synced to the attribute,
/** Leaflet event after which `get` is re-read and synced to the attribute (`move` keeps lat/lng current during a drag). */
// e.g. `move` keeps lat/lng current while a marker is dragged.
event?: string;
event?: string;
}
}
/** A record of {@link PropDef}s keyed by property name — an element's `PROPS` table. */
/** `<leaflet-icon>` — a Leaflet `Icon` (an image marker icon). Child of `<leaflet-marker>`; rebuilt on every attribute change and swapped in via `setIcon()`. */
/** `<leaflet-video-overlay>` — a Leaflet `VideoOverlay` (a video pinned to geographic `bounds`). `loop` / `autoplay` / `muted` / `playsinline` map to the `<video>`. */