forked from parcel-bundler/parcel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjson5.js.flow
32 lines (28 loc) · 868 Bytes
/
json5.js.flow
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// @flow
// Derived from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/json5/index.d.ts
// And https://github.com/DefinitelyTyped/DefinitelyTyped#readme
// Which is licensed MIT
declare module 'json5' {
declare type JSONReplacer = (
key: string,
value: mixed,
) => mixed | (number | string)[] | null;
declare type Reviver = (key: mixed, value: mixed) => mixed;
declare type Options = {|
space?: number | string,
quote?: string,
replacer?: JSONReplacer,
|};
declare module.exports: {|
parse(text: string, reviver?: Reviver): any, // Not type safe !
stringify(
value: mixed,
replacer?:
| (number | string)[]
| null
| ((key: string, value: mixed) => mixed),
space?: string | number,
): string,
stringify(value: mixed, options?: Options): string,
|};
}