Skip to content

Commit

Permalink
change: move RenderHookOptions into types/index
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuaellis committed Jan 7, 2021
1 parent bb870e0 commit 9bab184
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/core/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { CreateRenderer, Renderer, RenderResult, RenderHook } from '../types'
import { ResultContainer, RenderHookOptions } from '../types/internal'
import { CreateRenderer, Renderer, RenderResult, RenderHook, RenderHookOptions } from '../types'
import { ResultContainer } from '../types/internal'

import asyncUtils from './asyncUtils'
import { cleanup, addCleanup, removeCleanup } from './cleanup'
Expand Down
6 changes: 4 additions & 2 deletions src/types/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { RenderHookOptions } from './internal'

export type Renderer<TProps> = {
render: (props?: TProps) => void
rerender: (props?: TProps) => void
Expand Down Expand Up @@ -60,6 +58,10 @@ export interface ReactHooksRenderer {
removeCleanup: (callback: () => Promise<void> | void) => void
}

export type RenderHookOptions<TProps, TOptions extends {}> = TOptions & {
initialProps?: TProps
}

export interface Act {
(callback: () => void | undefined): void
(callback: () => Promise<void | undefined>): Promise<undefined>
Expand Down
4 changes: 0 additions & 4 deletions src/types/internal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,3 @@ export type ResultContainer<TValue> = {
setValue: (val: TValue) => void
setError: (error: Error) => void
}

export type RenderHookOptions<TProps, TOptions extends {}> = TOptions & {
initialProps?: TProps
}

0 comments on commit 9bab184

Please sign in to comment.