Files
DefinitelyTyped/firebase-client/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

75 lines
1.7 KiB
TypeScript

// Type definitions for Firebase Client 0.1.0
// Project: https://www.github.com/jpstevens/firebase-client
// Definitions by: Andrew Breen <https://github.com/fpsscarecrow/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
import * as Q from "q";
interface PushResponse {
/**
* Name ref (key) of the child resource
*/
name : string;
}
interface FirebaseConfig {
/**
* path for the Firebase instance
*/
url : string;
/**
* Token for authorisation
*/
auth: string;
}
interface FirebaseClient {
/**
* Creates a new FirebaseClient given the provided configuration
*/
new (config : FirebaseConfig) : FirebaseClient;
/**
* Retrieves all objects at the base path
*/
get<T>() : Q.Promise<T>;
/**
* Retrieves an object
* @param path Relative path from the base for the resource
*/
get<T>(path : string) : Q.Promise<T>;
/**
* Returns a promise of the HTTP response from setting the value at the given path
* @param path Relative path from the base for the resource
* @param data Data to be set as the value for the given path
*/
set<T>(path : string, data : T) : Q.Promise<T>;
/**
* Update a node at a given path
* @param path Relative path from the base for the resource
* @param value Value of the response
*/
update<T>(path : string, value : T) : Q.Promise<T>;
/**
* Deletes the resource at a given path
* @param path Relative path from the base for the resource
*/
delete(path : string) : Q.Promise<void>;
/**
* @param path Relative path from the base for the resource
* @param value Object to push to the path
*/
push<T>(path : string, value : T) : Q.Promise<PushResponse>;
}
declare var FirebaseClient: FirebaseClient;
export = FirebaseClient;
export as namespace FirebaseClient;