@mikezimm/fps-library-v2
Version:
Library of reusable typescript/javascript functions, interfaces and constants
45 lines • 2.06 kB
TypeScript
/**
* IReactJSONSettingsV1 was based off the original react-json-view based in this package:
* import ReactJson from 'react-json-view';
* https://github.com/mac-s-g/react-json-view
*
* IReactJSONSettingsV2 is based off a newer actively supported open source project that is recommended by the aformentioned owner:
* The new one does not need to be installed but is dynamically loaded when needed (unless you use the function variant)
* https://github.com/microlinkhq/react-json-view/
*
* npm install @microlink/react-json-view --save
*
*/
/// <reference types="react" />
export interface IReactJSONSettingsV1 {
jsonObject?: any;
name: string;
collapsed?: boolean | number;
displayDataTypes?: boolean;
displayObjectSize?: boolean;
enableClipboard?: boolean;
style?: React.CSSProperties;
theme?: ThemeKeys;
indentWidth?: number;
maxStrLength?: number | false;
arrayGroupSize?: number;
quotesOnKeys?: boolean;
}
export interface IReactJSONSettingsV2 extends IReactJSONSettingsV1 {
onAdd?: OnAdd;
onDelete?: OnDelete;
onEdit?: OnEdit;
}
type OnAdd = (add: InteractionProps) => void;
type OnDelete = (del: InteractionProps) => void;
type OnEdit = (edit: InteractionProps) => void;
interface InteractionProps {
updated_src: object;
name: string;
namespace: (string | number)[];
new_value?: any;
existing_value?: any;
}
export type ThemeKeys = 'apathy' | 'apathy:inverted' | 'ashes' | 'bespin' | 'brewer' | 'bright:inverted' | 'bright' | 'chalk' | 'codeschool' | 'colors' | 'eighties' | 'embers' | 'flat' | 'google' | 'grayscale' | 'grayscale:inverted' | 'greenscreen' | 'harmonic' | 'hopscotch' | 'isotope' | 'marrakesh' | 'mocha' | 'monokai' | 'ocean' | 'paraiso' | 'pop' | 'railscasts' | 'rjv-default' | 'shapeshifter' | 'shapeshifter:inverted' | 'solarized' | 'summerfruit' | 'summerfruit:inverted' | 'threezerotwofour' | 'tomorrow' | 'tube' | 'twilight';
export {};
//# sourceMappingURL=IReactJSONSettingsV2.d.ts.map