Skip to content

Commit

Permalink
refactor: import types from types
Browse files Browse the repository at this point in the history
  • Loading branch information
goosewobbler committed Dec 6, 2024
1 parent dabe9ea commit 8e6bfa2
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
3 changes: 1 addition & 2 deletions packages/zutron/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { useStore, type StoreApi } from 'zustand';
import { createStore as createZustandStore } from 'zustand/vanilla';

import type { AnyState, Handlers } from './index.js';
import type { Action, Thunk } from './types.js';
import type { Action, Thunk, AnyState, Handlers } from './types.js';

type ExtractState<S> = S extends {
getState: () => infer T;
Expand Down
2 changes: 1 addition & 1 deletion packages/zutron/src/preload.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ipcRenderer } from 'electron';

import type { AnyState, PreloadZustandBridgeReturn } from './index.js';
import type { AnyState, PreloadZustandBridgeReturn } from './types.js';

export const preloadZustandBridge = <S extends AnyState>(): PreloadZustandBridgeReturn<S> => ({
handlers: {
Expand Down
3 changes: 2 additions & 1 deletion packages/zutron/test/index.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import { beforeEach, describe, expect, it, type Mock, vi } from 'vitest';
import { screen, render, waitFor, fireEvent } from '@testing-library/react';
import '@testing-library/jest-dom/vitest';

import { createStore, createUseStore, type Handlers, useDispatch } from '../src/index.js';
import { createStore, createUseStore, useDispatch } from '../src/index.js';
import type { Handlers } from '../src/types.js';

describe('createUseStore', () => {
type TestState = { testCounter: number };
Expand Down
2 changes: 1 addition & 1 deletion packages/zutron/test/main.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { afterEach, beforeEach, describe, expect, it, type Mock, vi } from 'vitest';
import type { StoreApi } from 'zustand';
import type { AnyState } from '../src/index.js';
import type { AnyState } from '../src/types.js';

const mockIpcMain = {
emit: vi.fn(),
Expand Down

0 comments on commit 8e6bfa2

Please sign in to comment.