shineout
Version:
Shein 前端组件库
43 lines (42 loc) • 1.89 kB
TypeScript
import * as React from 'react';
export interface StandardProps {
/**
* @en extend className
* @cn 扩展 className
*
*/
className?: string;
/**
* @en Container element style
* @cn 最外层扩展样式
*/
style?: React.CSSProperties;
}
export declare type KeygenResult = string | number;
export declare type KeygenType<DataItem> = ObjectKey<DataItem> | ((data: DataItem, index?: number) => KeygenResult) | true;
export declare type StructKeygenType<DataItem> = ObjectKey<DataItem> | ((data: DataItem, index?: number) => KeygenResult);
/**
* 目前已知的最为简短的写法: @see https://github.com/Microsoft/TypeScript/issues/29729#issuecomment-1082546550
* 在类型守卫中会存在问题: @see https://github.com/Microsoft/TypeScript/issues/29729#issuecomment-1082791844
*/
export declare type ObjectKey<T = any> = T extends ObjectType ? (keyof T & string) : never;
export declare namespace RegularAttributes {
type Size = 'small' | 'default' | 'large';
type Type = 'default' | 'primary' | 'secondary' | 'success' | 'warning' | 'danger';
type Align = 'left' | 'center' | 'right';
type ListPosition = 'drop-down' | 'drop-up';
}
export declare type ObjectType<V = any> = {
[name: string]: V;
};
export declare type ValueOf<T> = T[keyof T];
export declare type ForceAdd<U extends {}, V> = U & Omit<V, keyof U>;
export declare type ExistKey<U, Keys extends string> = Omit<U, keyof Omit<U, Keys>>;
export declare type PartialKeys<U, keys extends string> = Omit<U, keys> & Partial<ExistKey<U, keys>>;
export declare type ValueArr<Value> = Value extends any[] ? Value : Value[];
export declare type ValueItem<Value> = Value extends (infer U)[] ? U : Value;
export interface UnMatchedValue {
IS_NOT_MATCHED_VALUE: boolean;
value: any;
}
export declare type ResultItem<DataItem> = DataItem | UnMatchedValue;