Skip to content

Commit

Permalink
🐛 fix(component-asset): 修正 CreateAssetStore 的类型,对齐到 ProEditorInstance
Browse files Browse the repository at this point in the history
  • Loading branch information
arvinxx committed Jun 15, 2023
1 parent 4f41f34 commit 769cf39
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/ComponentAsset/store/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { StateCreator, StoreApi, create } from 'zustand';
import { UseContextStore, createContext, optionalDevtools } from 'zustand-utils';
import { DevtoolsOptions } from 'zustand/middleware';

import { PublicProEditorStore } from '@/ProEditor/store';
import type { ProEditorInstance } from '@/ProEditor';
import { ReactNode } from 'react';

export interface AssetStoreOptions<T = any> {
Expand All @@ -12,7 +12,7 @@ export interface AssetStoreOptions<T = any> {
}

export type CreateAssetStore<T> = StateCreator<
T & PublicProEditorStore,
T & ProEditorInstance,
[['zustand/devtools', never]],
[],
T
Expand Down Expand Up @@ -45,8 +45,8 @@ export type WithoutCallSignature<T> = {
};

export const createUseAssetStore = <T>(): {
useStore: UseContextStore<StoreApi<T & PublicProEditorStore>>;
useStoreApi: () => WithoutCallSignature<StoreApi<T & PublicProEditorStore>>;
useStore: UseContextStore<StoreApi<T & ProEditorInstance>>;
useStoreApi: () => WithoutCallSignature<StoreApi<T & ProEditorInstance>>;
AssetProvider: ({
createStore,
children,
Expand Down

0 comments on commit 769cf39

Please sign in to comment.