mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
28 lines
583 B
TypeScript
28 lines
583 B
TypeScript
import Purdy = require('purdy');
|
|
|
|
const obj: object = {
|
|
str: 'string',
|
|
num: 5,
|
|
nil: null,
|
|
bool: false,
|
|
nested: {
|
|
hello: "world"
|
|
}
|
|
};
|
|
|
|
const options: Purdy.Options = {
|
|
pathPrefix: "",
|
|
arrayIndex: true,
|
|
indent: 2,
|
|
align: "left",
|
|
depth: null,
|
|
json: true
|
|
};
|
|
|
|
Purdy(obj, options); // $ExpectType void
|
|
Purdy.stringify(obj, options); // $ExpectType string
|
|
|
|
const inst = Purdy.purdy(options); // $ExpectType Instance
|
|
inst.print("string", 5, true, obj); // $ExpectType void
|
|
inst.stringify("string", 5, true, obj); // $ExpectType string
|