Skip to content

Commit

Permalink
Merge pull request #671 from layershifter/fix/typings-const-enum
Browse files Browse the repository at this point in the history
fix(fela): get rid of const enum in typings
  • Loading branch information
robinweser authored Feb 13, 2019
2 parents 628fc55 + 90eb8c4 commit 3706479
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions packages/fela/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
declare module "fela" {
import * as CSS from 'csstype';
import { TRuleType, TKeyframeType, TFontType, TStaticType, TClearType } from 'fela-utils';

export type TRuleProps = {};
export type TRule<T = TRuleProps> = (props: T) => IStyle
Expand All @@ -9,14 +10,7 @@ declare module "fela" {
type TPlugin = (style: IStyle) => IStyle; //http://fela.js.org/docs/advanced/Plugins.html
type TEnhancer = (renderer: IRenderer) => IRenderer; //http://fela.js.org/docs/advanced/Enhancers.html

const enum TSubscribeMessageType {
rule = 'RULE',
staticObject = 'RULE',
keyframes = 'KEYFRAME',
fontFace = 'FONT',
staticString = 'STATIC',
clear = 'CLEAR'
}
type TSubscribeMessageType = TRuleType | TKeyframeType | TFontType | TStaticType | TClearType

interface ISubscribeMessage {
type: TSubscribeMessageType;
Expand Down Expand Up @@ -186,6 +180,20 @@ declare module "fela-statistics" {
export default function(): TEnhancer;
}

declare module "fela-utils" {
export type TRuleType = "RULE"
export type TKeyframeType = "KEYFRAME"
export type TFontType = "FONT"
export type TStaticType = "STATIC"
export type TClearType = "CLEAR"

export const RULE_TYPE: TRuleType
export const KEYFRAME_TYPE: TKeyframeType
export const FONT_TYPE: TFontType
export const STATIC_TYPE: TStaticType
export const CLEAR_TYPE: TClearType
}

/**
* PLUGINS
*/
Expand Down

0 comments on commit 3706479

Please sign in to comment.