mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-05 07:17:04 +00:00
microgears: Provides its own types (#22356)
This commit is contained in:
@@ -642,6 +642,12 @@
|
||||
"sourceRepoURL": "https://github.com/onokumus/metisMenu",
|
||||
"asOfVersion": "2.7.1"
|
||||
},
|
||||
{
|
||||
"libraryName": "microgears",
|
||||
"typingsPackageName": "microgears",
|
||||
"sourceRepoURL": "https://github.com/marcusdb/microgears",
|
||||
"asOfVersion": "4.0.5"
|
||||
},
|
||||
{
|
||||
"libraryName": "mobservable",
|
||||
"typingsPackageName": "mobservable",
|
||||
|
||||
Vendored
-31
@@ -1,31 +0,0 @@
|
||||
// Type definitions for microgears v4.0.0
|
||||
// Project: https://github.com/marcusdb/microgears
|
||||
// Definitions by: Marcus David Bronstein <https://github.com/marcusdb>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare namespace microgears {
|
||||
export interface Service {
|
||||
name: string;
|
||||
async?: boolean;
|
||||
pathname?: string;
|
||||
namespace: string;
|
||||
}
|
||||
|
||||
interface MetaInformation {
|
||||
serviceName: string;
|
||||
methodName: string;
|
||||
serviceNameSpace: string;
|
||||
extra: any;
|
||||
}
|
||||
|
||||
interface Plugin {
|
||||
name: string;
|
||||
beforeChain(args: Array<any>, metaInfo: MetaInformation): Array<any>;
|
||||
afterChain<T>(result: T, metaInfo: MetaInformation): T;
|
||||
}
|
||||
|
||||
function addService(service: Service): Service;
|
||||
function addPlugin(plugin: Plugin): void;
|
||||
}
|
||||
|
||||
export = microgears;
|
||||
@@ -1,58 +0,0 @@
|
||||
import microgears = require("microgears");
|
||||
|
||||
|
||||
function verify_module_file() {
|
||||
var tracePlugin = new TracePlugin();
|
||||
microgears.addPlugin(tracePlugin);
|
||||
var service = new UserService();
|
||||
var userService = microgears.addService(service);
|
||||
|
||||
|
||||
}
|
||||
|
||||
class TracePlugin implements microgears.Plugin {
|
||||
name: 'TracePlugin';
|
||||
public beforeChain(args:Array<any>, _meta: microgears.MetaInformation) {
|
||||
var serviceName = _meta.serviceName,
|
||||
method = _meta.methodName;
|
||||
console.log('before call-> ' + serviceName + '.' + method);
|
||||
|
||||
_meta.extra = {
|
||||
count: 1
|
||||
};
|
||||
|
||||
return args
|
||||
}
|
||||
public afterChain(result:any, _meta: microgears.MetaInformation) {
|
||||
var serviceName = _meta.serviceName,
|
||||
method = _meta.methodName;
|
||||
|
||||
console.log('after of-> ' + serviceName + '.' + method);
|
||||
if (_meta.extra.count) {
|
||||
console.log('this number comes to the beforeChain: ' + _meta.extra.count);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
class User {
|
||||
name: string;
|
||||
email: string;
|
||||
|
||||
constructor(name: string, email: string) {
|
||||
this.email = email;
|
||||
this.name = name;
|
||||
}
|
||||
}
|
||||
|
||||
class UserService implements microgears.Service {
|
||||
name: string = "userService";
|
||||
namespace: string = "services.user";
|
||||
|
||||
public findUserById(id: number) {
|
||||
return new User('test', 'test@example.com');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": false,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"microgears-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -1,79 +0,0 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"adjacent-overload-signatures": false,
|
||||
"array-type": false,
|
||||
"arrow-return-shorthand": false,
|
||||
"ban-types": false,
|
||||
"callable-types": false,
|
||||
"comment-format": false,
|
||||
"dt-header": false,
|
||||
"eofline": false,
|
||||
"export-just-namespace": false,
|
||||
"import-spacing": false,
|
||||
"interface-name": false,
|
||||
"interface-over-type-literal": false,
|
||||
"jsdoc-format": false,
|
||||
"max-line-length": false,
|
||||
"member-access": false,
|
||||
"new-parens": false,
|
||||
"no-any-union": false,
|
||||
"no-boolean-literal-compare": false,
|
||||
"no-conditional-assignment": false,
|
||||
"no-consecutive-blank-lines": false,
|
||||
"no-construct": false,
|
||||
"no-declare-current-package": false,
|
||||
"no-duplicate-imports": false,
|
||||
"no-duplicate-variable": false,
|
||||
"no-empty-interface": false,
|
||||
"no-for-in-array": false,
|
||||
"no-inferrable-types": false,
|
||||
"no-internal-module": false,
|
||||
"no-irregular-whitespace": false,
|
||||
"no-mergeable-namespace": false,
|
||||
"no-misused-new": false,
|
||||
"no-namespace": false,
|
||||
"no-object-literal-type-assertion": false,
|
||||
"no-padding": false,
|
||||
"no-redundant-jsdoc": false,
|
||||
"no-redundant-jsdoc-2": false,
|
||||
"no-redundant-undefined": false,
|
||||
"no-reference-import": false,
|
||||
"no-relative-import-in-test": false,
|
||||
"no-self-import": false,
|
||||
"no-single-declare-module": false,
|
||||
"no-string-throw": false,
|
||||
"no-unnecessary-callback-wrapper": false,
|
||||
"no-unnecessary-class": false,
|
||||
"no-unnecessary-generics": false,
|
||||
"no-unnecessary-qualifier": false,
|
||||
"no-unnecessary-type-assertion": false,
|
||||
"no-useless-files": false,
|
||||
"no-var-keyword": false,
|
||||
"no-var-requires": false,
|
||||
"no-void-expression": false,
|
||||
"no-trailing-whitespace": false,
|
||||
"object-literal-key-quotes": false,
|
||||
"object-literal-shorthand": false,
|
||||
"one-line": false,
|
||||
"one-variable-per-declaration": false,
|
||||
"only-arrow-functions": false,
|
||||
"prefer-conditional-expression": false,
|
||||
"prefer-const": false,
|
||||
"prefer-declare-function": false,
|
||||
"prefer-for-of": false,
|
||||
"prefer-method-signature": false,
|
||||
"prefer-template": false,
|
||||
"radix": false,
|
||||
"semicolon": false,
|
||||
"space-before-function-paren": false,
|
||||
"space-within-parens": false,
|
||||
"strict-export-declare-modifiers": false,
|
||||
"trim-file": false,
|
||||
"triple-equals": false,
|
||||
"typedef-whitespace": false,
|
||||
"unified-signatures": false,
|
||||
"void-return": false,
|
||||
"whitespace": false
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user