mirror of
https://github.com/vale981/apollo-server
synced 2025-03-05 09:41:40 -05:00
improve typings config
This commit is contained in:
parent
6de92a884c
commit
1f26bbaecc
25 changed files with 5 additions and 8109 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -27,6 +27,7 @@ build/Release
|
||||||
|
|
||||||
# Dependency directory
|
# Dependency directory
|
||||||
node_modules
|
node_modules
|
||||||
|
typings
|
||||||
|
|
||||||
# Optional npm cache directory
|
# Optional npm cache directory
|
||||||
.npm
|
.npm
|
||||||
|
|
|
@ -12,9 +12,8 @@
|
||||||
"pretty": true,
|
"pretty": true,
|
||||||
"removeComments": true
|
"removeComments": true
|
||||||
},
|
},
|
||||||
"files": [
|
"exclude": [
|
||||||
"typings/index.d.ts",
|
"node_modules",
|
||||||
"src/core/runQuery.ts",
|
"dist"
|
||||||
"src/test/tests.ts"
|
]
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
|
133
typings/globals/body-parser/index.d.ts
vendored
133
typings/globals/body-parser/index.d.ts
vendored
|
@ -1,133 +0,0 @@
|
||||||
// Generated by typings
|
|
||||||
// Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/7de6c3dd94feaeb21f20054b9f30d5dabc5efabd/body-parser/body-parser.d.ts
|
|
||||||
declare module "body-parser" {
|
|
||||||
import * as express from "express";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* bodyParser: use individual json/urlencoded middlewares
|
|
||||||
* @deprecated
|
|
||||||
*/
|
|
||||||
|
|
||||||
function bodyParser(options?: {
|
|
||||||
/**
|
|
||||||
* if deflated bodies will be inflated. (default: true)
|
|
||||||
*/
|
|
||||||
inflate?: boolean;
|
|
||||||
/**
|
|
||||||
* maximum request body size. (default: '100kb')
|
|
||||||
*/
|
|
||||||
limit?: any;
|
|
||||||
/**
|
|
||||||
* function to verify body content, the parsing can be aborted by throwing an error.
|
|
||||||
*/
|
|
||||||
verify?: (req: express.Request, res: express.Response, buf: Buffer, encoding: string) => void;
|
|
||||||
/**
|
|
||||||
* only parse objects and arrays. (default: true)
|
|
||||||
*/
|
|
||||||
strict?: boolean;
|
|
||||||
/**
|
|
||||||
* passed to JSON.parse().
|
|
||||||
*/
|
|
||||||
receiver?: (key: string, value: any) => any;
|
|
||||||
/**
|
|
||||||
* parse extended syntax with the qs module. (default: true)
|
|
||||||
*/
|
|
||||||
extended?: boolean;
|
|
||||||
}): express.RequestHandler;
|
|
||||||
|
|
||||||
namespace bodyParser {
|
|
||||||
export function json(options?: {
|
|
||||||
/**
|
|
||||||
* if deflated bodies will be inflated. (default: true)
|
|
||||||
*/
|
|
||||||
inflate?: boolean;
|
|
||||||
/**
|
|
||||||
* maximum request body size. (default: '100kb')
|
|
||||||
*/
|
|
||||||
limit?: any;
|
|
||||||
/**
|
|
||||||
* request content-type to parse, passed directly to the type-is library. (default: 'json')
|
|
||||||
*/
|
|
||||||
type?: any;
|
|
||||||
/**
|
|
||||||
* function to verify body content, the parsing can be aborted by throwing an error.
|
|
||||||
*/
|
|
||||||
verify?: (req: express.Request, res: express.Response, buf: Buffer, encoding: string) => void;
|
|
||||||
/**
|
|
||||||
* only parse objects and arrays. (default: true)
|
|
||||||
*/
|
|
||||||
strict?: boolean;
|
|
||||||
/**
|
|
||||||
* passed to JSON.parse().
|
|
||||||
*/
|
|
||||||
receiver?: (key: string, value: any) => any;
|
|
||||||
}): express.RequestHandler;
|
|
||||||
|
|
||||||
export function raw(options?: {
|
|
||||||
/**
|
|
||||||
* if deflated bodies will be inflated. (default: true)
|
|
||||||
*/
|
|
||||||
inflate?: boolean;
|
|
||||||
/**
|
|
||||||
* maximum request body size. (default: '100kb')
|
|
||||||
*/
|
|
||||||
limit?: any;
|
|
||||||
/**
|
|
||||||
* request content-type to parse, passed directly to the type-is library. (default: 'application/octet-stream')
|
|
||||||
*/
|
|
||||||
type?: any;
|
|
||||||
/**
|
|
||||||
* function to verify body content, the parsing can be aborted by throwing an error.
|
|
||||||
*/
|
|
||||||
verify?: (req: express.Request, res: express.Response, buf: Buffer, encoding: string) => void;
|
|
||||||
}): express.RequestHandler;
|
|
||||||
|
|
||||||
export function text(options?: {
|
|
||||||
/**
|
|
||||||
* if deflated bodies will be inflated. (default: true)
|
|
||||||
*/
|
|
||||||
inflate?: boolean;
|
|
||||||
/**
|
|
||||||
* maximum request body size. (default: '100kb')
|
|
||||||
*/
|
|
||||||
limit?: any;
|
|
||||||
/**
|
|
||||||
* request content-type to parse, passed directly to the type-is library. (default: 'text/plain')
|
|
||||||
*/
|
|
||||||
type?: any;
|
|
||||||
/**
|
|
||||||
* function to verify body content, the parsing can be aborted by throwing an error.
|
|
||||||
*/
|
|
||||||
verify?: (req: express.Request, res: express.Response, buf: Buffer, encoding: string) => void;
|
|
||||||
/**
|
|
||||||
* the default charset to parse as, if not specified in content-type. (default: 'utf-8')
|
|
||||||
*/
|
|
||||||
defaultCharset?: string;
|
|
||||||
}): express.RequestHandler;
|
|
||||||
|
|
||||||
export function urlencoded(options: {
|
|
||||||
/**
|
|
||||||
* if deflated bodies will be inflated. (default: true)
|
|
||||||
*/
|
|
||||||
inflate?: boolean;
|
|
||||||
/**
|
|
||||||
* maximum request body size. (default: '100kb')
|
|
||||||
*/
|
|
||||||
limit?: any;
|
|
||||||
/**
|
|
||||||
* request content-type to parse, passed directly to the type-is library. (default: 'urlencoded')
|
|
||||||
*/
|
|
||||||
type?: any;
|
|
||||||
/**
|
|
||||||
* function to verify body content, the parsing can be aborted by throwing an error.
|
|
||||||
*/
|
|
||||||
verify?: (req: express.Request, res: express.Response, buf: Buffer, encoding: string) => void;
|
|
||||||
/**
|
|
||||||
* parse extended syntax with the qs module.
|
|
||||||
*/
|
|
||||||
extended: boolean;
|
|
||||||
}): express.RequestHandler;
|
|
||||||
}
|
|
||||||
|
|
||||||
export = bodyParser;
|
|
||||||
}
|
|
|
@ -1,8 +0,0 @@
|
||||||
{
|
|
||||||
"resolution": "main",
|
|
||||||
"tree": {
|
|
||||||
"src": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/7de6c3dd94feaeb21f20054b9f30d5dabc5efabd/body-parser/body-parser.d.ts",
|
|
||||||
"raw": "registry:dt/body-parser#0.0.0+20160317120654",
|
|
||||||
"typings": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/7de6c3dd94feaeb21f20054b9f30d5dabc5efabd/body-parser/body-parser.d.ts"
|
|
||||||
}
|
|
||||||
}
|
|
1057
typings/globals/express-serve-static-core/index.d.ts
vendored
1057
typings/globals/express-serve-static-core/index.d.ts
vendored
File diff suppressed because it is too large
Load diff
|
@ -1,8 +0,0 @@
|
||||||
{
|
|
||||||
"resolution": "main",
|
|
||||||
"tree": {
|
|
||||||
"src": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/fb2e78984b7076eda628892770a4314d618ac0d7/express-serve-static-core/express-serve-static-core.d.ts",
|
|
||||||
"raw": "registry:dt/express-serve-static-core#0.0.0+20160322035842",
|
|
||||||
"typings": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/fb2e78984b7076eda628892770a4314d618ac0d7/express-serve-static-core/express-serve-static-core.d.ts"
|
|
||||||
}
|
|
||||||
}
|
|
41
typings/globals/express/index.d.ts
vendored
41
typings/globals/express/index.d.ts
vendored
|
@ -1,41 +0,0 @@
|
||||||
// Generated by typings
|
|
||||||
// Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/7de6c3dd94feaeb21f20054b9f30d5dabc5efabd/express/express.d.ts
|
|
||||||
declare module "express" {
|
|
||||||
import * as serveStatic from "serve-static";
|
|
||||||
import * as core from "express-serve-static-core";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates an Express application. The express() function is a top-level function exported by the express module.
|
|
||||||
*/
|
|
||||||
function e(): core.Express;
|
|
||||||
|
|
||||||
namespace e {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This is the only built-in middleware function in Express. It serves static files and is based on serve-static.
|
|
||||||
*/
|
|
||||||
var static: typeof serveStatic;
|
|
||||||
|
|
||||||
export function Router(options?: any): core.Router;
|
|
||||||
|
|
||||||
interface Application extends core.Application { }
|
|
||||||
interface CookieOptions extends core.CookieOptions { }
|
|
||||||
interface Errback extends core.Errback { }
|
|
||||||
interface ErrorRequestHandler extends core.ErrorRequestHandler { }
|
|
||||||
interface Express extends core.Express { }
|
|
||||||
interface Handler extends core.Handler { }
|
|
||||||
interface IRoute extends core.IRoute { }
|
|
||||||
interface IRouter<T> extends core.IRouter<T> { }
|
|
||||||
interface IRouterMatcher<T> extends core.IRouterMatcher<T> { }
|
|
||||||
interface MediaType extends core.MediaType { }
|
|
||||||
interface NextFunction extends core.NextFunction { }
|
|
||||||
interface Request extends core.Request { }
|
|
||||||
interface RequestHandler extends core.RequestHandler { }
|
|
||||||
interface RequestParamHandler extends core.RequestParamHandler { }
|
|
||||||
export interface Response extends core.Response { }
|
|
||||||
interface Router extends core.Router { }
|
|
||||||
interface Send extends core.Send { }
|
|
||||||
}
|
|
||||||
|
|
||||||
export = e;
|
|
||||||
}
|
|
|
@ -1,8 +0,0 @@
|
||||||
{
|
|
||||||
"resolution": "main",
|
|
||||||
"tree": {
|
|
||||||
"src": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/7de6c3dd94feaeb21f20054b9f30d5dabc5efabd/express/express.d.ts",
|
|
||||||
"raw": "registry:dt/express#4.0.0+20160317120654",
|
|
||||||
"typings": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/7de6c3dd94feaeb21f20054b9f30d5dabc5efabd/express/express.d.ts"
|
|
||||||
}
|
|
||||||
}
|
|
2419
typings/globals/hapi/index.d.ts
vendored
2419
typings/globals/hapi/index.d.ts
vendored
File diff suppressed because it is too large
Load diff
|
@ -1,8 +0,0 @@
|
||||||
{
|
|
||||||
"resolution": "main",
|
|
||||||
"tree": {
|
|
||||||
"src": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/ccb4c316dcafde1bda8cd3aedbd2b95cbff20b47/hapi/hapi.d.ts",
|
|
||||||
"raw": "registry:dt/hapi#13.0.0+20160521152637",
|
|
||||||
"typings": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/ccb4c316dcafde1bda8cd3aedbd2b95cbff20b47/hapi/hapi.d.ts"
|
|
||||||
}
|
|
||||||
}
|
|
126
typings/globals/koa/index.d.ts
vendored
126
typings/globals/koa/index.d.ts
vendored
|
@ -1,126 +0,0 @@
|
||||||
// Generated by typings
|
|
||||||
// Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/7de6c3dd94feaeb21f20054b9f30d5dabc5efabd/koa/koa.d.ts
|
|
||||||
declare module "koa" {
|
|
||||||
import { EventEmitter } from "events";
|
|
||||||
import * as http from "http";
|
|
||||||
import * as net from "net";
|
|
||||||
|
|
||||||
namespace Koa {
|
|
||||||
export interface Context extends Request, Response {
|
|
||||||
body?: any;
|
|
||||||
request?: Request;
|
|
||||||
response?: Response;
|
|
||||||
originalUrl?: string;
|
|
||||||
state?: any;
|
|
||||||
name?: string;
|
|
||||||
cookies?: any;
|
|
||||||
writable?: Boolean;
|
|
||||||
respond?: Boolean;
|
|
||||||
app?: Koa;
|
|
||||||
req?: http.IncomingMessage;
|
|
||||||
res?: http.ServerResponse;
|
|
||||||
onerror(err: any): void;
|
|
||||||
toJSON(): any;
|
|
||||||
inspect(): any;
|
|
||||||
throw(code?: any, message?: any): void;
|
|
||||||
assert(): void;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface Request {
|
|
||||||
_querycache?: string;
|
|
||||||
app?: Koa;
|
|
||||||
req?: http.IncomingMessage;
|
|
||||||
res?: http.ServerResponse;
|
|
||||||
response?: Response;
|
|
||||||
ctx?: Context;
|
|
||||||
headers?: any;
|
|
||||||
header?: any;
|
|
||||||
method?: string;
|
|
||||||
length?: any;
|
|
||||||
url?: string;
|
|
||||||
origin?: string;
|
|
||||||
originalUrl?: string;
|
|
||||||
href?: string;
|
|
||||||
path?: string;
|
|
||||||
querystring?: string;
|
|
||||||
query?: any;
|
|
||||||
search?: string;
|
|
||||||
idempotent?: Boolean;
|
|
||||||
socket?: net.Socket;
|
|
||||||
protocol?: string;
|
|
||||||
host?: string;
|
|
||||||
hostname?: string;
|
|
||||||
fresh?: Boolean;
|
|
||||||
stale?: Boolean;
|
|
||||||
charset?: string;
|
|
||||||
secure?: Boolean;
|
|
||||||
ips?: Array<string>;
|
|
||||||
ip?: string;
|
|
||||||
subdomains?: Array<string>;
|
|
||||||
accept?: any;
|
|
||||||
type?: string;
|
|
||||||
accepts?: () => any;
|
|
||||||
acceptsEncodings?: () => any;
|
|
||||||
acceptsCharsets?: () => any;
|
|
||||||
acceptsLanguages?: () => any;
|
|
||||||
is?: (types: any) => any;
|
|
||||||
toJSON?: () => any;
|
|
||||||
inspect?: () => any;
|
|
||||||
get?: (field: string) => string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface Response {
|
|
||||||
_body?: any;
|
|
||||||
_explicitStatus?: Boolean;
|
|
||||||
app?: Koa;
|
|
||||||
res?: http.ServerResponse;
|
|
||||||
req?: http.IncomingMessage;
|
|
||||||
ctx?: Context;
|
|
||||||
request?: Request;
|
|
||||||
socket?: net.Socket;
|
|
||||||
header?: any;
|
|
||||||
headers?: any;
|
|
||||||
status?: number;
|
|
||||||
message?: string;
|
|
||||||
type?: string;
|
|
||||||
body?: any;
|
|
||||||
length?: any;
|
|
||||||
headerSent?: Boolean;
|
|
||||||
lastModified?: Date;
|
|
||||||
etag?: string;
|
|
||||||
writable?: Boolean;
|
|
||||||
is?: (types: any) => any;
|
|
||||||
redirect?: (url: string, alt: string) => void;
|
|
||||||
attachment?: (filename?: string) => void;
|
|
||||||
vary?: (field: string) => void;
|
|
||||||
get?: (field: string) => string;
|
|
||||||
set?: (field: any, val: any) => void;
|
|
||||||
remove?: (field: string) => void;
|
|
||||||
append?: (field: string, val: any) => void;
|
|
||||||
toJSON?: () => any;
|
|
||||||
inspect?: () => any;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class Koa extends EventEmitter {
|
|
||||||
keys: Array<string>;
|
|
||||||
subdomainOffset: number;
|
|
||||||
proxy: Boolean;
|
|
||||||
server: http.Server;
|
|
||||||
env: string;
|
|
||||||
context: Koa.Context;
|
|
||||||
request: Koa.Request;
|
|
||||||
response: Koa.Response;
|
|
||||||
silent: Boolean;
|
|
||||||
constructor();
|
|
||||||
use(middleware: (ctx: Koa.Context, next: Function) => any): Koa;
|
|
||||||
callback(): (req: http.IncomingMessage, res: http.ServerResponse) => void;
|
|
||||||
listen(port: number, callback?: Function): http.Server;
|
|
||||||
toJSON(): any;
|
|
||||||
inspect(): any;
|
|
||||||
onerror(err: any): void;
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace Koa {}
|
|
||||||
export = Koa;
|
|
||||||
}
|
|
|
@ -1,8 +0,0 @@
|
||||||
{
|
|
||||||
"resolution": "main",
|
|
||||||
"tree": {
|
|
||||||
"src": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/7de6c3dd94feaeb21f20054b9f30d5dabc5efabd/koa/koa.d.ts",
|
|
||||||
"raw": "registry:dt/koa#2.0.0+20160317120654",
|
|
||||||
"typings": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/7de6c3dd94feaeb21f20054b9f30d5dabc5efabd/koa/koa.d.ts"
|
|
||||||
}
|
|
||||||
}
|
|
15
typings/globals/mime/index.d.ts
vendored
15
typings/globals/mime/index.d.ts
vendored
|
@ -1,15 +0,0 @@
|
||||||
// Generated by typings
|
|
||||||
// Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/56295f5058cac7ae458540423c50ac2dcf9fc711/mime/mime.d.ts
|
|
||||||
declare module "mime" {
|
|
||||||
export function lookup(path: string): string;
|
|
||||||
export function extension(mime: string): string;
|
|
||||||
export function load(filepath: string): void;
|
|
||||||
export function define(mimes: Object): void;
|
|
||||||
|
|
||||||
interface Charsets {
|
|
||||||
lookup(mime: string): string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export var charsets: Charsets;
|
|
||||||
export var default_type: string;
|
|
||||||
}
|
|
|
@ -1,8 +0,0 @@
|
||||||
{
|
|
||||||
"resolution": "main",
|
|
||||||
"tree": {
|
|
||||||
"src": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/56295f5058cac7ae458540423c50ac2dcf9fc711/mime/mime.d.ts",
|
|
||||||
"raw": "registry:dt/mime#0.0.0+20160316155526",
|
|
||||||
"typings": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/56295f5058cac7ae458540423c50ac2dcf9fc711/mime/mime.d.ts"
|
|
||||||
}
|
|
||||||
}
|
|
233
typings/globals/mocha/index.d.ts
vendored
233
typings/globals/mocha/index.d.ts
vendored
|
@ -1,233 +0,0 @@
|
||||||
// Generated by typings
|
|
||||||
// Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/7de6c3dd94feaeb21f20054b9f30d5dabc5efabd/mocha/mocha.d.ts
|
|
||||||
interface MochaSetupOptions {
|
|
||||||
//milliseconds to wait before considering a test slow
|
|
||||||
slow?: number;
|
|
||||||
|
|
||||||
// timeout in milliseconds
|
|
||||||
timeout?: number;
|
|
||||||
|
|
||||||
// ui name "bdd", "tdd", "exports" etc
|
|
||||||
ui?: string;
|
|
||||||
|
|
||||||
//array of accepted globals
|
|
||||||
globals?: any[];
|
|
||||||
|
|
||||||
// reporter instance (function or string), defaults to `mocha.reporters.Spec`
|
|
||||||
reporter?: any;
|
|
||||||
|
|
||||||
// bail on the first test failure
|
|
||||||
bail?: boolean;
|
|
||||||
|
|
||||||
// ignore global leaks
|
|
||||||
ignoreLeaks?: boolean;
|
|
||||||
|
|
||||||
// grep string or regexp to filter tests with
|
|
||||||
grep?: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface MochaDone {
|
|
||||||
(error?: Error): void;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare var mocha: Mocha;
|
|
||||||
declare var describe: Mocha.IContextDefinition;
|
|
||||||
declare var xdescribe: Mocha.IContextDefinition;
|
|
||||||
// alias for `describe`
|
|
||||||
declare var context: Mocha.IContextDefinition;
|
|
||||||
// alias for `describe`
|
|
||||||
declare var suite: Mocha.IContextDefinition;
|
|
||||||
declare var it: Mocha.ITestDefinition;
|
|
||||||
declare var xit: Mocha.ITestDefinition;
|
|
||||||
// alias for `it`
|
|
||||||
declare var test: Mocha.ITestDefinition;
|
|
||||||
|
|
||||||
declare function before(action: () => void): void;
|
|
||||||
|
|
||||||
declare function before(action: (done: MochaDone) => void): void;
|
|
||||||
|
|
||||||
declare function before(description: string, action: () => void): void;
|
|
||||||
|
|
||||||
declare function before(description: string, action: (done: MochaDone) => void): void;
|
|
||||||
|
|
||||||
declare function setup(action: () => void): void;
|
|
||||||
|
|
||||||
declare function setup(action: (done: MochaDone) => void): void;
|
|
||||||
|
|
||||||
declare function after(action: () => void): void;
|
|
||||||
|
|
||||||
declare function after(action: (done: MochaDone) => void): void;
|
|
||||||
|
|
||||||
declare function after(description: string, action: () => void): void;
|
|
||||||
|
|
||||||
declare function after(description: string, action: (done: MochaDone) => void): void;
|
|
||||||
|
|
||||||
declare function teardown(action: () => void): void;
|
|
||||||
|
|
||||||
declare function teardown(action: (done: MochaDone) => void): void;
|
|
||||||
|
|
||||||
declare function beforeEach(action: () => void): void;
|
|
||||||
|
|
||||||
declare function beforeEach(action: (done: MochaDone) => void): void;
|
|
||||||
|
|
||||||
declare function beforeEach(description: string, action: () => void): void;
|
|
||||||
|
|
||||||
declare function beforeEach(description: string, action: (done: MochaDone) => void): void;
|
|
||||||
|
|
||||||
declare function suiteSetup(action: () => void): void;
|
|
||||||
|
|
||||||
declare function suiteSetup(action: (done: MochaDone) => void): void;
|
|
||||||
|
|
||||||
declare function afterEach(action: () => void): void;
|
|
||||||
|
|
||||||
declare function afterEach(action: (done: MochaDone) => void): void;
|
|
||||||
|
|
||||||
declare function afterEach(description: string, action: () => void): void;
|
|
||||||
|
|
||||||
declare function afterEach(description: string, action: (done: MochaDone) => void): void;
|
|
||||||
|
|
||||||
declare function suiteTeardown(action: () => void): void;
|
|
||||||
|
|
||||||
declare function suiteTeardown(action: (done: MochaDone) => void): void;
|
|
||||||
|
|
||||||
declare class Mocha {
|
|
||||||
constructor(options?: {
|
|
||||||
grep?: RegExp;
|
|
||||||
ui?: string;
|
|
||||||
reporter?: string;
|
|
||||||
timeout?: number;
|
|
||||||
bail?: boolean;
|
|
||||||
});
|
|
||||||
|
|
||||||
/** Setup mocha with the given options. */
|
|
||||||
setup(options: MochaSetupOptions): Mocha;
|
|
||||||
bail(value?: boolean): Mocha;
|
|
||||||
addFile(file: string): Mocha;
|
|
||||||
/** Sets reporter by name, defaults to "spec". */
|
|
||||||
reporter(name: string): Mocha;
|
|
||||||
/** Sets reporter constructor, defaults to mocha.reporters.Spec. */
|
|
||||||
reporter(reporter: (runner: Mocha.IRunner, options: any) => any): Mocha;
|
|
||||||
ui(value: string): Mocha;
|
|
||||||
grep(value: string): Mocha;
|
|
||||||
grep(value: RegExp): Mocha;
|
|
||||||
invert(): Mocha;
|
|
||||||
ignoreLeaks(value: boolean): Mocha;
|
|
||||||
checkLeaks(): Mocha;
|
|
||||||
/**
|
|
||||||
* Function to allow assertion libraries to throw errors directly into mocha.
|
|
||||||
* This is useful when running tests in a browser because window.onerror will
|
|
||||||
* only receive the 'message' attribute of the Error.
|
|
||||||
*/
|
|
||||||
throwError(error: Error): void;
|
|
||||||
/** Enables growl support. */
|
|
||||||
growl(): Mocha;
|
|
||||||
globals(value: string): Mocha;
|
|
||||||
globals(values: string[]): Mocha;
|
|
||||||
useColors(value: boolean): Mocha;
|
|
||||||
useInlineDiffs(value: boolean): Mocha;
|
|
||||||
timeout(value: number): Mocha;
|
|
||||||
slow(value: number): Mocha;
|
|
||||||
enableTimeouts(value: boolean): Mocha;
|
|
||||||
asyncOnly(value: boolean): Mocha;
|
|
||||||
noHighlighting(value: boolean): Mocha;
|
|
||||||
/** Runs tests and invokes `onComplete()` when finished. */
|
|
||||||
run(onComplete?: (failures: number) => void): Mocha.IRunner;
|
|
||||||
}
|
|
||||||
|
|
||||||
// merge the Mocha class declaration with a module
|
|
||||||
declare namespace Mocha {
|
|
||||||
/** Partial interface for Mocha's `Runnable` class. */
|
|
||||||
interface IRunnable {
|
|
||||||
title: string;
|
|
||||||
fn: Function;
|
|
||||||
async: boolean;
|
|
||||||
sync: boolean;
|
|
||||||
timedOut: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Partial interface for Mocha's `Suite` class. */
|
|
||||||
interface ISuite {
|
|
||||||
parent: ISuite;
|
|
||||||
title: string;
|
|
||||||
|
|
||||||
fullTitle(): string;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Partial interface for Mocha's `Test` class. */
|
|
||||||
interface ITest extends IRunnable {
|
|
||||||
parent: ISuite;
|
|
||||||
pending: boolean;
|
|
||||||
|
|
||||||
fullTitle(): string;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Partial interface for Mocha's `Runner` class. */
|
|
||||||
interface IRunner {}
|
|
||||||
|
|
||||||
interface IContextDefinition {
|
|
||||||
(description: string, spec: () => void): ISuite;
|
|
||||||
only(description: string, spec: () => void): ISuite;
|
|
||||||
skip(description: string, spec: () => void): void;
|
|
||||||
timeout(ms: number): void;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface ITestDefinition {
|
|
||||||
(expectation: string, assertion?: () => void): ITest;
|
|
||||||
(expectation: string, assertion?: (done: MochaDone) => void): ITest;
|
|
||||||
only(expectation: string, assertion?: () => void): ITest;
|
|
||||||
only(expectation: string, assertion?: (done: MochaDone) => void): ITest;
|
|
||||||
skip(expectation: string, assertion?: () => void): void;
|
|
||||||
skip(expectation: string, assertion?: (done: MochaDone) => void): void;
|
|
||||||
timeout(ms: number): void;
|
|
||||||
}
|
|
||||||
|
|
||||||
export module reporters {
|
|
||||||
export class Base {
|
|
||||||
stats: {
|
|
||||||
suites: number;
|
|
||||||
tests: number;
|
|
||||||
passes: number;
|
|
||||||
pending: number;
|
|
||||||
failures: number;
|
|
||||||
};
|
|
||||||
|
|
||||||
constructor(runner: IRunner);
|
|
||||||
}
|
|
||||||
|
|
||||||
export class Doc extends Base {}
|
|
||||||
export class Dot extends Base {}
|
|
||||||
export class HTML extends Base {}
|
|
||||||
export class HTMLCov extends Base {}
|
|
||||||
export class JSON extends Base {}
|
|
||||||
export class JSONCov extends Base {}
|
|
||||||
export class JSONStream extends Base {}
|
|
||||||
export class Landing extends Base {}
|
|
||||||
export class List extends Base {}
|
|
||||||
export class Markdown extends Base {}
|
|
||||||
export class Min extends Base {}
|
|
||||||
export class Nyan extends Base {}
|
|
||||||
export class Progress extends Base {
|
|
||||||
/**
|
|
||||||
* @param options.open String used to indicate the start of the progress bar.
|
|
||||||
* @param options.complete String used to indicate a complete test on the progress bar.
|
|
||||||
* @param options.incomplete String used to indicate an incomplete test on the progress bar.
|
|
||||||
* @param options.close String used to indicate the end of the progress bar.
|
|
||||||
*/
|
|
||||||
constructor(runner: IRunner, options?: {
|
|
||||||
open?: string;
|
|
||||||
complete?: string;
|
|
||||||
incomplete?: string;
|
|
||||||
close?: string;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
export class Spec extends Base {}
|
|
||||||
export class TAP extends Base {}
|
|
||||||
export class XUnit extends Base {
|
|
||||||
constructor(runner: IRunner, options?: any);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module "mocha" {
|
|
||||||
export = Mocha;
|
|
||||||
}
|
|
|
@ -1,8 +0,0 @@
|
||||||
{
|
|
||||||
"resolution": "main",
|
|
||||||
"tree": {
|
|
||||||
"src": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/7de6c3dd94feaeb21f20054b9f30d5dabc5efabd/mocha/mocha.d.ts",
|
|
||||||
"raw": "registry:dt/mocha#2.2.5+20160317120654",
|
|
||||||
"typings": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/7de6c3dd94feaeb21f20054b9f30d5dabc5efabd/mocha/mocha.d.ts"
|
|
||||||
}
|
|
||||||
}
|
|
2382
typings/globals/node/index.d.ts
vendored
2382
typings/globals/node/index.d.ts
vendored
File diff suppressed because it is too large
Load diff
|
@ -1,8 +0,0 @@
|
||||||
{
|
|
||||||
"resolution": "main",
|
|
||||||
"tree": {
|
|
||||||
"src": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/9081e075b730c9948b643a6c38d6deb18cb0ebdd/node/node.d.ts",
|
|
||||||
"raw": "registry:dt/node#6.0.0+20160524002506",
|
|
||||||
"typings": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/9081e075b730c9948b643a6c38d6deb18cb0ebdd/node/node.d.ts"
|
|
||||||
}
|
|
||||||
}
|
|
79
typings/globals/serve-static/index.d.ts
vendored
79
typings/globals/serve-static/index.d.ts
vendored
|
@ -1,79 +0,0 @@
|
||||||
// Generated by typings
|
|
||||||
// Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/25fde56c8d1ba7aa5fb700e928f5413e047561f3/serve-static/serve-static.d.ts
|
|
||||||
declare module "serve-static" {
|
|
||||||
import * as express from "express-serve-static-core";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Create a new middleware function to serve files from within a given root directory.
|
|
||||||
* The file to serve will be determined by combining req.url with the provided root directory.
|
|
||||||
* When a file is not found, instead of sending a 404 response, this module will instead call next() to move on to the next middleware, allowing for stacking and fall-backs.
|
|
||||||
*/
|
|
||||||
function serveStatic(root: string, options?: {
|
|
||||||
/**
|
|
||||||
* Set how "dotfiles" are treated when encountered. A dotfile is a file or directory that begins with a dot (".").
|
|
||||||
* Note this check is done on the path itself without checking if the path actually exists on the disk.
|
|
||||||
* If root is specified, only the dotfiles above the root are checked (i.e. the root itself can be within a dotfile when when set to "deny").
|
|
||||||
* The default value is 'ignore'.
|
|
||||||
* 'allow' No special treatment for dotfiles
|
|
||||||
* 'deny' Send a 403 for any request for a dotfile
|
|
||||||
* 'ignore' Pretend like the dotfile does not exist and call next()
|
|
||||||
*/
|
|
||||||
dotfiles?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Enable or disable etag generation, defaults to true.
|
|
||||||
*/
|
|
||||||
etag?: boolean;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set file extension fallbacks. When set, if a file is not found, the given extensions will be added to the file name and search for.
|
|
||||||
* The first that exists will be served. Example: ['html', 'htm'].
|
|
||||||
* The default value is false.
|
|
||||||
*/
|
|
||||||
extensions?: string[];
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Let client errors fall-through as unhandled requests, otherwise forward a client error.
|
|
||||||
* The default value is false.
|
|
||||||
*/
|
|
||||||
fallthrough?: boolean;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* By default this module will send "index.html" files in response to a request on a directory.
|
|
||||||
* To disable this set false or to supply a new index pass a string or an array in preferred order.
|
|
||||||
*/
|
|
||||||
index?: boolean|string|string[];
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Enable or disable Last-Modified header, defaults to true. Uses the file system's last modified value.
|
|
||||||
*/
|
|
||||||
lastModified?: boolean;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Provide a max-age in milliseconds for http caching, defaults to 0. This can also be a string accepted by the ms module.
|
|
||||||
*/
|
|
||||||
maxAge?: number|string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Redirect to trailing "/" when the pathname is a dir. Defaults to true.
|
|
||||||
*/
|
|
||||||
redirect?: boolean;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Function to set custom headers on response. Alterations to the headers need to occur synchronously.
|
|
||||||
* The function is called as fn(res, path, stat), where the arguments are:
|
|
||||||
* res the response object
|
|
||||||
* path the file path that is being sent
|
|
||||||
* stat the stat object of the file that is being sent
|
|
||||||
*/
|
|
||||||
setHeaders?: (res: express.Response, path: string, stat: any) => any;
|
|
||||||
}): express.Handler;
|
|
||||||
|
|
||||||
import * as m from "mime";
|
|
||||||
|
|
||||||
namespace serveStatic {
|
|
||||||
var mime: typeof m;
|
|
||||||
}
|
|
||||||
|
|
||||||
export = serveStatic;
|
|
||||||
}
|
|
|
@ -1,8 +0,0 @@
|
||||||
{
|
|
||||||
"resolution": "main",
|
|
||||||
"tree": {
|
|
||||||
"src": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/25fde56c8d1ba7aa5fb700e928f5413e047561f3/serve-static/serve-static.d.ts",
|
|
||||||
"raw": "registry:dt/serve-static#0.0.0+20160501131543",
|
|
||||||
"typings": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/25fde56c8d1ba7aa5fb700e928f5413e047561f3/serve-static/serve-static.d.ts"
|
|
||||||
}
|
|
||||||
}
|
|
11
typings/index.d.ts
vendored
11
typings/index.d.ts
vendored
|
@ -1,11 +0,0 @@
|
||||||
/// <reference path="globals/body-parser/index.d.ts" />
|
|
||||||
/// <reference path="globals/express-serve-static-core/index.d.ts" />
|
|
||||||
/// <reference path="globals/express/index.d.ts" />
|
|
||||||
/// <reference path="globals/hapi/index.d.ts" />
|
|
||||||
/// <reference path="globals/koa/index.d.ts" />
|
|
||||||
/// <reference path="globals/mime/index.d.ts" />
|
|
||||||
/// <reference path="globals/mocha/index.d.ts" />
|
|
||||||
/// <reference path="globals/node/index.d.ts" />
|
|
||||||
/// <reference path="globals/serve-static/index.d.ts" />
|
|
||||||
/// <reference path="modules/chai/index.d.ts" />
|
|
||||||
/// <reference path="modules/graphql/index.d.ts" />
|
|
547
typings/modules/chai/index.d.ts
vendored
547
typings/modules/chai/index.d.ts
vendored
|
@ -1,547 +0,0 @@
|
||||||
// Generated by typings
|
|
||||||
// Source: https://raw.githubusercontent.com/typed-typings/npm-assertion-error/105841317bd2bdd5d110bfb763e49e482a77230d/main.d.ts
|
|
||||||
declare module '~chai~assertion-error/main' {
|
|
||||||
// Type definitions for assertion-error 1.0.0
|
|
||||||
// Project: https://github.com/chaijs/assertion-error
|
|
||||||
// Definitions by: Bart van der Schoor <https://github.com/Bartvds>
|
|
||||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
|
||||||
|
|
||||||
export class AssertionError implements Error {
|
|
||||||
constructor(message: string, props?: any, ssf?: Function);
|
|
||||||
public name: string;
|
|
||||||
public message: string;
|
|
||||||
public showDiff: boolean;
|
|
||||||
public stack: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Allow errors to be converted to JSON for static transfer.
|
|
||||||
*
|
|
||||||
* @param {Boolean} include stack (default: `true`)
|
|
||||||
* @return {Object} object that can be `JSON.stringify`
|
|
||||||
*/
|
|
||||||
public toJSON(stack: boolean): Object;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
declare module '~chai~assertion-error' {
|
|
||||||
import alias = require('~chai~assertion-error/main');
|
|
||||||
export = alias;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Generated by typings
|
|
||||||
// Source: https://raw.githubusercontent.com/typed-typings/npm-chai/793bee097a6a644e078a033603d88ac89eb7b560/lib/Assert.d.ts
|
|
||||||
declare module '~chai/lib/Assert' {
|
|
||||||
export interface AssertStatic extends Assert {
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface Assert {
|
|
||||||
/**
|
|
||||||
* @param expression Expression to test for truthiness.
|
|
||||||
* @param message Message to display on error.
|
|
||||||
*/
|
|
||||||
(expression: any, message?: string): void;
|
|
||||||
(expression: any, messageCallback: () => string): void;
|
|
||||||
|
|
||||||
fail(actual?: any, expected?: any, msg?: string, operator?: string): void;
|
|
||||||
|
|
||||||
ok(val: any, msg?: string): void;
|
|
||||||
isOk(val: any, msg?: string): void;
|
|
||||||
notOk(val: any, msg?: string): void;
|
|
||||||
isNotOk(val: any, msg?: string): void;
|
|
||||||
|
|
||||||
equal(act: any, exp: any, msg?: string): void;
|
|
||||||
notEqual(act: any, exp: any, msg?: string): void;
|
|
||||||
|
|
||||||
strictEqual(act: any, exp: any, msg?: string): void;
|
|
||||||
notStrictEqual(act: any, exp: any, msg?: string): void;
|
|
||||||
|
|
||||||
deepEqual(act: any, exp: any, msg?: string): void;
|
|
||||||
notDeepEqual(act: any, exp: any, msg?: string): void;
|
|
||||||
|
|
||||||
isTrue(val: any, msg?: string): void;
|
|
||||||
isFalse(val: any, msg?: string): void;
|
|
||||||
|
|
||||||
isNotTrue(val: any, msg?: string): void;
|
|
||||||
isNotFalse(val: any, msg?: string): void;
|
|
||||||
|
|
||||||
isNull(val: any, msg?: string): void;
|
|
||||||
isNotNull(val: any, msg?: string): void;
|
|
||||||
|
|
||||||
isUndefined(val: any, msg?: string): void;
|
|
||||||
isDefined(val: any, msg?: string): void;
|
|
||||||
|
|
||||||
isNaN(val: any, msg?: string): void;
|
|
||||||
isNotNaN(val: any, msg?: string): void;
|
|
||||||
|
|
||||||
isAbove(val: number, abv: number, msg?: string): void;
|
|
||||||
isBelow(val: number, blw: number, msg?: string): void;
|
|
||||||
|
|
||||||
isAtLeast(val: number, atlst: number, msg?: string): void;
|
|
||||||
isAtMost(val: number, atmst: number, msg?: string): void;
|
|
||||||
|
|
||||||
isFunction(val: any, msg?: string): void;
|
|
||||||
isNotFunction(val: any, msg?: string): void;
|
|
||||||
|
|
||||||
isObject(val: any, msg?: string): void;
|
|
||||||
isNotObject(val: any, msg?: string): void;
|
|
||||||
|
|
||||||
isArray(val: any, msg?: string): void;
|
|
||||||
isNotArray(val: any, msg?: string): void;
|
|
||||||
|
|
||||||
isString(val: any, msg?: string): void;
|
|
||||||
isNotString(val: any, msg?: string): void;
|
|
||||||
|
|
||||||
isNumber(val: any, msg?: string): void;
|
|
||||||
isNotNumber(val: any, msg?: string): void;
|
|
||||||
|
|
||||||
isBoolean(val: any, msg?: string): void;
|
|
||||||
isNotBoolean(val: any, msg?: string): void;
|
|
||||||
|
|
||||||
typeOf(val: any, type: string, msg?: string): void;
|
|
||||||
notTypeOf(val: any, type: string, msg?: string): void;
|
|
||||||
|
|
||||||
instanceOf(val: any, type: Function, msg?: string): void;
|
|
||||||
notInstanceOf(val: any, type: Function, msg?: string): void;
|
|
||||||
|
|
||||||
include(exp: string, inc: any, msg?: string): void;
|
|
||||||
include(exp: any[], inc: any, msg?: string): void;
|
|
||||||
include(exp: Object, inc: Object, msg?: string): void;
|
|
||||||
|
|
||||||
notInclude(exp: string, inc: any, msg?: string): void;
|
|
||||||
notInclude(exp: any[], inc: any, msg?: string): void;
|
|
||||||
|
|
||||||
match(exp: any, re: RegExp, msg?: string): void;
|
|
||||||
notMatch(exp: any, re: RegExp, msg?: string): void;
|
|
||||||
|
|
||||||
property(obj: Object, prop: string, msg?: string): void;
|
|
||||||
notProperty(obj: Object, prop: string, msg?: string): void;
|
|
||||||
deepProperty(obj: Object, prop: string, msg?: string): void;
|
|
||||||
notDeepProperty(obj: Object, prop: string, msg?: string): void;
|
|
||||||
|
|
||||||
propertyVal(obj: Object, prop: string, val: any, msg?: string): void;
|
|
||||||
propertyNotVal(obj: Object, prop: string, val: any, msg?: string): void;
|
|
||||||
|
|
||||||
deepPropertyVal(obj: Object, prop: string, val: any, msg?: string): void;
|
|
||||||
deepPropertyNotVal(obj: Object, prop: string, val: any, msg?: string): void;
|
|
||||||
|
|
||||||
lengthOf(exp: any, len: number, msg?: string): void;
|
|
||||||
|
|
||||||
throw(fn: Function, msg?: string): void;
|
|
||||||
throw(fn: Function, regExp: RegExp): void;
|
|
||||||
throw(fn: Function, errType: Function, msg?: string): void;
|
|
||||||
throw(fn: Function, errType: Function, regExp: RegExp): void;
|
|
||||||
|
|
||||||
throws(fn: Function, msg?: string): void;
|
|
||||||
throws(fn: Function, regExp: RegExp): void;
|
|
||||||
throws(fn: Function, errType: Function, msg?: string): void;
|
|
||||||
throws(fn: Function, errType: Function, regExp: RegExp): void;
|
|
||||||
|
|
||||||
Throw(fn: Function, msg?: string): void;
|
|
||||||
Throw(fn: Function, regExp: RegExp): void;
|
|
||||||
Throw(fn: Function, errType: Function, msg?: string): void;
|
|
||||||
Throw(fn: Function, errType: Function, regExp: RegExp): void;
|
|
||||||
|
|
||||||
doesNotThrow(fn: Function, msg?: string): void;
|
|
||||||
doesNotThrow(fn: Function, regExp: RegExp): void;
|
|
||||||
doesNotThrow(fn: Function, errType: Function, msg?: string): void;
|
|
||||||
doesNotThrow(fn: Function, errType: Function, regExp: RegExp): void;
|
|
||||||
|
|
||||||
operator(val: any, operator: string, val2: any, msg?: string): void;
|
|
||||||
closeTo(act: number, exp: number, delta: number, msg?: string): void;
|
|
||||||
approximately(act: number, exp: number, delta: number, msg?: string): void;
|
|
||||||
|
|
||||||
sameMembers(set1: any[], set2: any[], msg?: string): void;
|
|
||||||
sameDeepMembers(set1: any[], set2: any[], msg?: string): void;
|
|
||||||
includeMembers(superset: any[], subset: any[], msg?: string): void;
|
|
||||||
includeDeepMembers(superset: any[], subset: any[], msg?: string): void;
|
|
||||||
|
|
||||||
ifError(val: any, msg?: string): void;
|
|
||||||
|
|
||||||
isExtensible(obj: {}, msg?: string): void;
|
|
||||||
extensible(obj: {}, msg?: string): void;
|
|
||||||
isNotExtensible(obj: {}, msg?: string): void;
|
|
||||||
notExtensible(obj: {}, msg?: string): void;
|
|
||||||
|
|
||||||
isSealed(obj: {}, msg?: string): void;
|
|
||||||
sealed(obj: {}, msg?: string): void;
|
|
||||||
isNotSealed(obj: {}, msg?: string): void;
|
|
||||||
notSealed(obj: {}, msg?: string): void;
|
|
||||||
|
|
||||||
isFrozen(obj: Object, msg?: string): void;
|
|
||||||
frozen(obj: Object, msg?: string): void;
|
|
||||||
isNotFrozen(obj: Object, msg?: string): void;
|
|
||||||
notFrozen(obj: Object, msg?: string): void;
|
|
||||||
|
|
||||||
oneOf(inList: any, list: any[], msg?: string): void;
|
|
||||||
|
|
||||||
changes(fn: Function, obj: {}, property: string): void;
|
|
||||||
doesNotChange(fn: Function, obj: {}, property: string): void;
|
|
||||||
increases(fn: Function, obj: {}, property: string): void;
|
|
||||||
doesNotIncrease(fn: Function, obj: {}, property: string): void;
|
|
||||||
|
|
||||||
decreases(fn: Function, obj: {}, property: string): void;
|
|
||||||
doesNotDecrease(fn: Function, obj: {}, property: string): void;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
declare module 'chai/lib/Assert' {
|
|
||||||
import alias = require('~chai/lib/Assert');
|
|
||||||
export = alias;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Generated by typings
|
|
||||||
// Source: https://raw.githubusercontent.com/typed-typings/npm-chai/793bee097a6a644e078a033603d88ac89eb7b560/lib/Assertion.d.ts
|
|
||||||
declare module '~chai/lib/Assertion' {
|
|
||||||
export interface AssertionStatic {
|
|
||||||
(target?: any, message?: string, stack?: Function): Assertion;
|
|
||||||
new (target?: any, message?: string, stack?: Function): Assertion;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface Assertion extends LanguageChains, NumericComparison, TypeComparison {
|
|
||||||
not: Assertion;
|
|
||||||
deep: Deep;
|
|
||||||
any: KeyFilter;
|
|
||||||
all: KeyFilter;
|
|
||||||
a: TypeComparison;
|
|
||||||
an: TypeComparison;
|
|
||||||
include: Include;
|
|
||||||
includes: Include;
|
|
||||||
contain: Include;
|
|
||||||
contains: Include;
|
|
||||||
ok: Assertion;
|
|
||||||
true: Assertion;
|
|
||||||
false: Assertion;
|
|
||||||
null: Assertion;
|
|
||||||
undefined: Assertion;
|
|
||||||
NaN: Assertion;
|
|
||||||
exist: Assertion;
|
|
||||||
empty: Assertion;
|
|
||||||
arguments: Assertion;
|
|
||||||
Arguments: Assertion;
|
|
||||||
equal: Equal;
|
|
||||||
equals: Equal;
|
|
||||||
eq: Equal;
|
|
||||||
eql: Equal;
|
|
||||||
eqls: Equal;
|
|
||||||
property: Property;
|
|
||||||
ownProperty: OwnProperty;
|
|
||||||
haveOwnProperty: OwnProperty;
|
|
||||||
ownPropertyDescriptor: OwnPropertyDescriptor;
|
|
||||||
haveOwnPropertyDescriptor: OwnPropertyDescriptor;
|
|
||||||
length: Length;
|
|
||||||
lengthOf: Length;
|
|
||||||
match: Match;
|
|
||||||
matches: Match;
|
|
||||||
string(str: string, message?: string): Assertion;
|
|
||||||
keys: Keys;
|
|
||||||
key(str: string): Assertion;
|
|
||||||
throw: Throw;
|
|
||||||
throws: Throw;
|
|
||||||
Throw: Throw;
|
|
||||||
respondTo: RespondTo;
|
|
||||||
respondsTo: RespondTo;
|
|
||||||
itself: Assertion;
|
|
||||||
satisfy: Satisfy;
|
|
||||||
satisfies: Satisfy;
|
|
||||||
closeTo: CloseTo;
|
|
||||||
approximately: CloseTo;
|
|
||||||
members: Members;
|
|
||||||
increase: PropertyChange;
|
|
||||||
increases: PropertyChange;
|
|
||||||
decrease: PropertyChange;
|
|
||||||
decreases: PropertyChange;
|
|
||||||
change: PropertyChange;
|
|
||||||
changes: PropertyChange;
|
|
||||||
extensible: Assertion;
|
|
||||||
sealed: Assertion;
|
|
||||||
frozen: Assertion;
|
|
||||||
oneOf(list: any[], message?: string): Assertion;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface LanguageChains {
|
|
||||||
to: Assertion;
|
|
||||||
be: Assertion;
|
|
||||||
been: Assertion;
|
|
||||||
is: Assertion;
|
|
||||||
that: Assertion;
|
|
||||||
which: Assertion;
|
|
||||||
and: Assertion;
|
|
||||||
has: Assertion;
|
|
||||||
have: Assertion;
|
|
||||||
with: Assertion;
|
|
||||||
at: Assertion;
|
|
||||||
of: Assertion;
|
|
||||||
same: Assertion;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface NumericComparison {
|
|
||||||
above: NumberComparer;
|
|
||||||
gt: NumberComparer;
|
|
||||||
greaterThan: NumberComparer;
|
|
||||||
least: NumberComparer;
|
|
||||||
gte: NumberComparer;
|
|
||||||
below: NumberComparer;
|
|
||||||
lt: NumberComparer;
|
|
||||||
lessThan: NumberComparer;
|
|
||||||
most: NumberComparer;
|
|
||||||
lte: NumberComparer;
|
|
||||||
within(start: number, finish: number, message?: string): Assertion;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface NumberComparer {
|
|
||||||
(value: number, message?: string): Assertion;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface TypeComparison {
|
|
||||||
(type: string, message?: string): Assertion;
|
|
||||||
instanceof: InstanceOf;
|
|
||||||
instanceOf: InstanceOf;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface InstanceOf {
|
|
||||||
(constructor: Object, message?: string): Assertion;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface CloseTo {
|
|
||||||
(expected: number, delta: number, message?: string): Assertion;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface Deep {
|
|
||||||
equal: Equal;
|
|
||||||
equals: Equal;
|
|
||||||
eq: Equal;
|
|
||||||
include: Include;
|
|
||||||
property: Property;
|
|
||||||
members: Members;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface KeyFilter {
|
|
||||||
keys: Keys;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface Equal {
|
|
||||||
(value: any, message?: string): Assertion;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface Property {
|
|
||||||
(name: string, value?: any, message?: string): Assertion;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface OwnProperty {
|
|
||||||
(name: string, message?: string): Assertion;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface OwnPropertyDescriptor {
|
|
||||||
(name: string, descriptor: PropertyDescriptor, message?: string): Assertion;
|
|
||||||
(name: string, message?: string): Assertion;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface Length extends LanguageChains, NumericComparison {
|
|
||||||
(length: number, message?: string): Assertion;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface Include {
|
|
||||||
(value: Object, message?: string): Assertion;
|
|
||||||
(value: string, message?: string): Assertion;
|
|
||||||
(value: number, message?: string): Assertion;
|
|
||||||
string(value: string, message?: string): Assertion;
|
|
||||||
keys: Keys;
|
|
||||||
members: Members;
|
|
||||||
any: KeyFilter;
|
|
||||||
all: KeyFilter;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface Match {
|
|
||||||
(regexp: RegExp | string, message?: string): Assertion;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface Keys {
|
|
||||||
(...keys: any[]): Assertion;
|
|
||||||
(keys: any[]): Assertion;
|
|
||||||
(keys: Object): Assertion;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface Throw {
|
|
||||||
(): Assertion;
|
|
||||||
(expected: string, message?: string): Assertion;
|
|
||||||
(expected: RegExp, message?: string): Assertion;
|
|
||||||
(constructor: Error, expected?: string, message?: string): Assertion;
|
|
||||||
(constructor: Error, expected?: RegExp, message?: string): Assertion;
|
|
||||||
(constructor: Function, expected?: string, message?: string): Assertion;
|
|
||||||
(constructor: Function, expected?: RegExp, message?: string): Assertion;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface RespondTo {
|
|
||||||
(method: string, message?: string): Assertion;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface Satisfy {
|
|
||||||
(matcher: Function, message?: string): Assertion;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface Members {
|
|
||||||
(set: any[], message?: string): Assertion;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface PropertyChange {
|
|
||||||
(object: Object, prop: string, msg?: string): Assertion;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
declare module 'chai/lib/Assertion' {
|
|
||||||
import alias = require('~chai/lib/Assertion');
|
|
||||||
export = alias;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Generated by typings
|
|
||||||
// Source: https://raw.githubusercontent.com/typed-typings/npm-chai/793bee097a6a644e078a033603d88ac89eb7b560/lib/Expect.d.ts
|
|
||||||
declare module '~chai/lib/Expect' {
|
|
||||||
import {AssertionStatic} from '~chai/lib/Assertion';
|
|
||||||
|
|
||||||
export interface ExpectStatic extends AssertionStatic {
|
|
||||||
fail(actual?: any, expected?: any, message?: string, operator?: string): void;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
declare module 'chai/lib/Expect' {
|
|
||||||
import alias = require('~chai/lib/Expect');
|
|
||||||
export = alias;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Generated by typings
|
|
||||||
// Source: https://raw.githubusercontent.com/typed-typings/npm-chai/793bee097a6a644e078a033603d88ac89eb7b560/lib/Should.d.ts
|
|
||||||
declare module '~chai/lib/Should' {
|
|
||||||
export interface Should extends ShouldAssertion {
|
|
||||||
not: ShouldAssertion;
|
|
||||||
fail(actual: any, expected: any, message?: string, operator?: string): void;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface ShouldAssertion {
|
|
||||||
Throw: ShouldThrow;
|
|
||||||
throw: ShouldThrow;
|
|
||||||
equal(value1: any, value2: any, message?: string): void;
|
|
||||||
exist(value: any, message?: string): void;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface ShouldThrow {
|
|
||||||
(actual: Function): void;
|
|
||||||
(actual: Function, expected: string | RegExp, message?: string): void;
|
|
||||||
(actual: Function, constructor: Error | Function, expected?: string | RegExp, message?: string): void;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
declare module 'chai/lib/Should' {
|
|
||||||
import alias = require('~chai/lib/Should');
|
|
||||||
export = alias;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Generated by typings
|
|
||||||
// Source: https://raw.githubusercontent.com/typed-typings/npm-chai/793bee097a6a644e078a033603d88ac89eb7b560/lib/Config.d.ts
|
|
||||||
declare module '~chai/lib/Config' {
|
|
||||||
export interface Config {
|
|
||||||
includeStack: boolean;
|
|
||||||
showDiff: boolean;
|
|
||||||
truncateThreshold: number;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
declare module 'chai/lib/Config' {
|
|
||||||
import alias = require('~chai/lib/Config');
|
|
||||||
export = alias;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Generated by typings
|
|
||||||
// Source: https://raw.githubusercontent.com/typed-typings/npm-chai/793bee097a6a644e078a033603d88ac89eb7b560/lib/Utils.d.ts
|
|
||||||
declare module '~chai/lib/Utils' {
|
|
||||||
import {Assertion} from '~chai/lib/Assertion';
|
|
||||||
|
|
||||||
export interface PathInfo {
|
|
||||||
parent: any;
|
|
||||||
name: number|string;
|
|
||||||
value: any;
|
|
||||||
exists: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface Utils {
|
|
||||||
addChainableMethod(ctx: any, name: string, chainingBehavior: (value: any) => void): void;
|
|
||||||
addMethod(ctx: any, name: string, method: (value: any) => void): void;
|
|
||||||
addProperty(ctx: any, name: string, getter: () => void): void;
|
|
||||||
expectTypes(obj: Object, types: string[]): void;
|
|
||||||
flag(obj: Object, key: string, value?: any): any;
|
|
||||||
getActual(obj: Object, actual?: any): any;
|
|
||||||
getEnumerableProperties(obj: Object): string[];
|
|
||||||
getMessage(obj: Object, params: any[]): string;
|
|
||||||
getMessage(obj: Object, message: string, negateMessage: string): string;
|
|
||||||
getName(func: Function): string;
|
|
||||||
getPathInfo(path: string, obj: Object): PathInfo;
|
|
||||||
getPathValue(path: string, obj: Object): any;
|
|
||||||
getProperties(obj: Object): string[];
|
|
||||||
hasProperty(obj: Object, name: string): boolean;
|
|
||||||
transferFlags(assertion: Assertion | any, obj: Object, includeAll?: boolean): void;
|
|
||||||
inspect(obj: any): any;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
declare module 'chai/lib/Utils' {
|
|
||||||
import alias = require('~chai/lib/Utils');
|
|
||||||
export = alias;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Generated by typings
|
|
||||||
// Source: https://raw.githubusercontent.com/typed-typings/npm-chai/793bee097a6a644e078a033603d88ac89eb7b560/lib/Chai.d.ts
|
|
||||||
declare module '~chai/lib/Chai' {
|
|
||||||
import * as AE from '~chai~assertion-error';
|
|
||||||
|
|
||||||
import * as Assert from '~chai/lib/Assert';
|
|
||||||
import * as A from '~chai/lib/Assertion';
|
|
||||||
import * as Expect from '~chai/lib/Expect';
|
|
||||||
import * as Should from '~chai/lib/Should';
|
|
||||||
import * as Config from '~chai/lib/Config';
|
|
||||||
import * as Utils from '~chai/lib/Utils';
|
|
||||||
|
|
||||||
namespace chai {
|
|
||||||
export interface AssertionStatic extends A.AssertionStatic {}
|
|
||||||
export class AssertionError extends AE.AssertionError {}
|
|
||||||
export var Assertion: A.AssertionStatic;
|
|
||||||
export var expect: Expect.ExpectStatic;
|
|
||||||
export var assert: Assert.AssertStatic;
|
|
||||||
export var config: Config.Config;
|
|
||||||
export var util: Utils.Utils;
|
|
||||||
export function should(): Should.Should;
|
|
||||||
export function Should(): Should.Should;
|
|
||||||
/**
|
|
||||||
* Provides a way to extend the internals of Chai
|
|
||||||
*/
|
|
||||||
export function use(fn: (chai: any, utils: Utils.Utils) => void): typeof chai;
|
|
||||||
}
|
|
||||||
|
|
||||||
export = chai;
|
|
||||||
|
|
||||||
/* tslint:disable:no-internal-module */
|
|
||||||
global {
|
|
||||||
interface Object {
|
|
||||||
should: A.Assertion;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
declare module 'chai/lib/Chai' {
|
|
||||||
import alias = require('~chai/lib/Chai');
|
|
||||||
export = alias;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Generated by typings
|
|
||||||
// Source: https://raw.githubusercontent.com/typed-typings/npm-chai/793bee097a6a644e078a033603d88ac89eb7b560/index.d.ts
|
|
||||||
declare module '~chai/index' {
|
|
||||||
// Type definitions for chai 3.4.0
|
|
||||||
// Project: http://chaijs.com/
|
|
||||||
// Original Definitions by: Jed Mao <https://github.com/jedmao/>,
|
|
||||||
// Bart van der Schoor <https://github.com/Bartvds>,
|
|
||||||
// Andrew Brown <https://github.com/AGBrown>,
|
|
||||||
// Olivier Chevet <https://github.com/olivr70>,
|
|
||||||
// Matt Wistrand <https://github.com/mwistrand>
|
|
||||||
|
|
||||||
import chai = require('~chai/lib/Chai');
|
|
||||||
|
|
||||||
export = chai;
|
|
||||||
}
|
|
||||||
declare module 'chai/index' {
|
|
||||||
import alias = require('~chai/index');
|
|
||||||
export = alias;
|
|
||||||
}
|
|
||||||
declare module 'chai' {
|
|
||||||
import alias = require('~chai/index');
|
|
||||||
export = alias;
|
|
||||||
}
|
|
|
@ -1,21 +0,0 @@
|
||||||
{
|
|
||||||
"resolution": "main",
|
|
||||||
"tree": {
|
|
||||||
"src": "https://raw.githubusercontent.com/typed-typings/npm-chai/793bee097a6a644e078a033603d88ac89eb7b560/typings.json",
|
|
||||||
"raw": "registry:npm/chai#3.5.0+20160415060238",
|
|
||||||
"main": "index.d.ts",
|
|
||||||
"global": false,
|
|
||||||
"dependencies": {
|
|
||||||
"assertion-error": {
|
|
||||||
"src": "https://raw.githubusercontent.com/typed-typings/npm-assertion-error/105841317bd2bdd5d110bfb763e49e482a77230d/typings.json",
|
|
||||||
"raw": "github:typed-typings/npm-assertion-error#105841317bd2bdd5d110bfb763e49e482a77230d",
|
|
||||||
"main": "main.d.ts",
|
|
||||||
"global": false,
|
|
||||||
"name": "assertion-error",
|
|
||||||
"type": "typings"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"name": "chai",
|
|
||||||
"type": "typings"
|
|
||||||
}
|
|
||||||
}
|
|
957
typings/modules/graphql/index.d.ts
vendored
957
typings/modules/graphql/index.d.ts
vendored
|
@ -1,957 +0,0 @@
|
||||||
// Generated by typings
|
|
||||||
// Source: https://raw.githubusercontent.com/nitintutlani/typed-graphql/master/graphql.d.ts
|
|
||||||
declare module '~graphql/graphql' {
|
|
||||||
|
|
||||||
// graphql.js
|
|
||||||
|
|
||||||
export function graphql(
|
|
||||||
schema: GraphQLSchema,
|
|
||||||
requestString: string,
|
|
||||||
rootValue?: any,
|
|
||||||
contextValue?: any,
|
|
||||||
variableValues?: { [key: string]: any },
|
|
||||||
operationName?: string
|
|
||||||
): Promise<GraphQLResult>;
|
|
||||||
|
|
||||||
interface GraphQLResult {
|
|
||||||
data?: any;
|
|
||||||
errors?: Array<GraphQLError>;
|
|
||||||
}
|
|
||||||
|
|
||||||
// error/*.js
|
|
||||||
|
|
||||||
class GraphQLError extends Error {
|
|
||||||
constructor(
|
|
||||||
message: string,
|
|
||||||
nodes?: Array<any>,
|
|
||||||
stack?: string,
|
|
||||||
source?: Source,
|
|
||||||
positions?: Array<number>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
export function formatError(error: GraphQLError): GraphQLFormattedError;
|
|
||||||
|
|
||||||
interface GraphQLFormattedError {
|
|
||||||
message: string,
|
|
||||||
locations: Array<GraphQLErrorLocation>
|
|
||||||
}
|
|
||||||
|
|
||||||
interface GraphQLErrorLocation {
|
|
||||||
line: number,
|
|
||||||
column: number
|
|
||||||
}
|
|
||||||
|
|
||||||
function locatedError(originalError: Error, nodes: Array<any>): GraphQLError;
|
|
||||||
|
|
||||||
function syntaxError(source: Source, position: number, description: string): GraphQLError;
|
|
||||||
|
|
||||||
// execution/*.js
|
|
||||||
|
|
||||||
interface ExecutionContext {
|
|
||||||
schema: GraphQLSchema;
|
|
||||||
fragments: {[key: string]: FragmentDefinition};
|
|
||||||
rootValue: any;
|
|
||||||
operation: OperationDefinition;
|
|
||||||
variableValues: {[key: string]: any};
|
|
||||||
errors: Array<GraphQLError>;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface ExecutionResult {
|
|
||||||
data: any;
|
|
||||||
errors?: Array<GraphQLError>;
|
|
||||||
}
|
|
||||||
|
|
||||||
function execute(
|
|
||||||
schema: GraphQLSchema,
|
|
||||||
documentAST: Document,
|
|
||||||
rootValue?: any,
|
|
||||||
contextValue?: any,
|
|
||||||
variableValues?: {[key: string]: any},
|
|
||||||
operationName?: string
|
|
||||||
): Promise<ExecutionResult>;
|
|
||||||
|
|
||||||
function getVariableValues(
|
|
||||||
schema: GraphQLSchema,
|
|
||||||
definitionASTs: Array<VariableDefinition>,
|
|
||||||
inputs: { [key: string]: any }
|
|
||||||
): { [key: string]: any };
|
|
||||||
|
|
||||||
function getArgumentValues(
|
|
||||||
argDefs: Array<GraphQLArgument>,
|
|
||||||
argASTs: Array<Argument>,
|
|
||||||
variableValues: { [key: string]: any }
|
|
||||||
): { [key: string]: any };
|
|
||||||
|
|
||||||
// validation/*.js
|
|
||||||
|
|
||||||
function validate(
|
|
||||||
schema: GraphQLSchema,
|
|
||||||
ast: Document,
|
|
||||||
rules?: Array<any>
|
|
||||||
): Array<GraphQLError>;
|
|
||||||
|
|
||||||
// jsutils/*.js
|
|
||||||
|
|
||||||
function find<T>(list: Array<T>, predicate: (item: T) => boolean): T;
|
|
||||||
function invariant(condition: any, message: string): void;
|
|
||||||
function isNullish(value: any): boolean;
|
|
||||||
function keyMap<T>(
|
|
||||||
list: Array<T>,
|
|
||||||
keyFn: (item: T) => string
|
|
||||||
): {[key: string]: T};
|
|
||||||
function keyValMap<T, V>(
|
|
||||||
list: Array<T>,
|
|
||||||
keyFn: (item: T) => string,
|
|
||||||
valFn: (item: T) => V
|
|
||||||
): {[key: string]: V}
|
|
||||||
|
|
||||||
// language/ast.js
|
|
||||||
interface Location {
|
|
||||||
start: number;
|
|
||||||
end: number;
|
|
||||||
source?: Source
|
|
||||||
}
|
|
||||||
|
|
||||||
type Node = Name
|
|
||||||
| Document
|
|
||||||
| OperationDefinition
|
|
||||||
| VariableDefinition
|
|
||||||
| Variable
|
|
||||||
| SelectionSet
|
|
||||||
| Field
|
|
||||||
| Argument
|
|
||||||
| FragmentSpread
|
|
||||||
| InlineFragment
|
|
||||||
| FragmentDefinition
|
|
||||||
| IntValue
|
|
||||||
| FloatValue
|
|
||||||
| StringValue
|
|
||||||
| BooleanValue
|
|
||||||
| EnumValue
|
|
||||||
| ListValue
|
|
||||||
| ObjectValue
|
|
||||||
| ObjectField
|
|
||||||
| Directive
|
|
||||||
| ListType
|
|
||||||
| NonNullType
|
|
||||||
| ObjectTypeDefinition
|
|
||||||
| FieldDefinition
|
|
||||||
| InputValueDefinition
|
|
||||||
| InterfaceTypeDefinition
|
|
||||||
| UnionTypeDefinition
|
|
||||||
| ScalarTypeDefinition
|
|
||||||
| EnumTypeDefinition
|
|
||||||
| EnumValueDefinition
|
|
||||||
| InputObjectTypeDefinition
|
|
||||||
| TypeExtensionDefinition;
|
|
||||||
|
|
||||||
interface Name {
|
|
||||||
kind: string;
|
|
||||||
loc?: Location;
|
|
||||||
value: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface Document {
|
|
||||||
kind: string;
|
|
||||||
loc?: Location;
|
|
||||||
definitions: Array<Definition>;
|
|
||||||
}
|
|
||||||
|
|
||||||
type Definition = OperationDefinition
|
|
||||||
| FragmentDefinition
|
|
||||||
| TypeDefinition;
|
|
||||||
|
|
||||||
interface OperationDefinition {
|
|
||||||
kind: string;
|
|
||||||
loc?: Location;
|
|
||||||
// Note: subscription is an experimental non-spec addition.
|
|
||||||
operation: string;
|
|
||||||
name?: Name;
|
|
||||||
variableDefinitions?: Array<VariableDefinition>;
|
|
||||||
directives?: Array<Directive>;
|
|
||||||
selectionSet: SelectionSet;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface VariableDefinition {
|
|
||||||
kind: string;
|
|
||||||
loc?: Location;
|
|
||||||
variable: Variable;
|
|
||||||
type: Type;
|
|
||||||
defaultValue?: Value;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface Variable {
|
|
||||||
kind: string;
|
|
||||||
loc?: Location;
|
|
||||||
name: Name;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface SelectionSet {
|
|
||||||
kind: string;
|
|
||||||
loc?: Location;
|
|
||||||
selections: Array<Selection>;
|
|
||||||
}
|
|
||||||
|
|
||||||
type Selection = Field
|
|
||||||
| FragmentSpread
|
|
||||||
| InlineFragment;
|
|
||||||
|
|
||||||
interface Field {
|
|
||||||
kind: string;
|
|
||||||
loc?: Location;
|
|
||||||
alias?: Name;
|
|
||||||
name: Name;
|
|
||||||
arguments?: Array<Argument>;
|
|
||||||
directives?: Array<Directive>;
|
|
||||||
selectionSet?: SelectionSet;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface Argument {
|
|
||||||
kind: string;
|
|
||||||
loc?: Location;
|
|
||||||
name: Name;
|
|
||||||
value: Value;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Fragments
|
|
||||||
|
|
||||||
interface FragmentSpread {
|
|
||||||
kind: string;
|
|
||||||
loc?: Location;
|
|
||||||
name: Name;
|
|
||||||
directives?: Array<Directive>;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface InlineFragment {
|
|
||||||
kind: string;
|
|
||||||
loc?: Location;
|
|
||||||
typeCondition?: NamedType;
|
|
||||||
directives?: Array<Directive>;
|
|
||||||
selectionSet: SelectionSet;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface FragmentDefinition {
|
|
||||||
kind: string;
|
|
||||||
loc?: Location;
|
|
||||||
name: Name;
|
|
||||||
typeCondition: NamedType;
|
|
||||||
directives?: Array<Directive>;
|
|
||||||
selectionSet: SelectionSet;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Values
|
|
||||||
|
|
||||||
type Value = Variable
|
|
||||||
| IntValue
|
|
||||||
| FloatValue
|
|
||||||
| StringValue
|
|
||||||
| BooleanValue
|
|
||||||
| EnumValue
|
|
||||||
| ListValue
|
|
||||||
| ObjectValue;
|
|
||||||
|
|
||||||
interface IntValue {
|
|
||||||
kind: string;
|
|
||||||
loc?: Location;
|
|
||||||
value: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface FloatValue {
|
|
||||||
kind: string;
|
|
||||||
loc?: Location;
|
|
||||||
value: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface StringValue {
|
|
||||||
kind: string;
|
|
||||||
loc?: Location;
|
|
||||||
value: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface BooleanValue {
|
|
||||||
kind: string;
|
|
||||||
loc?: Location;
|
|
||||||
value: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface EnumValue {
|
|
||||||
kind: string;
|
|
||||||
loc?: Location;
|
|
||||||
value: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface ListValue {
|
|
||||||
kind: string;
|
|
||||||
loc?: Location;
|
|
||||||
values: Array<Value>;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface ObjectValue {
|
|
||||||
kind: string;
|
|
||||||
loc?: Location;
|
|
||||||
fields: Array<ObjectField>;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface ObjectField {
|
|
||||||
kind: string;
|
|
||||||
loc?: Location;
|
|
||||||
name: Name;
|
|
||||||
value: Value;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Directives
|
|
||||||
|
|
||||||
interface Directive {
|
|
||||||
kind: string;
|
|
||||||
loc?: Location;
|
|
||||||
name: Name;
|
|
||||||
arguments?: Array<Argument>;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Type Reference
|
|
||||||
|
|
||||||
type Type = NamedType
|
|
||||||
| ListType
|
|
||||||
| NonNullType;
|
|
||||||
|
|
||||||
interface NamedType {
|
|
||||||
kind: string;
|
|
||||||
loc?: Location;
|
|
||||||
name: Name;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface ListType {
|
|
||||||
kind: string;
|
|
||||||
loc?: Location;
|
|
||||||
type: Type;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface NonNullType {
|
|
||||||
kind: string;
|
|
||||||
loc?: Location;
|
|
||||||
type: NamedType | ListType;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Type Definition
|
|
||||||
|
|
||||||
type TypeDefinition = ObjectTypeDefinition
|
|
||||||
| InterfaceTypeDefinition
|
|
||||||
| UnionTypeDefinition
|
|
||||||
| ScalarTypeDefinition
|
|
||||||
| EnumTypeDefinition
|
|
||||||
| InputObjectTypeDefinition
|
|
||||||
| TypeExtensionDefinition;
|
|
||||||
|
|
||||||
interface ObjectTypeDefinition {
|
|
||||||
kind: string;
|
|
||||||
loc?: Location;
|
|
||||||
name: Name;
|
|
||||||
interfaces?: Array<NamedType>;
|
|
||||||
fields: Array<FieldDefinition>;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface FieldDefinition {
|
|
||||||
kind: string;
|
|
||||||
loc?: Location;
|
|
||||||
name: Name;
|
|
||||||
arguments: Array<InputValueDefinition>;
|
|
||||||
type: Type;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface InputValueDefinition {
|
|
||||||
kind: string;
|
|
||||||
loc?: Location;
|
|
||||||
name: Name;
|
|
||||||
type: Type;
|
|
||||||
defaultValue?: Value;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface InterfaceTypeDefinition {
|
|
||||||
kind: string;
|
|
||||||
loc?: Location;
|
|
||||||
name: Name;
|
|
||||||
fields: Array<FieldDefinition>;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface UnionTypeDefinition {
|
|
||||||
kind: string;
|
|
||||||
loc?: Location;
|
|
||||||
name: Name;
|
|
||||||
types: Array<NamedType>;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface ScalarTypeDefinition {
|
|
||||||
kind: string;
|
|
||||||
loc?: Location;
|
|
||||||
name: Name;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface EnumTypeDefinition {
|
|
||||||
kind: string;
|
|
||||||
loc?: Location;
|
|
||||||
name: Name;
|
|
||||||
values: Array<EnumValueDefinition>;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface EnumValueDefinition {
|
|
||||||
kind: string;
|
|
||||||
loc?: Location;
|
|
||||||
name: Name;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface InputObjectTypeDefinition {
|
|
||||||
kind: string;
|
|
||||||
loc?: Location;
|
|
||||||
name: Name;
|
|
||||||
fields: Array<InputValueDefinition>;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface TypeExtensionDefinition {
|
|
||||||
kind: string;
|
|
||||||
loc?: Location;
|
|
||||||
definition: ObjectTypeDefinition;
|
|
||||||
}
|
|
||||||
|
|
||||||
// language/kinds.js
|
|
||||||
|
|
||||||
const NAME: string;
|
|
||||||
|
|
||||||
// Document
|
|
||||||
|
|
||||||
const DOCUMENT: string;
|
|
||||||
const OPERATION_DEFINITION: string;
|
|
||||||
const VARIABLE_DEFINITION: string;
|
|
||||||
const VARIABLE: string;
|
|
||||||
const SELECTION_SET: string;
|
|
||||||
const FIELD: string;
|
|
||||||
const ARGUMENT: string;
|
|
||||||
|
|
||||||
// Fragments
|
|
||||||
|
|
||||||
const FRAGMENT_SPREAD: string;
|
|
||||||
const INLINE_FRAGMENT: string;
|
|
||||||
const FRAGMENT_DEFINITION: string;
|
|
||||||
|
|
||||||
// Values
|
|
||||||
|
|
||||||
const INT: string;
|
|
||||||
const FLOAT: string;
|
|
||||||
const STRING: string;
|
|
||||||
const BOOLEAN: string;
|
|
||||||
const ENUM: string;
|
|
||||||
const LIST: string;
|
|
||||||
const OBJECT: string;
|
|
||||||
const OBJECT_FIELD: string;
|
|
||||||
|
|
||||||
// Directives
|
|
||||||
|
|
||||||
const DIRECTIVE: string;
|
|
||||||
|
|
||||||
// Types
|
|
||||||
|
|
||||||
const NAMED_TYPE: string;
|
|
||||||
const LIST_TYPE: string;
|
|
||||||
const NON_NULL_TYPE: string;
|
|
||||||
|
|
||||||
// Type Definitions
|
|
||||||
|
|
||||||
const OBJECT_TYPE_DEFINITION: string;
|
|
||||||
const FIELD_DEFINITION: string;
|
|
||||||
const INPUT_VALUE_DEFINITION: string;
|
|
||||||
const INTERFACE_TYPE_DEFINITION: string;
|
|
||||||
const UNION_TYPE_DEFINITION: string;
|
|
||||||
const SCALAR_TYPE_DEFINITION: string;
|
|
||||||
const ENUM_TYPE_DEFINITION: string;
|
|
||||||
const ENUM_VALUE_DEFINITION: string;
|
|
||||||
const INPUT_OBJECT_TYPE_DEFINITION: string;
|
|
||||||
const TYPE_EXTENSION_DEFINITION: string;
|
|
||||||
|
|
||||||
// language/lexer.js
|
|
||||||
|
|
||||||
interface Token {
|
|
||||||
kind: number;
|
|
||||||
start: number;
|
|
||||||
end: number;
|
|
||||||
value: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
type Lexer = (resetPosition?: number) => Token;
|
|
||||||
|
|
||||||
function lex(source: Source): Lexer;
|
|
||||||
|
|
||||||
type TokenKind = {[key: string]: number};
|
|
||||||
|
|
||||||
function getTokenDesc(token: Token): string;
|
|
||||||
function getTokenKindDesc(kind: number): string;
|
|
||||||
|
|
||||||
// language/location.js
|
|
||||||
|
|
||||||
interface SourceLocation {
|
|
||||||
line: number;
|
|
||||||
column: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
function getLocation(source: Source, position: number): SourceLocation;
|
|
||||||
|
|
||||||
// language/parser.js
|
|
||||||
|
|
||||||
interface ParseOptions {
|
|
||||||
noLocation?: boolean,
|
|
||||||
noSource?: boolean,
|
|
||||||
}
|
|
||||||
|
|
||||||
function parse(
|
|
||||||
source: Source | string,
|
|
||||||
options?: ParseOptions
|
|
||||||
): Document;
|
|
||||||
|
|
||||||
function parseValue(
|
|
||||||
source: Source | string,
|
|
||||||
options?: ParseOptions
|
|
||||||
): Value;
|
|
||||||
|
|
||||||
function parseConstValue(parser: any): Value;
|
|
||||||
|
|
||||||
function parseType(parser: any): Type;
|
|
||||||
|
|
||||||
function parseNamedType(parser: any): NamedType;
|
|
||||||
|
|
||||||
// language/printer.js
|
|
||||||
|
|
||||||
function print(ast: any): string;
|
|
||||||
|
|
||||||
// language/source.js
|
|
||||||
|
|
||||||
class Source {
|
|
||||||
body: string;
|
|
||||||
name: string;
|
|
||||||
constructor(body: string, name?: string);
|
|
||||||
}
|
|
||||||
|
|
||||||
// language/visitor.js
|
|
||||||
|
|
||||||
interface QueryDocumentKeys {
|
|
||||||
Name: any[];
|
|
||||||
Document: string[];
|
|
||||||
OperationDefinition: string[];
|
|
||||||
VariableDefinition: string[];
|
|
||||||
Variable: string[];
|
|
||||||
SelectionSet: string[];
|
|
||||||
Field: string[];
|
|
||||||
Argument: string[];
|
|
||||||
|
|
||||||
FragmentSpread: string[];
|
|
||||||
InlineFragment: string[];
|
|
||||||
FragmentDefinition: string[];
|
|
||||||
|
|
||||||
IntValue: number[];
|
|
||||||
FloatValue: number[];
|
|
||||||
StringValue: string[];
|
|
||||||
BooleanValue: boolean[];
|
|
||||||
EnumValue: any[];
|
|
||||||
ListValue: string[];
|
|
||||||
ObjectValue: string[];
|
|
||||||
ObjectField: string[];
|
|
||||||
|
|
||||||
Directive: string[];
|
|
||||||
|
|
||||||
NamedType: string[];
|
|
||||||
ListType: string[];
|
|
||||||
NonNullType: string[];
|
|
||||||
|
|
||||||
ObjectTypeDefinition: string[];
|
|
||||||
FieldDefinition: string[];
|
|
||||||
InputValueDefinition: string[];
|
|
||||||
InterfaceTypeDefinition: string[];
|
|
||||||
UnionTypeDefinition: string[];
|
|
||||||
ScalarTypeDefinition: string[];
|
|
||||||
EnumTypeDefinition: string[];
|
|
||||||
EnumValueDefinition: string[];
|
|
||||||
InputObjectTypeDefinition: string[];
|
|
||||||
TypeExtensionDefinition: string[];
|
|
||||||
}
|
|
||||||
|
|
||||||
const BREAK: Object;
|
|
||||||
|
|
||||||
function visit(root: any, visitor: any, keyMap: any): any;
|
|
||||||
|
|
||||||
function visitInParallel(visitors: any): any;
|
|
||||||
|
|
||||||
function visitWithTypeInfo(typeInfo: any, visitor: any): any;
|
|
||||||
|
|
||||||
// type/definition.js
|
|
||||||
|
|
||||||
type GraphQLType =
|
|
||||||
GraphQLScalarType |
|
|
||||||
GraphQLObjectType |
|
|
||||||
GraphQLInterfaceType |
|
|
||||||
GraphQLUnionType |
|
|
||||||
GraphQLEnumType |
|
|
||||||
GraphQLInputObjectType |
|
|
||||||
GraphQLList |
|
|
||||||
GraphQLNonNull;
|
|
||||||
|
|
||||||
function isType(type: any): boolean;
|
|
||||||
|
|
||||||
type GraphQLInputType =
|
|
||||||
GraphQLScalarType |
|
|
||||||
GraphQLEnumType |
|
|
||||||
GraphQLInputObjectType |
|
|
||||||
GraphQLList |
|
|
||||||
GraphQLNonNull;
|
|
||||||
|
|
||||||
function isInputType(type: GraphQLType): boolean;
|
|
||||||
|
|
||||||
type GraphQLOutputType =
|
|
||||||
GraphQLScalarType |
|
|
||||||
GraphQLObjectType |
|
|
||||||
GraphQLInterfaceType |
|
|
||||||
GraphQLUnionType |
|
|
||||||
GraphQLEnumType |
|
|
||||||
GraphQLList |
|
|
||||||
GraphQLNonNull;
|
|
||||||
|
|
||||||
function isOutputType(type: GraphQLType): boolean;
|
|
||||||
|
|
||||||
type GraphQLLeafType =
|
|
||||||
GraphQLScalarType |
|
|
||||||
GraphQLEnumType;
|
|
||||||
|
|
||||||
function isLeafType(type: GraphQLType): boolean;
|
|
||||||
|
|
||||||
type GraphQLCompositeType =
|
|
||||||
GraphQLObjectType |
|
|
||||||
GraphQLInterfaceType |
|
|
||||||
GraphQLUnionType;
|
|
||||||
|
|
||||||
function isCompositeType(type: GraphQLType): boolean;
|
|
||||||
|
|
||||||
type GraphQLAbstractType =
|
|
||||||
GraphQLInterfaceType |
|
|
||||||
GraphQLUnionType;
|
|
||||||
|
|
||||||
function isAbstractType(type: GraphQLType): boolean;
|
|
||||||
|
|
||||||
type GraphQLNullableType =
|
|
||||||
GraphQLScalarType |
|
|
||||||
GraphQLObjectType |
|
|
||||||
GraphQLInterfaceType |
|
|
||||||
GraphQLUnionType |
|
|
||||||
GraphQLEnumType |
|
|
||||||
GraphQLInputObjectType |
|
|
||||||
GraphQLList;
|
|
||||||
|
|
||||||
function getNullableType(type: GraphQLType): GraphQLNullableType;
|
|
||||||
|
|
||||||
type GraphQLNamedType =
|
|
||||||
GraphQLScalarType |
|
|
||||||
GraphQLObjectType |
|
|
||||||
GraphQLInterfaceType |
|
|
||||||
GraphQLUnionType |
|
|
||||||
GraphQLEnumType |
|
|
||||||
GraphQLInputObjectType;
|
|
||||||
|
|
||||||
function getNamedType(type: GraphQLType): GraphQLNamedType;
|
|
||||||
|
|
||||||
export class GraphQLScalarType {
|
|
||||||
constructor(config: GraphQLScalarTypeConfig);
|
|
||||||
serialize(value: any): any;
|
|
||||||
parseValue(value: any): any;
|
|
||||||
parseLiteral(valueAST: Value): any;
|
|
||||||
toString(): string;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface GraphQLScalarTypeConfig {
|
|
||||||
name: string;
|
|
||||||
description?: string;
|
|
||||||
serialize: (value: any) => any;
|
|
||||||
parseValue?: (value: any) => any;
|
|
||||||
parseLiteral?: (valueAST: Value) => any;
|
|
||||||
}
|
|
||||||
|
|
||||||
export class GraphQLObjectType {
|
|
||||||
constructor(config: GraphQLObjectTypeConfig);
|
|
||||||
getFields(): GraphQLFieldDefinitionMap;
|
|
||||||
getInterfaces(): Array<GraphQLInterfaceType>;
|
|
||||||
toString(): string;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface GraphQLObjectTypeConfig {
|
|
||||||
name: string;
|
|
||||||
interfaces?: GraphQLInterfacesThunk | Array<GraphQLInterfaceType>;
|
|
||||||
fields: GraphQLFieldConfigMapThunk | GraphQLFieldConfigMap;
|
|
||||||
isTypeOf?: (value: any, info?: GraphQLResolveInfo) => boolean;
|
|
||||||
description?: string
|
|
||||||
}
|
|
||||||
|
|
||||||
type GraphQLInterfacesThunk = () => Array<GraphQLInterfaceType>;
|
|
||||||
|
|
||||||
type GraphQLFieldConfigMapThunk = () => GraphQLFieldConfigMap;
|
|
||||||
|
|
||||||
type GraphQLFieldResolveFn = (
|
|
||||||
source?: any,
|
|
||||||
args?: { [argName: string]: any },
|
|
||||||
context?: any,
|
|
||||||
info?: GraphQLResolveInfo
|
|
||||||
) => any;
|
|
||||||
|
|
||||||
interface GraphQLResolveInfo {
|
|
||||||
fieldName: string,
|
|
||||||
fieldASTs: Array<Field>,
|
|
||||||
returnType: GraphQLOutputType,
|
|
||||||
parentType: GraphQLCompositeType,
|
|
||||||
schema: GraphQLSchema,
|
|
||||||
fragments: { [fragmentName: string]: FragmentDefinition },
|
|
||||||
rootValue: any,
|
|
||||||
operation: OperationDefinition,
|
|
||||||
variableValues: { [variableName: string]: any },
|
|
||||||
}
|
|
||||||
|
|
||||||
interface GraphQLFieldConfig {
|
|
||||||
type: GraphQLOutputType;
|
|
||||||
args?: GraphQLFieldConfigArgumentMap;
|
|
||||||
resolve?: GraphQLFieldResolveFn;
|
|
||||||
deprecationReason?: string;
|
|
||||||
description?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface GraphQLFieldConfigArgumentMap {
|
|
||||||
[argName: string]: GraphQLArgumentConfig;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface GraphQLArgumentConfig {
|
|
||||||
type: GraphQLInputType;
|
|
||||||
defaultValue?: any;
|
|
||||||
description?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface GraphQLFieldConfigMap {
|
|
||||||
[fieldName: string]: GraphQLFieldConfig;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface GraphQLFieldDefinition {
|
|
||||||
name: string;
|
|
||||||
description: string;
|
|
||||||
type: GraphQLOutputType;
|
|
||||||
args: Array<GraphQLArgument>;
|
|
||||||
resolve?: GraphQLFieldResolveFn;
|
|
||||||
deprecationReason?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface GraphQLArgument {
|
|
||||||
name: string;
|
|
||||||
type: GraphQLInputType;
|
|
||||||
defaultValue?: any;
|
|
||||||
description?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface GraphQLFieldDefinitionMap {
|
|
||||||
[fieldName: string]: GraphQLFieldDefinition;
|
|
||||||
}
|
|
||||||
|
|
||||||
export class GraphQLInterfaceType {
|
|
||||||
name: string;
|
|
||||||
description: string;
|
|
||||||
resolveType: (value: any, info?: GraphQLResolveInfo) => GraphQLObjectType;
|
|
||||||
constructor(config: GraphQLInterfaceTypeConfig);
|
|
||||||
getFields(): GraphQLFieldDefinitionMap;
|
|
||||||
getPossibleTypes(): Array<GraphQLObjectType>;
|
|
||||||
isPossibleType(type: GraphQLObjectType): boolean;
|
|
||||||
getObjectType(value: any, info: GraphQLResolveInfo): GraphQLObjectType;
|
|
||||||
toString(): string;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface GraphQLInterfaceTypeConfig {
|
|
||||||
name: string;
|
|
||||||
fields: GraphQLFieldConfigMapThunk | GraphQLFieldConfigMap;
|
|
||||||
resolveType?: (value: any, info?: GraphQLResolveInfo) => GraphQLObjectType;
|
|
||||||
description?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export class GraphQLUnionType {
|
|
||||||
name: string;
|
|
||||||
description: string;
|
|
||||||
resolveType: (value: any, info?: GraphQLResolveInfo) => GraphQLObjectType;
|
|
||||||
constructor(config: GraphQLUnionTypeConfig);
|
|
||||||
getPossibleTypes(): Array<GraphQLObjectType>;
|
|
||||||
isPossibleType(type: GraphQLObjectType): boolean;
|
|
||||||
getObjectType(value: any, info: GraphQLResolveInfo): GraphQLObjectType;
|
|
||||||
toString(): string;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
interface GraphQLUnionTypeConfig {
|
|
||||||
name: string,
|
|
||||||
types: Array<GraphQLObjectType>,
|
|
||||||
/**
|
|
||||||
* Optionally provide a custom type resolver function. If one is not provided,
|
|
||||||
* the default implementation will call `isTypeOf` on each implementing
|
|
||||||
* Object type.
|
|
||||||
*/
|
|
||||||
resolveType?: (value: any, info?: GraphQLResolveInfo) => GraphQLObjectType;
|
|
||||||
description?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export class GraphQLEnumType {
|
|
||||||
name: string;
|
|
||||||
description: string;
|
|
||||||
constructor(config: GraphQLEnumTypeConfig);
|
|
||||||
getValues(): Array<GraphQLEnumValueDefinition>;
|
|
||||||
serialize(value: any): string;
|
|
||||||
parseValue(value: any): any;
|
|
||||||
parseLiteral(valueAST: Value): any;
|
|
||||||
toString(): string;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface GraphQLEnumTypeConfig {
|
|
||||||
name: string;
|
|
||||||
values: GraphQLEnumValueConfigMap;
|
|
||||||
description?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface GraphQLEnumValueConfigMap {
|
|
||||||
[valueName: string]: GraphQLEnumValueConfig;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface GraphQLEnumValueConfig {
|
|
||||||
value?: any;
|
|
||||||
deprecationReason?: string;
|
|
||||||
description?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface GraphQLEnumValueDefinition {
|
|
||||||
name: string;
|
|
||||||
description: string;
|
|
||||||
deprecationReason: string;
|
|
||||||
value: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
export class GraphQLInputObjectType {
|
|
||||||
name: string;
|
|
||||||
description: string;
|
|
||||||
constructor(config: InputObjectConfig);
|
|
||||||
getFields(): InputObjectFieldMap;
|
|
||||||
toString(): string;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface InputObjectConfig {
|
|
||||||
name: string;
|
|
||||||
fields: InputObjectConfigFieldMapThunk | InputObjectConfigFieldMap;
|
|
||||||
description?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
type InputObjectConfigFieldMapThunk = () => InputObjectConfigFieldMap;
|
|
||||||
|
|
||||||
interface InputObjectFieldConfig {
|
|
||||||
type: GraphQLInputType;
|
|
||||||
defaultValue?: any;
|
|
||||||
description?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface InputObjectConfigFieldMap {
|
|
||||||
[fieldName: string]: InputObjectFieldConfig;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface InputObjectField {
|
|
||||||
name: string;
|
|
||||||
type: GraphQLInputType;
|
|
||||||
defaultValue?: any;
|
|
||||||
description?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface InputObjectFieldMap {
|
|
||||||
[fieldName: string]: InputObjectField;
|
|
||||||
}
|
|
||||||
|
|
||||||
export class GraphQLList {
|
|
||||||
ofType: GraphQLType;
|
|
||||||
constructor(type: GraphQLType);
|
|
||||||
toString(): string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export class GraphQLNonNull {
|
|
||||||
ofType: GraphQLNullableType;
|
|
||||||
constructor(type: GraphQLNullableType);
|
|
||||||
toString(): string;
|
|
||||||
}
|
|
||||||
|
|
||||||
// type/directives.js
|
|
||||||
|
|
||||||
class GraphQLDirective {
|
|
||||||
name: string;
|
|
||||||
description: string;
|
|
||||||
args: Array<GraphQLArgument>;
|
|
||||||
onOperation: boolean;
|
|
||||||
onFragment: boolean;
|
|
||||||
onField: boolean;
|
|
||||||
constructor(config: GraphQLDirectiveConfig);
|
|
||||||
}
|
|
||||||
|
|
||||||
interface GraphQLDirectiveConfig {
|
|
||||||
name: string;
|
|
||||||
description?: string;
|
|
||||||
args?: Array<GraphQLArgument>;
|
|
||||||
onOperation?: boolean;
|
|
||||||
onFragment?: boolean;
|
|
||||||
onField?: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
export var GraphQLIncludeDirective: GraphQLDirective;
|
|
||||||
|
|
||||||
export var GraphQLSkipDirective: GraphQLDirective;
|
|
||||||
|
|
||||||
// type/introspection.js
|
|
||||||
|
|
||||||
var __Schema: GraphQLObjectType;
|
|
||||||
|
|
||||||
type TypeKind = {[key: string]: string};
|
|
||||||
|
|
||||||
var SchemaMetaFieldDef: GraphQLFieldDefinition;
|
|
||||||
|
|
||||||
var TypeMetaFieldDef: GraphQLFieldDefinition;
|
|
||||||
|
|
||||||
var TypeNameMetaFieldDef: GraphQLFieldDefinition;
|
|
||||||
|
|
||||||
// type/scalars.js
|
|
||||||
|
|
||||||
export var GraphQLInt: GraphQLScalarType;
|
|
||||||
export var GraphQLFloat: GraphQLScalarType;
|
|
||||||
export var GraphQLString: GraphQLScalarType;
|
|
||||||
export var GraphQLBoolean: GraphQLScalarType;
|
|
||||||
export var GraphQLID: GraphQLScalarType;
|
|
||||||
|
|
||||||
// type/schema.js
|
|
||||||
|
|
||||||
export class GraphQLSchema {
|
|
||||||
constructor(config: GraphQLSchemaConfig);
|
|
||||||
getQueryType(): GraphQLObjectType;
|
|
||||||
getMutationType(): GraphQLObjectType;
|
|
||||||
getSubscriptionType(): GraphQLObjectType;
|
|
||||||
getTypeMap(): TypeMap;
|
|
||||||
getType(name: string): GraphQLType;
|
|
||||||
getDirectives(): Array<GraphQLDirective>;
|
|
||||||
getDirective(name: string): GraphQLDirective;
|
|
||||||
}
|
|
||||||
|
|
||||||
type TypeMap = { [typeName: string]: GraphQLType };
|
|
||||||
|
|
||||||
interface GraphQLSchemaConfig {
|
|
||||||
query: GraphQLObjectType;
|
|
||||||
mutation?: GraphQLObjectType;
|
|
||||||
subscription?: GraphQLObjectType;
|
|
||||||
directives?: Array<GraphQLDirective>;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
declare module 'graphql/graphql' {
|
|
||||||
import alias = require('~graphql/graphql');
|
|
||||||
export = alias;
|
|
||||||
}
|
|
||||||
declare module 'graphql' {
|
|
||||||
import alias = require('~graphql/graphql');
|
|
||||||
export = alias;
|
|
||||||
}
|
|
|
@ -1,11 +0,0 @@
|
||||||
{
|
|
||||||
"resolution": "main",
|
|
||||||
"tree": {
|
|
||||||
"src": "https://raw.githubusercontent.com/nitintutlani/typed-graphql/master/typings.json",
|
|
||||||
"raw": "github:nitintutlani/typed-graphql",
|
|
||||||
"main": "graphql.d.ts",
|
|
||||||
"global": false,
|
|
||||||
"name": "graphql",
|
|
||||||
"type": "typings"
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Add table
Reference in a new issue