Link

Overview


Table of contents


ExtendRuleModule (interface)

Build a RuleModule From other RuleModule

Signature

interface ExtendRuleModule {}

Added in v0.2.0

ParseRule (interface)

Parse RuleModule to ThemeNode

Signature

interface ParseRule {}

Added in v0.2.0

RuleModule (interface)

Rule Module include a rule and default theme and next RuleModule. The Parse order is rule > next

Signature

interface RuleModule {
  next?: RuleModule<N>
  rule: R
  theme: T
}

Added in v0.2.0

ExtendRule (type alias)

Signature

export type ExtendRule<R extends Rule, S extends CssProperties, E extends object = {}, T extends CssTheme = {}> = Rule<
  S,
  E,
  GetRuleProp<R>,
  T,
  GetRuleTheme<R>
>

Added in v0.2.0

GetRuleInput (type alias)

Get input type from Rule.E & S

Signature

export type GetRuleInput<R extends Rule> = NonNullable<R['_I']>

Added in v0.2.0

GetRuleOTheme (type alias)

Get Parent Theme type from Rule.

Signature

export type GetRuleOTheme<R extends Rule> = NonNullable<R['_OT']>

Added in v0.2.0

GetRuleOutput (type alias)

Get output type from Rule.

Signature

export type GetRuleOutput<R extends Rule> = NonNullable<R['_O']>

Added in v0.2.0

GetRuleProp (type alias)

Properties is css properties’s type

Signature

export type GetRuleProp<R extends Rule> = NonNullable<R['_P']>

Added in v0.2.0

GetRuleSTheme (type alias)

Get Self Theme type from Rule.

Signature

export type GetRuleSTheme<R extends Rule> = NonNullable<R['_ST']>

Added in v0.2.0

GetRuleTheme (type alias)

Get Theme type from Rule.

Signature

export type GetRuleTheme<R extends Rule> = NonNullable<R['_T']>

Added in v0.2.0

ParseProp (type alias)

Parse RuleModule to CssThemeNode

Signature

export type ParseProp = <R extends Rule>(
  rules: RuleModule<R>
) => (value: CssThemeNode<GetRuleProp<R>, GetRuleTheme<R>>) => GetRuleOutput<R>

Added in v0.2.0

ParseString (type alias)

Parse RuleModule to css string

Signature

export type ParseString = <R extends Rule>(
  rules: RuleModule<R>
) => (value: CssThemeNode<Input<GetRuleInput<R>, GetRuleOutput<R>>, GetRuleTheme<R>>) => string

Added in v0.2.0

Rule (type alias)

The define rule how covert from a properties type to another properties type

Signature

export type Rule<
  S extends object = {},
  E extends object = {},
  O extends object = {},
  T extends object = {},
  OT extends object = {}
> = {
  readonly _E?: E
  readonly _S?: S
  readonly _I?: E & S
  readonly _ST?: T
  readonly _T?: OT & T
  readonly _OT?: OT
  readonly _O?: O
  readonly _P?: Input<E & S, O>
  /**
   * stand rule
   */
  rule?: StandRule<S, O, T>
  /**
   * enum rule
   */
  ruleEnum?: EnumRule<E, O, T>
  /**
   * default style
   */
  style?: CssNode<O>
}

Added in v0.2.0

extendRuleModule (function)

Signature


export const extendRuleModule: ExtendRuleModule = a => b => ...

Added in v0.2.0

foldRuleModule (function)

Fold some RuleModule that extend same RuleModule

Signature


export const foldRuleModule=<R extends Rule = Rule>()=><N extends Rule>(as:NonEmptyArray<RuleModule<any,N>>):RuleModule<R,N>=>{
   const folds= getFold()(as)
   return{
       rule:folds.rule,
       theme:folds.theme,
       next:as[0].next
   }
} => ...

Added in v0.2.0

parse (function)

Signature


export const parse: ParseString = rule => value => ...

Added in v0.2.0

parseProp (function)

Signature


export const parseProp: ParseProp = rule => value => ...

Added in v0.2.0

parseRule (function)

Signature


export const parseRule: ParseRule = ({ rule, theme = {}, next }) => (value) => ...

Added in v0.2.0

Input (export)

Signature

any

Added in v0.2.0

InputNode (export)

Signature

any

Added in v0.2.0

dataToInputNode (export)

Signature


<O extends object, T extends object>(input: ThemeNode<O, T>) => CssThemeNode<O, T>

Added in v0.2.0

inputNodeToData (export)

Signature


<P extends object, T extends object>(a: CssThemeNode<P, T>) => ThemeNode<P, T>

Added in v0.2.0