-
Notifications
You must be signed in to change notification settings - Fork 135
Expand file tree
/
Copy pathpreact.d.ts
More file actions
24 lines (20 loc) · 727 Bytes
/
preact.d.ts
File metadata and controls
24 lines (20 loc) · 727 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// T - Wrapped component props
// S - Wrapped component state
// K - Store state
// I - Injected props to wrapped component
declare module 'unistore/preact' {
import * as Preact from 'preact';
import { ActionCreator, StateMapper, Store } from 'unistore';
export function connect<T, S, K, I>(
mapStateToProps: string | Array<string> | StateMapper<T, K, I>,
actions?: ActionCreator<K> | object
): (
Child: Preact.ComponentConstructor<T & I, S> | Preact.AnyComponent<T & I, S>
) => Preact.ComponentConstructor<T | T & I, S>;
export interface ProviderProps<T> {
store: Store<T>;
}
export class Provider<T> extends Preact.Component<ProviderProps<T>> {
render(props: ProviderProps<T>): Preact.JSX.Element;
}
}