mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-12 13:00:19 +00:00
New typings: japan-postal-code (#42700)
* clear to tests * Clear to tests * Failing tests fix * fix failing tests * fix failing tests * fix failing tests
This commit is contained in:
Vendored
+31
@@ -0,0 +1,31 @@
|
||||
// Type definitions for japan-postal-code 0.2
|
||||
// Project: https://github.com/mzp/japan-postal-code
|
||||
// Definitions by: Takesi Tokugawa <https://github.com/TokugawaTakesi>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export as namespace JapanPostalCodeLibrary;
|
||||
|
||||
export = JapanPostalCode;
|
||||
|
||||
declare const JapanPostalCode: JapanPostalCode.API;
|
||||
|
||||
declare namespace JapanPostalCode {
|
||||
interface API {
|
||||
get: FetchPostalCodeMethod;
|
||||
}
|
||||
|
||||
interface FetchPostalCodeMethod {
|
||||
(stringifiedPostalCode: string, callback: Callback): void;
|
||||
}
|
||||
|
||||
interface Callback {
|
||||
(addressData: AddressData): void;
|
||||
}
|
||||
|
||||
interface AddressData {
|
||||
prefecture: string;
|
||||
city: string;
|
||||
area: string;
|
||||
street: string;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
import JapanPostalCode from "japan-postal-code";
|
||||
|
||||
JapanPostalCode.get('1000001', (addressData: JapanPostalCode.AddressData) => {
|
||||
console.log(addressData.prefecture);
|
||||
console.log(addressData.city);
|
||||
console.log(addressData.area);
|
||||
console.log(addressData.street);
|
||||
});
|
||||
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"esModuleInterop": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"japan-postal-code-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user