utils.d.ts 2.2 KB

1234567891011121314151617181920212223242526
  1. import type { AbstractNode, IconDefinition } from '@ant-design/icons-svg/lib/types';
  2. import type { CSSProperties, MouseEventHandler, MutableRefObject, ReactNode } from 'react';
  3. import React from 'react';
  4. export declare function warning(valid: boolean, message: string): void;
  5. export declare function isIconDefinition(target: any): target is IconDefinition;
  6. export declare function normalizeAttrs(attrs?: Attrs): Attrs;
  7. export type Attrs = Record<string, string>;
  8. interface RootProps {
  9. onClick: MouseEventHandler<Element>;
  10. style: CSSProperties;
  11. ref: MutableRefObject<any>;
  12. [props: string]: string | number | ReactNode | MouseEventHandler<Element> | CSSProperties | MutableRefObject<any>;
  13. }
  14. export declare function generate(node: AbstractNode, key: string, rootProps?: RootProps | false): any;
  15. export declare function getSecondaryColor(primaryColor: string): string;
  16. export declare function normalizeTwoToneColors(twoToneColor: string | [string, string] | undefined): string[];
  17. export declare const svgBaseProps: {
  18. width: string;
  19. height: string;
  20. fill: string;
  21. 'aria-hidden': string;
  22. focusable: string;
  23. };
  24. export declare const iconStyles = "\n.anticon {\n display: inline-flex;\n align-items: center;\n color: inherit;\n font-style: normal;\n line-height: 0;\n text-align: center;\n text-transform: none;\n vertical-align: -0.125em;\n text-rendering: optimizeLegibility;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n\n.anticon > * {\n line-height: 1;\n}\n\n.anticon svg {\n display: inline-block;\n}\n\n.anticon::before {\n display: none;\n}\n\n.anticon .anticon-icon {\n display: block;\n}\n\n.anticon[tabindex] {\n cursor: pointer;\n}\n\n.anticon-spin::before,\n.anticon-spin {\n display: inline-block;\n -webkit-animation: loadingCircle 1s infinite linear;\n animation: loadingCircle 1s infinite linear;\n}\n\n@-webkit-keyframes loadingCircle {\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n\n@keyframes loadingCircle {\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n";
  25. export declare const useInsertStyles: (eleRef: React.RefObject<HTMLElement>) => void;
  26. export {};