global.d.ts 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. declare interface Fn<T = any, R = T> {
  2. (...arg: T[]): R;
  3. }
  4. declare interface PromiseFn<T = any, R = T> {
  5. (...arg: T[]): Promise<R>;
  6. }
  7. declare interface IObj<T = any> {
  8. [key: string]: T;
  9. [key: number]: T;
  10. }
  11. declare function parseInt(s: string | number, radix?: number): number;
  12. declare function parseFloat(string: string | number): number;
  13. declare type Dictionary<T> = Record<string, T>;
  14. declare type Nullable<T> = T | null;
  15. declare type RefInstanceType<T> = {
  16. $: T;
  17. } | null;
  18. declare type RefType<T> = T | null;
  19. declare type CustomizedHTMLElement<T> = HTMLElement & T;
  20. declare type Indexable<T = any> = {
  21. [key: string]: T;
  22. };
  23. declare type Hash<T> = Indexable<T>;
  24. declare type DeepPartial<T> = {
  25. [P in keyof T]?: DeepPartial<T[P]>;
  26. };
  27. declare type LabelValueOptions = {
  28. label: string;
  29. value: any;
  30. }[];
  31. declare type EmitType = (event: string, ...args: any[]) => void;
  32. declare type TargetContext = '_self' | '_blank';
  33. declare type TimeoutHandle = ReturnType<typeof setTimeout>;
  34. declare type IntervalHandle = ReturnType<typeof setInterval>;