-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
323c531
commit 67eb9a5
Showing
22 changed files
with
5,549 additions
and
5,417 deletions.
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 |
---|---|---|
@@ -1,105 +1,111 @@ | ||
/* | ||
* Copyright (c) 2016-2018 Untu, Inc. | ||
* This code is licensed under Eclipse Public License - v 1.0. | ||
* The full license text can be found in LICENSE.txt file and | ||
* on the Eclipse official site (https://www.eclipse.org/legal/epl-v10.html). | ||
*/ | ||
|
||
import {EventEmitter} from 'events'; | ||
|
||
export interface Logger { | ||
isDebug(): boolean; | ||
|
||
debug(...messages: any[]): void; | ||
|
||
info(...messages: any[]): void; | ||
|
||
warn(...messages: any[]): void; | ||
|
||
error(...messages: any[]): void; | ||
} | ||
|
||
export interface ParentActorRef { | ||
getId(): string; | ||
|
||
send(topic: string, ...message: any[]): Promise<void>; | ||
|
||
sendAndReceive(topic: string, ...message: any[]): Promise<any>; | ||
} | ||
|
||
export interface SystemBus extends EventEmitter { | ||
} | ||
|
||
export interface ActorRef extends EventEmitter { | ||
getId(): string; | ||
|
||
getName(): string; | ||
|
||
getLog(): Logger; | ||
|
||
getSystem(): ActorSystem; | ||
|
||
getMode(): string; | ||
|
||
getState(): string; | ||
|
||
getCustomParameters(): any; | ||
|
||
changeConfiguration(config: object): Promise<void>; | ||
|
||
changeGlobalConfiguration(config: object): Promise<void>; | ||
|
||
send(topic: string, ...message: any[]): Promise<void>; | ||
|
||
sendAndReceive(topic: string, ...message: any[]): Promise<any>; | ||
|
||
broadcast(topic: string, ...message: any[]): Promise<void>; | ||
|
||
broadcastAndReceive(topic: string, ...message: any[]): Promise<any[]>; | ||
|
||
forwardToParent(...topics: Array<string|RegExp>): void; | ||
|
||
forwardToChild(child: ActorRef, ...topics: Array<string|RegExp>): void; | ||
|
||
metrics(): Promise<Object>; | ||
|
||
destroy(): Promise<void>; | ||
|
||
getBus(): SystemBus; | ||
|
||
tree(): Promise<Object>; | ||
} | ||
|
||
export interface Actor extends ActorRef { | ||
getParent(): ParentActorRef; | ||
|
||
createChild(behaviour: ActorDefinition|Object, options?: Object): Promise<ActorRef>; | ||
|
||
createChildren(modulePath: string): Promise<ActorRef[]>; | ||
} | ||
|
||
export interface ActorDefinition { | ||
initialize(selfActor: Actor): Promise<void>|void; | ||
|
||
destroy(): Promise<void>|void; | ||
} | ||
|
||
export interface ResourceDefinition<T> { | ||
initialize(system: ActorSystem): Promise<void>|void; | ||
|
||
destroy(): Promise<void>|void; | ||
|
||
getResource(): T; | ||
} | ||
|
||
export interface ActorSystem { | ||
rootActor(): Promise<Actor>; | ||
|
||
destroy(): Promise<void>; | ||
|
||
getBus(): SystemBus; | ||
|
||
listen(port?: number, host?: string): Promise<void>; | ||
} | ||
|
||
export function createSystem(options: Object): ActorSystem; | ||
/* | ||
* Copyright (c) 2016-2018 Untu, Inc. | ||
* This code is licensed under Eclipse Public License - v 1.0. | ||
* The full license text can be found in LICENSE.txt file and | ||
* on the Eclipse official site (https://www.eclipse.org/legal/epl-v10.html). | ||
*/ | ||
|
||
import {EventEmitter} from 'events'; | ||
import * as P from 'bluebird'; | ||
|
||
export interface Logger { | ||
isDebug(): boolean; | ||
|
||
debug(...messages: any[]): void; | ||
|
||
info(...messages: any[]): void; | ||
|
||
warn(...messages: any[]): void; | ||
|
||
error(...messages: any[]): void; | ||
getImplementation(): any; | ||
} | ||
|
||
export interface ParentActorRef { | ||
getId(): string; | ||
|
||
send(topic: string, ...message: any[]): Promise<void>; | ||
|
||
sendAndReceive(topic: string, ...message: any[]): P<any>; | ||
} | ||
|
||
export interface SystemBus extends EventEmitter { | ||
} | ||
|
||
export interface ActorRef extends EventEmitter { | ||
getId(): string; | ||
|
||
getName(): string; | ||
|
||
getLog(): Logger; | ||
|
||
getSystem(): ActorSystem; | ||
|
||
getMode(): string; | ||
|
||
getState(): string; | ||
|
||
getCustomParameters(): any; | ||
|
||
changeConfiguration(config: object): Promise<void>; | ||
|
||
changeGlobalConfiguration(config: object): Promise<void>; | ||
|
||
send(topic: string, ...message: any[]): Promise<void>; | ||
|
||
sendAndReceive(topic: string, ...message: any[]): P<any>; | ||
|
||
broadcast(topic: string, ...message: any[]): Promise<void>; | ||
|
||
broadcastAndReceive(topic: string, ...message: any[]): Promise<any[]>; | ||
|
||
forwardToParent(...topics: Array<string|RegExp>): void; | ||
|
||
forwardToChild(child: ActorRef, ...topics: Array<string|RegExp>): void; | ||
|
||
metrics(): Promise<{summary: { count: Number }}>; | ||
|
||
destroy(): Promise<void>; | ||
|
||
getBus(): SystemBus; | ||
|
||
tree(): Promise<Object>; | ||
} | ||
|
||
export interface Actor extends ActorRef { | ||
getParent(): ParentActorRef; | ||
|
||
createChild(behaviour: ActorDefinition|Object, options?: Object): Promise<ActorRef>; | ||
|
||
createChildren(modulePath: string, options?: Object): Promise<ActorRef[]>; | ||
} | ||
|
||
export interface ActorDefinition { | ||
initialize(selfActor: Actor): Promise<void>|void; | ||
|
||
destroy(): Promise<void>|void; | ||
} | ||
|
||
export interface ResourceDefinition<T> { | ||
initialize(system: ActorSystem): Promise<void>|void; | ||
|
||
destroy(): Promise<void>|void; | ||
|
||
getResource(): T; | ||
} | ||
|
||
export interface ActorSystem { | ||
rootActor(): Promise<Actor>; | ||
|
||
destroy(): Promise<void>; | ||
|
||
getBus(): SystemBus; | ||
|
||
listen(port?: number, host?: string): Promise<void>; | ||
|
||
getLog(): Logger; | ||
} | ||
|
||
export function createSystem(options: Object): ActorSystem; | ||
|
||
export function inherits(subClass: any, superClass: any): void; |
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,27 @@ | ||
/* | ||
* Copyright (c) 2016-2018 Untu, Inc. | ||
* This code is licensed under Eclipse Public License - v 1.0. | ||
* The full license text can be found in LICENSE.txt file and | ||
* on the Eclipse official site (https://www.eclipse.org/legal/epl-v10.html). | ||
*/ | ||
|
||
import { EventEmitter } from 'events'; | ||
import {Socket} from 'net'; | ||
|
||
export class MessageSocket extends EventEmitter { | ||
|
||
constructor(socket: Socket); | ||
// @ts-ignore | ||
on(event: string | symbol, listener: (...args: any[]) => void): void; | ||
// @ts-ignore | ||
once(event: string | symbol, listener: (...args: any[]) => void): void; | ||
// @ts-ignore | ||
removeListener(event: string | symbol, listener: (...args: any[]) => void): void; | ||
|
||
write(message: object, cb: Function): void; | ||
send(message: object, cb?: Function): void; | ||
makePacket(message: object): Buffer; | ||
end(): void; | ||
destroy(): void; | ||
_handleIncomingData(data: Buffer): void; | ||
} |
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
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 |
---|---|---|
@@ -1,2 +1,5 @@ | ||
export function transformObject(input: Object, transformer: (value: any, key: string) => any): Object; | ||
export function transformObjectRecursive(input: Object, transformer: (value: any, key: string) => any): Object; | ||
export function transformObject(input: Object, transformer: (value: any, key: string) => any): Object; | ||
export function transformObjectRecursive(input: Object, transformer: (value: any, key: string) => any): Object; | ||
export function isPlainObject(input: any): boolean; | ||
export function flatten(obj: object|undefined, options?: object): Object|undefined; | ||
export function getNodeJsVersions(): { major: number, minor: number, revision: number }; |
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
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
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,19 @@ | ||
// Type definitions for chai-like 0.1.10 | ||
// Project: https://github.com/zation/chai-like | ||
// Definitions by: noctifer20 <https://github.com/noctifer20>, | ||
|
||
/// <reference types="chai" /> | ||
|
||
declare module 'chai-like' { | ||
function chaiLike(chai: any, utils: any): void; | ||
namespace chaiLike { | ||
|
||
} | ||
export = chaiLike; | ||
} | ||
|
||
declare namespace Chai { | ||
interface Assertion extends LanguageChains, NumericComparison, TypeComparison { | ||
like(toMatch: object|object[]): Assertion; | ||
} | ||
} |
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,9 @@ | ||
// Type definitions for is-running 2.1.0 | ||
// Project: https://github.com/nisaacson/is-running | ||
// Definitions by: noctifer20 <https://github.com/noctifer20>, | ||
|
||
declare module 'is-running' { | ||
function isRunning(pid: number): boolean; | ||
namespace isRunning {} | ||
export = isRunning; | ||
} |
Oops, something went wrong.