mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-06-28 14:20:12 +00:00
Add input-moment declarations (#37231)
* Add input-moment * Strings * Add File to TSConfig (sorry) * Rename * Package.json * change Require * Require index.d.ts
This commit is contained in:
committed by
Jesse Trinity
parent
e64c46abc4
commit
95264ebcb9
25
types/input-moment/index.d.ts
vendored
Normal file
25
types/input-moment/index.d.ts
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
// Type definitions for input-moment 0.4
|
||||
// Project: https://github.com/wangzuo/input-moment
|
||||
// Definitions by: Tim Ittermann <https://github.com/timia2109>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 3.5
|
||||
|
||||
import React = require('react');
|
||||
import moment = require('moment');
|
||||
|
||||
export type OnChangeListener = (m: moment.Moment) => void;
|
||||
export type OnSaveListener = () => void;
|
||||
|
||||
export interface InputMomentProps {
|
||||
moment: moment.Moment;
|
||||
onChange?: OnChangeListener;
|
||||
onSave?: OnSaveListener;
|
||||
minStep?: number;
|
||||
hourStep?: number;
|
||||
prevMonthIcon?: string;
|
||||
nextMonthIcon?: string;
|
||||
}
|
||||
|
||||
export default class InputMoment extends React.Component<InputMomentProps> {
|
||||
constructor(props: Readonly<InputMomentProps>);
|
||||
}
|
||||
10
types/input-moment/input-moment-tests.tsx
Normal file
10
types/input-moment/input-moment-tests.tsx
Normal file
@@ -0,0 +1,10 @@
|
||||
import React = require('react');
|
||||
import InputMoment from 'input-moment';
|
||||
import moment = require('moment');
|
||||
|
||||
const momentI = moment();
|
||||
|
||||
const OnChange: (m: moment.Moment) => void = (m: moment.Moment) => console.log(m);
|
||||
const OnSave: () => void = () => console.log('Save');
|
||||
|
||||
const InputMomentTest: React.SFC = () => <InputMoment moment={momentI} onChange={OnChange} onSave={OnSave} />;
|
||||
6
types/input-moment/package.json
Normal file
6
types/input-moment/package.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"moment": "latest"
|
||||
}
|
||||
}
|
||||
26
types/input-moment/tsconfig.json
Normal file
26
types/input-moment/tsconfig.json
Normal file
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"jsx": "preserve"
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"input-moment-tests.tsx"
|
||||
]
|
||||
}
|
||||
3
types/input-moment/tslint.json
Normal file
3
types/input-moment/tslint.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json"
|
||||
}
|
||||
Reference in New Issue
Block a user