import useStore, { Store, InitializerFunction } from 'use-global-hook'; import React = require('react'); interface state { value: string; } interface associatedActions { setValue(value: string): void; } const initializer: InitializerFunction = (store: Store) => { store.actions.setValue(""); store.state.value; store.setState({ value: "string" }); }; useStore(React, { value: "" }, {}, initializer); // $ExpectType () => [state, associatedActions] useStore(React, { value: "" }, {}); // $ExpectType () => [state, associatedActions]