8853dae75117f08253b1a76caf168d3c6725f224e3d2674eeed2b2aab04af6a46ec336ec4d2b5fd0688c2a409e3c9a8924b5099accc47125c6802a644b81b1 1.5 KB

1234567891011121314151617181920212223242526272829303132
  1. export { JSON5ParseOptions, JSON5StringifyOptions, parseJSON5, stringifyJSON5 } from './json5.cjs';
  2. export { JSONCParseError, JSONCParseOptions, parseJSONC, stringifyJSONC } from './jsonc.cjs';
  3. export { YAMLParseOptions, YAMLStringifyOptions, parseYAML, stringifyYAML } from './yaml.cjs';
  4. import { F as FormatOptions } from './shared/confbox.9745c98f.cjs';
  5. export { parseTOML, stringifyTOML } from './toml.cjs';
  6. /**
  7. * Converts a [JSON](https://www.json.org/json-en.html) string into an object.
  8. *
  9. * Indentation status is auto-detected and preserved when stringifying back using `stringifyJSON`
  10. */
  11. declare function parseJSON<T = unknown>(text: string, options?: JSONParseOptions): T;
  12. /**
  13. * Converts a JavaScript value to a [JSON](https://www.json.org/json-en.html) string.
  14. *
  15. * Indentation status is auto detected and preserved when using value from parseJSON.
  16. */
  17. declare function stringifyJSON(value: any, options?: JSONStringifyOptions): string;
  18. interface JSONParseOptions extends FormatOptions {
  19. /**
  20. * A function that transforms the results. This function is called for each member of the object.
  21. */
  22. reviver?: (this: any, key: string, value: any) => any;
  23. }
  24. interface JSONStringifyOptions extends FormatOptions {
  25. /**
  26. * A function that transforms the results. This function is called for each member of the object.
  27. */
  28. replacer?: (this: any, key: string, value: any) => any;
  29. }
  30. export { type JSONParseOptions, type JSONStringifyOptions, parseJSON, stringifyJSON };