mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
json-file-plus: fix types (#41988)
Some of these types were wrong, and some were missing.
This commit is contained in:
parent
cceda7c3f5
commit
f47104d0f0
@ -31,5 +31,8 @@
|
||||
"_comment": "This will remove husky from when we started migrating to use prettier",
|
||||
"pre-commit": "npm uninstall husky"
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"@types/node": "^13.7.0"
|
||||
}
|
||||
}
|
||||
|
||||
9
types/json-file-plus/index.d.ts
vendored
9
types/json-file-plus/index.d.ts
vendored
@ -3,13 +3,15 @@
|
||||
// Definitions by: Daniel Byrne <https://github.com/danwbyrne>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
declare function readJSON(filename: string): Promise<readJSON.JSONFile>;
|
||||
|
||||
declare namespace readJSON {
|
||||
function sync(filename: string): JSONFile;
|
||||
|
||||
interface Format {
|
||||
readonly indent: number;
|
||||
readonly indent: number | '\t';
|
||||
readonly trailing: boolean;
|
||||
}
|
||||
|
||||
@ -17,9 +19,10 @@ declare namespace readJSON {
|
||||
format: Format;
|
||||
data: any;
|
||||
constructor(raw: string);
|
||||
get: (key: string) => Promise<any>;
|
||||
get: (key: PropertyKey) => Promise<any>;
|
||||
set: (data: any) => void;
|
||||
remove: (key: string) => Promise<void>;
|
||||
remove: (key: PropertyKey) => Promise<void>;
|
||||
stringify: () => Buffer;
|
||||
}
|
||||
|
||||
class JSONFile extends JSONData {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user