mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
Added types for d3-interpolate-path package (#35828)
* Added types for reactour package * added types for d3-interpolate-path package
This commit is contained in:
parent
48fd0bd15a
commit
a539320135
14
types/d3-interpolate-path/d3-interpolate-path-tests.ts
Normal file
14
types/d3-interpolate-path/d3-interpolate-path-tests.ts
Normal file
@ -0,0 +1,14 @@
|
||||
import { interpolatePath } from 'd3-interpolate-path';
|
||||
|
||||
// $ExpectType (t: number) => string
|
||||
const interpolate = interpolatePath('M0,0 L10,10', 'M10,10 L20,20 L30,30');
|
||||
|
||||
// $ExpectType string
|
||||
interpolate(0.6);
|
||||
|
||||
// $ExpectType string
|
||||
interpolatePath(
|
||||
'M0,0 L10,10',
|
||||
'M10,10 L20,20 L30,30',
|
||||
(a, b) => a.x === b.x && b.y === 30 && a.type === 'L'
|
||||
)(0.3);
|
||||
16
types/d3-interpolate-path/index.d.ts
vendored
Normal file
16
types/d3-interpolate-path/index.d.ts
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
// Type definitions for d3-interpolate-path 2.0
|
||||
// Project: https://github.com/pbeshai/d3-interpolate-path
|
||||
// Definitions by: Paweł Dąbrowski <https://github.com/paolostyle>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export interface PathCommandObject {
|
||||
type: string;
|
||||
x: number;
|
||||
y: number;
|
||||
}
|
||||
|
||||
export function interpolatePath(
|
||||
a: string,
|
||||
b: string,
|
||||
excludeSegment?: (a: PathCommandObject, b: PathCommandObject) => boolean
|
||||
): (t: number) => string;
|
||||
23
types/d3-interpolate-path/tsconfig.json
Normal file
23
types/d3-interpolate-path/tsconfig.json
Normal file
@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"d3-interpolate-path-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/d3-interpolate-path/tslint.json
Normal file
1
types/d3-interpolate-path/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Loading…
Reference in New Issue
Block a user