Skip to content
This repository was archived by the owner on Jun 5, 2019. It is now read-only.

Commit d297215

Browse files
authored
Moar typings (#32)
* Moves and fixes image typings. * Types electron-store.
1 parent 5db8c64 commit d297215

File tree

3 files changed

+80
-8
lines changed

3 files changed

+80
-8
lines changed

globals.d.ts

-8
This file was deleted.

types/electron-store.d.ts

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
// Type definitions for electron-store 1.2.0
2+
// Project: https://github.com/sindresorhus/electron-store
3+
// TypeScript Version: 2.4.0
4+
5+
declare module 'electron-store' {
6+
interface ElectronStoreOptions {
7+
/** Default data. */
8+
defaults?: {}
9+
10+
/** Name of the storage file (without extension). Default is `config`. */
11+
name?: string
12+
13+
/** Storage file location. Don't specify this unless absolutely necessary! */
14+
cwd?: string
15+
}
16+
17+
/**
18+
* Simple data persistence for your Electron app or module.
19+
*
20+
* You can use dot-notation in a key to access nested properties. The instance is iterable
21+
* so you can use it directly in a for…of loop.
22+
*/
23+
export default class ElectronStore
24+
implements Iterable<[string, string | number | boolean | symbol | {}]> {
25+
constructor(options?: ElectronStoreOptions)
26+
27+
[Symbol.iterator](): Iterator<[string, string | number | boolean | symbol | {}]>
28+
29+
/** Set an item. */
30+
set(key: string, value: any): void
31+
32+
/** Set multiple items at once. */
33+
set(object: {}): void
34+
35+
/** Get an item or defaultValue if the item does not exist. */
36+
get(key: string, defaultValue?: any): any
37+
38+
/** Check if an item exists. */
39+
has(key: string): boolean
40+
41+
/** Delete an item. */
42+
delete(key: string): void
43+
44+
/** Delete all items. */
45+
clear(): void
46+
47+
/** Open the storage file in the user's editor. */
48+
openInEditor(): void
49+
50+
/** Get the item count. */
51+
size: number
52+
53+
/** Get all the data as an object or replace the current data with an object. */
54+
store: {}
55+
56+
/** Get the path to the storage file. */
57+
path: string
58+
}
59+
}

types/images.d.ts

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// Tell the TS compiler that it's ok to load these
2+
// types of extensions. FuseBox will do the right thing.
3+
declare module '*.jpeg' {
4+
export default ''
5+
}
6+
7+
declare module '*.jpg' {
8+
export default ''
9+
}
10+
11+
declare module '*.gif' {
12+
export default ''
13+
}
14+
15+
declare module '*.png' {
16+
export default ''
17+
}
18+
19+
declare module '*.svg' {
20+
export default ''
21+
}

0 commit comments

Comments
 (0)