Typings for apollo-upload-client (#27094)

* Typings for apollo-upload-client

* Update package.json

* Triggering build
This commit is contained in:
Edward Sammut Alessi 2018-07-12 19:00:16 +02:00 committed by Ryan Cavanaugh
parent fb6990cd4d
commit 4a4db6d249
5 changed files with 63 additions and 0 deletions

View File

@ -0,0 +1,16 @@
import { createUploadLink, ReactNativeFile } from "apollo-upload-client";
new ReactNativeFile({
name: "its coming home",
type: "its coming",
uri: "football's coming home",
});
createUploadLink({
fetch: (uri, options) => fetch(`http://localhost/${uri}`, options),
fetchOptions: { method: "GET" },
headers: { special: "Special header value" },
includeExtensions: true,
uri: "http://localhost",
credentials: "beepboop",
});

16
types/apollo-upload-client/index.d.ts vendored Normal file
View File

@ -0,0 +1,16 @@
// Type definitions for apollo-upload-client 8.1
// Project: https://github.com/jaydenseric/apollo-upload-client#readme
// Definitions by: Edward Sammut Alessi <https://github.com/Slessi>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2
import { ApolloLink } from "apollo-link";
import { HttpOptions } from "apollo-link-http-common";
export { ReactNativeFile } from "extract-files";
/**
* `createUploadLink` options match `createHttpLink` options
* @param linkOptions `HttpOptions`
*/
export function createUploadLink(linkOptions?: HttpOptions): ApolloLink;

View File

@ -0,0 +1,7 @@
{
"private": true,
"dependencies": {
"apollo-link": "^1.0.0",
"apollo-link-http-common": "^0.2.4"
}
}

View File

@ -0,0 +1,23 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6", "dom"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"apollo-upload-client-tests.ts"
]
}

View File

@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }