Files
DefinitelyTyped/node-persist/index.d.ts
Mohamed Hegazy 2952469366 Add Q.try definition (#15161)
* Add Q.try defintion

* Persever q@0.0

* Depend on q@0.0

* Remove uneeded `/// <reference types="q" />`

* Use built-in Promise instead of Q.Promise

* Remove usused path mappings

* Use Q again

* Use global reference instead of path mapping for q

* Add dependncy on q@0.0

* Switch hystrixjs to a module

* Remove import when there is a triple-slash-reference-types in the index

* Use triple-slash-reference-types instead of path mapping

* Update version of Q to 1.0

* Switch the file to a module and use declare global

* Switch to a module

* use import instead of triple-slash-reference-types

* Do not use triple-slash-reference types

* Switch firebase-client to a module

* import q as a module

* use import for q
2017-03-14 18:21:24 -07:00

44 lines
1.9 KiB
TypeScript

// Type definitions for node-persist
// Project: https://github.com/simonlast/node-persist
// Definitions by: Spencer Williams <http://spencerwi.com/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="node" />
import * as Q from "q";
type milliseconds = number;
declare namespace NodePersist {
export interface InitOptions {
dir?: string;
stringify?: (toSerialize: any) => string;
parse?: (serialized: string) => any;
encoding?: string;
logging?: boolean | Function;
continuous?: boolean;
interval?: milliseconds | boolean;
ttl?: milliseconds | boolean;
}
export function init(options?: InitOptions, callback?: Function): Q.Promise<any>;
export function initSync(options?: InitOptions): void;
export function getItem(key: string, callback?: (err: any, value: any) => any): Q.Promise<any>;
export function getItemSync(key: string): any;
export function setItem(key: string, value: any, callback?: (err: any) => any): Q.Promise<any>;
export function setItemSync(key: string, value: any): void;
export function removeItem(key: string, callback?: (err: any) => any): Q.Promise<any>;
export function removeItemSync(key: string): void;
export function clear(callback?: (err: any) => any): Q.Promise<any>;
export function clearSync(): void;
export function values(): Array<any>;
export function valuesWithKeyMatch(match: string): Array<any>;
export function keys(): Array<string>;
export function length(): number;
export function forEach(callback: (key: string, value: any) => void): void;
export function persist(callback?: (err: any) => any): Q.Promise<any>;
export function persistSync(): void;
export function persistKey(key: string, callback?: (err: any) => any): Q.Promise<any>;
export function persistKeySync(key: string): void;
}
export = NodePersist;