-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add typescript definitions (#54)
Add TypeScript definition file
- Loading branch information
1 parent
154bf5e
commit cf43d8b
Showing
1 changed file
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// Type definitions for styled-css-grid | ||
// Project: https://github.com/azz/styled-css-grid | ||
// Definitions by: protocol114 <https://github.com/protocol114> | ||
|
||
declare module 'styled-css-grid' { | ||
import * as React from "react"; | ||
import {StyledComponent} from "styled-components"; | ||
|
||
export interface ICellProps extends React.ComponentPropsWithRef<'div'> { | ||
className?: string, | ||
width?: number, | ||
height?: number, | ||
top?: number | string, | ||
left?: number | string, | ||
middle?: boolean, | ||
center?: boolean, | ||
area?: string | ||
} | ||
|
||
export interface IGridProps extends React.ComponentPropsWithRef<'div'> { | ||
className?: string, | ||
columns?: number | string, | ||
gap?: string, | ||
columnGap?: string, | ||
rowGap?: string, | ||
height?: string, | ||
minRowHeight?: string, | ||
flow?: string, | ||
rows?: number | string, | ||
areas?: string[], | ||
justifyContent?: string, | ||
alignContent?: string | ||
} | ||
|
||
export type GridComponent = StyledComponent< | ||
React.ForwardRefExoticComponent<Partial<IGridProps>>, | ||
any | ||
>; | ||
|
||
export type CellComponent = StyledComponent< | ||
React.ForwardRefExoticComponent<Partial<ICellProps>>, | ||
any | ||
>; | ||
|
||
export const Grid: GridComponent; | ||
export const Cell: CellComponent; | ||
} |