use-sync-external-store.d.ts 638 B

1234567891011121314
  1. /**
  2. * Local typings for use-sync-external-store 1.2.0: the package ships no types
  3. * and the DefinitelyTyped package is unavailable offline. Mirrors the shim's
  4. * with-selector build (the only entry this package consumes).
  5. */
  6. declare module 'use-sync-external-store/shim/with-selector.js' {
  7. export function useSyncExternalStoreWithSelector<Snapshot, Selection>(
  8. subscribe: (onStoreChange: () => void) => () => void,
  9. getSnapshot: () => Snapshot,
  10. getServerSnapshot: undefined | null | (() => Snapshot),
  11. selector: (snapshot: Snapshot) => Selection,
  12. isEqual?: (a: Selection, b: Selection) => boolean,
  13. ): Selection
  14. }