location-china
Advanced tools
Comparing version 0.1.3 to 0.1.4
@@ -0,3 +1,7 @@ | ||
## v0.1.4 | ||
* re-publish | ||
## v0.1.3 | ||
* export ChinaCode. |
@@ -1,12 +0,39 @@ | ||
import * as Division from 'china-division'; | ||
import { Level, Location } from './location'; | ||
export { Level, Location } from './location'; | ||
export { Province } from './province'; | ||
export declare const ChinaCode = "10000"; | ||
export declare function provinces(): Division.Location[]; | ||
export declare function cities(): Division.Location[]; | ||
export declare function districts(): Division.Location[]; | ||
export declare function streets(): Division.Location[]; | ||
export declare function from(value: number | string, level?: Level): any; | ||
export declare function fromCode(code: string, level?: Level): Location; | ||
export declare function fromString(name: string, level?: Level): Location; | ||
export enum Level { | ||
Province = 1, | ||
City = 2, | ||
District = 3, | ||
Street = 4 | ||
} | ||
export abstract class Location { | ||
public code: string | ||
public name: string | ||
public level: Level | ||
public parent: string | ||
constructor(code: string, level: Level) | ||
public abstract toString(): string | ||
public abstract toShort(): string | ||
} | ||
export class Province extends Location { | ||
public constructor(code: string) | ||
public toString(): string | ||
public toShort(): string | ||
} | ||
export const ChinaCode | ||
export function provinces(): Location[] | ||
export function cities(): Location[] | ||
export function districts(): Location[] | ||
export function streets(): Location[] | ||
export function from(value: number | string, level?: Level): Location | ||
export function fromCode(code: string, level?: Level): Location | ||
export function fromString(name: string, level?: Level): Location |
{ | ||
"name": "location-china", | ||
"version": "0.1.3", | ||
"version": "0.1.4", | ||
"description": "typescript version for location of china", | ||
"main": "./dist/index.js", | ||
"scripts": { | ||
"start": "npm run build && npm run tslint", | ||
"start": "npm run build && npm run tslint && npm run copy-d", | ||
"build": "tsc -p .", | ||
"copy-d": "cpx \"./index.d.ts\" \"./dist/\"", | ||
"test": "jest", | ||
@@ -41,2 +42,3 @@ "tslint": "tslint -c tslint.json -p tsconfig.json" | ||
"@types/node": "^7.0.29", | ||
"cpx": "^1.5.0", | ||
"jest": "^20.0.4", | ||
@@ -47,2 +49,2 @@ "ts-jest": "^20.0.6", | ||
} | ||
} | ||
} |
{ | ||
"compilerOptions": { | ||
"declaration": true, | ||
"module": "commonjs", | ||
@@ -5,0 +4,0 @@ "target": "es6", |
20985
25
464
7