atlassian-labs / react-resource-router

Configuration driven routing solution for React SPAs that manages route matching, data fetching and progressive rendering
https://atlassian-labs.github.io/react-resource-router
Apache License 2.0
198 stars 28 forks source link

Use interface instead of type for ResourceStoreContext #142

Closed AllySummers closed 2 years ago

AllySummers commented 2 years ago

This PR just changes the TypeScript typings for ResourceStoreContext to be an empty interface instead of an any typed type, so that consumers of the library can do a module declaration to extend the ResourceStoreContext to type their own code.

Example:

import 'react-resource-router';
import type { MyResourceContext } from './my-resource-context';

declare module 'react-resource-router' {
    export interface ResourceStoreContext extends MyResourceContext {}
}

Closes #141