mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-06 15:57:13 +00:00
add yog-ral (#40410)
* add yog-ral * Update index.d.ts * Update index.d.ts * Update index.d.ts * Update tslint.json * Update tslint.json * Update yog-ral-tests.ts * Update yog-ral-tests.ts
This commit is contained in:
committed by
Pranav Senthilnathan
parent
0ed8c63f76
commit
13894c24ab
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
// Type definitions for yog-ral 0.20
|
||||
// Project: https://gitlab.baidu.com/fex/node-ral
|
||||
// Definitions by: ssddi456 <https://github.com/ssddi456>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
export * from 'node-ral';
|
||||
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "es6",
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"yog-ral-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json"
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
import * as yogRal from "yog-ral";
|
||||
|
||||
class FormConverter extends yogRal.Converter {
|
||||
pack(config: yogRal.Service, data: {}) {
|
||||
return new Buffer('123');
|
||||
}
|
||||
unpack(config: yogRal.Service, data: {}) {
|
||||
return {};
|
||||
}
|
||||
getName() {
|
||||
return 'form';
|
||||
}
|
||||
}
|
||||
|
||||
class HashringBalance extends yogRal.Balance {
|
||||
getName() {
|
||||
return 'hashring';
|
||||
}
|
||||
fetchServer(balanceContext: yogRal.Balance.BalanceContextClass, conf: {}, prevBackend: yogRal.Server): yogRal.Server {
|
||||
return {
|
||||
host: '127.0.0.1',
|
||||
port: 8888,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
class HttpProtocol extends yogRal.Protocol {
|
||||
getName() {
|
||||
return 'http';
|
||||
}
|
||||
_request(config: any, callback: (err: any, data: any) => any) {
|
||||
callback(new Error(), '123');
|
||||
}
|
||||
}
|
||||
|
||||
class DefaultConfigNormalizer extends yogRal.ConfigNormalizer {
|
||||
getName() {
|
||||
return 'default';
|
||||
}
|
||||
needUpdate() {
|
||||
return false;
|
||||
}
|
||||
normalizeConfig(config: any) {
|
||||
return config;
|
||||
}
|
||||
}
|
||||
|
||||
const runner = yogRal.RAL('test', {});
|
||||
runner.on('data', () => {
|
||||
// yeap
|
||||
});
|
||||
runner.doRequest();
|
||||
|
||||
yogRal.RAL.init();
|
||||
|
||||
yogRal.RALPromise('test', {}).then;
|
||||
|
||||
yogRal.Config.loadRawConf;
|
||||
yogRal.Config.load;
|
||||
yogRal.Config.normalizerManager;
|
||||
yogRal.Config.normalize;
|
||||
yogRal.Config.getContext;
|
||||
yogRal.Config.getConf;
|
||||
yogRal.Config.clearConf;
|
||||
yogRal.Config.getConfNames;
|
||||
yogRal.Config.getRawConf;
|
||||
yogRal.Config.getUpdateNeededRawConf;
|
||||
yogRal.Config.enableUpdate;
|
||||
yogRal.Config.disableUpdate;
|
||||
yogRal.Config.isAutoUpdateEnabled;
|
||||
|
||||
const logger = yogRal.Logger('some');
|
||||
logger.debug('test');
|
||||
Reference in New Issue
Block a user