ant-design/components/theme/export.ts
二货爱吃白萝卜 78cca16779
chore: default hashed (#37154)
* chore: default hashed

* test: try for clean default hashed

* chore: clean up

* chore: fix dist

* chore: es inject

* chore: no hashed in test env

* chore: update comment

* chore: hack in jest env

* chore: try unique entry
2022-08-19 17:45:03 +08:00

27 lines
916 B
TypeScript

/* eslint-disable import/prefer-default-export */
import { useToken as useInternalToken, defaultConfig } from '.';
import defaultAlgorithm from './themes/default';
import darkAlgorithm from './themes/dark';
import { defaultAlgorithmV4, darkAlgorithmV4 } from './themes/v4';
// ZombieJ: We export as object to user but array in internal.
// This is used to minimize the bundle size for antd package but safe to refactor as object also.
// Please do not export internal `useToken` directly to avoid something export unexpected.
/** Get current context Design Token. Will be different if you using nest theme config. */
function useToken() {
const [theme, token, hashId] = useInternalToken();
return { theme, token, hashId };
}
export default {
/** @private Test Usage. Do not use in production. */
defaultConfig,
useToken,
defaultAlgorithm,
darkAlgorithm,
defaultAlgorithmV4,
darkAlgorithmV4,
};