@types/fragmented-store
TypeScript icon, indicating that this package has built-in type declarations

0.2.3 • Public • Published

Installation

npm install --save @types/fragmented-store

Summary

This package contains type definitions for fragmented-store (https://github.com/aralroca/fragmented-store).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/fragmented-store.

index.d.ts

import { Dispatch, ExoticComponent, ReactNode, SetStateAction } from "react";

type StateHook<S> = () => [S, Dispatch<SetStateAction<S>>];

type StoreUtils<Store extends { [K: string]: any }> =
    & Omit<
        {
            [K in keyof Store as `use${Capitalize<string & K>}`]: StateHook<Store[K]>;
        },
        "useStore"
    >
    & {
        Provider: ExoticComponent<{ children: ReactNode }>;
        useStore: StateHook<Store>;
    };

declare function createStore<Store extends { [K: string]: any }>(store: Store): StoreUtils<Store>;

export = createStore;

Additional Details

  • Last updated: Tue, 07 Nov 2023 03:09:37 GMT
  • Dependencies: @types/react

Credits

These definitions were written by Lunuy.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/fragmented-store

Weekly Downloads

1

Version

0.2.3

License

MIT

Unpacked Size

3.8 kB

Total Files

5

Last publish

Collaborators

  • types