microsoft/vscode-react-native
Publicmirrored from https://github.com/microsoft/vscode-react-nativeAvailable
src/typings/winreg/winreg.d.ts
248lines · modeblame
6cd1e194Meena Kunnathur Balakrishnan10 years ago | 1 | // Type definitions for Winreg v0.0.15 |
| 2 | // Project: https://github.com/fresc81/node-winreg/ | |
| 3 | // Definitions by: RX14 <https://github.com/RX14> | |
| 4 | // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | |
| 5 | | |
| 6 | declare var Winreg: WinregStatic; | |
| 7 | | |
| 8 | interface WinregStatic { | |
| 9 | /** | |
| 10 | * Create a new Winreg instance with the given options. | |
| 11 | * @param options options object | |
| 12 | */ | |
| 13 | new (options: Winreg.Options): Winreg; | |
| 14 | | |
| 15 | /** | |
| 16 | * HKEY_LOCAL_MACHINE registry hive. | |
| 17 | */ | |
| 18 | HKLM: string; | |
| 19 | | |
| 20 | /** | |
| 21 | * HKEY_CURRENT_USER registry hive. | |
| 22 | */ | |
| 23 | HKCU: string; | |
| 24 | | |
| 25 | /** | |
| 26 | * HKEY_CLASSES_ROOT registry hive. | |
| 27 | */ | |
| 28 | HKCR: string; | |
| 29 | | |
| 30 | /** | |
| 31 | * HKEY_USERS registry hive. | |
| 32 | */ | |
| 33 | HKU: string; | |
| 34 | | |
| 35 | /** | |
| 36 | * HKEY_CURRENT_CONFIG registry hive. | |
| 37 | */ | |
| 38 | HKCC: string; | |
| 39 | | |
| 40 | /** | |
| 41 | * Array of available registry hives. | |
| 42 | */ | |
| 43 | HIVES: Array<string>; | |
| 44 | | |
| 45 | /** | |
| 46 | * Registry value type STRING. | |
| 47 | * | |
| 48 | * Values of this type contain a string. | |
| 49 | */ | |
| 50 | REG_SZ: string; | |
| 51 | | |
| 52 | /** | |
| 53 | * Registry value type MULTILINE_STRING. | |
| 54 | * | |
| 55 | * Values of this type contain a multiline string. | |
| 56 | */ | |
| 57 | REG_MULTI_SZ: string; | |
| 58 | | |
| 59 | /** | |
| 60 | * Registry value type EXPANDABLE_STRING. | |
| 61 | * | |
| 62 | * Values of this type contain an expandable string. | |
| 63 | */ | |
| 64 | REG_EXPAND_SZ: string; | |
| 65 | | |
| 66 | /** | |
| 67 | * Registry value type DOUBLE_WORD. | |
| 68 | * | |
| 69 | * Values of this type contain a double word (32 bit integer). | |
| 70 | */ | |
| 71 | REG_DWORD: string; | |
| 72 | | |
| 73 | /** | |
| 74 | * Registry value type QUAD_WORD. | |
| 75 | * | |
| 76 | * Values of this type contain a quad word (64 bit integer). | |
| 77 | */ | |
| 78 | REG_QWORD: string; | |
| 79 | | |
| 80 | /** | |
| 81 | * Registry value type BINARY. | |
| 82 | * | |
| 83 | * Values of this type contain a binary value. | |
| 84 | */ | |
| 85 | REG_BINARY: string; | |
| 86 | | |
| 87 | /** | |
| 88 | * Registry value type UNKNOWN. | |
| 89 | * | |
| 90 | * Values of this type contain a value of an unknown type. | |
| 91 | */ | |
| 92 | REG_NONE: string; | |
| 93 | | |
| 94 | /** | |
| 95 | * Array of available registry value types. | |
| 96 | */ | |
| 97 | REG_TYPES: Array<string>; | |
| 98 | } | |
| 99 | | |
| 100 | interface Winreg { | |
| 101 | /** | |
| 102 | * Hostname, if set in options. | |
| 103 | * @readonly | |
| 104 | */ | |
| 105 | host: string; | |
| 106 | | |
| 107 | /** | |
| 108 | * Hive ID. | |
| 109 | * @readonly | |
| 110 | */ | |
| 111 | hive: string; | |
| 112 | | |
| 113 | /** | |
| 114 | * The registry key. | |
| 115 | * @readonly | |
| 116 | */ | |
| 117 | key: string; | |
| 118 | | |
| 119 | /** | |
| 120 | * The path of the registry key, including hostname (if set) and hive. | |
| 121 | * @readonly | |
| 122 | */ | |
| 123 | path: string; | |
| 124 | | |
| 125 | /** | |
| 126 | * A new Winreg instance of the parent key. | |
| 127 | * @readonly | |
| 128 | */ | |
| 129 | parent: Winreg; | |
| 130 | | |
| 131 | /** | |
| 132 | * Retrieves all values from this registry key. | |
| 133 | * | |
| 134 | * @param cb Callback with an array of RegistryItem objects, one for each value. | |
| 135 | */ | |
| 136 | values(cb: (err: Error, result: Array<Winreg.RegistryItem>) => void): void; | |
| 137 | | |
| 138 | /** | |
| 139 | * Retrieves all subkeys of this registry key. | |
| 140 | * | |
| 141 | * @param cb Callback with an array of Winreg objects, one for each subkey. | |
| 142 | */ | |
| 143 | keys(cb: (err: Error, result: Array<Winreg>) => void): void; | |
| 144 | | |
| 145 | /** | |
| 146 | * Retrieves a named value from this registry key. | |
| 147 | * | |
| 148 | * @param name Name of the value to retrieve. | |
| 149 | * @param cb Callback with a RegistryItem object for the value. | |
| 150 | */ | |
| 151 | get(name: string, cb: (err: Error, result: Winreg.RegistryItem) => void): void; | |
| 152 | | |
| 153 | /** | |
| 154 | * Sets a named value in this registry key. Overwrites existing value. | |
| 155 | * | |
| 156 | * @param name Name of the value to set. | |
| 157 | * @param type Type of the value to set. | |
| 158 | * @param value Value of value to set. | |
| 159 | * @param cb Callback with any errors. | |
| 160 | */ | |
| 161 | set(name: string, type: string, value: string, cb: (err: Error) => void): void; | |
| 162 | | |
| 163 | /** | |
| 164 | * Remove a named value from this registry key. | |
| 165 | * | |
| 166 | * @param name Name of the value to remove. | |
| 167 | * @param cb Callback with any errors. | |
| 168 | */ | |
| 169 | remove(name: string, cb: (err: Error) => void): void; | |
| 170 | | |
| 171 | /** | |
| 172 | * Create this registry key. | |
| 173 | * | |
| 174 | * @param cb Callback with any errors. | |
| 175 | */ | |
| 176 | create(cb: (err: Error) => void): void; | |
| 177 | | |
| 178 | /** | |
| 179 | * Erase this registry key and its contents. | |
| 180 | * | |
| 181 | * @param cb Callback with any errors. | |
| 182 | */ | |
| 183 | erase(cb: (err: Error) => void): void; | |
| 184 | } | |
| 185 | | |
| 186 | declare namespace Winreg { | |
| 187 | export interface Options { | |
| 188 | /** | |
| 189 | * Optional hostname, must start with '\\' sequence. | |
| 190 | */ | |
| 191 | host?: string; | |
| 192 | | |
| 193 | /** | |
| 194 | * Optional hive ID, default is HKLM. | |
| 195 | */ | |
| 196 | hive?: string; | |
| 197 | | |
| 198 | /** | |
| 199 | * Optional key, default is the root key. | |
| 200 | */ | |
| 201 | key?: String; | |
| 202 | } | |
| 203 | | |
| 204 | /** | |
| 205 | * A single registry value record | |
| 206 | */ | |
| 207 | interface RegistryItem { | |
| 208 | /** | |
| 209 | * Hostname, if set in options. | |
| 210 | * @readonly | |
| 211 | */ | |
| 212 | host: string; | |
| 213 | | |
| 214 | /** | |
| 215 | * Hive ID. | |
| 216 | * @readonly | |
| 217 | */ | |
| 218 | hive: string; | |
| 219 | | |
| 220 | /** | |
| 221 | * Key that the registry value belongs to. | |
| 222 | * @readonly | |
| 223 | */ | |
| 224 | key: string; | |
| 225 | | |
| 226 | /** | |
| 227 | * Name of the registry value. | |
| 228 | * @readonly | |
| 229 | */ | |
| 230 | name: string; | |
| 231 | | |
| 232 | /** | |
| 233 | * Type of the registry value. | |
| 234 | * @readonly | |
| 235 | */ | |
| 236 | type: string; | |
| 237 | | |
| 238 | /** | |
| 239 | * Value of the registry value, as a string. | |
| 240 | * @readonly | |
| 241 | */ | |
| 242 | value: string; | |
| 243 | } | |
| 244 | } | |
| 245 | | |
| 246 | declare module "winreg" { | |
| 247 | export = Winreg; | |
| 248 | } |