Skip to content

Commit

Permalink
Update index.d.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
VeeeneX authored Sep 22, 2020
1 parent 5edfd4e commit a387795
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import { EventEmitter } from 'events';
import { Stream } from 'stream';
import * as grpc from 'grpc';
import {Context} from "mali";

type GrpcRequest = any;

Expand All @@ -14,13 +15,17 @@ type GrpcCall =
grpc.ServerWriteableStream<any> |
grpc.ServerDuplexStream<any, any>

declare class Mali extends EventEmitter {
interface App<T> {
context: T
}

declare class Mali<T> extends EventEmitter implements App<T> {
constructor(path?: any, name?: string | ReadonlyArray<string>, options?: any);
name: string;
env: string;
ports: ReadonlyArray<number>;
silent: boolean;
context: object
context: T

addService (path: any, name: string | ReadonlyArray<string>, options?: any): void;
use (service?: any, name?: any, fns?: any): void;
Expand All @@ -31,12 +36,12 @@ declare class Mali extends EventEmitter {
}

declare namespace Mali {
interface Context {
interface Context<R> {
name: string;
fullName: string;
service: string;
package: string;
app: Mali;
app: App<R>;
call: GrpcCall;
request: Request;
response: Response;
Expand Down

0 comments on commit a387795

Please sign in to comment.