ui.d.ts 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. // interface View {
  2. // w: 'auto' | '*' | number;
  3. // h: 'auto' | '*' | number;
  4. // id: string;
  5. // gravity: 'left' | 'right' | 'top' | 'bottom' | 'center' | 'center_vertical' | 'center_horizontal' | string;
  6. // layout_gravity: 'left' | 'right' | 'top' | 'bottom' | 'center' | 'center_vertical' | 'center_horizontal' | string;
  7. // margin: number | string;
  8. // marginLeft: number;
  9. // marginRight: number;
  10. // marginTop: number;
  11. // marginBottom: number;
  12. // padding
  13. // paddingLeft: number;
  14. // paddingRight: number;
  15. // paddingTop: number;
  16. // paddingBottom: number;
  17. // bg
  18. // alpha
  19. // foreground
  20. // minHeight
  21. // minWidth
  22. // visbility
  23. // rotation
  24. // transformPivotX
  25. // transformPivotY
  26. // style
  27. // }
  28. // interface UI {
  29. // [id: string]: View | ((...args: any[]) => any);
  30. // layout(xml: any): void;
  31. // inflate(xml: any, parent?: View): void;
  32. // findView(id: string): View;
  33. // finish()
  34. // setContentView(view: View)
  35. // run(callback)
  36. // post(callback, delay?: number): void;
  37. // statusBarColor(color)
  38. // showPopupMenu(view, menu)
  39. // }
  40. // declare const ui: UI;
  41. type View = any;
  42. interface UILike {
  43. toString(): string;
  44. }
  45. declare namespace ui {
  46. function layout(xml: UILike | any): void;
  47. function inflate(xml: UILike | any, parent?: View): void;
  48. function findView(id: string): View;
  49. function finish()
  50. function setContentView(view: View)
  51. function run(callback)
  52. function post(callback, delay?: number): void;
  53. function statusBarColor(color)
  54. function showPopupMenu(view, menu)
  55. }