"use strict" ; import vscode = require ( "vscode" ) ; import DataStore = require ( "nedb" ) ; export class BindingDataStore { private dataStore : any ; constructor ( ) { var datastore = new DataStore ( ) ; datastore . loadDatabase ( ) ; this . dataStore = datastore ; } ; insertBinding ( filePath , binding ) { var record = { filePath : filePath , binding : binding } ; this . dataStore . insert ( record ) ; } ; getByFile ( filePath , callback ) { this . dataStore . find ( { filePath : filePath } , callback ) ; } ; getByBinding ( binding , callback ) { this . dataStore . find ( { binding : new RegExp ( binding ) } , callback ) ; } ; countAll ( callback ) { this . dataStore . count ( { } , callback ) ; } ; } ;