sanity-plugin-google-maps-zoom
Version:
Sanity plugin providing input handlers for geo-related input types using Google Maps
77 lines (61 loc) • 2.06 kB
TypeScript
/// <reference types="google.maps" />
import {ArrayDiff} from 'sanity'
import {DiffComponent} from 'sanity'
import {DiffComponentOptions} from 'sanity'
import {DiffProps} from 'sanity'
import {JSX as JSX_2} from 'react/jsx-runtime'
import {ObjectDiff} from 'sanity'
import {ObjectInputProps} from 'sanity'
import {ObjectSchemaType} from 'sanity'
import {Plugin as Plugin_2} from 'sanity'
import {default as React_2} from 'react'
declare type Focusable = any
export declare interface Geopoint {
_type: 'geopoint'
_key?: string
lat: number
lng: number
alt?: number
}
export declare const GeopointArrayDiff: DiffComponent<ArrayDiff<Geopoint>>
export declare type GeopointArrayDiffProps = DiffProps<ArrayDiff<Geopoint>>
export declare const GeopointFieldDiff: DiffComponent<ObjectDiff<Geopoint>>
export declare type GeopointFieldDiffProps = DiffProps<ObjectDiff<Geopoint>>
export declare class GeopointInput extends React_2.PureComponent<GeopointInputProps, InputState> {
_geopointInputId: string
editButton: Focusable | undefined
constructor(props: GeopointInputProps)
setEditButton: (el: Focusable) => void
focus(): void
handleToggleModal: () => void
handleCloseModal: () => void
handleChange: (latLng: google.maps.LatLng) => void
handleZoomChange: (zoom: number) => void
handleClear: () => void
render(): JSX_2.Element
}
export declare type GeopointInputProps = ObjectInputProps<Geopoint, GeopointSchemaType> & {
geoConfig: GoogleMapsInputConfig
}
export declare interface GeopointSchemaType extends ObjectSchemaType {
diffComponent?: DiffComponent<ObjectDiff<Geopoint>> | DiffComponentOptions<ObjectDiff<Geopoint>>
}
export declare const googleMapsInput: Plugin_2<GoogleMapsInputConfig>
export declare interface GoogleMapsInputConfig {
apiKey: string
defaultZoom?: number
saveZoom?: boolean
defaultLocale?: string
defaultLocation?: {
lat: number
lng: number
}
}
declare interface InputState {
modalOpen: boolean
}
export declare interface LatLng {
lat: number
lng: number
}
export {}