index.d.ts 1.0 KB

12345678910111213141516171819202122
  1. export type Replacer = (number | string)[] | null | undefined | ((key: string, value: unknown) => string | number | boolean | null | object)
  2. export function stringify(value: undefined | symbol | ((...args: unknown[]) => unknown), replacer?: Replacer, space?: string | number): undefined
  3. export function stringify(value: string | number | unknown[] | null | boolean | object, replacer?: Replacer, space?: string | number): string
  4. export function stringify(value: unknown, replacer?: ((key: string, value: unknown) => unknown) | (number | string)[] | null | undefined, space?: string | number): string | undefined
  5. export interface StringifyOptions {
  6. bigint?: boolean,
  7. circularValue?: string | null | TypeErrorConstructor | ErrorConstructor,
  8. deterministic?: boolean,
  9. maximumBreadth?: number,
  10. maximumDepth?: number,
  11. strict?: boolean,
  12. }
  13. export namespace stringify {
  14. export function configure(options: StringifyOptions): typeof stringify
  15. }
  16. export function configure(options: StringifyOptions): typeof stringify
  17. export default stringify