-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #35 from blakek/correct-typings
💯 update type exports
- Loading branch information
Showing
7 changed files
with
40 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { Geolocation, ZIPCode } from '.' | ||
|
||
export type ZIPCodeList = Geolocation & { zipCode: ZIPCode } | ||
|
||
declare module 'us-zips/array' { | ||
const defaultExport: ZIPCodeList[] | ||
export default defaultExport | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,11 @@ | ||
interface ZIPGeolocation { | ||
export interface Geolocation { | ||
latitude: number | ||
longitude: number | ||
} | ||
|
||
type ZIPCode = string | ||
|
||
type ZIPCodeList = (ZIPGeolocation & { zipCode: ZIPCode })[] | ||
type ZIPKeyValueList = [ZIPCode, ZIPGeolocation][] | ||
type ZIPMap = Map<ZIPCode, ZIPGeolocation> | ||
type ZIPObject = Record<ZIPCode, ZIPGeolocation> | ||
|
||
declare module 'us-zips/array' { | ||
const defaultExport: ZIPCodeList | ||
export default defaultExport | ||
} | ||
|
||
declare module 'us-zips/key-value' { | ||
const defaultExport: ZIPKeyValueList | ||
export default defaultExport | ||
} | ||
|
||
declare module 'us-zips/map' { | ||
const defaultExport: ZIPMap | ||
export default defaultExport | ||
} | ||
|
||
declare module 'us-zips/object' { | ||
const defaultExport: ZIPObject | ||
export default defaultExport | ||
} | ||
export type ZIPCode = string | ||
|
||
declare module 'us-zips' { | ||
const defaultExport: ZIPObject | ||
const defaultExport: import('./object').ZIPCodeList | ||
export default defaultExport | ||
} | ||
|
||
declare module 'us-zips/zipCount' { | ||
const zipCount: number | ||
export default zipCount | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { Geolocation, ZIPCode } from '.' | ||
|
||
export type ZIPCodeList = [ZIPCode, Geolocation][] | ||
|
||
declare module 'us-zips/key-value' { | ||
const defaultExport: ZIPCodeList | ||
export default defaultExport | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { Geolocation, ZIPCode } from '.' | ||
|
||
export type ZIPCodeList = Map<ZIPCode, Geolocation> | ||
|
||
declare module 'us-zips/map' { | ||
const defaultExport: ZIPCodeList | ||
export default defaultExport | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { Geolocation, ZIPCode } from '.' | ||
|
||
export type ZIPCodeList = Record<ZIPCode, Geolocation> | ||
|
||
declare module 'us-zips/object' { | ||
const defaultExport: ZIPCodeList | ||
export default defaultExport | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
declare module 'us-zips/zipCount' { | ||
const zipCount: number | ||
export default zipCount | ||
} |