Skip to content
This repository has been archived by the owner on Dec 13, 2018. It is now read-only.

Commit

Permalink
docs: add comments to typings (#302) (#371)
Browse files Browse the repository at this point in the history
  • Loading branch information
Powell-v2 authored and Kent C. Dodds committed Jan 8, 2018
1 parent 1405345 commit 8a0216f
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions typings/glamorous.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,17 +85,38 @@ export {
}

export interface GlamorousOptions<Props, Context, DefaultProps> {
/**
* Used by React in the React DevTools
*/
displayName: string
/**
* Applies the same logic to components (html/svg) for which props to forward as it does for the built-in factories
*/
rootEl: string | Element
/**
* Specifies extra props that should be forwarded and spread on the DOM element
*/
forwardProps: string[]
/**
* Specifies properties to filter out from being forwarded to the child components; Useful for components like react-router Link
*/
filterProps: string[]
/**
* Allows you to prevent glamor from computing your styles when you know the class name should not change.
*/
shouldClassNameUpdate: (
props: Props,
prevProps: Props,
context: Context,
prevContext: Context,
) => boolean
/**
* Allows you to use props as CSS
*/
propsAreCssOverrides?: false
/**
* Applies props by default for a component
*/
withProps: DefaultProps
}

Expand All @@ -104,17 +125,38 @@ export interface PropsAreCssOverridesGlamorousOptions<
Context,
DefaultProps
> {
/**
* Used by React in the React DevTools
*/
displayName?: string
/**
* Applies the same logic to components (html/svg) for which props to forward as it does for the built-in factories
*/
rootEl?: string | Element
/**
* Specifies extra props that should be forwarded and spread on the DOM element
*/
forwardProps?: string[]
/**
* Specifies properties to filter out from being forwarded to the child components; Useful for components like react-router Link
*/
filterProps?: string[]
/**
* Allows you to prevent glamor from computing your styles when you know the class name should not change.
*/
shouldClassNameUpdate?: (
props: Props,
prevProps: Props,
context: Context,
prevContext: Context,
) => boolean
/**
* Allows you to use props as CSS
*/
propsAreCssOverrides: true
/**
* Applies props by default for a component
*/
withProps?: DefaultProps
}

Expand Down

0 comments on commit 8a0216f

Please sign in to comment.