@types/react-google-places-suggest
TypeScript icon, indicating that this package has built-in type declarations

3.12.0 • Public • Published

Installation

npm install --save @types/react-google-places-suggest

Summary

This package contains type definitions for react-google-places-suggest (https://github.com/xuopled/react-google-places-suggest).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-google-places-suggest.

/// <reference types="google.maps" />

import { Component, JSX, ReactNode } from "react";

declare class ReactGooglePlacesSuggest extends Component<ReactGooglePlacesSuggest.Props> {}

declare namespace ReactGooglePlacesSuggest {
    type AutocompletionRequest = google.maps.places.AutocompletionRequest;
    type PlacesServiceStatus = google.maps.places.PlacesServiceStatus;
    type Prediction = google.maps.places.AutocompletePrediction;
    type GoogleMaps = typeof google.maps;
    type GeocodedPrediction = google.maps.GeocoderResult;

    interface Props {
        /** Undocumented */
        autocompletionRequest: AutocompletionRequest;

        /** Undocumented */
        children: ReactNode;

        /** injected by react-google-maps-loader */
        googleMaps: GoogleMaps;

        /** Handle no results when enter key is pressed */
        onNoResult?:
            | (
                (
                    geocodedPrediction: GeocodedPrediction,
                    originalPrediction: Prediction,
                ) => void
            )
            | undefined;

        /** Handle click on suggest */
        onSelectSuggest?:
            | (
                (
                    geocodedPrediction: GeocodedPrediction,
                    originalPrediction: Prediction,
                ) => void
            )
            | undefined;

        /** Handle places service status update */
        onStatusUpdate?: ((status: PlacesServiceStatus) => void) | undefined;

        /** Customize list item */
        customRender?: ((prediction?: Prediction) => JSX.Element | string) | undefined;

        /** Customize list */
        customContainerRender?: ((predictions: Prediction[]) => JSX.Element | string) | undefined;

        /**
         * Display the "Powered By Google" logo as required by the [Google Maps autocomplete terms and conditions](https://developers.google.com/maps/documentation/javascript/place-autocomplete#fig1).
         * (defaults to true. Not included when using customContainerRender prop)
         *
         * @default true
         */
        displayPoweredByGoogle?: boolean;

        /**
         * No results text, null to disable
         *
         * @default "No results"
         */
        textNoResults?: string | null | undefined;
    }
}

export = ReactGooglePlacesSuggest;

Additional Details

Credits

These definitions were written by .

Readme

Keywords

none

Package Sidebar

Install

npm i @types/react-google-places-suggest

Weekly Downloads

1,286

Version

3.12.0

License

MIT

Unpacked Size

7.38 kB

Total Files

5

Last publish

Collaborators

  • types