Skip to content

Commit

Permalink
updated types for preact integration
Browse files Browse the repository at this point in the history
  • Loading branch information
developit committed Sep 20, 2018
1 parent 9c756c2 commit 5056baf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
"jest": "^22.1.4",
"microbundle": "^0.4.3",
"npm-run-all": "^4.1.2",
"preact": "^8.2.7",
"preact": "^8.3.1",
"raf": "^3.4.0",
"react": "^16.2.0",
"react-dom": "^16.2.0",
Expand Down
10 changes: 6 additions & 4 deletions preact.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,18 @@ declare module "unistore/preact" {
import * as Preact from "preact";
import { ActionCreator, StateMapper, Store } from "unistore";

export function connect<T, S, K, I>(
export function connect<T, K, I>(
mapStateToProps: string | Array<string> | StateMapper<T, K, I>,
actions?: ActionCreator<K> | object
): (Child: ((props: T & I) => Preact.VNode) | Preact.ComponentConstructor<T & I, S>) => Preact.ComponentConstructor<T, S>;
): (
Child: ((props?: T & I) => JSX.Element) | Preact.ComponentConstructor<T & I> | Preact.AnyComponent<T & I>
) => Preact.ComponentConstructor<T>;

export interface ProviderProps<T> {
store: Store<T>;
}

export class Provider<T> extends Preact.Component<ProviderProps<T>, {}> {
render(props: ProviderProps<T>, {}): Preact.VNode;
export class Provider<T> extends Preact.Component<ProviderProps<T>> {
render(props: ProviderProps<T>): JSX.Element;
}
}

0 comments on commit 5056baf

Please sign in to comment.