Skip to content

Commit

Permalink
fix: Export type definitions as an external module for typescript
Browse files Browse the repository at this point in the history
  • Loading branch information
notheotherben committed Apr 14, 2016
1 parent def0e0e commit 16ee3c5
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 69 deletions.
136 changes: 68 additions & 68 deletions dist/main.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2265,6 +2265,74 @@ declare module 'iridium/dist/lib/Core' {
export * from '~iridium/dist/lib/Core';
}

// Generated by typings
// Source: dist/lib/General.d.ts
declare module '~iridium/dist/lib/General' {
/**
* A method which is called once an asynchronous operation has completed, an alternative
* to using Promises.
* @param T The type of object returned by the asynchronous operation.
*/
export interface Callback<T> {
/**
* @param err The error object, if one occurred, otherwise null if the operation completed successfully.
* @param object The result of the asynchronous operation if it completed successfully. If err is defined, the presence of this value is unknown.
*/
(err: Error, object?: T): void;
}
/**
* A method which is used to determine whether a value within a collection meets a set of criteria.
* @param T The type of item in the collection.
*/
export interface Predicate<T> {
/**
* @param object The value of the item in the collection
* @param key The key, if one is available, under which the item appeared within the collection
* @returns A true-y value if the item met the predicate conditions, false-y values if it did not.
*/
(object: T, key?: string): boolean;
}
/**
* A method which is called to retrieve a value of the given type.
* @param T The type of value to be retrieved.
*/
export interface PropertyGetter<T> {
/**
* Gets the current value of the property
* @returns The current value
*/
(): T;
}
/**
* A method which is called to set a value of the given type.
* @param T The type of value to set
*/
export interface PropertySetter<T> {
/**
* Sets the value to the provided one
* @param value The new value to set
*/
(value: T): void;
}
/**
* A compound property which provides either a getter, setter or both.
* @param T The type of objects stored in the property
*/
export interface Property<T> {
/**
* An optional getter which can be used to retrieve the property's value
*/
get?: PropertyGetter<T>;
/**
* An optional setter which can be used to set the property's value
*/
set?: PropertySetter<T>;
}
}
declare module 'iridium/dist/lib/General' {
export * from '~iridium/dist/lib/General';
}

// Generated by typings
// Source: dist/lib/Cursor.d.ts
declare module '~iridium/dist/lib/Cursor' {
Expand Down Expand Up @@ -2976,74 +3044,6 @@ declare module 'iridium/dist/lib/Model' {
export * from '~iridium/dist/lib/Model';
}

// Generated by typings
// Source: dist/lib/General.d.ts
declare module '~iridium/dist/lib/General' {
/**
* A method which is called once an asynchronous operation has completed, an alternative
* to using Promises.
* @param T The type of object returned by the asynchronous operation.
*/
export interface Callback<T> {
/**
* @param err The error object, if one occurred, otherwise null if the operation completed successfully.
* @param object The result of the asynchronous operation if it completed successfully. If err is defined, the presence of this value is unknown.
*/
(err: Error, object?: T): void;
}
/**
* A method which is used to determine whether a value within a collection meets a set of criteria.
* @param T The type of item in the collection.
*/
export interface Predicate<T> {
/**
* @param object The value of the item in the collection
* @param key The key, if one is available, under which the item appeared within the collection
* @returns A true-y value if the item met the predicate conditions, false-y values if it did not.
*/
(object: T, key?: string): boolean;
}
/**
* A method which is called to retrieve a value of the given type.
* @param T The type of value to be retrieved.
*/
export interface PropertyGetter<T> {
/**
* Gets the current value of the property
* @returns The current value
*/
(): T;
}
/**
* A method which is called to set a value of the given type.
* @param T The type of value to set
*/
export interface PropertySetter<T> {
/**
* Sets the value to the provided one
* @param value The new value to set
*/
(value: T): void;
}
/**
* A compound property which provides either a getter, setter or both.
* @param T The type of objects stored in the property
*/
export interface Property<T> {
/**
* An optional getter which can be used to retrieve the property's value
*/
get?: PropertyGetter<T>;
/**
* An optional setter which can be used to set the property's value
*/
set?: PropertySetter<T>;
}
}
declare module 'iridium/dist/lib/General' {
export * from '~iridium/dist/lib/General';
}

// Generated by typings
// Source: dist/lib/Instance.d.ts
declare module '~iridium/dist/lib/Instance' {
Expand Down
2 changes: 2 additions & 0 deletions iridium.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/// <reference path="./dist/main.d.ts" />
export * from "~iridium/dist/iridium";
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"benchmark": "node ./benchmarks/mongodb.js",
"build": "gulp build"
},
"typings": "dist/main.d.ts",
"typings": "iridium.d.ts",
"engines": {
"node": ">= 0.10"
},
Expand Down

0 comments on commit 16ee3c5

Please sign in to comment.