1.2.5 • Published 7 months ago

@types/leaflet-textpath v1.2.5

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

Installation

npm install --save @types/leaflet-textpath

Summary

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

Details

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

index.d.ts

// Type definitions for leaflet-textpath 1.2
// Project: https://github.com/makinacorpus/Leaflet.TextPath
// Definitions by: Eric Myllyoja <https://github.com/MasterEric>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

// Needed to access the leaflet module, to extend it.
import * as Leaflet from 'leaflet';

// Needed to access JSX.IntrinsicElements.
import * as React from 'react';

/*
 * Add new properties to existing types in the leaflet module.
 */
declare module 'leaflet' {
    /**
     * <number> rotates the text by the specified angle, in degrees.
     * 'flip' rotates the text by 180 degrees.
     * 'perpendicular' rotates the text by 90 degrees.
     */
    type TextPathOrientation = 'flip' | 'perpendicular' | number;

    interface TextPathOptions {
        /**
         * Specifies if the text should be repeated along the polyline.
         * @default false
         */
        repeat?: boolean | undefined;
        /**
         * Centers the text according to the polyline's bounding box.
         * @default false
         */
        center?: boolean | undefined;
        /**
         * Show text below the path.
         * @default false
         */
        below?: boolean | undefined;
        /**
         * Set an offset to position text relative to the polyline.
         * @default 0
         */
        offset?: number | undefined;
        /**
         * Rotate text.
         * @default 0
         */
        orientation?: TextPathOrientation | undefined;
        /**
         * Object containing the attributes applied to the text tag.
         * @see https://developer.mozilla.org/en-US/docs/Web/SVG/Element/text#attributes
         * @default {}
         */
        attributes?: Record<string, string> | undefined;
    }

    interface Polyline {
        /**
         * Set the text to display over this Polyline.
         * @default null Represents no text.
         */
        setText: (text: string | null, options?: TextPathOptions) => void;
    }

    interface LayerGroup {
        /**
         * Set the text to display over the Polylines in this layer group.
         * @default null Represents no text.
         */
        setText: (text: string | null, options?: TextPathOptions) => void;
    }
}

Additional Details

Credits

These definitions were written by Eric Myllyoja.

1.2.5

7 months ago

1.2.4

7 months ago

1.2.3

9 months ago

1.2.2

1 year ago

1.2.1

3 years ago

1.2.0

3 years ago