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

Moar typings #32

Merged
merged 2 commits into from
Aug 5, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions globals.d.ts

This file was deleted.

59 changes: 59 additions & 0 deletions types/electron-store.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
// Type definitions for electron-store 1.2.0
// Project: https://github.com/sindresorhus/electron-store
// TypeScript Version: 2.4.0

declare module 'electron-store' {
interface ElectronStoreOptions {
/** Default data. */
defaults?: {}

/** Name of the storage file (without extension). Default is `config`. */
name?: string

/** Storage file location. Don't specify this unless absolutely necessary! */
cwd?: string
}

/**
* Simple data persistence for your Electron app or module.
*
* You can use dot-notation in a key to access nested properties. The instance is iterable
* so you can use it directly in a for…of loop.
*/
export default class ElectronStore
implements Iterable<[string, string | number | boolean | symbol | {}]> {
constructor(options?: ElectronStoreOptions)

[Symbol.iterator](): Iterator<[string, string | number | boolean | symbol | {}]>

/** Set an item. */
set(key: string, value: any): void

/** Set multiple items at once. */
set(object: {}): void

/** Get an item or defaultValue if the item does not exist. */
get(key: string, defaultValue?: any): any

/** Check if an item exists. */
has(key: string): boolean

/** Delete an item. */
delete(key: string): void

/** Delete all items. */
clear(): void

/** Open the storage file in the user's editor. */
openInEditor(): void

/** Get the item count. */
size: number

/** Get all the data as an object or replace the current data with an object. */
store: {}

/** Get the path to the storage file. */
path: string
}
}
21 changes: 21 additions & 0 deletions types/images.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Tell the TS compiler that it's ok to load these
// types of extensions. FuseBox will do the right thing.
declare module '*.jpeg' {
export default ''
}

declare module '*.jpg' {
export default ''
}

declare module '*.gif' {
export default ''
}

declare module '*.png' {
export default ''
}

declare module '*.svg' {
export default ''
}