mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-06-05 20:02:05 +08:00
[hedron] - Add typings
This commit is contained in:
10
types/hedron/hedron-tests.tsx
Normal file
10
types/hedron/hedron-tests.tsx
Normal file
@@ -0,0 +1,10 @@
|
||||
import * as React from 'react';
|
||||
import * as hedron from 'hedron';
|
||||
|
||||
<hedron.BreakpointProvider breakpoints={{ lg: 1, md: 2 }}>
|
||||
<hedron.Page debug fluid tagName="div" width="10px">
|
||||
<hedron.Row debug tagName="div">
|
||||
<hedron.Column debug divisions={3} fluid lg={3} smShift={2}>test</hedron.Column>
|
||||
</hedron.Row>
|
||||
</hedron.Page>
|
||||
</hedron.BreakpointProvider>;
|
||||
61
types/hedron/index.d.ts
vendored
Normal file
61
types/hedron/index.d.ts
vendored
Normal file
@@ -0,0 +1,61 @@
|
||||
// Type definitions for Hedron 0.7
|
||||
// Project: https://github.com/JSBros/hedron
|
||||
// Definitions by: Dmytro Borysov <https://github.com/dborysov>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.4
|
||||
|
||||
import * as React from 'react';
|
||||
|
||||
export interface ColumnProps {
|
||||
tagName?: string;
|
||||
debug?: boolean;
|
||||
divisions?: number;
|
||||
fluid?: boolean;
|
||||
xs?: number;
|
||||
sm?: number;
|
||||
md?: number;
|
||||
lg?: number;
|
||||
xsShift?: number;
|
||||
smShift?: number;
|
||||
mdShift?: number;
|
||||
lgShift?: number;
|
||||
}
|
||||
|
||||
export interface PageProps {
|
||||
tagName?: string;
|
||||
debug?: boolean;
|
||||
fluid?: boolean;
|
||||
width?: string;
|
||||
}
|
||||
|
||||
export interface RowProps {
|
||||
debug?: boolean;
|
||||
tagName?: string;
|
||||
divisions?: number;
|
||||
alignContent?: string;
|
||||
alignItems?: string;
|
||||
alignSelf?: string;
|
||||
justifyContent?: string;
|
||||
order?: string;
|
||||
}
|
||||
|
||||
export interface HiddenProps {
|
||||
debug?: boolean;
|
||||
xs?: boolean;
|
||||
sm?: boolean;
|
||||
md?: boolean;
|
||||
lg?: boolean;
|
||||
}
|
||||
|
||||
export interface BreakpointProviderProps {
|
||||
breakpoints: { sm?: number; md?: number; lg?: number };
|
||||
}
|
||||
|
||||
export class Column extends React.Component<ColumnProps> {}
|
||||
export class Page extends React.Component<PageProps> {}
|
||||
export class Row extends React.Component<RowProps> {}
|
||||
export class Hidden extends React.Component<HiddenProps> {}
|
||||
export class BreakpointProvider extends React.Component<BreakpointProviderProps> {}
|
||||
export function withBreakpoints<T>(
|
||||
wrappedComponent: React.ComponentClass<T>
|
||||
): React.ComponentClass<T>;
|
||||
20
types/hedron/tsconfig.json
Normal file
20
types/hedron/tsconfig.json
Normal file
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"files": ["index.d.ts", "hedron-tests.tsx"],
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": ["es6", "dom"],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strict": true,
|
||||
"noImplicitReturns": true,
|
||||
"noUnusedLocals": true,
|
||||
"noUnusedParameters": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": ["../"],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"jsx": "preserve"
|
||||
}
|
||||
}
|
||||
1
types/hedron/tslint.json
Normal file
1
types/hedron/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user