DefinitelyTyped/types/angular-feature-flags/index.d.ts
Georgii Dolzhykov 69acc07b23 angular: Better types for HTTP interceptors & response objects (#19247)
* Better types for HTTP interceptors & response objects

* Fix failing tests

* Don't use TS 2.3 features, staying compatible with 2.1
2017-08-22 22:22:20 +01:00

49 lines
1.4 KiB
TypeScript

// 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
// TypeScript Version: 2.3
/// <reference types="angular" />
import * as ng from 'angular';
declare module 'angular' {
namespace 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: ReadonlyArray<FlagData>): void;
}
export interface FeatureFlagsService {
set(
flagsPromise:
| ng.IPromise<ReadonlyArray<FlagData>>
| ng.IHttpPromise<ReadonlyArray<FlagData>>
): void;
}
}
}