{ constructor(props: P); props: P; }
declare class GenericComponent = string & { attachPayloadTypeHack?: P & never }
type Handler
handler: Handler , handler: Handler (x: P, callback: R[P]): void;
};
declare var x: O;
x.on('a', a => {});
// #29775
namespace N1 {
declare class Component {
constructor(props: P);
}
interface ComponentClass {
new (props: P): Component ;
}
type CreateElementChildren =
P extends { children?: infer C }
? C extends any[]
? C
: C[]
: unknown;
declare function createElement (
type: ComponentClass ,
...children: CreateElementChildren
): any;
declare function createElement2 (
type: ComponentClass ,
child: CreateElementChildren
): any;
class InferFunctionTypes extends Component<{children: (foo: number) => string}> {}
createElement(InferFunctionTypes, (foo) => "" + foo);
createElement2(InferFunctionTypes, [(foo) => "" + foo]);
}
// #30341
type InnerBox = P extends void
? (state: S) => S
: (state: S, payload: P) => S
interface ActionHandler {
actionType: ActionType
}
declare function handler(actionType: ActionType): ActionHandler
declare function createReducer(
defaultState: S,
...actionHandlers: ActionHandler[]
): any
interface AppState {
dummy: string
}
const defaultState: AppState = {
dummy: ''
}
const NON_VOID_ACTION: ActionType