Created
June 18, 2017 00:30
-
-
Save devonzuegel/f7cd0870e11bdff1ae9151544ae05641 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| interface BaseRule { | |
| enforce?: 'pre' | 'post'; | |
| test?: Condition | Condition[]; /** A condition that must be met */ | |
| exclude?: Condition | Condition[]; /** A condition that must not be met */ | |
| include?: Condition | Condition[]; /** A condition that must be met */ | |
| resource?: Condition | Condition[]; /** A Condition matched with the resource. */ | |
| issuer?: Condition | Condition[]; /** A condition matched with the issuer */ | |
| parser?: { [optName: string]: any }; | |
| rules?: Rule[]; /** An array of Rules that is also used when the Rule matches. */ | |
| oneOf?: Rule[]; /** An array of Rules from which only the first matching Rule is used when the Rule matches. */ | |
| } | |
| // Direct Rules | |
| interface NewUseRule extends BaseDirectRule { | |
| test: Condition | Condition[]; /** A condition that must be met */ | |
| use: Loader | Loader[]; /** A loader or array of loaders */ | |
| } | |
| // Delegate Rules | |
| interface RulesRule extends BaseRule { | |
| rules: Rule[]; /** An array of Rules that is also used when the Rule matches. */ | |
| } | |
| interface OneOfRule extends BaseRule { | |
| oneOf: Rule[]; | |
| } | |
| type Rule = NewUseRule | RulesRule | OneOfRule; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment