react-arborist 3.3.1-0 → 3.3.2-0

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.
@@ -125,7 +125,7 @@ export declare class TreeApi<T> {
125
125
  get overscanCount(): number;
126
126
  get searchTerm(): string;
127
127
  get matchFn(): (node: NodeApi<T>) => boolean;
128
- accessChildren(data: T): T[] | null;
128
+ accessChildren(data: T): readonly T[] | null;
129
129
  accessId(data: T): string;
130
130
  get firstNode(): NodeApi<T>;
131
131
  get lastNode(): NodeApi<T>;
@@ -26,7 +26,7 @@ export interface TreeProps<T> {
26
26
  paddingTop?: number;
27
27
  paddingBottom?: number;
28
28
  padding?: number;
29
- childrenAccessor?: string | ((d: T) => T[] | null);
29
+ childrenAccessor?: string | ((d: T) => readonly T[] | null);
30
30
  idAccessor?: string | ((d: T) => string);
31
31
  openByDefault?: boolean;
32
32
  selectionFollowsFocus?: boolean;
@@ -125,7 +125,7 @@ export declare class TreeApi<T> {
125
125
  get overscanCount(): number;
126
126
  get searchTerm(): string;
127
127
  get matchFn(): (node: NodeApi<T>) => boolean;
128
- accessChildren(data: T): T[] | null;
128
+ accessChildren(data: T): readonly T[] | null;
129
129
  accessId(data: T): string;
130
130
  get firstNode(): NodeApi<T>;
131
131
  get lastNode(): NodeApi<T>;
@@ -26,7 +26,7 @@ export interface TreeProps<T> {
26
26
  paddingTop?: number;
27
27
  paddingBottom?: number;
28
28
  padding?: number;
29
- childrenAccessor?: string | ((d: T) => T[] | null);
29
+ childrenAccessor?: string | ((d: T) => readonly T[] | null);
30
30
  idAccessor?: string | ((d: T) => string);
31
31
  openByDefault?: boolean;
32
32
  selectionFollowsFocus?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-arborist",
3
- "version": "3.3.1-0",
3
+ "version": "3.3.2-0",
4
4
  "license": "MIT",
5
5
  "source": "src/index.ts",
6
6
  "main": "dist/main/index.js",
@@ -59,5 +59,5 @@
59
59
  "ts-jest": "^29.1.1",
60
60
  "typescript": "^5.3.3"
61
61
  },
62
- "stableVersion": "3.3.0"
62
+ "stableVersion": "3.3.1"
63
63
  }
@@ -105,7 +105,7 @@ export class TreeApi<T> {
105
105
 
106
106
  accessChildren(data: T) {
107
107
  const get = this.props.childrenAccessor || "children";
108
- return utils.access<T[] | undefined>(data, get) ?? null;
108
+ return utils.access<readonly T[] | undefined>(data, get) ?? null;
109
109
  }
110
110
 
111
111
  accessId(data: T) {
@@ -36,7 +36,7 @@ export interface TreeProps<T> {
36
36
  padding?: number;
37
37
 
38
38
  /* Config */
39
- childrenAccessor?: string | ((d: T) => T[] | null);
39
+ childrenAccessor?: string | ((d: T) => readonly T[] | null);
40
40
  idAccessor?: string | ((d: T) => string);
41
41
  openByDefault?: boolean;
42
42
  selectionFollowsFocus?: boolean;