diff --git a/test/src/Counter.tsx b/test/src/Counter.tsx index 4f6712b..b7260df 100644 --- a/test/src/Counter.tsx +++ b/test/src/Counter.tsx @@ -1,8 +1,8 @@ -interface CounterStore { +type CounterStore = HUI.Store<{ value: number; -} +}, {}>; -const Counter = HUI.define<{}, HUI.Store, HUI.EmptyStore>('Counter', { +const Counter = HUI.define<{}, CounterStore, HUI.EmptyStore>('Counter', { state: ['value'], diff --git a/test/src/Dialog.tsx b/test/src/Dialog.tsx index a37f0ea..90ffedf 100644 --- a/test/src/Dialog.tsx +++ b/test/src/Dialog.tsx @@ -1,12 +1,10 @@ -interface DialogStore { +type DialogStore = HUI.Store<{ on: boolean; -} - -interface DialogStoreHandlers { +}, { toggle: () => void; -} +}>; -const Dialog = HUI.define<{}, HUI.Store, HUI.EmptyStore>('Dialog', { +const Dialog = HUI.define<{}, DialogStore, HUI.EmptyStore>('Dialog', { state: ['on'], diff --git a/test/src/TestInput.tsx b/test/src/TestInput.tsx index 48c297a..99ffd0a 100644 --- a/test/src/TestInput.tsx +++ b/test/src/TestInput.tsx @@ -2,12 +2,12 @@ interface TestInputProps { children: string; } -interface TestInputStore { +type TestInputStore = HUI.Store<{ input?: HTMLInputElement; value: string; -} +}, {}>; -const TestInput = HUI.define, HUI.EmptyStore>('TestInput', { +const TestInput = HUI.define('TestInput', { state: ['value'], diff --git a/test/src/ThrowTest.tsx b/test/src/ThrowTest.tsx index dbaf611..d9e027a 100644 --- a/test/src/ThrowTest.tsx +++ b/test/src/ThrowTest.tsx @@ -1,8 +1,8 @@ -interface ThrowTestStore { +type ThrowTestStore = HUI.Store<{ msg: string; -} +}, {}>; -const ThrowTest = HUI.define<{}, HUI.Store, HUI.EmptyStore>('ThrowTest', { +const ThrowTest = HUI.define<{}, ThrowTestStore, HUI.EmptyStore>('ThrowTest', { state: ['msg'], diff --git a/test/src/Timer.tsx b/test/src/Timer.tsx index 744e59c..d48de81 100644 --- a/test/src/Timer.tsx +++ b/test/src/Timer.tsx @@ -2,15 +2,13 @@ interface TimerProps { start?: number; } -interface TimerStore { +type TimerStore = HUI.Store<{ time: number; -} - -interface TimerStoreHandlers { +}, { setInterval: (interval: number) => any; -} +}>; -const Timer = HUI.define, HUI.EmptyStore>('Timer', { +const Timer = HUI.define('Timer', { state: ['time'],