8.0.5 • Published 6 months ago

@types/zipcodes v8.0.5

Weekly downloads
5,565
License
MIT
Repository
github
Last release
6 months ago

Installation

npm install --save @types/zipcodes

Summary

This package contains type definitions for zipcodes (https://github.com/davglass/zipcodes#readme).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/zipcodes.

index.d.ts

// 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>
//                 Piotr Błażejewicz <https://github.com/peterblazejewicz>
// 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 const codes: Record<string, ZipCode>;

export const states: {
    full: Record<string, string>;
    abbr: Record<string, string>;
    normalize: (state: string) => 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;

Additional Details

  • Last updated: Sun, 18 Jul 2021 21:31:11 GMT
  • Dependencies: none
  • Global values: ZipCodes

Credits

These definitions were written by Brayden Lopez, Dobes Vandermeer, and Piotr Błażejewicz.

8.0.5

6 months ago

8.0.4

7 months ago

8.0.3

11 months ago

8.0.2

3 years ago

8.0.1

3 years ago

8.0.0

4 years ago

6.1.0

6 years ago

6.0.0

6 years ago