Skip to content

Commit 85d9f1b

Browse files
committed
refactor: dependency inversion
1 parent 7e3b72c commit 85d9f1b

File tree

5 files changed

+193
-126
lines changed

5 files changed

+193
-126
lines changed

src/context/config-provider.ts

Lines changed: 0 additions & 33 deletions
This file was deleted.

src/context/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
export { useMergedConfigContext } from './config-provider';
21
export { useMergedThemeContext } from './theme-provider';
32

4-
export type { GetConfigProviderContext } from './config-provider';
53
export type { GetThemeProviderContext } from './theme-provider';

src/hooks/useCSP.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
export type UseCSP = () => {
2+
nonce?: string;
3+
};
4+
5+
/**
6+
* Provide a default hook since not everyone need config this.
7+
*/
8+
const useDefaultCSP: UseCSP = () => ({});
9+
10+
export default useDefaultCSP;

src/hooks/usePrefix.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
export type UsePrefix = () => {
2+
/**
3+
* All the component use `@ant-design/cssinjs-utils` should have same `rootPrefixCls`.
4+
*/
5+
rootPrefixCls: string;
6+
/**
7+
* `iconPrefixCls` comes from the setting of `@ant-design/icons`.
8+
* Here maybe little coupling but everyone need use this.
9+
*/
10+
iconPrefixCls: string;
11+
};

0 commit comments

Comments
 (0)