component.d.ts 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. import type { InspectorNodeTag } from './api.js';
  2. import type { ID } from './util.js';
  3. export declare type ComponentInstance = any;
  4. export interface ComponentTreeNode {
  5. uid: ID;
  6. id: string;
  7. name: string;
  8. renderKey: string | number;
  9. inactive: boolean;
  10. isFragment: boolean;
  11. hasChildren: boolean;
  12. children: ComponentTreeNode[];
  13. domOrder?: number[];
  14. consoleId?: string;
  15. isRouterView?: boolean;
  16. macthedRouteSegment?: string;
  17. tags: InspectorNodeTag[];
  18. meta?: any;
  19. }
  20. export interface InspectedComponentData {
  21. id: string;
  22. name: string;
  23. file: string;
  24. state: ComponentState[];
  25. functional?: boolean;
  26. }
  27. export interface StateBase {
  28. key: string;
  29. value: any;
  30. editable?: boolean;
  31. objectType?: 'ref' | 'reactive' | 'computed' | 'other';
  32. raw?: string;
  33. }
  34. export interface ComponentStateBase extends StateBase {
  35. type: string;
  36. }
  37. export interface ComponentPropState extends ComponentStateBase {
  38. meta?: {
  39. type: string;
  40. required: boolean;
  41. /** Vue 1 only */
  42. mode?: 'default' | 'sync' | 'once';
  43. };
  44. }
  45. export declare type ComponentBuiltinCustomStateTypes = 'function' | 'map' | 'set' | 'reference' | 'component' | 'component-definition' | 'router' | 'store';
  46. export interface ComponentCustomState extends ComponentStateBase {
  47. value: CustomState;
  48. }
  49. export declare type CustomState = {
  50. _custom: {
  51. type: ComponentBuiltinCustomStateTypes | string;
  52. objectType?: string;
  53. display?: string;
  54. tooltip?: string;
  55. value?: any;
  56. abstract?: boolean;
  57. file?: string;
  58. uid?: number;
  59. readOnly?: boolean;
  60. /** Configure immediate child fields */
  61. fields?: {
  62. abstract?: boolean;
  63. };
  64. id?: any;
  65. actions?: {
  66. icon: string;
  67. tooltip?: string;
  68. action: () => void | Promise<void>;
  69. }[];
  70. /** internal */
  71. _reviveId?: number;
  72. };
  73. };
  74. export declare type ComponentState = ComponentStateBase | ComponentPropState | ComponentCustomState;
  75. export interface ComponentDevtoolsOptions {
  76. hide?: boolean;
  77. }