JS: Add Firebase test with types

This commit is contained in:
Asger F
2019-08-28 15:22:15 +01:00
parent ec81e368da
commit d8cda5e268
6 changed files with 31 additions and 0 deletions

View File

@@ -1,3 +1,6 @@
| src/import_assign.ts:4:3:4:17 | db.ref("hello") |
| src/import_named.ts:4:3:4:17 | db.ref("hello") |
| src/import_star.ts:4:3:4:17 | db.ref("hello") |
| tst.js:5:1:5:22 | fb.data ... ef('x') |
| tst.js:7:3:7:7 | x.ref |
| tst.js:7:3:7:14 | x.ref.parent |

View File

@@ -0,0 +1,10 @@
// Greatly simplified version of the Firebase d.ts file.
declare namespace firebase.database {
interface Database {
ref(name: string): any;
}
}
export = firebase;
export as namespace firebase;

View File

@@ -0,0 +1,5 @@
import firebase = require("firebase");
function test(db: firebase.database.Database) {
db.ref("hello");
}

View File

@@ -0,0 +1,5 @@
import { database } from "firebase";
function test(db: database.Database) {
db.ref("hello");
}

View File

@@ -0,0 +1,5 @@
import * as firebase from "firebase";
function test(db: firebase.database.Database) {
db.ref("hello");
}

View File

@@ -0,0 +1,3 @@
{
"include": ["src"]
}