-
Notifications
You must be signed in to change notification settings - Fork 15
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 #8 from andy-viv/typedefs
Added typescript definition file
- Loading branch information
Showing
2 changed files
with
37 additions
and
1 deletion.
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,35 @@ | ||
export = Cerebro | ||
declare class Cerebro { | ||
static rehydrate(dehydratedObject: string): Cerebro.ICerebroConfig | ||
constructor(config: Cerebro.ICerebroConfigEntry[], options?: Cerebro.ICerebroOptions) | ||
resolveConfig( | ||
context: Cerebro.ICerebroContext, | ||
options?: Cerebro.ICerebroConfigOptions | ||
): Cerebro.ICerebroConfig | ||
} | ||
declare namespace Cerebro { | ||
interface ICerebroConfigEntry { | ||
setting: string | ||
value: any | ||
except?: ICerebroConfigEntryException[] | ||
} | ||
type ICerebroConfigEntryException = { | ||
value: any | ||
[key: string]: any | ||
} | ||
interface ICerebroOptions { | ||
customEvaluators?: { [key: string]: Function } | ||
} | ||
interface ICerebroContext { | ||
percentageSeed: string | number | ||
} | ||
interface ICerebroConfigOptions { | ||
overrides?: { [key: string]: any } | ||
} | ||
interface ICerebroConfig { | ||
isEnabled(name: string): boolean | ||
getValue(name: string): any | ||
dehydrate(): string | ||
getRawConfig(): { [key: string]: any } | ||
} | ||
} |
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 |
---|---|---|
|
@@ -27,5 +27,6 @@ | |
"buffer-crc32": "^0.2.13", | ||
"lodash.template": "^4.4.0", | ||
"tv4": "^1.2.7" | ||
} | ||
}, | ||
"types": "index.d.ts" | ||
} |