@react-three/drei 9.51.21 → 9.51.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-three/drei",
3
- "version": "9.51.21",
3
+ "version": "9.51.23",
4
4
  "private": false,
5
5
  "description": "useful add-ons for react-three-fiber",
6
6
  "keywords": [
@@ -1,5 +1,18 @@
1
1
  import * as React from 'react';
2
- import { GetState, Subscribe } from 'zustand';
2
+ import { StoreApi } from 'zustand';
3
+ declare type State = object;
4
+ declare type StateSelector<T extends State, U> = (state: T) => U;
5
+ declare type EqualityChecker<T> = (state: T, newState: T) => boolean;
6
+ declare type StateListener<T> = (state: T, previousState: T) => void;
7
+ declare type StoreApiWithSubscribeWithSelector<T extends State> = Omit<StoreApi<T>, 'subscribe'> & {
8
+ subscribe: {
9
+ (listener: StateListener<T>): () => void;
10
+ <StateSlice>(selector: StateSelector<T, StateSlice>, listener: StateListener<StateSlice>, options?: {
11
+ equalityFn?: EqualityChecker<StateSlice>;
12
+ fireImmediately?: boolean;
13
+ }): () => void;
14
+ };
15
+ };
3
16
  declare type KeyboardControlsState<T extends string = string> = {
4
17
  [K in T]: boolean;
5
18
  };
@@ -17,8 +30,8 @@ declare type KeyboardControlsProps = {
17
30
  export declare function KeyboardControls({ map, children, onChange, domElement }: KeyboardControlsProps): JSX.Element;
18
31
  declare type Selector<T extends string = string> = (state: KeyboardControlsState<T>) => boolean;
19
32
  export declare function useKeyboardControls<T extends string = string>(): [
20
- Subscribe<KeyboardControlsState<T>>,
21
- GetState<KeyboardControlsState<T>>
33
+ StoreApiWithSubscribeWithSelector<KeyboardControlsState<T>>['subscribe'],
34
+ StoreApiWithSubscribeWithSelector<KeyboardControlsState<T>>['getState']
22
35
  ];
23
36
  export declare function useKeyboardControls<T extends string = string>(sel: Selector<T>): ReturnType<Selector<T>>;
24
37
  export {};