Skip to main content

@unwind/class-name

Functions

Function

Description

defineClassName(selector)

Defines className value

mergeClassNames(base, extension)

Combines two className values

resolveClassName(state, classNameList)

Resolves className to string

resolveClassNameDelegateFactory(wrapperState, className)

Factory that creates a delegate resolver callback that could be passed down the wrapped component with narrowed state scope.

setClassNameConfig(override)

Sets library ClassNameConfig partial

Variables

Variable

Description

HOST_KEY

A property key of ClassNameObject used internally to hold it's host element value

Type Aliases

Type Alias

Description

Alpha

Alphabet used to restrict allowed keys for sub-components of ClassNameObject

AlphaLower

Lowercase characters of Alpha

AlphaUpper

Uppercase characters of Alpha

AnyObject

Type alias representing any object

ClassName

A ClassName type

ClassNameCallback

A non-primitive class selector, a function ought to be passed to the resolving function

ClassNameConfig

Library config

ClassNameObject

A nested class name represented as an object

ClassNameObjectPartial

A nested class name represented as an object, deep partial of ClassNameObject

ClassNamePrimitive

A primitive (primitive selector, primitive class selector value) is data that has no methods or properties.

ClassNameProp

Utility type to define className prop

CombineClassNameType

Utility type of mergeClassNames()

CombineStates

Utility type that combines 2 objects unless keys are not DisjunctKeys or of match in key but not in type.

DefineClassNameType

Return type of defineClassName()

DisjunctKeys

Utility type that returns keys that are not present in any of the two unions used by CombineStates

EmptyObject

Type alias representing an empty object

ExcludeFromCombinedState

Utility type to exclude own state from the combined

ExtractState

Utility type to extract state type from HostClassName or HostClassNameObject

HostClassName

A host class selector value (the host element value) represents the class selector name value of the component's root element.

HostClassNameMember

Type of the HostClassName array

HostClassNameObject

An object version of HostClassName used only for type inference.

IncompatibleKeys

Utility type to return object keys of value set to never except of those of an empty object.

Merge

Merges intersection of {...} & & ... & {...} into a single { ... }

ResolveClassNameDelegateFactoryType

Return type of resolveClassNameDelegateFactory()

StateOrEmptyObject

Utility type that returns state objects unless it was extracted/inferred as any type in which case we return EmptyObject

StringClassNameTransformer

A function that transforms input string to a different string, see resolveClassName()

TypeofState

Type utility that returns typeof state object

UnionToIntersection

Transforms union type to intersection type