mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-05 07:17:04 +00:00
react-daum-postcode: Provides its own types (#39507)
* react-daum-postcode: Provides its own types * Fix notNeededPackages.json after merge
This commit is contained in:
committed by
Nathan Shively-Sanders
parent
51de8fe815
commit
d73ef93f00
@@ -3576,6 +3576,12 @@
|
||||
"sourceRepoURL": "https://github.com/gor181/react-chartjs-2",
|
||||
"asOfVersion": "2.5.7"
|
||||
},
|
||||
{
|
||||
"libraryName": "react-daum-postcode",
|
||||
"typingsPackageName": "react-daum-postcode",
|
||||
"sourceRepoURL": "https://github.com/kimminsik-bernard/react-daum-postcode",
|
||||
"asOfVersion": "1.6.1"
|
||||
},
|
||||
{
|
||||
"libraryName": "react-collapsible",
|
||||
"typingsPackageName": "react-collapsible",
|
||||
|
||||
Vendored
-26
@@ -1,26 +0,0 @@
|
||||
// Type definitions for react-daum-postcode 1.3
|
||||
// Project: https://github.com/kimminsik-bernard/react-daum-postcode
|
||||
// Definitions by: Sa-ryong Kang <https://github.com/Sa-ryong>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
import { Component } from 'react';
|
||||
|
||||
export namespace DaumPostcode {
|
||||
interface Props {
|
||||
onComplete: any;
|
||||
width?: number | string;
|
||||
height?: number | string;
|
||||
autoClose?: boolean;
|
||||
autoResize?: boolean;
|
||||
animation?: boolean;
|
||||
style?: any;
|
||||
defaultQuery?: string;
|
||||
theme?: any;
|
||||
scriptUrl?: string;
|
||||
}
|
||||
}
|
||||
|
||||
export default class DaumPostcode extends Component<DaumPostcode.Props, any> {
|
||||
render(): JSX.Element;
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
import * as React from 'react';
|
||||
import DaumPostcode from 'react-daum-postcode';
|
||||
|
||||
class Postcode extends React.Component<any, any> {
|
||||
handleAddress = (data: any) => {
|
||||
let fullAddress: string = data.address;
|
||||
let extraAddress = '';
|
||||
|
||||
if (data.addressType === 'R') {
|
||||
if (data.bname !== '') {
|
||||
extraAddress += data.bname;
|
||||
}
|
||||
if (data.buildingName !== '') {
|
||||
extraAddress += (extraAddress !== '' ? `, ${data.buildingName}` : data.buildingName);
|
||||
}
|
||||
fullAddress += (extraAddress !== '' ? ` (${extraAddress})` : '');
|
||||
}
|
||||
|
||||
console.log(fullAddress); // e.g. '서울 성동구 왕십리로2길 20 (성수동1가)'
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<DaumPostcode
|
||||
onComplete={this.handleAddress}
|
||||
/>
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
{
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"react-daum-postcode-tests.tsx"
|
||||
],
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": false,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"jsx": "react",
|
||||
"experimentalDecorators": true,
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
}
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user