UNPKG

2.02 kBMarkdownView Raw
1# Installation
2> `npm install --save @types/configstore`
3
4# Summary
5This package contains type definitions for configstore (https://github.com/yeoman/configstore).
6
7# Details
8Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/configstore.
9## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/configstore/index.d.ts)
10````ts
11export default class Configstore {
12 constructor(packageName: string, defaults?: any, options?: ConfigstoreOptions);
13
14 /**
15 * Get the path to the config file. Can be used to show the user
16 * where it is, or better, open it for them.
17 */
18 path: string;
19
20 /**
21 * Get all items as an object or replace the current config with an object.
22 */
23 all: any;
24
25 /**
26 * Get the item count
27 */
28 size: number;
29
30 /**
31 * Get an item
32 * @param key The string key to get
33 * @return The contents of the config from key $key
34 */
35 get(key: string): any;
36
37 /**
38 * Set an item
39 * @param key The string key
40 * @param val The value to set
41 */
42 set(key: string, val: any): void;
43
44 /**
45 * Set all key/value pairs declared in $values
46 * @param values The values object.
47 */
48 set(values: any): void;
49
50 /**
51 * Determines if a key is present in the config
52 * @param key The string key to test for
53 * @return True if the key is present
54 */
55 has(key: string): boolean;
56
57 /**
58 * Delete an item.
59 * @param key The key to delete
60 */
61 delete(key: string): void;
62
63 /**
64 * Clear the config.
65 * Equivalent to <code>Configstore.all = {};</code>
66 */
67 clear(): void;
68}
69
70export interface ConfigstoreOptions {
71 globalConfigPath?: boolean | undefined;
72 configPath?: string | undefined;
73}
74
75````
76
77### Additional Details
78 * Last updated: Mon, 06 Nov 2023 22:41:05 GMT
79 * Dependencies: none
80
81# Credits
82These definitions were written by [ArcticLight](https://github.com/ArcticLight).
83
\No newline at end of file