.gitignore added
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / flatted / types.d.ts
1 interface Flatted {
2   /**
3    * Converts a JavaScript Object Notation (using Flatted encoding) string into an object.
4    * @param text A valid Flatted string.
5    * @param reviver A function that transforms the results. This function is called for each member of the object.
6    * If a member contains nested objects, the nested objects are transformed before the parent object is.
7    */
8   parse(
9     text: string,
10     reviver?: (this: any, key: string, value: any) => any
11   ): any;
12   /**
13    * Converts a JavaScript value to a JavaScript Object Notation (using Flatted encoding) string.
14    * @param value A JavaScript value, usually an object or array, to be converted.
15    * @param replacer A function that transforms the results.
16    * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read.
17    */
18   stringify(
19     value: any,
20     replacer?: (this: any, key: string, value: any) => any,
21     space?: string | number
22   ): string;
23   /**
24    * Converts a JavaScript value to a JavaScript Object Notation (using Flatted encoding) string.
25    * @param value A JavaScript value, usually an object or array, to be converted.
26    * @param replacer An array of strings and numbers that acts as an approved list for selecting the object properties that will be stringified.
27    * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read.
28    */
29   stringify(
30     value: any,
31     replacer?: (number | string)[] | null,
32     space?: string | number
33   ): string;
34 }
35
36 /**
37  * Fast and minimal circular JSON parser.
38  * logic example
39 ```js
40 var a = [{one: 1}, {two: '2'}];
41 a[0].a = a;
42 // a is the main object, will be at index '0'
43 // {one: 1} is the second object, index '1'
44 // {two: '2'} the third, in '2', and it has a string
45 // which will be found at index '3'
46 Flatted.stringify(a);
47 // [["1","2"],{"one":1,"a":"0"},{"two":"3"},"2"]
48 // a[one,two]    {one: 1, a}    {two: '2'}  '2'
49 ```
50  */
51 declare const Flatted: Flatted;
52 export = Flatted;