react-json-pretty: Provides its own types (#39512)

This commit is contained in:
Alexander T
2019-11-06 14:01:38 -08:00
committed by Nathan Shively-Sanders
parent d402dab6cc
commit 7936f4d588
5 changed files with 6 additions and 74 deletions
+6
View File
@@ -3666,6 +3666,12 @@
"sourceRepoURL": "https://github.com/formatjs/react-intl",
"asOfVersion": "3.0.0"
},
{
"libraryName": "react-json-pretty",
"typingsPackageName": "react-json-pretty",
"sourceRepoURL": "https://github.com/chenckang/react-json-pretty",
"asOfVersion": "2.2.0"
},
{
"libraryName": "react-joyride",
"typingsPackageName": "react-joyride",
-23
View File
@@ -1,23 +0,0 @@
// Type definitions for react-json-pretty 1.7
// Project: https://github.com/chenckang/react-json-pretty
// Definitions by: Karol Janyst <https://github.com/LKay>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8
import { ComponentClass, HTMLAttributes } from 'react';
export as namespace JSONPretty;
export = JSONPretty;
declare const JSONPretty: JSONPretty;
type JSONPretty = ComponentClass<JSONPretty.JSONPrettyProps>;
declare namespace JSONPretty {
interface JSONPrettyProps extends HTMLAttributes<HTMLPreElement> {
json: any;
replacer?(this: any, key: string, value: any): any;
space?: number;
themeClassName?: string;
}
}
@@ -1,24 +0,0 @@
import * as React from "react";
import JSONPretty = require("react-json-pretty");
export class Test extends React.Component {
render() {
const json = {
foo: "bar"
};
const fn = (key: string, value: any) => {
return value;
};
return (
<div>
<JSONPretty json={json} />
<JSONPretty json={JSON.stringify(json)} />
<JSONPretty json={json} replacer={fn} />
<JSONPretty json={json} space={1} />
<JSONPretty json={json} themeClassName="themeName" />
</div>
);
}
}
-26
View File
@@ -1,26 +0,0 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6",
"dom"
],
"target": "es6",
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"jsx": "preserve",
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"react-json-pretty-tests.tsx"
]
}
-1
View File
@@ -1 +0,0 @@
{ "extends": "dtslint/dt.json" }