diff --git a/types/reactabular-dnd/index.d.ts b/types/reactabular-dnd/index.d.ts new file mode 100644 index 0000000000..b0985b7941 --- /dev/null +++ b/types/reactabular-dnd/index.d.ts @@ -0,0 +1,18 @@ +// Type definitions for reactabular-dnd 8.16 +// Project: http://reactabular.js.org/ +// Definitions by: Marcos Junior +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 3.0 + +/// + +import * as Table from "reactabular-table"; + +export interface DndMoveEvent { + sourceLabel: string; + targetLabel: string; +} + +export function moveLabels(columns: Table.Column[], event: DndMoveEvent): Table.Column[]; + +export function Header(props: any): JSX.Element; diff --git a/types/reactabular-dnd/reactabular-dnd-tests.tsx b/types/reactabular-dnd/reactabular-dnd-tests.tsx new file mode 100644 index 0000000000..0892972164 --- /dev/null +++ b/types/reactabular-dnd/reactabular-dnd-tests.tsx @@ -0,0 +1,39 @@ +import * as React from "react"; +import * as dnd from "reactabular-dnd"; +import * as Table from "reactabular-table"; + +export interface Props { + columns: Table.Column[]; + rows: any[]; +} + +class ReactabularDndTestComponent extends React.Component { + constructor(props: Props) { + super(props); + } + + renderers: Table.Renderers = { + header: { + cell: dnd.Header, + }, + body: { + row: (props: any) => , + }, + }; + + render() { + return
+ + + + +
; + } +} +export default ReactabularDndTestComponent; diff --git a/types/reactabular-dnd/tsconfig.json b/types/reactabular-dnd/tsconfig.json new file mode 100644 index 0000000000..a9d72242a4 --- /dev/null +++ b/types/reactabular-dnd/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "jsx": "react", + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "reactabular-dnd-tests.tsx" + ] +} diff --git a/types/reactabular-dnd/tslint.json b/types/reactabular-dnd/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/reactabular-dnd/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }