mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
First version of reactabular-dnd typings (#40497)
This commit is contained in:
parent
b81ff8f424
commit
29ba6577fa
18
types/reactabular-dnd/index.d.ts
vendored
Normal file
18
types/reactabular-dnd/index.d.ts
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
// Type definitions for reactabular-dnd 8.16
|
||||
// Project: http://reactabular.js.org/
|
||||
// Definitions by: Marcos Junior <https://github.com/junalmeida>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 3.0
|
||||
|
||||
/// <reference types="react" />
|
||||
|
||||
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;
|
||||
39
types/reactabular-dnd/reactabular-dnd-tests.tsx
Normal file
39
types/reactabular-dnd/reactabular-dnd-tests.tsx
Normal file
@ -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<Props> {
|
||||
constructor(props: Props) {
|
||||
super(props);
|
||||
}
|
||||
|
||||
renderers: Table.Renderers = {
|
||||
header: {
|
||||
cell: dnd.Header,
|
||||
},
|
||||
body: {
|
||||
row: (props: any) => <tr {...props} />,
|
||||
},
|
||||
};
|
||||
|
||||
render() {
|
||||
return <div>
|
||||
<Table.Provider
|
||||
columns={this.props.columns}
|
||||
renderers={this.renderers}
|
||||
>
|
||||
<Table.Header />
|
||||
<Table.Body
|
||||
rows={this.props.rows}
|
||||
rowKey="id"
|
||||
/>
|
||||
</Table.Provider>
|
||||
</div>;
|
||||
}
|
||||
}
|
||||
export default ReactabularDndTestComponent;
|
||||
25
types/reactabular-dnd/tsconfig.json
Normal file
25
types/reactabular-dnd/tsconfig.json
Normal file
@ -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"
|
||||
]
|
||||
}
|
||||
1
types/reactabular-dnd/tslint.json
Normal file
1
types/reactabular-dnd/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Loading…
Reference in New Issue
Block a user