Press n or j to go to the next uncovered block, b, p or k for the previous block.
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 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 | /** * `Options` types contain all the configuration options for * Options that can be set in the constructor of KeyValues Class * Example: * new KeyValues({fileName: 'config.json'}) */ type Options = { /** * Whether or not to save the settings file atomically. */ atomicSave: boolean; /** * The path to the settings directory. Defaults to your * app's user data direcory. */ dir?: string; // /** // * A custom Electron instance to use. Great for testing! // */ // electron?: typeof Electron; /** * The name of the settings file that will be saved to * the disk. */ fileName: string; /** * Whether or not to prettify the data when it's saved to * disk. */ prettify: boolean; /** * The number of spaces to use when stringifying the data * before saving to disk if `prettify` is set to `true`. */ numSpaces: number; }; /** * `KeyPath` is a type that represents a key path in a key-value pair. * * It can be a string or an array of strings. * Example: * const keyPath: KeyPath = "user.name"; * const keyPathArray: KeyPath = ["user", "name"]; * This type is used to access nested properties in an object. * @typedef {string | Array<string>} KeyPath **/ type KeyPath = string | Array<string>; /** * `valueTypes` is a type that represents the possible values * that can be stored in a key-value pair. * * It can be null, string, number, boolean, object, dictionaryType, * or an array of valueTypes. * Example: * const value: valueTypes = "Hello World"; * const valueArray: valueTypes = [1, 2, 3]; * @typedef {null | string | number | boolean | object | dictionaryType | valueTypes} * @internal */ type valueTypes = null | string | number | boolean | object | dictionaryType | valueTypes[]; /** * `Types` is a type that represents an object with string keys * and values of type `T`, where `T` is a subtype of `valueTypes`. * This type is used to define the structure of key-value pairs. * @typedef {Record<string, T>} Types * @internal */ type Types<T extends valueTypes> = Record<string, T>; /** * `dictionaryType` is a type that represents an object * with string keys and values of type `valueTypes`. * This type is used to define a dictionary-like structure * where each key maps to a value of various types. * @typedef {Record<string, valueTypes>} dictionaryType * @internal */ type dictionaryType = { [key: string]: valueTypes }; export type { Options, KeyPath, valueTypes, Types, dictionaryType }; |