-
Notifications
You must be signed in to change notification settings - Fork 30k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from DefinitelyTyped/master
Update master
- Loading branch information
Showing
101 changed files
with
15,812 additions
and
10,176 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/// <reference path="angular-feature-flags.d.ts" /> | ||
|
||
let myApp = angular.module('myApp', ['feature-flags']); | ||
|
||
const flagsData: Array<angular.featureflags.FlagData> = [ | ||
{ | ||
key: '1', | ||
active: true, | ||
name: 'flag1', | ||
description: 'This is the first flag' | ||
}, | ||
{ | ||
key: '2', | ||
active: false, | ||
name: 'flag2', | ||
description: 'This is the second flag' | ||
} | ||
]; | ||
|
||
myApp.config(function (featureFlagsProvider: angular.featureflags.FeatureFlagsProvider) { | ||
featureFlagsProvider.setInitialFlags(flagsData); | ||
}); | ||
|
||
myApp.run(function ($q: angular.IQService, $http: angular.IHttpService, featureFlags: angular.featureflags.FeatureFlagsService) { | ||
let deferred = $q.defer(); | ||
deferred.resolve(flagsData); | ||
|
||
featureFlags.set(deferred.promise); | ||
|
||
featureFlags.set($http.get('/data/flags.json')); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// Type definitions for angular-feature-flags 1.4.0 | ||
// Project: https://github.com/mjt01/angular-feature-flags | ||
// Definitions by: Borislav Zhivkov <https://github.com/borislavjivkov/> | ||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
|
||
/// <reference path="../angularjs/angular.d.ts" /> | ||
|
||
declare namespace angular.featureflags { | ||
export interface FlagData { | ||
/** | ||
* Unique key that is used from the markup to resolve whether a flag is active or not. | ||
*/ | ||
key: string; | ||
|
||
/** | ||
* Boolean value for enabling/disabling the feature | ||
*/ | ||
active: boolean; | ||
|
||
/** | ||
* A short name of the flag (only visible in the list of flags) | ||
*/ | ||
name: string; | ||
|
||
/** | ||
* A long description of the flag to further explain the feature being toggled (only visible in the list of flags) | ||
*/ | ||
description: string; | ||
} | ||
|
||
export interface FeatureFlagsProvider { | ||
setInitialFlags(flags: Array<FlagData>): void; | ||
} | ||
|
||
export interface FeatureFlagsService { | ||
set(flagsPromise: angular.IPromise<FlagData> | angular.IHttpPromise<FlagData>): void; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.