diff --git a/angular-locker/angular-locker-tests.ts b/angular-locker/angular-locker-tests.ts index 0a1e107b0..c3c280e77 100644 --- a/angular-locker/angular-locker-tests.ts +++ b/angular-locker/angular-locker-tests.ts @@ -3,13 +3,13 @@ angular .module('angular-locker-tests', ['angular-locker']) -.config(['lockerProvider', function config(lockerProvider) { +.config(['lockerProvider', function config(lockerProvider: angular.locker.ILockerProvider) { let lockerSettings: angular.locker.ILockerSettings = { driver: 'session', namespace: 'myApp', separator: '.', eventsEnabled: true, - extend: {} + extend: {} }; lockerProvider.defaults(lockerSettings); @@ -38,7 +38,7 @@ angular locker.put('someKey', ['foo', 'bar']); //The current value will be passed into the function so you can perform logic on the current value, before returning it. e.g. - locker.put('someKey', function(current) { + locker.put('someKey', function(current: any) { current.push('baz'); return current; @@ -47,7 +47,7 @@ angular locker.get('someKey'); // = ['foo', 'bar', 'baz'] // given locker.get('foo') is not defined - locker.put('foo', function (current) { + locker.put('foo', function (current: any) { // current will equal 'bar' }, 'bar'); diff --git a/angular-locker/angular-locker.d.ts b/angular-locker/angular-locker.d.ts index a3cf4c87f..e911e3be7 100644 --- a/angular-locker/angular-locker.d.ts +++ b/angular-locker/angular-locker.d.ts @@ -15,7 +15,7 @@ declare module angular.locker { (current: any): any } - interface ILockerRepository { + interface ILockerService { /** * Add an item to storage if it doesn't already exist * @@ -85,14 +85,14 @@ declare module angular.locker { * * @param {String} key The key to remove */ - forget(key: string): void; + forget(key: string): ILockerService; /** * Remove specified item(s) from storage * * @param {Array} keys The array of keys to remove * */ - forget(keys: Array): void; + forget(keys: Array): ILockerService; /** * Retrieve the specified item from storage and then remove it * @@ -100,9 +100,6 @@ declare module angular.locker { * @param {Mixed} def The default value if it does not exist */ pull(key: string | Array, defaultValue?: any): any; - } - - interface ILockerService extends ILockerRepository { /** * Bind a storage key to a $scope property * @@ -136,7 +133,7 @@ declare module angular.locker { * * @param {String} namespace The namespace to switch to */ - 'namespace'(name: string): ILockerRepository; + 'namespace'(name: string): ILockerService; /** * Check browser support * @@ -151,7 +148,7 @@ declare module angular.locker { * @param {Object} $scope The angular $scope object * @param {String} key The key to remove from bindings */ - unbind(scope: IScope, property: string): void; + unbind(scope: IScope, property: string): ILockerService; } interface ILockerSettings { @@ -159,7 +156,7 @@ declare module angular.locker { 'namespace'?: string | boolean; separator?: string; eventsEnabled?: boolean; - extend?: any; + extend?: Object; } interface ILockerProvider extends angular.IServiceProvider {