typings.d.ts 2.32 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11
declare module '*.css';
declare module '*.less';
declare module '*.scss';
declare module '*.sass';
declare module '*.svg';
declare module '*.png';
declare module '*.jpg';
declare module '*.jpeg';
declare module '*.gif';
declare module '*.bmp';
declare module '*.tiff';
何乐's avatar
何乐 committed
12 13 14
declare module 'rc-animate';
declare module 'omit.js';
declare module 'react-copy-to-clipboard';
15 16 17
declare module 'react-fittext';
declare module '@antv/data-set';
declare module 'nzh/cn';
18
declare var APP_TYPE: string;
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84
declare module 'memoize-one' {
  function memoizeOne<T extends (...args: any[]) => any>(
    resultFn: T,
    isEqual?: (a: any, b: any, index: number) => boolean,
  ): T;
  export default memoizeOne;
}

declare module 'ant-design-pro' {
  import { Component } from 'react';
  export interface NoticeIconTabProps<T extends NoticeIconData = NoticeIconData> {
    className?: string;
    count?: number;
    emptyText?: React.ReactNode;
    emptyImage?: string;
    list?: T[];
    showClear?: boolean;
    showViewMore?: boolean;
    style?: React.CSSProperties;
    title?: string;
  }

  export type NoticeIconTabComponent<T extends NoticeIconData = NoticeIconData> = React.FC<
    NoticeIconTabProps<T>
  >;

  export interface NoticeIconData {
    avatar?: string | React.ReactNode;
    clickClose?: boolean;
    description?: React.ReactNode;
    datetime?: React.ReactNode;
    extra?: React.ReactNode;
    key?: string | number;
    read?: boolean;
    style?: React.CSSProperties;
    title?: React.ReactNode;
    [key: string]: any;
  }

  export interface NoticeIconProps<T extends NoticeIconData = NoticeIconData> {
    count?: number;
    bell?: React.ReactNode;
    className?: string;
    loading?: boolean;
    onClear?: (tabTitle?: string) => void;
    onItemClick?: (item: T, tabProps: NoticeIconProps<T>) => void;
    onViewMore?: (tabProps: NoticeIconProps<T>, e: React.MouseEvent) => void;
    onTabChange?: (tabTile?: string) => void;
    style?: React.CSSProperties;
    onPopupVisibleChange?: (visible: boolean) => void;
    popupVisible?: boolean;
    locale?: {
      emptyText: string;
      clear: string;
      viewMore: string;
      [key: string]: string;
    };
    clearClose?: boolean;
  }

  export default class NoticeIcon<T extends NoticeIconData = NoticeIconData> extends Component<
    NoticeIconProps<T>
  > {
    static Tab: NoticeIconTabComponent;
  }
}