mobx-view-model-devtools 0.0.34 → 0.0.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.d.ts CHANGED
@@ -5,13 +5,20 @@ import { VirtualizerHandle } from 'virtua';
5
5
  import { Ref } from 'yummies/mobx';
6
6
  import { Maybe, AnyObject, Defined } from 'yummies/types';
7
7
  import { KeyboardHandler as KeyboardHandler$1, KeyboardHandlerAction } from 'mobx-swiss-knife';
8
- import * as react from 'react';
9
8
  import { ComponentType } from 'react';
10
9
 
11
10
  declare class KeyboardHandler extends KeyboardHandler$1<KeyboardHandlerAction> {
12
11
  constructor(devtools: ViewModelDevtools);
13
12
  }
14
13
 
14
+ type ListItemViewProps<T extends ListItem<any>> = {
15
+ item: T;
16
+ };
17
+ type ListItemOperation<T> = {
18
+ title: string;
19
+ icon: ComponentType;
20
+ action: VoidFunction;
21
+ } | ComponentType<ListItemViewProps<ListItem<T>>>;
15
22
  declare abstract class ListItem<T> {
16
23
  devtools: ViewModelDevtools;
17
24
  key: string;
@@ -31,11 +38,7 @@ declare abstract class ListItem<T> {
31
38
  abstract get depth(): number;
32
39
  get depthLine(): string;
33
40
  get stringifiedData(): string;
34
- get operations(): {
35
- title: string;
36
- icon: ComponentType;
37
- action: VoidFunction;
38
- }[];
41
+ get operations(): ListItemOperation<T>[];
39
42
  expandKey: string;
40
43
  constructor(devtools: ViewModelDevtools, key: string, _data: T, getChildren?: ((item: ListItem<T>) => ListItem<any>[]) | undefined, cache?: Map<string, any>);
41
44
  }
@@ -45,7 +48,10 @@ declare class PropertyListItem extends ListItem<any> {
45
48
  path: string;
46
49
  order: number;
47
50
  private parent;
51
+ private dataWatchAtom;
52
+ isEditMode: boolean;
48
53
  get data(): any;
54
+ get descriptor(): PropertyDescriptor | null | undefined;
49
55
  get dataType(): "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function";
50
56
  get stringifiedDataType(): string;
51
57
  get type(): "array" | "instance" | "function" | "object" | "primitive";
@@ -61,11 +67,7 @@ declare class PropertyListItem extends ListItem<any> {
61
67
  private failedStringify;
62
68
  get isCopiable(): boolean;
63
69
  get stringifiedData(): string;
64
- get operations(): {
65
- title: string;
66
- icon: (props: react.SVGProps<SVGSVGElement>) => React.JSX.Element;
67
- action: () => Promise<void>;
68
- }[];
70
+ get operations(): ListItemOperation<any>[];
69
71
  protected constructor(devtools: ViewModelDevtools, property: Maybe<string>, path: string, order: number, parent: ListItem<any>);
70
72
  static createKey(parent: ListItem<any>, property: Maybe<string>): string;
71
73
  static create(devtools: ViewModelDevtools, property: Maybe<string>, path: string, order: number, parent: ListItem<any>): PropertyListItem;
@@ -152,11 +154,13 @@ declare class ViewModelDevtools {
152
154
  declare class VMListItem extends ListItem<AnyVM> {
153
155
  private allVms;
154
156
  private parent?;
157
+ private dataWatchAtom;
155
158
  private get childVMListItems();
156
159
  get isFitted(): boolean;
157
160
  private get propertyListItems();
158
161
  get children(): ListItem<any>[];
159
162
  private getVmParams;
163
+ get operations(): ListItemOperation<any>[];
160
164
  get depth(): number;
161
165
  searchData: {
162
166
  name: string;