Comparing version 0.20.2 to 0.20.3
@@ -26,3 +26,3 @@ import { Result } from './prague'; | ||
}; | ||
export declare class ActionReferences<ACTIONS extends Actions, CONTEXTARGS extends any[]> { | ||
export declare class ActionReferences<CONTEXTARGS extends any[], ACTIONS extends Actions> { | ||
private actions; | ||
@@ -29,0 +29,0 @@ reference: Stubs<ACTIONS>; |
import { Observableable, Match } from './prague'; | ||
export declare function match<ARGS extends any[], VALUE, ONMATCH, ONNOMATCH>(getMatch: (...args: ARGS) => Observableable<null | undefined | VALUE | Match<VALUE>>, onMatch: (match: Match<VALUE>) => ONMATCH, onNoMatch?: () => ONNOMATCH): any; | ||
declare function _if<ARGS extends any[], ONTRUE, ONFALSE>(predicate: (...args: ARGS) => any, onTrue: () => ONTRUE, onFalse?: () => ONFALSE): any; | ||
export declare function match<ARGS extends any[], VALUE, ONMATCH, ONNOMATCH>(getMatch: (...args: ARGS) => Observableable<null | undefined | VALUE | Match<VALUE>>, onMatch: (match: Match<VALUE>) => ONMATCH, onNoMatch?: () => ONNOMATCH): import("./core").Transform<ARGS, import("./core").Result | Exclude<(import("./core").BaseType<ONNOMATCH> extends null | undefined ? undefined : import("./core").BaseType<ONNOMATCH> extends import("./core").Result ? import("./core").BaseType<ONNOMATCH> : import("./core").BaseType<ONNOMATCH> extends () => any ? import("./core").Action : Match<import("./core").BaseType<ONNOMATCH>>) extends null | undefined ? undefined : (import("./core").BaseType<ONNOMATCH> extends null | undefined ? undefined : import("./core").BaseType<ONNOMATCH> extends import("./core").Result ? import("./core").BaseType<ONNOMATCH> : import("./core").BaseType<ONNOMATCH> extends () => any ? import("./core").Action : Match<import("./core").BaseType<ONNOMATCH>>) extends import("./core").Result ? import("./core").BaseType<ONNOMATCH> extends null | undefined ? undefined : import("./core").BaseType<ONNOMATCH> extends import("./core").Result ? import("./core").BaseType<ONNOMATCH> : import("./core").BaseType<ONNOMATCH> extends () => any ? import("./core").Action : Match<import("./core").BaseType<ONNOMATCH>> : (import("./core").BaseType<ONNOMATCH> extends null | undefined ? undefined : import("./core").BaseType<ONNOMATCH> extends import("./core").Result ? import("./core").BaseType<ONNOMATCH> : import("./core").BaseType<ONNOMATCH> extends () => any ? import("./core").Action : Match<import("./core").BaseType<ONNOMATCH>>) extends () => any ? import("./core").Action : Match<import("./core").BaseType<ONNOMATCH> extends null | undefined ? undefined : import("./core").BaseType<ONNOMATCH> extends import("./core").Result ? import("./core").BaseType<ONNOMATCH> : import("./core").BaseType<ONNOMATCH> extends () => any ? import("./core").Action : Match<import("./core").BaseType<ONNOMATCH>>>, undefined>>; | ||
declare function _if<ARGS extends any[], ONTRUE, ONFALSE>(predicate: (...args: ARGS) => any, onTrue: () => ONTRUE, onFalse?: () => ONFALSE): import("./core").Transform<ARGS, import("./core").Result | Exclude<(import("./core").BaseType<ONFALSE> extends null | undefined ? undefined : import("./core").BaseType<ONFALSE> extends import("./core").Result ? import("./core").BaseType<ONFALSE> : import("./core").BaseType<ONFALSE> extends () => any ? import("./core").Action : Match<import("./core").BaseType<ONFALSE>>) extends null | undefined ? undefined : (import("./core").BaseType<ONFALSE> extends null | undefined ? undefined : import("./core").BaseType<ONFALSE> extends import("./core").Result ? import("./core").BaseType<ONFALSE> : import("./core").BaseType<ONFALSE> extends () => any ? import("./core").Action : Match<import("./core").BaseType<ONFALSE>>) extends import("./core").Result ? import("./core").BaseType<ONFALSE> extends null | undefined ? undefined : import("./core").BaseType<ONFALSE> extends import("./core").Result ? import("./core").BaseType<ONFALSE> : import("./core").BaseType<ONFALSE> extends () => any ? import("./core").Action : Match<import("./core").BaseType<ONFALSE>> : (import("./core").BaseType<ONFALSE> extends null | undefined ? undefined : import("./core").BaseType<ONFALSE> extends import("./core").Result ? import("./core").BaseType<ONFALSE> : import("./core").BaseType<ONFALSE> extends () => any ? import("./core").Action : Match<import("./core").BaseType<ONFALSE>>) extends () => any ? import("./core").Action : Match<import("./core").BaseType<ONFALSE> extends null | undefined ? undefined : import("./core").BaseType<ONFALSE> extends import("./core").Result ? import("./core").BaseType<ONFALSE> : import("./core").BaseType<ONFALSE> extends () => any ? import("./core").Action : Match<import("./core").BaseType<ONFALSE>>>, undefined>>; | ||
export { _if as if }; |
@@ -8,9 +8,6 @@ "use strict"; | ||
function match(getMatch, onMatch, onNoMatch) { | ||
const _getMatch = prague_1.from(getMatch); | ||
const _onMatch = prague_1.from(onMatch); | ||
const _onNoMatch = prague_1.from(onNoMatch); | ||
return prague_1.first(prague_1.pipe(_getMatch, prague_1.tap(result => { | ||
return prague_1.first(prague_1.pipe(getMatch, prague_1.tap(result => { | ||
if (!(result instanceof prague_1.Match)) | ||
throw getMatchError; | ||
}), _onMatch), _onNoMatch); | ||
}), onMatch), prague_1.from(onNoMatch)); | ||
} | ||
@@ -17,0 +14,0 @@ exports.match = match; |
{ | ||
"name": "prague", | ||
"version": "0.20.2", | ||
"version": "0.20.3", | ||
"description": "EDSL for rules", | ||
@@ -21,3 +21,3 @@ "main": "lib/src/prague.js", | ||
"mocha": "^5.2.0", | ||
"typescript": "^3.0.1" | ||
"typescript": "^3.1.0-dev.20180817" | ||
}, | ||
@@ -24,0 +24,0 @@ "dependencies": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
59301
335