diff --git a/browser-resolve/browser-resolve-tests.ts b/browser-resolve/browser-resolve-tests.ts
index 071b17a1d2..2225f7754c 100644
--- a/browser-resolve/browser-resolve-tests.ts
+++ b/browser-resolve/browser-resolve-tests.ts
@@ -1,4 +1,4 @@
-///
+///
import * as browserResolve from 'browser-resolve';
diff --git a/browser-resolve/browser-resolve.d.ts b/browser-resolve/browser-resolve.d.ts
deleted file mode 100644
index 8c1456c8f0..0000000000
--- a/browser-resolve/browser-resolve.d.ts
+++ /dev/null
@@ -1,61 +0,0 @@
-// Type definitions for browser-resolve
-// Project: https://github.com/defunctzombie/node-browser-resolve
-// Definitions by: Mario Nebl
-// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
-
-///
-
-declare module 'browser-resolve' {
- import * as resolve from 'resolve';
-
- /**
- * Callback invoked when resolving asynchronously
- *
- * @param error
- * @param resolved Absolute path to resolved identifier
- */
- type resolveCallback = (err?: Error, resolved?: string) => void;
-
- /**
- * Resolve a module path and call cb(err, path [, pkg])
- *
- * @param id Identifier to resolve
- * @param callback
- */
- function browserResolve(id: string, cb: resolveCallback): void;
-
- /**
- * Resolve a module path and call cb(err, path [, pkg])
- *
- * @param id Identifier to resolve
- * @param options Options to use for resolving, optional.
- * @param callback
- */
- function browserResolve(id: string, opts: browserResolve.AsyncOpts, cb: resolveCallback): void;
-
- /**
- * Returns a module path
- *
- * @param id Identifier to resolve
- * @param options Options to use for resolving, optional.
- */
- function browserResolveSync(id: string, opts?: browserResolve.SyncOpts): string;
-
- namespace browserResolve {
- interface Opts {
- // the 'browser' property to use from package.json (defaults to 'browser')
- browser?: string;
- // the calling filename where the require() call originated (in the source)
- filename?: string;
- // modules object with id to path mappings to consult before doing manual resolution (use to provide core modules)
- modules?: any;
- }
-
- export interface AsyncOpts extends resolve.AsyncOpts, Opts {}
- export interface SyncOpts extends resolve.SyncOpts, Opts {}
-
- export var sync: typeof browserResolveSync;
- }
-
- export = browserResolve
-}
diff --git a/browser-resolve/index.d.ts b/browser-resolve/index.d.ts
new file mode 100644
index 0000000000..30f3875541
--- /dev/null
+++ b/browser-resolve/index.d.ts
@@ -0,0 +1,59 @@
+// Type definitions for browser-resolve
+// Project: https://github.com/defunctzombie/node-browser-resolve
+// Definitions by: Mario Nebl
+// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+
+///
+
+import * as resolve from 'resolve';
+
+/**
+ * Callback invoked when resolving asynchronously
+ *
+ * @param error
+ * @param resolved Absolute path to resolved identifier
+ */
+type resolveCallback = (err?: Error, resolved?: string) => void;
+
+/**
+ * Resolve a module path and call cb(err, path [, pkg])
+ *
+ * @param id Identifier to resolve
+ * @param callback
+ */
+declare function browserResolve(id: string, cb: resolveCallback): void;
+
+/**
+ * Resolve a module path and call cb(err, path [, pkg])
+ *
+ * @param id Identifier to resolve
+ * @param options Options to use for resolving, optional.
+ * @param callback
+ */
+declare function browserResolve(id: string, opts: browserResolve.AsyncOpts, cb: resolveCallback): void;
+
+/**
+ * Returns a module path
+ *
+ * @param id Identifier to resolve
+ * @param options Options to use for resolving, optional.
+ */
+declare function browserResolveSync(id: string, opts?: browserResolve.SyncOpts): string;
+
+declare namespace browserResolve {
+ interface Opts {
+ // the 'browser' property to use from package.json (defaults to 'browser')
+ browser?: string;
+ // the calling filename where the require() call originated (in the source)
+ filename?: string;
+ // modules object with id to path mappings to consult before doing manual resolution (use to provide core modules)
+ modules?: any;
+ }
+
+ export interface AsyncOpts extends resolve.AsyncOpts, Opts { }
+ export interface SyncOpts extends resolve.SyncOpts, Opts { }
+
+ export var sync: typeof browserResolveSync;
+}
+
+export = browserResolve;
diff --git a/browser-resolve/tsconfig.json b/browser-resolve/tsconfig.json
new file mode 100644
index 0000000000..937a2406b8
--- /dev/null
+++ b/browser-resolve/tsconfig.json
@@ -0,0 +1,19 @@
+{
+ "compilerOptions": {
+ "module": "commonjs",
+ "target": "es5",
+ "noImplicitAny": true,
+ "strictNullChecks": false,
+ "baseUrl": "../",
+ "typeRoots": [
+ "../"
+ ],
+ "types": [],
+ "noEmit": true,
+ "forceConsistentCasingInFileNames": true
+ },
+ "files": [
+ "index.d.ts",
+ "browser-resolve-tests.ts"
+ ]
+}
\ No newline at end of file
diff --git a/cassandra-driver/cassandra-driver.d.ts b/cassandra-driver/cassandra-driver.d.ts
deleted file mode 100644
index 9a4184b62e..0000000000
--- a/cassandra-driver/cassandra-driver.d.ts
+++ /dev/null
@@ -1,761 +0,0 @@
-// Type definitions for nodejs-driver v0.8.2
-// Project: https://github.com/datastax/nodejs-driver
-// Definitions by: Marc Fisher
-// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
-
-///
-///
-
-declare module "cassandra-driver" {
- type Callback = Function;
- type ResultCallback = (err: Error, result: types.ResultSet) => void;
-
- import * as events from "events";
- import * as stream from "stream";
- import _Long = require("long");
-
- namespace policies {
- namespace addressResolution {
- var EC2MultiRegionTranslator: EC2MultiRegionTranslatorStatic;
-
- interface AddressTranslator {
- translate(address: string, port: number, callback: Callback): void;
- }
-
- interface EC2MultiRegionTranslatorStatic {
- new(): EC2MultiRegionTranslator;
- }
-
- interface EC2MultiRegionTranslator extends AddressTranslator {
- logError(address: string, err: Error): void;
- }
- }
-
- namespace loadBalancing {
- var DCAwareRoundRobinPolicy: DCAwareRoundRobinPolicyStatic;
- var RoundRobinPolicy: RoundRobinPolicyStatic;
- var TokenAwarePolicy: TokenAwarePolicyStatic;
- var WhiteListPolicy: WhiteListPolicyStatic;
-
- interface LoadBalancingPolicy {
- init(client: Client, hosts: HostMap, callback: Callback): void;
- getDistance(host: Host): types.distance;
- newQueryPlan(keyspace: string, queryOptions: any, callback: Callback): void;
- }
-
- interface DCAwareRoundRobinPolicyStatic {
- new(localDc?: string, usedHostsPerRemoteDc?: number): DCAwareRoundRobinPolicy;
- }
-
- interface DCAwareRoundRobinPolicy extends LoadBalancingPolicy {
- localHostsArray: Array;
- remoteHostsArray: Array;
- }
-
- interface RoundRobinPolicyStatic {
- new(): RoundRobinPolicy;
- }
-
- interface RoundRobinPolicy extends LoadBalancingPolicy {}
-
- interface TokenAwarePolicyStatic {
- new(childPolicy: LoadBalancingPolicy): TokenAwarePolicy;
- }
-
- interface TokenAwarePolicy extends LoadBalancingPolicy {}
-
- interface WhiteListPolicyStatic {
- new(childPolicy: LoadBalancingPolicy, whiteList: Array): WhiteListPolicy;
- }
-
- interface WhiteListPolicy extends LoadBalancingPolicy {}
- }
-
- namespace reconnection {
- var ConstantReconnectionPolicy: ConstantReconnectionPolicyStatic;
- var ExponentialReconnectionPolicy: ExponentialReconnectionPolicyStatic;
-
- interface ReconnectionPolicy {
- newSchedule(): {next: Function};
- }
-
- interface ConstantReconnectionPolicyStatic {
- new(delay: number): ConstantReconnectionPolicy;
- }
-
- interface ConstantReconnectionPolicy extends ReconnectionPolicy {}
-
- interface ExponentialReconnectionPolicyStatic {
- new(baseDelay: number, maxDelay: number, startWithNoDelay: boolean): ExponentialReconnectionPolicy;
- }
-
- interface ExponentialReconnectionPolicy extends ReconnectionPolicy {}
- }
-
- namespace retry {
- var RetryPolicy: RetryPolicyStatic;
-
- interface DecisionInfo {
- decision: number;
- consistency: number;
- }
-
- interface RequestInfo {
- request: any,
- nbRetry: number
- }
-
- enum retryDecision {
- rethrow = 0,
- retry,
- ignore
- }
-
- interface RetryPolicyStatic {
- new (): RetryPolicy;
-
- retryDecision: any;
- }
-
- interface RetryPolicy {
- onReadTimeout(requestInfo: RequestInfo, consistency: types.consistencies, received: number, blockFor: number, isDataPresent: boolean): DecisionInfo;
- onUnavailable(requestInfo: RequestInfo, consistency: types.consistencies, required: number, alive: number): DecisionInfo;
- onWriteTimeout(requestInfo: RequestInfo, consistency: types.consistencies, received: number, blockFor: number, writeType: string): DecisionInfo;
- rethrowResult(): { decision: retryDecision };
- retryResult(): { decision: retryDecision, consistency: types.consistencies, useCurrentHost: boolean };
- }
- }
- }
-
- namespace types {
- var BigDecimal: BigDecimalStatic;
- var InetAddress: InetAddressStatic;
- var Integer: IntegerStatic;
- var LocalDate: LocalDateStatic;
- var LocalTime: LocalTimeStatic;
- var Long: _Long;
- var ResultSet: ResultSetStatic;
- var ResultStream: ResultStreamStatic;
- var Row: RowStatic;
- var TimeUuid: TimeUuidStatic;
- var Tuple: TupleStatic;
- var Uuid: UuidStatic;
-
- enum consistencies {
- any = 0,
- one,
- two,
- three,
- quorum,
- all,
- localQuorm,
- eachQuorum,
- serial,
- localSerial,
- localOne
- }
-
- enum dataTypes {
- custom = 0,
- ascii,
- bigint,
- blob,
- boolean,
- counter,
- decimal,
- double,
- float,
- int,
- text,
- timestamp,
- uuid,
- varchar,
- varint,
- timeuuid,
- inet,
- date,
- time,
- smallint,
- tinyint,
- list,
- map,
- set,
- udt,
- tuple
- }
-
- enum distance {
- local = 0,
- remote,
- ignored
- }
-
- interface responseErrorCodes { [key:string]:number; }
- interface unset { unset: boolean; }
-
- function generateTimestamp(date?: Date, microseconds?: number): _Long;
- function timeuuid(options?: {msecs: number | Date, node: Buffer, clockseq: number, nsecs: number}, buffer?: Buffer, offset?: number): string;
-
- interface BigDecimalStatic {
- new (unscaledValue: number, scale: number): BigDecimal;
-
- fromBuffer(buf: Buffer): BigDecimal;
- toBuffer(value: BigDecimal): Buffer;
- fromString(value: string): BigDecimal;
- fromNumber(value: number): BigDecimal;
- }
-
- interface BigDecimal {
- equals(other: BigDecimal): boolean;
- inspect(): string;
- notEquals(other: BigDecimal): boolean;
- compare(other: BigDecimal): number;
- subtract(other: BigDecimal): BigDecimal;
- add(other: BigDecimal): BigDecimal;
- greaterThan(other: BigDecimal): boolean;
- isNegative(): boolean;
- isZero(): boolean;
- toString(): string;
- toNumber(): number;
- toJSON(): string;
- }
-
- interface InetAddressStatic {
- new(buffer: Buffer): InetAddress;
-
- fromString(value: string): InetAddress;
- }
-
- interface InetAddress {
- equals(other: InetAddress): boolean;
- getBuffer(): Buffer;
- inspect(): string;
- toString(): string;
- toJSON(): string;
-
- length: number;
- version: number;
- }
-
- interface IntegerStatic {
- new(bits: Array, sign: number): Integer;
-
- fromInt(value: number): Integer;
- fromNumber(value: number): Integer;
- fromBits(bits: Array): Integer;
- fromString(str: string, opt_radix?: number): Integer;
- fromBuffer(bits: Buffer): Integer;
- toBuffer(value: Integer): Buffer;
-
- ZERO: Integer;
- ONE: Integer;
- }
-
- interface Integer {
- toInt(): number;
- toNumber(): number;
- toString(opt_radix?: number): string;
- getBits(index: number): number;
- getBitsUnsigned(index: number): number;
- getSign(): number;
- isZero(): boolean;
- isNegative(): boolean;
- isOdd(): boolean;
- equals(other: Integer): boolean;
- notEquals(other: Integer): boolean;
- greaterThan(other: Integer): boolean;
- greaterThanOrEqual(other: Integer): boolean;
- lessThan(other: Integer): boolean;
- lessThanOrEqual(other: Integer): boolean;
- compare(other: Integer): number;
- shorten(numBits: number): Integer;
- negate(): Integer;
- add(other: Integer): Integer;
- subtract(other: Integer): Integer;
- multiply(other: Integer): Integer;
- divide(other: Integer): Integer;
- modulo(other: Integer): Integer;
- not(): Integer;
- and(other: Integer): Integer;
- or(other: Integer): Integer;
- xor(other: Integer): Integer;
- shiftLeft(numBits: number): Integer;
- shiftRight(numBits: number): Integer;
- inspect(): string;
- abs(): Integer;
- toJSON(): string;
- }
-
- interface LocalDateStatic {
- new(year: number, month: number, day: number): LocalDate;
-
- now(): LocalDate;
- utcNow(): LocalDate;
- fromDate(date: Date): LocalDate;
- fromString(value: string): LocalDate;
- fromBuffer(buffer: Buffer): LocalDate;
- }
-
- interface LocalDate {
- _value: number;
- year: number;
- month: number;
- day: number;
-
- equals(other: LocalDate): boolean;
- inspect(): string;
- toBuffer(): Buffer;
- toString(): string;
- toJSON(): string;
- }
-
- interface LocalTimeStatic {
- new (totalNanoseconds: _Long): LocalTime;
-
- fromString(value: string): LocalTime;
- now(nanoseconds?: number): LocalTime;
- fromDate(date: Date, nanoseconds: number): LocalTime;
- fromMilliseconds(milliseconds: number, nanoseconds?: number): LocalTime;
- fromBuffer(value: Buffer): LocalTime;
- }
-
- interface LocalTime {
- hour: number;
- minute: number;
- second: number;
- nanosecond: number;
-
- compare(other: LocalTime): boolean;
- equals(other: LocalTime): boolean;
- getTotalNanoseconds(): _Long;
- inspect(): string;
- toBuffer(): Buffer;
- toString(): string;
- toJSON(): string;
- }
-
- interface ResultSetStatic {
- new(response: any, host: string, triedHost: { [key:string]: any }, consistency: consistencies): ResultSet;
- }
-
- interface ResultSet {
- info: {
- queriedHost: Host,
- triedHosts: { [key:string]:string; },
- achievedConsistency: consistencies,
- traceId: Uuid,
- warnings: Array,
- customPayload: any
- };
- rows: Array;
- rowLength: number;
- columns: Array<{ [key:string]:string; }>;
- pageState: string;
- nextPage: any; // function
-
- first(): Row;
- getPageState(): string;
- getColumns(): Array<{ [key:string]:string; }>;
- }
-
- interface ResultStreamStatic {
- new (opt: any): ResultSet;
- }
-
- interface ResultStream extends stream.Readable {
- buffer: Buffer;
- paused: boolean;
-
- _read(): void;
- _valve(readNext: Function): void;
- add(chunk: Buffer): void;
- }
-
- interface RowStatic {
- new(columns: Array<{ [key:string]:string; }>): Row;
- }
-
- interface Row {
- get(columnName: string|number): { [key:string]:any; };
- values(): Array<{ [key:string]:any; }>;
- keys(): Array;
- forEach(callback: Callback): void;
- }
-
- interface TimeUuidStatic {
- new (value?: Date, ticks?: number, nodeId?: string|Buffer, clockId?: string|Buffer): TimeUuid;
-
- fromDate(date: Date, ticks?: number, nodeId?: string|Buffer, clockId?: string|Buffer): TimeUuid;
- fromString(value: string): TimeUuid;
- min(date: Date, ticks?: number): TimeUuid;
- max(date: Date, ticks?: number): TimeUuid;
- now(nodeId?: string|Buffer, clockId?: string|Buffer): TimeUuid;
- }
-
- interface TimeUuid extends Uuid {
- getDatePrecision(): { date: Date, ticks: number };
- getDate(): Date;
- getNodeId(): Buffer;
- getNodeIdString(): string;
- }
-
- interface TupleStatic {
- new (...arguments: Array): Tuple;
-
- fromArray(elements: Array): Tuple;
- }
-
- interface Tuple {
- elements: Array;
- length: number;
-
- get(index: number): any;
- toString(): string;
- toJSON(): string;
- values(): Array;
- }
-
- interface UuidStatic {
- new (buffer: Buffer): Uuid;
-
- fromString(value: string): Uuid;
- random(): Uuid;
- }
-
- interface Uuid {
- buffer: Buffer;
-
- getBuffer(): Buffer;
- equals(other: types.Uuid): boolean;
- toString(): string;
- inspect(): string;
- toJSON(): string;
- }
- }
-
- var Client: ClientStatic;
- var Host: HostStatic;
- var HostMap: HostMapStatic;
- var Encoder: EncoderStatic;
-
- interface ClientOptions {
- contactPoints: Array,
- keyspace: string,
- policies?: {
- addressResolution?: policies.addressResolution.AddressTranslator,
- loadBalancing?: policies.loadBalancing.LoadBalancingPolicy,
- reconnection?: policies.reconnection.ReconnectionPolicy,
- retry?: policies.retry.RetryPolicy
- },
- queryOptions?: QueryOptions,
- pooling?: {
- heartBeatInterval: number,
- coreConnectionsPerHost: { [key:number]:number; },
- warmup: boolean;
- },
- protocolOptions?: {
- port: number,
- maxSchemaAgreementWaitSeconds: number,
- maxVersion: number
- },
- socketOptions?: {
- connectTimeout: number,
- defunctReadTimeoutThreshold: number,
- keepAlive: boolean,
- keepAliveDelay: number,
- readTimeout: number,
- tcpNoDelay: boolean,
- coalescingThreshold: number
- },
- authProvider?: auth.AuthProvider,
- sslOptions?: any,
- encoding?: {
- map: Function,
- set: Function,
- copyBuffer: boolean,
- useUndefinedAsUnset: boolean
- }
- }
-
- interface QueryOptions {
- autoPage?: boolean;
- captureStackTrace?: boolean;
- consistency?: number;
- customPayload?: any;
- fetchSize?: number;
- hints?: Array | Array>;
- logged?: boolean;
- pageState?: Buffer|string;
- prepare?: boolean;
- readTimeout?: number;
- retry?: policies.retry.RetryPolicy;
- retryOnTimeout?: boolean;
- routingIndexes?: Array;
- routingKey?: Buffer | Array;
- routingNames?: Array;
- serialConsistency?: number;
- timestamp?: number | _Long;
- traceQuery?: boolean;
- }
-
- interface ClientStatic {
- new(options?: ClientOptions): Client;
- }
-
- interface Client extends events.EventEmitter {
- hosts: HostMap;
- keyspace: string;
- metadata: metadata.Metadata;
-
- batch(queries: Array|Array<{query: string, params?: any}>, options: QueryOptions, callback: ResultCallback): void;
- connect(callback: Callback): void;
- eachRow(query: string, params?: any, options?: QueryOptions, rowCallback?: Callback, callback?: Callback): void;
- execute(query: string, params?: any, options?: QueryOptions, callback?: ResultCallback): void;
- getReplicas(keyspace: string, token: Buffer): Array; // TODO: Should this be a more explicit return?
- shutdown(callback?: Callback): void;
- stream(query: string, params?: any, options?: QueryOptions, callback?: Callback): NodeJS.ReadableStream;
- }
-
- interface HostStatic {
- new(address: string, protocolVersion: number, options: ClientOptions): Host;
- }
-
- interface Host extends events.EventEmitter {
- address: string;
- cassandraVersion: string;
- dataCenter: string;
- rack: string;
- tokens: Array;
-
- canBeConsideredAsUp(): boolean;
- getCassandraVersion(): Array;
- isUp(): boolean;
- }
-
- interface HostMapStatic {
- new (): HostMap;
- }
-
- interface HostMap extends events.EventEmitter {
- length: number;
-
- forEach(callback: Callback): void;
- get(key: string): Host;
- keys(): Array;
- remove(key: string): void;
- removeMultiple(keys: Array): void;
- set(key: string, value: Host): void;
- values(): Array;
- }
-
- interface EncoderStatic {
- new(protocolVersion: number, options: ClientOptions) : Encoder;
- }
-
- interface Encoder {
- decode(buffer: Buffer, type: {code: number, info?: any}): void;
- encode(value: any, typeInfo?: string|number|{code: number, info?: any}): Buffer;
- }
-
- namespace auth {
- var Authenticator: AuthenticatorStatic;
- var PlainTextAuthProvider: PlainTextAuthProviderStatic;
-
- interface AuthenticatorStatic {
- new (): Authenticator;
- }
-
- interface Authenticator {
- evaluateChallenge(challenge: Buffer, callback: Callback): void;
- initialResponse(callback: Callback): void;
- onAuthenticationSuccess(token?: Buffer): void;
- }
-
- interface AuthProvider {
- newAuthenticator(endpoint: string, name: string): void;
- }
-
- interface PlainTextAuthProviderStatic {
- new (username: string, password: string): PlainTextAuthProvider;
- }
-
- interface PlainTextAuthProvider extends AuthProvider {
- newAuthenticator(endpoint: string, name: string): void;
- }
- }
-
- namespace errors {
- abstract class DriverError {
- constructor(message: string, constructor?: any);
- }
-
- class ArgumentError extends DriverError {
- constructor(message: string);
- }
-
- class AuthenticationError extends DriverError {
- constructor(message: string);
- }
-
- class DriverInternalError extends DriverError {
- constructor(message: string);
- }
-
- class NoHostAvailableError extends DriverError {
- constructor(innerErrors: any, message?: string);
- }
-
- class NotSupportedError extends DriverError {
- constructor(message: string);
- }
-
- class OperationTimedOutError extends DriverError {}
-
- class ResponseError extends DriverError {
- constructor(code: number, message: string);
- }
- }
-
- namespace metadata {
- var Aggregate: AggregateStatic;
- var Index: IndexStatic;
- var MaterializedView: MaterializedViewStatic;
- var Metadata: MetadataStatic;
- var SchemaFunction: SchemaFunctionStatic;
- var TableMetadata: TableMetadataStatic;
-
- type caching = "all" | "keys_only" | "rows_only" | "none";
-
- interface AggregateStatic {
- new (): Aggregate;
- }
-
- interface Aggregate {
- argumentTypes: Array<{ code: number, info: any}>;
- finalFunction: string;
- initCondition: string;
- keyspaceName: string,
- returnType: string;
- signature: Array;
- stateFunction: string;
- stateType: string;
- }
-
- interface DataTypeInfo {
- code: number,
- info: string | DataTypeInfo | Array,
- options: {
- frozen: boolean,
- reversed: boolean
- }
- }
-
- interface ColumnInfo {
- name: string,
- type: DataTypeInfo
- }
-
- interface DataCollection {
- bloomFilterFalsePositiveChance: number;
- caching: caching;
- clusterKeys: Array<{ c: ColumnInfo, index: number, order: string }>;
- clusteringOrder: Array;
- columns: Array;
- columnsByName: { [key: string]: ColumnInfo };
- comment: string;
- compactionClass: string;
- compactionOptions: any;
- compression: any;
- crcCheckChange?: number;
- defaultTtl: number;
- extensions: any;
- gcGraceSeconds: number;
- localReadRepairChance: number;
- maxIndexInterval?: number;
- minIndexInterval?: number;
- name: string;
- partitionKeys: Array<{ c: ColumnInfo, index: number }>
- populateCacheOnFlush: boolean;
- readRepairChance: number;
- speculateRetry: string;
- }
-
- enum IndexType {
- custom = 0,
- keys,
- composites
- }
-
- interface IndexStatic {
- new (name: string, target: string, kind: IndexType, options: Object): Index;
-
- fromRows(indexRows: Array): Array;
- fromColumnRows(columnRows: Array, columnsByName: { [key:string]: ColumnInfo }): Array;
- }
-
- interface Index {
- kind: IndexType;
- name: string;
- options: Object;
- target: string;
-
- isCompositesKind(): boolean;
- isCustomKind(): boolean;
- isKeysKind(): boolean;
- }
-
- interface MaterializedViewStatic {
- new (name: string): MaterializedView;
- }
-
- interface MaterializedView extends DataCollection {}
-
- interface MetadataStatic {
- new (options: ClientOptions, controlConnection: any): Metadata;
- }
-
- interface Metadata {
- clearPrepared(): void;
-
- getAggregate(keyspaceName: string, name: string, signature: Array | Array<{ code: number, info: any }>, callback: Callback): void;
- getAggregates(keyspaceName: string, name: string, callback: Callback): void;
- getFunction(keyspaceName: string, name: string, signature: Array | Array<{ code: number, info: any }>, callback: Callback): void;
- getFunctions(keyspaceName: string, name: string, callback: Callback): void;
- getMaterializedView(keyspaceName: string, name: string, callback: Callback): void;
- getReplicas(keyspaceName: string, tokenBuffer: Buffer): Array;
- getTable(keyspaceName: string, name: string, callback: Callback): void;
- getTrace(traceId: types.Uuid, callback: Callback): void;
- getUdt(keyspaceName: string, name: string, callback: Callback): void;
- refreshKeyspace(name: string, callback?: Callback): void;
- refreshKeyspaces(callback?: Callback): void;
- }
-
- interface SchemaFunctionStatic {
- new (): SchemaFunction;
- }
-
- interface SchemaFunction {
- argumentNames: Array;
- argumentTypes: Array<{ code: number, info: any}>;
- body: string;
- calledOnNullInput: boolean;
- keyspaceName: string,
- language: string;
- name: string;
- returnType: string;
- signature: Array;
- }
-
- interface TableMetadataStatic {
- new (name: string): TableMetadata;
- }
-
- interface TableMetadata extends DataCollection {
- indexes: Array;
- indexInterval?: number;
- isCompact: boolean;
- memtableFlushPeriod: number;
- replicateOnWrite: boolean;
- }
- }
-}
diff --git a/cassandra-driver/cassandra-driver.tests.ts b/cassandra-driver/cassandra-driver.tests.ts
index 3eebf93018..514514b059 100644
--- a/cassandra-driver/cassandra-driver.tests.ts
+++ b/cassandra-driver/cassandra-driver.tests.ts
@@ -1,4 +1,4 @@
-///
+///
import * as cassandra from 'cassandra-driver';
import * as util from 'util';
@@ -6,6 +6,6 @@ import * as util from 'util';
var client = new cassandra.Client({ contactPoints: ['h1', 'h2'], keyspace: 'ks1'});
var query = 'SELECT email, last_name FROM user_profiles WHERE key=?';
-client.execute(query, ['guy'], function(err, result) {
- console.log('got user profile with email ' + result.rows[0].email);
+client.execute(query, ['guy'], {}, function(err, result) {
+ console.log('got user profile with email ' + result.rows[0].get("email"));
});
\ No newline at end of file
diff --git a/cassandra-driver/index.d.ts b/cassandra-driver/index.d.ts
new file mode 100644
index 0000000000..55a67e11f9
--- /dev/null
+++ b/cassandra-driver/index.d.ts
@@ -0,0 +1,759 @@
+// Type definitions for nodejs-driver v0.8.2
+// Project: https://github.com/datastax/nodejs-driver
+// Definitions by: Marc Fisher
+// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+
+///
+///
+
+export type Callback = Function;
+export type ResultCallback = (err: Error, result: types.ResultSet) => void;
+
+import * as events from "events";
+import * as stream from "stream";
+import _Long = require("long");
+
+export namespace policies {
+ namespace addressResolution {
+ var EC2MultiRegionTranslator: EC2MultiRegionTranslatorStatic;
+
+ interface AddressTranslator {
+ translate(address: string, port: number, callback: Callback): void;
+ }
+
+ interface EC2MultiRegionTranslatorStatic {
+ new (): EC2MultiRegionTranslator;
+ }
+
+ interface EC2MultiRegionTranslator extends AddressTranslator {
+ logError(address: string, err: Error): void;
+ }
+ }
+
+ namespace loadBalancing {
+ var DCAwareRoundRobinPolicy: DCAwareRoundRobinPolicyStatic;
+ var RoundRobinPolicy: RoundRobinPolicyStatic;
+ var TokenAwarePolicy: TokenAwarePolicyStatic;
+ var WhiteListPolicy: WhiteListPolicyStatic;
+
+ interface LoadBalancingPolicy {
+ init(client: Client, hosts: HostMap, callback: Callback): void;
+ getDistance(host: Host): types.distance;
+ newQueryPlan(keyspace: string, queryOptions: any, callback: Callback): void;
+ }
+
+ interface DCAwareRoundRobinPolicyStatic {
+ new (localDc?: string, usedHostsPerRemoteDc?: number): DCAwareRoundRobinPolicy;
+ }
+
+ interface DCAwareRoundRobinPolicy extends LoadBalancingPolicy {
+ localHostsArray: Array;
+ remoteHostsArray: Array;
+ }
+
+ interface RoundRobinPolicyStatic {
+ new (): RoundRobinPolicy;
+ }
+
+ interface RoundRobinPolicy extends LoadBalancingPolicy { }
+
+ interface TokenAwarePolicyStatic {
+ new (childPolicy: LoadBalancingPolicy): TokenAwarePolicy;
+ }
+
+ interface TokenAwarePolicy extends LoadBalancingPolicy { }
+
+ interface WhiteListPolicyStatic {
+ new (childPolicy: LoadBalancingPolicy, whiteList: Array): WhiteListPolicy;
+ }
+
+ interface WhiteListPolicy extends LoadBalancingPolicy { }
+ }
+
+ namespace reconnection {
+ var ConstantReconnectionPolicy: ConstantReconnectionPolicyStatic;
+ var ExponentialReconnectionPolicy: ExponentialReconnectionPolicyStatic;
+
+ interface ReconnectionPolicy {
+ newSchedule(): { next: Function };
+ }
+
+ interface ConstantReconnectionPolicyStatic {
+ new (delay: number): ConstantReconnectionPolicy;
+ }
+
+ interface ConstantReconnectionPolicy extends ReconnectionPolicy { }
+
+ interface ExponentialReconnectionPolicyStatic {
+ new (baseDelay: number, maxDelay: number, startWithNoDelay: boolean): ExponentialReconnectionPolicy;
+ }
+
+ interface ExponentialReconnectionPolicy extends ReconnectionPolicy { }
+ }
+
+ namespace retry {
+ var RetryPolicy: RetryPolicyStatic;
+
+ interface DecisionInfo {
+ decision: number;
+ consistency: number;
+ }
+
+ interface RequestInfo {
+ request: any,
+ nbRetry: number
+ }
+
+ enum retryDecision {
+ rethrow = 0,
+ retry,
+ ignore
+ }
+
+ interface RetryPolicyStatic {
+ new (): RetryPolicy;
+
+ retryDecision: any;
+ }
+
+ interface RetryPolicy {
+ onReadTimeout(requestInfo: RequestInfo, consistency: types.consistencies, received: number, blockFor: number, isDataPresent: boolean): DecisionInfo;
+ onUnavailable(requestInfo: RequestInfo, consistency: types.consistencies, required: number, alive: number): DecisionInfo;
+ onWriteTimeout(requestInfo: RequestInfo, consistency: types.consistencies, received: number, blockFor: number, writeType: string): DecisionInfo;
+ rethrowResult(): { decision: retryDecision };
+ retryResult(): { decision: retryDecision, consistency: types.consistencies, useCurrentHost: boolean };
+ }
+ }
+}
+
+export namespace types {
+ var BigDecimal: BigDecimalStatic;
+ var InetAddress: InetAddressStatic;
+ var Integer: IntegerStatic;
+ var LocalDate: LocalDateStatic;
+ var LocalTime: LocalTimeStatic;
+ var Long: _Long;
+ var ResultSet: ResultSetStatic;
+ var ResultStream: ResultStreamStatic;
+ var Row: RowStatic;
+ var TimeUuid: TimeUuidStatic;
+ var Tuple: TupleStatic;
+ var Uuid: UuidStatic;
+
+ enum consistencies {
+ any = 0,
+ one,
+ two,
+ three,
+ quorum,
+ all,
+ localQuorm,
+ eachQuorum,
+ serial,
+ localSerial,
+ localOne
+ }
+
+ enum dataTypes {
+ custom = 0,
+ ascii,
+ bigint,
+ blob,
+ boolean,
+ counter,
+ decimal,
+ double,
+ float,
+ int,
+ text,
+ timestamp,
+ uuid,
+ varchar,
+ varint,
+ timeuuid,
+ inet,
+ date,
+ time,
+ smallint,
+ tinyint,
+ list,
+ map,
+ set,
+ udt,
+ tuple
+ }
+
+ enum distance {
+ local = 0,
+ remote,
+ ignored
+ }
+
+ interface responseErrorCodes { [key: string]: number; }
+ interface unset { unset: boolean; }
+
+ function generateTimestamp(date?: Date, microseconds?: number): _Long;
+ function timeuuid(options?: { msecs: number | Date, node: Buffer, clockseq: number, nsecs: number }, buffer?: Buffer, offset?: number): string;
+
+ interface BigDecimalStatic {
+ new (unscaledValue: number, scale: number): BigDecimal;
+
+ fromBuffer(buf: Buffer): BigDecimal;
+ toBuffer(value: BigDecimal): Buffer;
+ fromString(value: string): BigDecimal;
+ fromNumber(value: number): BigDecimal;
+ }
+
+ interface BigDecimal {
+ equals(other: BigDecimal): boolean;
+ inspect(): string;
+ notEquals(other: BigDecimal): boolean;
+ compare(other: BigDecimal): number;
+ subtract(other: BigDecimal): BigDecimal;
+ add(other: BigDecimal): BigDecimal;
+ greaterThan(other: BigDecimal): boolean;
+ isNegative(): boolean;
+ isZero(): boolean;
+ toString(): string;
+ toNumber(): number;
+ toJSON(): string;
+ }
+
+ interface InetAddressStatic {
+ new (buffer: Buffer): InetAddress;
+
+ fromString(value: string): InetAddress;
+ }
+
+ interface InetAddress {
+ equals(other: InetAddress): boolean;
+ getBuffer(): Buffer;
+ inspect(): string;
+ toString(): string;
+ toJSON(): string;
+
+ length: number;
+ version: number;
+ }
+
+ interface IntegerStatic {
+ new (bits: Array, sign: number): Integer;
+
+ fromInt(value: number): Integer;
+ fromNumber(value: number): Integer;
+ fromBits(bits: Array): Integer;
+ fromString(str: string, opt_radix?: number): Integer;
+ fromBuffer(bits: Buffer): Integer;
+ toBuffer(value: Integer): Buffer;
+
+ ZERO: Integer;
+ ONE: Integer;
+ }
+
+ interface Integer {
+ toInt(): number;
+ toNumber(): number;
+ toString(opt_radix?: number): string;
+ getBits(index: number): number;
+ getBitsUnsigned(index: number): number;
+ getSign(): number;
+ isZero(): boolean;
+ isNegative(): boolean;
+ isOdd(): boolean;
+ equals(other: Integer): boolean;
+ notEquals(other: Integer): boolean;
+ greaterThan(other: Integer): boolean;
+ greaterThanOrEqual(other: Integer): boolean;
+ lessThan(other: Integer): boolean;
+ lessThanOrEqual(other: Integer): boolean;
+ compare(other: Integer): number;
+ shorten(numBits: number): Integer;
+ negate(): Integer;
+ add(other: Integer): Integer;
+ subtract(other: Integer): Integer;
+ multiply(other: Integer): Integer;
+ divide(other: Integer): Integer;
+ modulo(other: Integer): Integer;
+ not(): Integer;
+ and(other: Integer): Integer;
+ or(other: Integer): Integer;
+ xor(other: Integer): Integer;
+ shiftLeft(numBits: number): Integer;
+ shiftRight(numBits: number): Integer;
+ inspect(): string;
+ abs(): Integer;
+ toJSON(): string;
+ }
+
+ interface LocalDateStatic {
+ new (year: number, month: number, day: number): LocalDate;
+
+ now(): LocalDate;
+ utcNow(): LocalDate;
+ fromDate(date: Date): LocalDate;
+ fromString(value: string): LocalDate;
+ fromBuffer(buffer: Buffer): LocalDate;
+ }
+
+ interface LocalDate {
+ _value: number;
+ year: number;
+ month: number;
+ day: number;
+
+ equals(other: LocalDate): boolean;
+ inspect(): string;
+ toBuffer(): Buffer;
+ toString(): string;
+ toJSON(): string;
+ }
+
+ interface LocalTimeStatic {
+ new (totalNanoseconds: _Long): LocalTime;
+
+ fromString(value: string): LocalTime;
+ now(nanoseconds?: number): LocalTime;
+ fromDate(date: Date, nanoseconds: number): LocalTime;
+ fromMilliseconds(milliseconds: number, nanoseconds?: number): LocalTime;
+ fromBuffer(value: Buffer): LocalTime;
+ }
+
+ interface LocalTime {
+ hour: number;
+ minute: number;
+ second: number;
+ nanosecond: number;
+
+ compare(other: LocalTime): boolean;
+ equals(other: LocalTime): boolean;
+ getTotalNanoseconds(): _Long;
+ inspect(): string;
+ toBuffer(): Buffer;
+ toString(): string;
+ toJSON(): string;
+ }
+
+ interface ResultSetStatic {
+ new (response: any, host: string, triedHost: { [key: string]: any }, consistency: consistencies): ResultSet;
+ }
+
+ interface ResultSet {
+ info: {
+ queriedHost: Host,
+ triedHosts: { [key: string]: string; },
+ achievedConsistency: consistencies,
+ traceId: Uuid,
+ warnings: Array,
+ customPayload: any
+ };
+ rows: Array;
+ rowLength: number;
+ columns: Array<{ [key: string]: string; }>;
+ pageState: string;
+ nextPage: any; // function
+
+ first(): Row;
+ getPageState(): string;
+ getColumns(): Array<{ [key: string]: string; }>;
+ }
+
+ interface ResultStreamStatic {
+ new (opt: any): ResultSet;
+ }
+
+ interface ResultStream extends stream.Readable {
+ buffer: Buffer;
+ paused: boolean;
+
+ _read(): void;
+ _valve(readNext: Function): void;
+ add(chunk: Buffer): void;
+ }
+
+ interface RowStatic {
+ new (columns: Array<{ [key: string]: string; }>): Row;
+ }
+
+ interface Row {
+ get(columnName: string | number): { [key: string]: any; };
+ values(): Array<{ [key: string]: any; }>;
+ keys(): Array;
+ forEach(callback: Callback): void;
+ }
+
+ interface TimeUuidStatic {
+ new (value?: Date, ticks?: number, nodeId?: string | Buffer, clockId?: string | Buffer): TimeUuid;
+
+ fromDate(date: Date, ticks?: number, nodeId?: string | Buffer, clockId?: string | Buffer): TimeUuid;
+ fromString(value: string): TimeUuid;
+ min(date: Date, ticks?: number): TimeUuid;
+ max(date: Date, ticks?: number): TimeUuid;
+ now(nodeId?: string | Buffer, clockId?: string | Buffer): TimeUuid;
+ }
+
+ interface TimeUuid extends Uuid {
+ getDatePrecision(): { date: Date, ticks: number };
+ getDate(): Date;
+ getNodeId(): Buffer;
+ getNodeIdString(): string;
+ }
+
+ interface TupleStatic {
+ new (...args: Array): Tuple;
+
+ fromArray(elements: Array): Tuple;
+ }
+
+ interface Tuple {
+ elements: Array;
+ length: number;
+
+ get(index: number): any;
+ toString(): string;
+ toJSON(): string;
+ values(): Array;
+ }
+
+ interface UuidStatic {
+ new (buffer: Buffer): Uuid;
+
+ fromString(value: string): Uuid;
+ random(): Uuid;
+ }
+
+ interface Uuid {
+ buffer: Buffer;
+
+ getBuffer(): Buffer;
+ equals(other: types.Uuid): boolean;
+ toString(): string;
+ inspect(): string;
+ toJSON(): string;
+ }
+}
+
+export var Client: ClientStatic;
+export var Host: HostStatic;
+export var HostMap: HostMapStatic;
+export var Encoder: EncoderStatic;
+
+export interface ClientOptions {
+ contactPoints: Array,
+ keyspace: string,
+ policies?: {
+ addressResolution?: policies.addressResolution.AddressTranslator,
+ loadBalancing?: policies.loadBalancing.LoadBalancingPolicy,
+ reconnection?: policies.reconnection.ReconnectionPolicy,
+ retry?: policies.retry.RetryPolicy
+ },
+ queryOptions?: QueryOptions,
+ pooling?: {
+ heartBeatInterval: number,
+ coreConnectionsPerHost: { [key: number]: number; },
+ warmup: boolean;
+ },
+ protocolOptions?: {
+ port: number,
+ maxSchemaAgreementWaitSeconds: number,
+ maxVersion: number
+ },
+ socketOptions?: {
+ connectTimeout: number,
+ defunctReadTimeoutThreshold: number,
+ keepAlive: boolean,
+ keepAliveDelay: number,
+ readTimeout: number,
+ tcpNoDelay: boolean,
+ coalescingThreshold: number
+ },
+ authProvider?: auth.AuthProvider,
+ sslOptions?: any,
+ encoding?: {
+ map: Function,
+ set: Function,
+ copyBuffer: boolean,
+ useUndefinedAsUnset: boolean
+ }
+}
+
+export interface QueryOptions {
+ autoPage?: boolean;
+ captureStackTrace?: boolean;
+ consistency?: number;
+ customPayload?: any;
+ fetchSize?: number;
+ hints?: Array | Array>;
+ logged?: boolean;
+ pageState?: Buffer | string;
+ prepare?: boolean;
+ readTimeout?: number;
+ retry?: policies.retry.RetryPolicy;
+ retryOnTimeout?: boolean;
+ routingIndexes?: Array;
+ routingKey?: Buffer | Array;
+ routingNames?: Array;
+ serialConsistency?: number;
+ timestamp?: number | _Long;
+ traceQuery?: boolean;
+}
+
+export interface ClientStatic {
+ new (options?: ClientOptions): Client;
+}
+
+export interface Client extends events.EventEmitter {
+ hosts: HostMap;
+ keyspace: string;
+ metadata: metadata.Metadata;
+
+ batch(queries: Array | Array<{ query: string, params?: any }>, options: QueryOptions, callback: ResultCallback): void;
+ connect(callback: Callback): void;
+ eachRow(query: string, params?: any, options?: QueryOptions, rowCallback?: Callback, callback?: Callback): void;
+ execute(query: string, params?: any, options?: QueryOptions, callback?: ResultCallback): void;
+ getReplicas(keyspace: string, token: Buffer): Array; // TODO: Should this be a more explicit return?
+ shutdown(callback?: Callback): void;
+ stream(query: string, params?: any, options?: QueryOptions, callback?: Callback): NodeJS.ReadableStream;
+}
+
+export interface HostStatic {
+ new (address: string, protocolVersion: number, options: ClientOptions): Host;
+}
+
+export interface Host extends events.EventEmitter {
+ address: string;
+ cassandraVersion: string;
+ dataCenter: string;
+ rack: string;
+ tokens: Array;
+
+ canBeConsideredAsUp(): boolean;
+ getCassandraVersion(): Array;
+ isUp(): boolean;
+}
+
+export interface HostMapStatic {
+ new (): HostMap;
+}
+
+export interface HostMap extends events.EventEmitter {
+ length: number;
+
+ forEach(callback: Callback): void;
+ get(key: string): Host;
+ keys(): Array;
+ remove(key: string): void;
+ removeMultiple(keys: Array): void;
+ set(key: string, value: Host): void;
+ values(): Array;
+}
+
+export interface EncoderStatic {
+ new (protocolVersion: number, options: ClientOptions): Encoder;
+}
+
+export interface Encoder {
+ decode(buffer: Buffer, type: { code: number, info?: any }): void;
+ encode(value: any, typeInfo?: string | number | { code: number, info?: any }): Buffer;
+}
+
+export namespace auth {
+ var Authenticator: AuthenticatorStatic;
+ var PlainTextAuthProvider: PlainTextAuthProviderStatic;
+
+ interface AuthenticatorStatic {
+ new (): Authenticator;
+ }
+
+ interface Authenticator {
+ evaluateChallenge(challenge: Buffer, callback: Callback): void;
+ initialResponse(callback: Callback): void;
+ onAuthenticationSuccess(token?: Buffer): void;
+ }
+
+ interface AuthProvider {
+ newAuthenticator(endpoint: string, name: string): void;
+ }
+
+ interface PlainTextAuthProviderStatic {
+ new (username: string, password: string): PlainTextAuthProvider;
+ }
+
+ interface PlainTextAuthProvider extends AuthProvider {
+ newAuthenticator(endpoint: string, name: string): void;
+ }
+}
+
+export namespace errors {
+ abstract class DriverError {
+ constructor(message: string, constructor?: any);
+ }
+
+ class ArgumentError extends DriverError {
+ constructor(message: string);
+ }
+
+ class AuthenticationError extends DriverError {
+ constructor(message: string);
+ }
+
+ class DriverInternalError extends DriverError {
+ constructor(message: string);
+ }
+
+ class NoHostAvailableError extends DriverError {
+ constructor(innerErrors: any, message?: string);
+ }
+
+ class NotSupportedError extends DriverError {
+ constructor(message: string);
+ }
+
+ class OperationTimedOutError extends DriverError { }
+
+ class ResponseError extends DriverError {
+ constructor(code: number, message: string);
+ }
+}
+
+export namespace metadata {
+ var Aggregate: AggregateStatic;
+ var Index: IndexStatic;
+ var MaterializedView: MaterializedViewStatic;
+ var Metadata: MetadataStatic;
+ var SchemaFunction: SchemaFunctionStatic;
+ var TableMetadata: TableMetadataStatic;
+
+ type caching = "all" | "keys_only" | "rows_only" | "none";
+
+ interface AggregateStatic {
+ new (): Aggregate;
+ }
+
+ interface Aggregate {
+ argumentTypes: Array<{ code: number, info: any }>;
+ finalFunction: string;
+ initCondition: string;
+ keyspaceName: string,
+ returnType: string;
+ signature: Array;
+ stateFunction: string;
+ stateType: string;
+ }
+
+ interface DataTypeInfo {
+ code: number,
+ info: string | DataTypeInfo | Array,
+ options: {
+ frozen: boolean,
+ reversed: boolean
+ }
+ }
+
+ interface ColumnInfo {
+ name: string,
+ type: DataTypeInfo
+ }
+
+ interface DataCollection {
+ bloomFilterFalsePositiveChance: number;
+ caching: caching;
+ clusterKeys: Array<{ c: ColumnInfo, index: number, order: string }>;
+ clusteringOrder: Array;
+ columns: Array;
+ columnsByName: { [key: string]: ColumnInfo };
+ comment: string;
+ compactionClass: string;
+ compactionOptions: any;
+ compression: any;
+ crcCheckChange?: number;
+ defaultTtl: number;
+ extensions: any;
+ gcGraceSeconds: number;
+ localReadRepairChance: number;
+ maxIndexInterval?: number;
+ minIndexInterval?: number;
+ name: string;
+ partitionKeys: Array<{ c: ColumnInfo, index: number }>
+ populateCacheOnFlush: boolean;
+ readRepairChance: number;
+ speculateRetry: string;
+ }
+
+ enum IndexType {
+ custom = 0,
+ keys,
+ composites
+ }
+
+ interface IndexStatic {
+ new (name: string, target: string, kind: IndexType, options: Object): Index;
+
+ fromRows(indexRows: Array): Array;
+ fromColumnRows(columnRows: Array, columnsByName: { [key: string]: ColumnInfo }): Array;
+ }
+
+ interface Index {
+ kind: IndexType;
+ name: string;
+ options: Object;
+ target: string;
+
+ isCompositesKind(): boolean;
+ isCustomKind(): boolean;
+ isKeysKind(): boolean;
+ }
+
+ interface MaterializedViewStatic {
+ new (name: string): MaterializedView;
+ }
+
+ interface MaterializedView extends DataCollection { }
+
+ interface MetadataStatic {
+ new (options: ClientOptions, controlConnection: any): Metadata;
+ }
+
+ interface Metadata {
+ clearPrepared(): void;
+
+ getAggregate(keyspaceName: string, name: string, signature: Array | Array<{ code: number, info: any }>, callback: Callback): void;
+ getAggregates(keyspaceName: string, name: string, callback: Callback): void;
+ getFunction(keyspaceName: string, name: string, signature: Array | Array<{ code: number, info: any }>, callback: Callback): void;
+ getFunctions(keyspaceName: string, name: string, callback: Callback): void;
+ getMaterializedView(keyspaceName: string, name: string, callback: Callback): void;
+ getReplicas(keyspaceName: string, tokenBuffer: Buffer): Array;
+ getTable(keyspaceName: string, name: string, callback: Callback): void;
+ getTrace(traceId: types.Uuid, callback: Callback): void;
+ getUdt(keyspaceName: string, name: string, callback: Callback): void;
+ refreshKeyspace(name: string, callback?: Callback): void;
+ refreshKeyspaces(callback?: Callback): void;
+ }
+
+ interface SchemaFunctionStatic {
+ new (): SchemaFunction;
+ }
+
+ interface SchemaFunction {
+ argumentNames: Array;
+ argumentTypes: Array<{ code: number, info: any }>;
+ body: string;
+ calledOnNullInput: boolean;
+ keyspaceName: string,
+ language: string;
+ name: string;
+ returnType: string;
+ signature: Array;
+ }
+
+ interface TableMetadataStatic {
+ new (name: string): TableMetadata;
+ }
+
+ interface TableMetadata extends DataCollection {
+ indexes: Array;
+ indexInterval?: number;
+ isCompact: boolean;
+ memtableFlushPeriod: number;
+ replicateOnWrite: boolean;
+ }
+}
diff --git a/cassandra-driver/tsconfig.json b/cassandra-driver/tsconfig.json
new file mode 100644
index 0000000000..0dec57214f
--- /dev/null
+++ b/cassandra-driver/tsconfig.json
@@ -0,0 +1,19 @@
+{
+ "compilerOptions": {
+ "module": "commonjs",
+ "target": "es5",
+ "noImplicitAny": true,
+ "strictNullChecks": false,
+ "baseUrl": "../",
+ "typeRoots": [
+ "../"
+ ],
+ "types": [],
+ "noEmit": true,
+ "forceConsistentCasingInFileNames": true
+ },
+ "files": [
+ "index.d.ts",
+ "cassandra-driver.tests.ts"
+ ]
+}
\ No newline at end of file
diff --git a/flux/tsconfig.json b/flux/tsconfig.json
index 9148aa5a60..07ef395eab 100644
--- a/flux/tsconfig.json
+++ b/flux/tsconfig.json
@@ -14,6 +14,7 @@
},
"files": [
"index.d.ts",
+ "utils/index.d.ts",
"flux-tests.ts"
]
}
\ No newline at end of file
diff --git a/flux/utils/index.d.ts b/flux/utils/index.d.ts
index c43b1a8417..d69a6f1e55 100644
--- a/flux/utils/index.d.ts
+++ b/flux/utils/index.d.ts
@@ -3,6 +3,11 @@
// Definitions by: Steve Baker , Giedrius Grabauskas
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+///
+///
+///
+///
+
import * as React from 'react';
import * as Flux from 'flux';
import * as fbEmitter from 'fbemitter';
@@ -13,24 +18,24 @@ export = FluxUtils;
declare namespace FluxUtils {
/**
* Default options to create a Container with
- *
+ *
* @interface RealOptions
*/
interface RealOptions {
/**
* Default value: true
- *
+ *
* @type {boolean}
*/
pure?: boolean;
/**
* Default value: false
- *
+ *
* @type {boolean}
*/
withProps?: boolean;
}
-
+
export class Container {
constructor();
/**
diff --git a/highcharts/highstock.d.ts b/highcharts/highstock.d.ts
index ac4064ddd1..d1b21da62e 100644
--- a/highcharts/highstock.d.ts
+++ b/highcharts/highstock.d.ts
@@ -3,8 +3,6 @@
// Definitions by: David Deutsch
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
-
-
interface HighstockChartObject extends HighchartsChartObject {
options: HighstockOptions;
}
@@ -81,9 +79,9 @@ interface HighstockScrollbarOptions {
}
interface HighstockOptions extends HighchartsOptions {
- navigator?: HighstockNavigatorOptions;
- rangeSelector?: HighstockRangeSelectorOptions;
- scrollbar?: HighstockScrollbarOptions;
+ navigator?: HighstockNavigatorOptions;
+ rangeSelector?: HighstockRangeSelectorOptions;
+ scrollbar?: HighstockScrollbarOptions;
}
interface HighstockChart {
@@ -92,7 +90,7 @@ interface HighstockChart {
}
interface HighchartsStatic {
- StockChart: HighstockChart;
+ StockChart: HighstockChart;
}
interface JQuery {
diff --git a/highcharts/index.d.ts b/highcharts/index.d.ts
index 7185587190..4ca5fc9cb6 100644
--- a/highcharts/index.d.ts
+++ b/highcharts/index.d.ts
@@ -3,6 +3,8 @@
// Definitions by: Damiano Gambarotto , Dan Lewi Harkestad
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+///
+
interface HighchartsPosition {
align?: string;
verticalAlign?: string;
diff --git a/highcharts/tsconfig.json b/highcharts/tsconfig.json
index 2651f0bc61..735490820e 100644
--- a/highcharts/tsconfig.json
+++ b/highcharts/tsconfig.json
@@ -14,6 +14,8 @@
},
"files": [
"index.d.ts",
- "highcharts-tests.ts"
+ "highstock.d.ts",
+ "highcharts-tests.ts",
+ "highstock-tests.ts"
]
}
\ No newline at end of file
diff --git a/resolve/index.d.ts b/resolve/index.d.ts
new file mode 100644
index 0000000000..ed047af9c6
--- /dev/null
+++ b/resolve/index.d.ts
@@ -0,0 +1,100 @@
+// Type definitions for resolve
+// Project: https://github.com/substack/node-resolve
+// Definitions by: Mario Nebl
+// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+
+///
+
+/**
+ * Callback invoked when resolving asynchronously
+ *
+ * @param error
+ * @param resolved Absolute path to resolved identifier
+ */
+type resolveCallback = (err: Error, resolved?: string) => void;
+
+/**
+ * Callback invoked when checking if a file exists
+ *
+ * @param error
+ * @param isFile If the given file exists
+ */
+type isFileCallback = (err: Error, isFile?: boolean) => void;
+
+/**
+ * Callback invoked when reading a file
+ *
+ * @param error
+ * @param isFile If the given file exists
+ */
+type readFileCallback = (err: Error, file?: Buffer) => void;
+
+/**
+ * Asynchronously resolve the module path string id into cb(err, res [, pkg]), where pkg (if defined) is the data from package.json
+ *
+ * @param id Identifier to resolve
+ * @param callback
+ */
+declare function resolve(id: string, cb: resolveCallback): void;
+
+/**
+ * Asynchronously resolve the module path string id into cb(err, res [, pkg]), where pkg (if defined) is the data from package.json
+ *
+ * @param id Identifier to resolve
+ * @param options Options to use for resolving, optional.
+ * @param callback
+ */
+declare function resolve(id: string, opts: resolve.AsyncOpts, cb: resolveCallback): void;
+
+/**
+ * Synchronously resolve the module path string id, returning the result and throwing an error when id can't be resolved.
+ *
+ * @param id Identifier to resolve
+ * @param options Options to use for resolving, optional.
+ */
+declare function resolveSync(id: string, opts?: resolve.SyncOpts): string;
+
+/**
+ * Return whether a package is in core
+ *
+ * @param id
+ */
+declare function resolveIsCore(id: string): boolean;
+
+declare namespace resolve {
+ interface Opts {
+ // directory to begin resolving from (defaults to __dirname)
+ basedir?: string;
+ // package.json data applicable to the module being loaded
+ package?: any;
+ // array of file extensions to search in order (defaults to ['.js'])
+ extensions?: string | string[];
+ // transform the parsed package.json contents before looking at the "main" field
+ packageFilter?: (pkg: any, pkgfile: string) => any;
+ // transform a path within a package
+ pathFilter?: (pkg: any, path: string, relativePath: string) => string;
+ // require.paths array to use if nothing is found on the normal node_modules recursive walk (probably don't use this)
+ paths?: string | string[];
+ // directory (or directories) in which to recursively look for modules. (default to 'node_modules')
+ moduleDirectory?: string | string[]
+ }
+
+ export interface AsyncOpts extends Opts {
+ // how to read files asynchronously (defaults to fs.readFile)
+ readFile?: (file: string, cb: readFileCallback) => void;
+ // function to asynchronously test whether a file exists
+ isFile?: (file: string, cb: isFileCallback) => void;
+ }
+
+ export interface SyncOpts extends Opts {
+ // how to read files synchronously (defaults to fs.readFileSync)
+ readFileSync?: (file: string) => Buffer;
+ // function to synchronously test whether a file exists
+ isFile?: (file: string) => boolean;
+ }
+
+ export var sync: typeof resolveSync;
+ export var isCore: typeof resolveIsCore;
+}
+
+export = resolve;
diff --git a/resolve/resolve-tests.ts b/resolve/resolve-tests.ts
index 5922f3f0a8..3cac830c58 100644
--- a/resolve/resolve-tests.ts
+++ b/resolve/resolve-tests.ts
@@ -1,4 +1,4 @@
-///
+///
import * as fs from 'fs';
import * as resolve from 'resolve';
diff --git a/resolve/resolve.d.ts b/resolve/resolve.d.ts
deleted file mode 100644
index 83082d7006..0000000000
--- a/resolve/resolve.d.ts
+++ /dev/null
@@ -1,102 +0,0 @@
-// Type definitions for resolve
-// Project: https://github.com/substack/node-resolve
-// Definitions by: Mario Nebl
-// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
-
-///
-
-declare module 'resolve' {
- /**
- * Callback invoked when resolving asynchronously
- *
- * @param error
- * @param resolved Absolute path to resolved identifier
- */
- type resolveCallback = (err: Error, resolved?: string) => void;
-
- /**
- * Callback invoked when checking if a file exists
- *
- * @param error
- * @param isFile If the given file exists
- */
- type isFileCallback = (err: Error, isFile?: boolean) => void;
-
- /**
- * Callback invoked when reading a file
- *
- * @param error
- * @param isFile If the given file exists
- */
- type readFileCallback = (err: Error, file?: Buffer) => void;
-
- /**
- * Asynchronously resolve the module path string id into cb(err, res [, pkg]), where pkg (if defined) is the data from package.json
- *
- * @param id Identifier to resolve
- * @param callback
- */
- function resolve(id: string, cb: resolveCallback): void;
-
- /**
- * Asynchronously resolve the module path string id into cb(err, res [, pkg]), where pkg (if defined) is the data from package.json
- *
- * @param id Identifier to resolve
- * @param options Options to use for resolving, optional.
- * @param callback
- */
- function resolve(id: string, opts: resolve.AsyncOpts, cb: resolveCallback): void;
-
- /**
- * Synchronously resolve the module path string id, returning the result and throwing an error when id can't be resolved.
- *
- * @param id Identifier to resolve
- * @param options Options to use for resolving, optional.
- */
- function resolveSync(id: string, opts?: resolve.SyncOpts): string;
-
- /**
- * Return whether a package is in core
- *
- * @param id
- */
- function resolveIsCore(id: string): boolean;
-
- namespace resolve {
- interface Opts {
- // directory to begin resolving from (defaults to __dirname)
- basedir?: string;
- // package.json data applicable to the module being loaded
- package?: any;
- // array of file extensions to search in order (defaults to ['.js'])
- extensions?: string|string[];
- // transform the parsed package.json contents before looking at the "main" field
- packageFilter?: (pkg: any, pkgfile: string) => any;
- // transform a path within a package
- pathFilter?: (pkg: any, path: string, relativePath: string) => string;
- // require.paths array to use if nothing is found on the normal node_modules recursive walk (probably don't use this)
- paths?: string|string[];
- // directory (or directories) in which to recursively look for modules. (default to 'node_modules')
- moduleDirectory?: string|string[]
- }
-
- export interface AsyncOpts extends Opts {
- // how to read files asynchronously (defaults to fs.readFile)
- readFile?: (file: string, cb: readFileCallback) => void;
- // function to asynchronously test whether a file exists
- isFile?: (file: string, cb: isFileCallback) => void;
- }
-
- export interface SyncOpts extends Opts {
- // how to read files synchronously (defaults to fs.readFileSync)
- readFileSync?: (file: string) => Buffer;
- // function to synchronously test whether a file exists
- isFile?: (file: string) => boolean;
- }
-
- export var sync: typeof resolveSync;
- export var isCore: typeof resolveIsCore;
- }
-
- export = resolve;
-}
diff --git a/resolve/tsconfig.json b/resolve/tsconfig.json
new file mode 100644
index 0000000000..3327aff4ab
--- /dev/null
+++ b/resolve/tsconfig.json
@@ -0,0 +1,19 @@
+{
+ "compilerOptions": {
+ "module": "commonjs",
+ "target": "es5",
+ "noImplicitAny": true,
+ "strictNullChecks": false,
+ "baseUrl": "../",
+ "typeRoots": [
+ "../"
+ ],
+ "types": [],
+ "noEmit": true,
+ "forceConsistentCasingInFileNames": true
+ },
+ "files": [
+ "index.d.ts",
+ "resolve-tests.ts"
+ ]
+}
\ No newline at end of file
diff --git a/webpack/tsconfig.json b/webpack/tsconfig.json
index 67896791c3..4f74594aa4 100644
--- a/webpack/tsconfig.json
+++ b/webpack/tsconfig.json
@@ -14,6 +14,7 @@
},
"files": [
"index.d.ts",
+ "webpack-env.d.ts",
"webpack-tests.ts"
]
}
\ No newline at end of file