diff --git a/types/react-countdown-circle-timer/index.d.ts b/types/react-countdown-circle-timer/index.d.ts new file mode 100644 index 0000000000..9e7ec0df9a --- /dev/null +++ b/types/react-countdown-circle-timer/index.d.ts @@ -0,0 +1,28 @@ +// Type definitions for react-countdown-circle-timer 1.0 +// Project: https://github.com/vydimitrov/react-countdown-circle-timer +// Definitions by: Tim Ittermann +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 3.6 + +import { Component, ReactNode } from 'react'; + +export type ColorType = ReadonlyArray<[ string, number? ]>; +export type StrokeLinecapType = "round" | "square"; +export type RenderTimeFunctionType = (remainingTime: number, elapsedTime: number, isPlaying: boolean) => ReactNode; +export type OnCompleteFunctionType = () => [boolean, number] | undefined | void; + +export class CountdownCircleTimer extends Component {} + +export interface Props { + durationSeconds: number; + colors: ColorType; + size?: number; + strokeWidth?: number; + strokeLinecap?: StrokeLinecapType; + trailColor?: string; + isPlaying?: boolean; + isLinearGradient?: boolean; + gradientUniqueKey?: string; + renderTime?: RenderTimeFunctionType; + onComplete?: OnCompleteFunctionType; +} diff --git a/types/react-countdown-circle-timer/react-countdown-circle-timer-tests.tsx b/types/react-countdown-circle-timer/react-countdown-circle-timer-tests.tsx new file mode 100644 index 0000000000..2126bbad7a --- /dev/null +++ b/types/react-countdown-circle-timer/react-countdown-circle-timer-tests.tsx @@ -0,0 +1,22 @@ +import * as React from "react"; +import { CountdownCircleTimer } from "react-countdown-circle-timer"; + +const Test: React.FC = () => { + return

Test

} + onComplete={() => { }} + />; +}; diff --git a/types/react-countdown-circle-timer/tsconfig.json b/types/react-countdown-circle-timer/tsconfig.json new file mode 100644 index 0000000000..1d82b2a6aa --- /dev/null +++ b/types/react-countdown-circle-timer/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "jsx": "react" + }, + "files": [ + "index.d.ts", + "react-countdown-circle-timer-tests.tsx" + ] +} diff --git a/types/react-countdown-circle-timer/tslint.json b/types/react-countdown-circle-timer/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/react-countdown-circle-timer/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }