mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-24 02:59:58 +08:00
chore: fix override type (#36297)
This commit is contained in:
parent
0b2acfc6cb
commit
70334ff3c9
@ -11,9 +11,3 @@ export type ElementOf<T> = T extends (infer E)[] ? E : T extends readonly (infer
|
||||
|
||||
/** https://github.com/Microsoft/TypeScript/issues/29729 */
|
||||
export type LiteralUnion<T extends U, U> = T | (U & {});
|
||||
|
||||
export type DeepPartial<T> = T extends object
|
||||
? {
|
||||
[P in keyof T]?: DeepPartial<T[P]>;
|
||||
}
|
||||
: T;
|
||||
|
@ -2,7 +2,6 @@ import type { CSSInterpolation } from '@ant-design/cssinjs';
|
||||
import { Theme, useCacheToken, useStyleRegister } from '@ant-design/cssinjs';
|
||||
import React from 'react';
|
||||
import version from '../version';
|
||||
import type { DeepPartial } from '../_util/type';
|
||||
import type {
|
||||
AliasToken,
|
||||
GlobalToken,
|
||||
@ -51,7 +50,7 @@ export type {
|
||||
export const DesignTokenContext = React.createContext<{
|
||||
token: Partial<SeedToken>;
|
||||
derivative?: (token: SeedToken) => MapToken;
|
||||
override?: DeepPartial<OverrideToken>;
|
||||
override?: OverrideToken;
|
||||
hashed?: string | boolean;
|
||||
}>({
|
||||
token: defaultSeedToken,
|
||||
|
@ -41,7 +41,6 @@ import type { ComponentToken as TooltipComponentToken } from '../tooltip/style';
|
||||
import type { ComponentToken as TransferComponentToken } from '../transfer/style';
|
||||
import type { ComponentToken as TypographyComponentToken } from '../typography/style';
|
||||
import type { ComponentToken as UploadComponentToken } from '../upload/style';
|
||||
import type { DeepPartial } from '../_util/type';
|
||||
import type { BgPalettes, TextAlphaPalettes } from './themes/IPalettes';
|
||||
|
||||
export const PresetColors = [
|
||||
@ -131,7 +130,11 @@ export interface ComponentTokenMap {
|
||||
Progress?: ProgressComponentToken;
|
||||
}
|
||||
|
||||
export interface OverrideToken extends DeepPartial<ComponentTokenMap> {
|
||||
type OverrideComponentToken = {
|
||||
[key in keyof ComponentTokenMap]: Partial<ComponentTokenMap[key]>;
|
||||
};
|
||||
|
||||
export interface OverrideToken extends OverrideComponentToken {
|
||||
derivative?: Partial<MapToken>;
|
||||
/** @private Internal Usage */
|
||||
alias?: Partial<AliasToken>;
|
||||
|
Loading…
Reference in New Issue
Block a user