context.d.ts 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. import type { ExtractPropTypes, InjectionKey, PropType, Ref } from 'vue';
  2. import type { ValidateMessages } from '../form/interface';
  3. import type { RequiredMark } from '../form/Form';
  4. import type { RenderEmptyHandler } from './renderEmpty';
  5. import type { TransformCellTextProps } from '../table/interface';
  6. import type { Locale } from '../locale-provider';
  7. declare type GlobalFormCOntextProps = {
  8. validateMessages?: Ref<ValidateMessages>;
  9. };
  10. export declare const GlobalFormContextKey: InjectionKey<GlobalFormCOntextProps>;
  11. export declare const useProvideGlobalForm: (state: GlobalFormCOntextProps) => void;
  12. export declare const useInjectGlobalForm: () => GlobalFormCOntextProps;
  13. export declare const GlobalConfigContextKey: InjectionKey<GlobalFormCOntextProps>;
  14. export interface CSPConfig {
  15. nonce?: string;
  16. }
  17. export interface Theme {
  18. primaryColor?: string;
  19. infoColor?: string;
  20. successColor?: string;
  21. processingColor?: string;
  22. errorColor?: string;
  23. warningColor?: string;
  24. }
  25. export declare type SizeType = 'small' | 'middle' | 'large' | undefined;
  26. export declare type Direction = 'ltr' | 'rtl';
  27. export interface ConfigConsumerProps {
  28. getTargetContainer?: () => HTMLElement;
  29. getPopupContainer?: (triggerNode?: HTMLElement) => HTMLElement;
  30. rootPrefixCls?: string;
  31. getPrefixCls: (suffixCls?: string, customizePrefixCls?: string) => string;
  32. renderEmpty: RenderEmptyHandler;
  33. transformCellText?: (tableProps: TransformCellTextProps) => any;
  34. csp?: CSPConfig;
  35. autoInsertSpaceInButton?: boolean;
  36. input?: {
  37. autocomplete?: string;
  38. };
  39. locale?: Locale;
  40. pageHeader?: {
  41. ghost: boolean;
  42. };
  43. componentSize?: SizeType;
  44. direction?: 'ltr' | 'rtl';
  45. space?: {
  46. size?: SizeType | number;
  47. };
  48. virtual?: boolean;
  49. dropdownMatchSelectWidth?: boolean | number;
  50. form?: {
  51. requiredMark?: RequiredMark;
  52. colon?: boolean;
  53. };
  54. }
  55. export declare const configProviderProps: () => {
  56. getTargetContainer: {
  57. type: PropType<() => HTMLElement>;
  58. };
  59. getPopupContainer: {
  60. type: PropType<(triggerNode?: HTMLElement) => HTMLElement>;
  61. };
  62. prefixCls: StringConstructor;
  63. getPrefixCls: {
  64. type: PropType<(suffixCls?: string, customizePrefixCls?: string) => string>;
  65. };
  66. renderEmpty: {
  67. type: PropType<typeof import("./renderEmpty").default>;
  68. };
  69. transformCellText: {
  70. type: PropType<(tableProps: TransformCellTextProps) => any>;
  71. };
  72. csp: {
  73. type: PropType<CSPConfig>;
  74. default: CSPConfig;
  75. };
  76. input: {
  77. type: PropType<{
  78. autocomplete: string;
  79. }>;
  80. };
  81. autoInsertSpaceInButton: {
  82. type: BooleanConstructor;
  83. default: any;
  84. };
  85. locale: {
  86. type: PropType<Locale>;
  87. default: Locale;
  88. };
  89. pageHeader: {
  90. type: PropType<{
  91. ghost: boolean;
  92. }>;
  93. };
  94. componentSize: {
  95. type: PropType<SizeType>;
  96. };
  97. direction: {
  98. type: PropType<"ltr" | "rtl">;
  99. };
  100. space: {
  101. type: PropType<{
  102. size: SizeType | number;
  103. }>;
  104. };
  105. virtual: {
  106. type: BooleanConstructor;
  107. default: any;
  108. };
  109. dropdownMatchSelectWidth: {
  110. type: (BooleanConstructor | NumberConstructor)[];
  111. default: boolean;
  112. };
  113. form: {
  114. type: PropType<{
  115. validateMessages?: ValidateMessages;
  116. requiredMark?: RequiredMark;
  117. colon?: boolean;
  118. }>;
  119. default: {
  120. validateMessages?: ValidateMessages;
  121. requiredMark?: RequiredMark;
  122. colon?: boolean;
  123. };
  124. };
  125. notUpdateGlobalConfig: BooleanConstructor;
  126. };
  127. export declare type ConfigProviderProps = Partial<ExtractPropTypes<ReturnType<typeof configProviderProps>>>;
  128. export {};