From 16ee3c582f689d2c7512c94cc9fdcf2717b9db56 Mon Sep 17 00:00:00 2001 From: Benjamin Pannell Date: Thu, 14 Apr 2016 10:56:26 +0200 Subject: [PATCH] fix: Export type definitions as an external module for typescript --- dist/main.d.ts | 136 ++++++++++++++++++++++++------------------------- iridium.d.ts | 2 + package.json | 2 +- 3 files changed, 71 insertions(+), 69 deletions(-) create mode 100644 iridium.d.ts diff --git a/dist/main.d.ts b/dist/main.d.ts index be3bdde..c755d23 100644 --- a/dist/main.d.ts +++ b/dist/main.d.ts @@ -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 { + /** + * @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 { + /** + * @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 { + /** + * 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 { + /** + * 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 { + /** + * An optional getter which can be used to retrieve the property's value + */ + get?: PropertyGetter; + /** + * An optional setter which can be used to set the property's value + */ + set?: PropertySetter; +} +} +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' { @@ -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 { - /** - * @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 { - /** - * @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 { - /** - * 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 { - /** - * 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 { - /** - * An optional getter which can be used to retrieve the property's value - */ - get?: PropertyGetter; - /** - * An optional setter which can be used to set the property's value - */ - set?: PropertySetter; -} -} -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' { diff --git a/iridium.d.ts b/iridium.d.ts new file mode 100644 index 0000000..167c76c --- /dev/null +++ b/iridium.d.ts @@ -0,0 +1,2 @@ +/// +export * from "~iridium/dist/iridium"; \ No newline at end of file diff --git a/package.json b/package.json index d5130f2..9e93986 100644 --- a/package.json +++ b/package.json @@ -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" },