Utility
This module contains some helpful types and factories.
Table of contents
Interfaces
Type Aliases
- FComponentFactory
- FRootStyles
- FStylable
- PParentComponent
- TComplement
- TComponentRenderFunction
- TDefault
- TPartialSubset
- TPartialSubsetFromKeys
- TRef
- TStateUnstyled
- TStyledProps
- TStyles
Type Aliases
FComponentFactory
Ƭ FComponentFactory: Object
Type declaration
Name | Type |
---|---|
Full | <PProps, SState>(Props : PProps , RenderFunction : TComponentRenderFunction <SState >, UseStateFunction : (Props : PProps ) => TStateUnstyled <SState >, UseStylesFunction : (StateUnstyled : TStateUnstyled <SState >) => SState , DisplayName? : string ) => ReactElement |
NoProps | { Full : <SState>(RenderFunction : TComponentRenderFunction <SState >, UseStateFunction : () => TStateUnstyled <SState >, UseStylesFunction : (StateUnstyled : TStateUnstyled <SState >) => SState , DisplayName? : string ) => ReactElement ; Stateless : (RenderFunction : TComponentRenderFunction <FStyledState >, UseStylesFunction : () => FStyledState , DisplayName? : string ) => ReactElement ; Unstyled : <SState>(RenderFunction : TComponentRenderFunction <SState >, UseStateFunction : () => SState , DisplayName? : string ) => ReactElement } |
NoProps.Full | <SState>(RenderFunction : TComponentRenderFunction <SState >, UseStateFunction : () => TStateUnstyled <SState >, UseStylesFunction : (StateUnstyled : TStateUnstyled <SState >) => SState , DisplayName? : string ) => ReactElement |
NoProps.Stateless | (RenderFunction : TComponentRenderFunction <FStyledState >, UseStylesFunction : () => FStyledState , DisplayName? : string ) => ReactElement |
NoProps.Unstyled | <SState>(RenderFunction : TComponentRenderFunction <SState >, UseStateFunction : () => SState , DisplayName? : string ) => ReactElement |
Stateless | <PProps>(Props : PProps , RenderFunction : TComponentRenderFunction <TStyledProps <PProps >>, UseStylesFunction : (Props : PProps ) => TStyledProps <PProps >, DisplayName? : string ) => ReactElement |
Unstyled | <PProps, SState>(Props : PProps , RenderFunction : TComponentRenderFunction <SState >, UseStateFunction : (Props : PProps ) => SState , DisplayName? : string ) => ReactElement |
Defined in
FRootStyles
Ƭ FRootStyles: () => { Root
: string
}
Type declaration
▸ (): Object
Returns
Object
Name | Type |
---|---|
Root | string |
Defined in
FStylable
Ƭ FStylable: Object
Type declaration
Name | Type |
---|---|
style? | CSSProperties |
Defined in
PParentComponent
Ƭ PParentComponent: FStyledState
& { children?
: ReactNode
}
Defined in
TComplement
Ƭ TComplement<T
, U
>: { [K in Exclude<keyof T, keyof U>]: T[K] }
Type parameters
Name | Type |
---|---|
T | extends U |
U | U |
Defined in
TComponentRenderFunction
Ƭ TComponentRenderFunction<SState
>: Object
Type parameters
Name |
---|
SState |
Call signature
▸ (State
): ReactElement
<any
, string
| JSXElementConstructor
<any
>>
Parameters
Name | Type |
---|---|
State | SState |
Returns
ReactElement
<any
, string
| JSXElementConstructor
<any
>>
Type declaration
Name | Type |
---|---|
displayName? | string |
Defined in
TDefault
Ƭ TDefault<T
, TKeys
>: { [Key in TKeys]-?: undefined extends T[Key] ? T[Key] : never }
Contains the optional properties of T
, but they are now required.
Type parameters
Name | Type |
---|---|
T | T |
TKeys | extends keyof T = keyof T |
Defined in
TPartialSubset
Ƭ TPartialSubset<T
, U
>: Omit
<T
, keyof U
> & Partial
<Pick
<T
, keyof U
>>
Type parameters
Name | Type |
---|---|
T | extends U |
U | U |
Defined in
TPartialSubsetFromKeys
Ƭ TPartialSubsetFromKeys<T
, TKeys
>: Omit
<T
, TKeys
> & Partial
<Pick
<T
, TKeys
>>
Make specific properties partial.
Type parameters
Name | Type |
---|---|
T | T |
TKeys | extends keyof T |
Defined in
TRef
Ƭ TRef<T
>: Object
Type parameters
Name |
---|
T |
Type declaration
Name | Type |
---|---|
Ref | T |
Defined in
TStateUnstyled
Ƭ TStateUnstyled<SState
>: SState
extends FStyledState
? TPartialSubset
<SState
, FStyledState
> : SState
Sometimes the Props are the State, so we do not have a separate type. Thus, we use a conditional type here in case the template parameter does not contain (new) styles.
Type parameters
Name |
---|
SState |
Defined in
TStyledProps
Ƭ TStyledProps<PProps
>: PProps
& FStyledState
A type of state that is the Props, equipped with styling.
Type parameters
Name |
---|
PProps |
Defined in
TStyles
Ƭ TStyles<T
>: () => { [Index in T]: string }
The return value of makeStyles
for T
union of class names.
Type parameters
Name | Type |
---|---|
T | extends string |
Type declaration
▸ (): { [Index in T]: string }
Returns
{ [Index in T]: string }