@atomist/rug
Advanced tools
Comparing version 0.4.6 to 0.5.0
@@ -338,5 +338,2 @@ | ||
//sourcePath: string | ||
copyEditorBackingFileOrFail(sourcePath: string): void | ||
//sourcePath: string | ||
//destinationPath: string | ||
@@ -346,2 +343,5 @@ copyEditorBackingFileOrFail(sourcePath: string, destinationPath: string): void | ||
//sourcePath: string | ||
copyEditorBackingFileOrFail(sourcePath: string): void | ||
//sourcePath: string | ||
//destinationPath: string | ||
@@ -1051,5 +1051,2 @@ copyEditorBackingFilesOrFail(sourcePath: string, destinationPath: string): void | ||
//sourcePath: string | ||
copyEditorBackingFileOrFail(sourcePath: string): void | ||
//sourcePath: string | ||
//destinationPath: string | ||
@@ -1059,2 +1056,5 @@ copyEditorBackingFileOrFail(sourcePath: string, destinationPath: string): void | ||
//sourcePath: string | ||
copyEditorBackingFileOrFail(sourcePath: string): void | ||
//sourcePath: string | ||
//destinationPath: string | ||
@@ -1281,2 +1281,10 @@ copyEditorBackingFilesOrFail(sourcePath: string, destinationPath: string): void | ||
/* | ||
* Service | ||
*/ | ||
interface Service extends TreeNode { | ||
} // interface Service | ||
/* | ||
* | ||
@@ -1333,5 +1341,2 @@ Type for services. Used in executors. | ||
//sourcePath: string | ||
copyEditorBackingFileOrFail(sourcePath: string): void | ||
//sourcePath: string | ||
//destinationPath: string | ||
@@ -1341,2 +1346,5 @@ copyEditorBackingFileOrFail(sourcePath: string, destinationPath: string): void | ||
//sourcePath: string | ||
copyEditorBackingFileOrFail(sourcePath: string): void | ||
//sourcePath: string | ||
//destinationPath: string | ||
@@ -1517,2 +1525,3 @@ copyEditorBackingFilesOrFail(sourcePath: string, destinationPath: string): void | ||
export { PythonRequirementsTxt } | ||
export { Service } | ||
export { Services } | ||
@@ -1519,0 +1528,0 @@ export { SpringBootProject } |
import {Match,PathExpression} from "../tree/PathExpression" | ||
import {Project,File} from "../model/Core" | ||
import {Project,File,Service} from "../model/Core" | ||
@@ -11,5 +11,14 @@ /** | ||
on<R,N>(pathExpression: string, handler: (m: Match<R,N>) => void): void | ||
on<R,N>(pathExpression: string, handler: (m: ContextMatch<R,N>) => void): void | ||
on<R,N>(pathExpression: PathExpression<R,N>, handler: (m: ContextMatch<R,N>) => void): void | ||
} | ||
export interface ContextMatch<R,N> extends Match<R,N>, ServiceSource { | ||
serviceSource: ServiceSource | ||
} | ||
// Also call unicode like π if we want some of $ familiarity | ||
@@ -19,1 +28,42 @@ export interface Atomist extends CallbackRegistry { | ||
} | ||
/** | ||
* Exposes model information to us | ||
*/ | ||
export interface ServiceSource { | ||
services(): Array<Service> | ||
userMessageRouter(): UserMessageRouter | ||
} | ||
export interface UserMessageRouter { | ||
/** | ||
* Send a message to the channel associated with the current service, | ||
* or `general` or some other fallback channel if the service is null | ||
* | ||
* @param service service we're concerned with. Null if this affects multiple services | ||
* @param msg message | ||
*/ | ||
messageServiceChannel(service: Service, msg: String): void | ||
/** | ||
* Send a message to the current user, possibly associated with a current service. | ||
* | ||
* @param service service we're concerned with. Null if this affects multiple services | ||
* @param screenName screen name in chat | ||
* @param msg message | ||
*/ | ||
messageUser(service: Service, screenName: String, msg: String): void | ||
/** | ||
* Send a message to the given channel | ||
* | ||
* @param channelName name of the channel | ||
* @param msg message text | ||
*/ | ||
messageChannel(channelName: String, msg: String): void | ||
} |
{ | ||
"name": "@atomist/rug", | ||
"version": "0.4.6", | ||
"version": "0.5.0", | ||
"description": "TypeScript model for Atomist editors, generators etc", | ||
@@ -5,0 +5,0 @@ "repository": { |
"use strict"; | ||
/** | ||
Returned when a PathExpression is evaluated | ||
*/ | ||
var Match = (function () { | ||
function Match(root, matches) { | ||
var MatchImpl = (function () { | ||
function MatchImpl(root, matches) { | ||
this._root = root; | ||
this._matches = matches; | ||
} | ||
Match.prototype.root = function () { return this._root; }; | ||
Match.prototype.matches = function () { return this._matches; }; | ||
return Match; | ||
MatchImpl.prototype.root = function () { return this._root; }; | ||
MatchImpl.prototype.matches = function () { return this._matches; }; | ||
return MatchImpl; | ||
}()); | ||
exports.Match = Match; | ||
var PathExpression = (function () { | ||
@@ -16,0 +12,0 @@ function PathExpression(expression) { |
@@ -5,4 +5,12 @@ | ||
*/ | ||
class Match<R,N> { | ||
interface Match<R,N> { | ||
root(): R | ||
matches(): Array<N> | ||
} | ||
class MatchImpl<R,N> implements Match<R,N> { | ||
private _root: R; | ||
@@ -9,0 +17,0 @@ private _matches: Array<N>; |
80746
1432