Skip to content

Commit 50f2866

Browse files
Merge pull request #21 from alexstrat/master
Publish declaration in package
2 parents c5ab398 + 210734c commit 50f2866

File tree

9 files changed

+26
-2
lines changed

9 files changed

+26
-2
lines changed

dist/context.d.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
export interface ContextData {
2+
models: Object;
3+
user: Object;
4+
}
5+
export declare const createExpressContext: (data: any, res: any) => Context;
6+
export declare class Context {
7+
models: Object;
8+
user: Object;
9+
constructor(data: ContextData);
10+
dispose(): void;
11+
}

dist/helper.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export declare const combineResolvers: (resolvers?: any[]) => any;

dist/index.d.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { usePromise } from './promise';
2+
import { combineResolvers } from './helper';
3+
import { createExpressContext } from './context';
4+
import { createResolver } from './resolver';
5+
export { usePromise, combineResolvers, createExpressContext, createResolver };

dist/promise.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export declare const usePromise: (pLib: any) => void;
2+
export declare const getPromise: () => PromiseConstructor;

dist/resolver.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export declare const createResolver: (resFn: any, errFn: any) => (root: any, args?: {}, context?: {}) => Promise<any>;

dist/util.d.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export declare const isFunction: (fn: any) => boolean;
2+
export declare const Promisify: (fn: any) => (...args: any[]) => Promise<{}>;
3+
export declare const isNotNullOrUndefined: (val: any) => boolean;

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "1.0.3",
44
"description": "Expressive and composable resolvers for Apollostack's GraphQL server Edit",
55
"main": "dist/index.js",
6+
"types": "dist/index.d.ts",
67
"scripts": {
78
"test": "make test"
89
},

src/context.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as assert from 'assert';
2-
interface ContextData {
2+
export interface ContextData {
33
models: Object;
44
user: Object;
55
};

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
"target": "es2015",
44
"module": "commonjs",
55
"moduleResolution": "node",
6+
"declaration": true,
67
"sourceMap": true,
78
"removeComments": false,
89
"noImplicitAny": false,
9-
"allowJs": true,
1010
"outDir": "./dist"
1111
},
1212
"include": [

0 commit comments

Comments
 (0)