Skip to content

Commit

Permalink
feat: 🎸 add placeholders for decorator and comp addons types
Browse files Browse the repository at this point in the history
  • Loading branch information
streamich committed Aug 5, 2018
1 parent 155169b commit 2c897e0
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .storybook/component.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ const renderer = create({h});
addonRule(renderer);
addonCache(renderer);
addonComponent(renderer);
const {Component} = renderer;

const {Component} = renderer;

class CssTest extends Component {
static css = {
Expand Down
1 change: 1 addition & 0 deletions .storybook/decorator.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const renderer = create({h});
addonRule(renderer);
addonCache(renderer);
addonDecorator(renderer);

const {css} = renderer;

@css({
Expand Down
7 changes: 7 additions & 0 deletions types/addon/component.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import {NanoRenderer} from '../nano';

export interface ComponentPatch {
Component;
}

export type KeyframesAddon = <T extends NanoRenderer>(nano: T) => T & ComponentPatch;
7 changes: 7 additions & 0 deletions types/addon/decorator.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import {NanoRenderer} from '../nano';

export interface DecoratorPatch {
css;
}

export type KeyframesAddon = <T extends NanoRenderer>(nano: T) => T & DecoratorPatch;
6 changes: 5 additions & 1 deletion types/nano.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import {DrulePatch} from './addon/drule';
import {UnitsPatch} from './addon/units';
import {SheetPatch} from './addon/sheet';
import {KeyframesPatch} from './addon/keyframes';
import {ComponentPatch} from './addon/component';
import {DecoratorPatch} from './addon/decorator';

/*
interface NanoRenderer extends Partial<IUnits> {
Expand Down Expand Up @@ -51,7 +53,9 @@ export interface NanoRenderer
Partial<UnitsPatch>,
Partial<DrulePatch>,
Partial<SheetPatch>,
Partial<KeyframesPatch> {
Partial<KeyframesPatch>,
Partial<ComponentPatch>,
Partial<DecoratorPatch> {
/**
* Equals to `true` if in browser environment.
*/
Expand Down

0 comments on commit 2c897e0

Please sign in to comment.