mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
34 lines
1.0 KiB
TypeScript
34 lines
1.0 KiB
TypeScript
// Type definitions for zipcodes 8.0
|
|
// Project: https://github.com/davglass/zipcodes#readme
|
|
// Definitions by: Brayden Lopez <https://github.com/headdetect>, Dobes Vandermeer <https://github.com/dobesv>
|
|
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
|
|
export as namespace ZipCodes;
|
|
|
|
export interface ZipCode {
|
|
zip: string;
|
|
latitude: number;
|
|
longitude: number;
|
|
city: string;
|
|
state: string;
|
|
country: string;
|
|
}
|
|
|
|
export function lookup(zip: string | number): ZipCode | undefined;
|
|
|
|
export function lookupByName(city: string, state: string): ZipCode[];
|
|
|
|
export function lookupByState(state: string): ZipCode[];
|
|
|
|
export function distance(zipA: string | number, zipB: string | number): number | null;
|
|
|
|
export function radius(zip: string | number, miles: number, full: boolean): string[] | ZipCode[];
|
|
|
|
export function toMiles(kilos: number): number;
|
|
|
|
export function toKilometers(miles: number): number;
|
|
|
|
export function lookupByCoords(lat: number, lon: number): string | null;
|
|
|
|
export function random(): ZipCode;
|