@types/leaflet-label
TypeScript icon, indicating that this package has built-in type declarations

0.2.39 • Public • Published

Installation

npm install --save @types/leaflet-label

Summary

This package contains type definitions for leaflet-label (https://github.com/Leaflet/Leaflet.label).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/leaflet-label.

index.d.ts

import * as L from "leaflet";

declare module "leaflet" {
    interface IconOptions {
        labelAnchor?: Point | undefined;
    }

    interface PathOptions {
        labelAnchor?: Point | undefined;
    }

    interface CircleMarkerOptions {
        labelAnchor?: Point | undefined;
    }

    interface Marker {
        showLabel(): Marker;
        hideLabel(): Marker;
        setLabelNoHide(noHide: boolean): void;
        bindLabel(content: string, options?: LabelOptions): Marker;
        unbindLabel(): Marker;
        updateLabelContent(content: string): void;
        getLabel(): Label;
        setOpacity(opacity: number, labelHasSemiTransparency: boolean): void;
    }

    interface CircleMarker {
        showLabel(): CircleMarker;
        hideLabel(): CircleMarker;
        setLabelNoHide(noHide: boolean): void;
        bindLabel(content: string, options?: LabelOptions): CircleMarker;
        unbindLabel(): CircleMarker;
        updateLabelContent(content: string): void;
        getLabel(): Label;
    }

    interface FeatureGroup<T extends ILayer> {
        clearLayers(): FeatureGroup<T>;
        bindLabel(content: string, options?: LabelOptions): FeatureGroup<T>;
        unbindLabel(): FeatureGroup<T>;
        updateLabelContent(content: string): FeatureGroup<T>;
    }

    interface Path {
        bindLabel(content: string, options?: LabelOptions): Path;
        unbindLabel(): Path;
        updateLabelContent(content: string): void;
    }

    interface LabelOptions {
        className?: string | undefined;
        clickable?: boolean | undefined;
        direction?: string | undefined; // 'left' | 'right' | 'auto';
        pane?: string | undefined;
        noHide?: boolean | undefined;
        offset?: Point | undefined;
        opacity?: number | undefined;
        zoomAnimation?: boolean | undefined;
    }

    interface LabelStatic extends ClassStatic {
        new(options?: LabelOptions): Label;
    }

    const Label: LabelStatic;

    interface Label extends IEventPowered<Label> {
        onAdd(map: Map): void;
        onRemove(map: Map): void;
        setLatLng(latlng: LatLng): Label;
        setContent(content: string): Label;
        close(): void;
        updateZIndex(zIndex: number): void;
        setOpacity(opacity: number): void;
    }
}

Additional Details

  • Last updated: Tue, 07 Nov 2023 09:09:38 GMT
  • Dependencies: @types/leaflet

Credits

These definitions were written by Wim Looman.

Versions

Current Tags

Version History

Package Sidebar

Install

npm i @types/leaflet-label

Weekly Downloads

68

Version

0.2.39

License

MIT

Unpacked Size

7.26 kB

Total Files

5

Last publish

Collaborators

  • types