added tslint.json

This commit is contained in:
Ilko Hoffmann 2017-04-07 18:12:24 +02:00
parent 094e41b9ce
commit 3ee5cdec27
3 changed files with 53 additions and 57 deletions

View File

@ -1,8 +1,8 @@
import { Eureka } from 'eureka-js-client';
// example configuration
// example configuration
let client = new Eureka({
// application instance information
// application instance information
instance: {
app: 'jqservice',
hostName: 'localhost',
@ -14,8 +14,8 @@ let client = new Eureka({
},
},
eureka: {
// eureka server host / port
// eureka server host / port
host: '192.168.99.100',
port: 32768,
}
});
});

View File

@ -3,78 +3,73 @@
// Definitions by: Ilko Hoffmann <https://github.com/Schnillz>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export declare class Eureka {
export class Eureka {
constructor(config: EurekaClient.EurekaConfig)
start(): void;
stop(): void;
getInstancesByAppId(appId: string): Array<string>;
getInstancesByVipAddress(vidAddress: string): Array<string>;
getInstancesByAppId(appId: string): string[];
getInstancesByVipAddress(vidAddress: string): string [];
}
declare namespace EurekaClient {
export namespace EurekaClient {
type InstanceStatus = 'UP' | 'DOWN' | 'STARTING' | 'OUT_OF_SERVICE' | 'UNKNOWN';
type ActionType = 'ADDED' | 'MODIFIED' | 'DELETED';
type DataCenterName = 'Netflix' | 'Amazon' | 'MyOwn';
interface EurekaConfig {
instance: EurekaInstanceConfig,
eureka: EurekaClientConfig
instance: EurekaInstanceConfig;
eureka: EurekaClientConfig;
}
interface EurekaInstanceConfig {
app: string,
hostName: string,
ipAddr: string,
vipAddress: string,
dataCenterInfo: DataCenterInfo,
port?: number,
instanceId?: string,
appGroupName?: string,
sid?: string,
securePort?: PortWrapper,
homePageUrl?: string,
statusPageUrl?: string,
healthCheckUrl?: string,
secureHealthCheckUrl?: string,
secureVipAddress?: string,
countryId?: number,
status?: InstanceStatus,
overriddenstatus?: InstanceStatus,
leaseInfo?: LeaseInfo,
isCoordinatingDiscoveryServer?: boolean,
metadata?: Array<[string, string]>,
lastUpdatedTimestamp?: number,
lastDirtyTimestamp?: number,
actionType?: ActionType,
asgName?: string
app: string;
hostName: string;
ipAddr: string;
vipAddress: string;
dataCenterInfo: DataCenterInfo;
port?: number;
instanceId?: string;
appGroupName?: string;
sid?: string;
securePort?: PortWrapper;
homePageUrl?: string;
statusPageUrl?: string;
healthCheckUrl?: string;
secureHealthCheckUrl?: string;
secureVipAddress?: string;
countryId?: number;
status?: InstanceStatus;
overriddenstatus?: InstanceStatus;
leaseInfo?: LeaseInfo;
isCoordinatingDiscoveryServer?: boolean;
}
interface EurekaClientConfig {
host: string,
port: number,
heartbeatInterval?: number,
registryFetchInterval?: number,
maxRetries?: number,
requestRetryDelay?: number,
fetchRegistry?: boolean,
filterUpInstances?: boolean,
servicePath?: string,
ssl?: boolean,
useDns?: boolean,
preferSameZone?: boolean,
clusterRefreshInterval?: boolean,
fetchMetadata?: boolean,
registerWithEureka?: boolean,
useLocalMetadata?: boolean,
preferIpAddress?: boolean
host: string;
port: number;
heartbeatInterval?: number;
registryFetchInterval?: number;
maxRetries?: number;
requestRetryDelay?: number;
fetchRegistry?: boolean;
filterUpInstances?: boolean;
servicePath?: string;
ssl?: boolean;
useDns?: boolean;
preferSameZone?: boolean;
clusterRefreshInterval?: boolean;
fetchMetadata?: boolean;
registerWithEureka?: boolean;
useLocalMetadata?: boolean;
preferIpAddress?: boolean;
}
interface PortWrapper {
enabled: boolean,
port: number
enabled: boolean;
port: number;
}
interface LeaseInfo {
renewalIntervalInSecs: number;
durationInSecs: number;
}
interface DataCenterInfo {
name: 'Netflix' | 'Amazon' | 'MyOwn';
name: DataCenterName;
}
}
}

View File

@ -0,0 +1 @@
{ "extends": "../tslint.json" }