mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-16 11:02:11 +08:00
Add recharts-scale (#29186)
* Add recharts-scale * Use path mapping to import * file should end with new line
This commit is contained in:
29
types/recharts-scale/index.d.ts
vendored
Normal file
29
types/recharts-scale/index.d.ts
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
// Type definitions for Recharts 1.0
|
||||
// Project: https://github.com/recharts/recharts-scale
|
||||
// Definitions by: John Reilly <https://github.com/johnnyreilly>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
/**
|
||||
* Calculate the ticks of an interval
|
||||
* @param [minAndMax] min: The minimum value, max: The maximum value
|
||||
* @param tickCount The count of ticks
|
||||
* @param allowDecimals Allow the ticks to be decimals or not - defaults to true
|
||||
*/
|
||||
export function getTickValues(domain: [number, number], tickCount?: number, allowDecimals?: boolean): number[];
|
||||
|
||||
/**
|
||||
* Calculate the ticks of an interval
|
||||
* @param [minAndMax] min: The minimum value, max: The maximum value
|
||||
* @param tickCount The count of ticks
|
||||
* @param allowDecimals Allow the ticks to be decimals or not - defaults to true
|
||||
*/
|
||||
export function getNiceTickValues(domain: [number, number], tickCount?: number, allowDecimals?: boolean): number[];
|
||||
|
||||
/**
|
||||
* Calculate the ticks of an interval
|
||||
* @param [minAndMax] min: The minimum value, max: The maximum value
|
||||
* @param tickCount The count of ticks
|
||||
* @param allowDecimals Allow the ticks to be decimals or not - defaults to true
|
||||
*/
|
||||
export function getTickValuesFixedDomain(domain: [number, number], tickCount?: number, allowDecimals?: boolean): number[];
|
||||
9
types/recharts-scale/recharts-scale-tests.ts
Normal file
9
types/recharts-scale/recharts-scale-tests.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import {
|
||||
getTickValues,
|
||||
getNiceTickValues,
|
||||
getTickValuesFixedDomain
|
||||
} from 'recharts-scale';
|
||||
|
||||
getTickValues([1, 10], 6, false);
|
||||
getNiceTickValues([1, 10], 6, false);
|
||||
getTickValuesFixedDomain([1, 10], 6, false);
|
||||
25
types/recharts-scale/tsconfig.json
Normal file
25
types/recharts-scale/tsconfig.json
Normal file
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"jsx": "react",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"recharts-scale-tests.ts"
|
||||
]
|
||||
}
|
||||
7
types/recharts-scale/tslint.json
Normal file
7
types/recharts-scale/tslint.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
// TODO
|
||||
"no-any-union": false
|
||||
}
|
||||
}
|
||||
1
types/recharts/index.d.ts
vendored
1
types/recharts/index.d.ts
vendored
@@ -15,6 +15,7 @@
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
import * as React from 'react';
|
||||
import { getTickValues, getNiceTickValues, getTickValuesFixedDomain } from 'recharts-scale';
|
||||
import { CurveFactory } from 'd3-shape';
|
||||
|
||||
export type Percentage = string;
|
||||
|
||||
Reference in New Issue
Block a user