mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
Add definitions for ink-table
This commit is contained in:
parent
d77c47c753
commit
233f4e2101
23
types/ink-table/index.d.ts
vendored
Normal file
23
types/ink-table/index.d.ts
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
// Type definitions for ink-table 1.0
|
||||
// Project: https://github.com/maticzav/ink-table#readme
|
||||
// Definitions by: Łukasz Ostrowski <https://github.com/lukostry>
|
||||
// Definitions: https://github.com/DefinitelyTyped/
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
import { InkComponent, InkNode, StatelessComponent } from 'ink';
|
||||
|
||||
export interface TableProps {
|
||||
cell?: InkComponent;
|
||||
data?: ReadonlyArray<object>;
|
||||
header?: InkComponent;
|
||||
padding?: number;
|
||||
skeleton?: InkComponent;
|
||||
}
|
||||
|
||||
export const Cell: StatelessComponent<{ children: InkNode }>;
|
||||
export const Header: StatelessComponent<{ children: InkNode }>;
|
||||
export const Skeleton: StatelessComponent<{ children: InkNode }>;
|
||||
|
||||
declare const Table: StatelessComponent<TableProps>;
|
||||
|
||||
export default Table;
|
||||
45
types/ink-table/ink-table-tests.tsx
Normal file
45
types/ink-table/ink-table-tests.tsx
Normal file
@ -0,0 +1,45 @@
|
||||
/** @jsx h */
|
||||
import { h } from 'ink';
|
||||
import Table from 'ink-table';
|
||||
|
||||
const data = [
|
||||
{
|
||||
name: 'Sosa Saunders',
|
||||
gender: 'male',
|
||||
age: 17,
|
||||
email: 'sosa.saunders@mail.com',
|
||||
phone: '+1 (809) 435-2786'
|
||||
},
|
||||
{
|
||||
name: 'Angelina Kirk',
|
||||
gender: 'female',
|
||||
age: 3,
|
||||
email: 'angelina@kirk.io',
|
||||
phone: '+1 (870) 567-3516'
|
||||
},
|
||||
{
|
||||
name: 'Bradford Rosales',
|
||||
gender: 'male',
|
||||
age: 20,
|
||||
email: 'bradfordrosales@fast.com',
|
||||
phone: '+1 (918) 573-3240'
|
||||
},
|
||||
{
|
||||
name: 'Gwen Schroeder',
|
||||
gender: 'female',
|
||||
age: 17,
|
||||
email: 'gwen@corp.xyz',
|
||||
phone: '+1 (987) 417-2062'
|
||||
},
|
||||
{
|
||||
name: 'Ellison Mann',
|
||||
gender: 'male',
|
||||
age: 5,
|
||||
email: 'ellisonmann@katakana.com',
|
||||
phone: '+1 (889) 411-2186'
|
||||
}
|
||||
];
|
||||
|
||||
const Basic = () => (
|
||||
<Table data= { data } />
|
||||
);
|
||||
24
types/ink-table/tsconfig.json
Normal file
24
types/ink-table/tsconfig.json
Normal file
@ -0,0 +1,24 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"jsx": "react",
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictFunctionTypes": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"ink-table-tests.tsx"
|
||||
]
|
||||
}
|
||||
1
types/ink-table/tslint.json
Normal file
1
types/ink-table/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Loading…
Reference in New Issue
Block a user