Skip to content

Commit d7a9973

Browse files
committed
Export additional types
1 parent e85a54f commit d7a9973

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ A [React](https://github.com/facebook/react) component for editing or viewing JS
2828
> **Version 1.14.0** has a change which recommends you provide a `setData` prop and not use `onUpdate` for updating your data externally. See [Managing state](#managing-state).
2929
3030
## Contents
31+
- [Contents](#contents)
3132
- [Installation](#installation)
3233
- [Implementation](#implementation)
3334
- [Usage](#usage)
@@ -121,8 +122,8 @@ The only *required* value is `data` (although you will need to provide a `setDat
121122
| `restrictEdit` | `boolean\|FilterFunction` | `false` | If `true`, no editing is permitted. A function can be provided for more specificity — see [Filter functions](#filter-functions) |
122123
| `restrictDelete` | `boolean\|FilterFunction` | `false` | As with `restrictEdit` but for deletion |
123124
| `restrictAdd` | `boolean\|FilterFunction` | `false` | As with `restrictEdit` but for adding new properties |
124-
| `restrictTypeSelection` | `boolean\|FilterFunction` | `true` | Set to `false` to enable drag and drop functionality. See [Drag-n-drop](#drag-n-drop) |
125-
| `restrictDrag` | `boolean\|DataType[]\|TypeFilterFunction` | `false` | For restricting the data types the user can select. Can be a list of data types (e.g. `[ 'string', 'number', 'boolean', 'array', 'object', 'null' ]`) or a boolean. A function can be provided -- it should take the same input as the above `FilterFunction`s, but output should be `boolean \| DataType[]`. |
125+
| `restrictTypeSelection` | `boolean\|DataType[]\|TypeFilterFunction` | `true` | For restricting the data types the user can select. Can be a list of data types (e.g. `[ 'string', 'number', 'boolean', 'array', 'object', 'null' ]`) or a boolean. A function can be provided -- it should take the same input as the above `FilterFunction`s, but output should be `boolean \| DataType[]`. |
126+
| `restrictDrag` | `boolean\|FilterFunction` | `true` | Set to `false` to enable drag and drop functionality. See [Drag-n-drop](#drag-n-drop) |
126127
| `searchText` | `string` | `undefined` | Data visibility will be filtered by matching against value, using the method defined below in `searchFilter` |
127128
| `searchFilter` | `"key"\|"value"\|"all"\|SearchFilterFunction` | `undefined` | Define how `searchText` should be matched to filter the visible items. See [Search/Filtering](#searchfiltering) |
128129
| `searchDebounceTime` | `number` | `350` | Debounce time when `searchText` changes |
@@ -666,12 +667,13 @@ A few helper functions, components and types that might be useful in your own im
666667
- `ThemeInput`: input type for the `theme` prop
667668
- `JsonEditorProps`: all input props for the Json Editor component
668669
- `JsonData`: main `data` object -- any valid JSON structure
669-
- [`UpdateFunction`](#update-functions), [`OnChangeFunction`](#onchange-function), [`OnErrorFunction`](#onerror-function) [`FilterFunction`](#filter-functions), [`CopyFunction`](#copy-function), [`SearchFilterFunction`](#searchfiltering), [`CompareFunction`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort), [`LocalisedString`](#localisation), [`CustomNodeDefinition`](#custom-nodes), [`CustomTextDefinitions`](#custom-text)
670+
- [`UpdateFunction`](#update-functions), [`OnChangeFunction`](#onchange-function), [`OnErrorFunction`](#onerror-function) [`FilterFunction`](#filter-functions), [`CopyFunction`](#copy-function), [`SearchFilterFunction`](#searchfiltering), [`CompareFunction`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort),[`TypeFilterFunction`](#filter-functions), [`LocalisedString`](#localisation), [`CustomNodeDefinition`](#custom-nodes), [`CustomTextDefinitions`](#custom-text), [`CustomTextFunction`](#custom-text),
670671
- `TranslateFunction`: function that takes a [localisation](#localisation) key and returns a translated string
671672
- `IconReplacements`: input type for the `icons` prop
672673
- `CollectionNodeProps`: all props passed internally to "collection" nodes (i.e. objects/arrays)
673674
- `ValueNodeProps`: all props passed internally to "value" nodes (i.e. *not* objects/arrays)
674675
- `CustomNodeProps`: all props passed internally to [Custom nodes](#custom-nodes); basically the same as `CollectionNodeProps` with an extra `customNodeProps` field for passing props unique to your component`
676+
- `DataType`: `"string"` | `"number"` | `"boolean"` | `"null"` | `"object"` | `"array"`
675677
676678
## Issues, bugs, suggestions?
677679

src/index.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,20 @@ import {
55
type OnChangeFunction,
66
type OnErrorFunction,
77
type JerError,
8+
type DataType,
89
type CopyFunction,
910
type FilterFunction,
1011
type SearchFilterFunction,
12+
type TypeFilterFunction,
1113
type CompareFunction,
1214
type IconReplacements,
1315
type CollectionNodeProps,
1416
type ValueNodeProps,
1517
type CustomNodeProps,
1618
type CustomNodeDefinition,
1719
type CustomTextDefinitions,
20+
type CustomTextFunction,
21+
type DefaultValueFunction,
1822
type ThemeName,
1923
type Theme,
2024
type ThemeInput,
@@ -41,9 +45,11 @@ export {
4145
type OnChangeFunction,
4246
type OnErrorFunction,
4347
type JerError,
48+
type DataType,
4449
type CopyFunction,
4550
type FilterFunction,
4651
type SearchFilterFunction,
52+
type TypeFilterFunction,
4753
type CompareFunction,
4854
type NodeData,
4955
type IconReplacements,
@@ -54,6 +60,8 @@ export {
5460
type CustomNodeProps,
5561
type CustomNodeDefinition,
5662
type CustomTextDefinitions,
63+
type CustomTextFunction,
64+
type DefaultValueFunction,
5765
type JsonData,
5866
LinkCustomComponent,
5967
LinkCustomNodeDefinition,

0 commit comments

Comments
 (0)