Use TypeScript 2.1 for the docs build

Until TypeDoc supports TS 2.2
This commit is contained in:
Hristo Deshev
2017-02-24 14:48:49 +02:00
committed by Hristo Deshev
parent 7bb457ef2b
commit 9113fa9ed8
5 changed files with 72 additions and 0 deletions

View File

@@ -90,6 +90,7 @@ module.exports = function(grunt) {
var dtsFiles = grunt.file.expand({cwd: srcDir }, [
"**/*.d.ts",
//Exclude the d.ts files in the apps folder - these are part of the apps and are already packed there!
"!docs-shims.d.ts",
"!node-tests/**",
"!org.nativescript.widgets.d.ts",
"!android17.d.ts",

68
tns-core-modules/docs-shims.d.ts vendored Normal file
View File

@@ -0,0 +1,68 @@
declare type Promise<T> = any;
declare type Set<T> = any;
declare type Map<K, V> = any;
declare class Request {
constructor(input: string|Request, init?: RequestInit);
method: string;
url: string;
headers: Headers;
context: RequestContext;
referrer: string;
mode: RequestMode;
credentials: RequestCredentials;
cache: RequestCache;
}
interface RequestInit {
method?: string;
headers?: HeaderInit|{ [index: string]: string };
body?: BodyInit;
mode?: RequestMode;
credentials?: RequestCredentials;
cache?: RequestCache;
}
declare class Headers {
append(name: string, value: string): void;
delete(name: string): void;
get(name: string): string;
getAll(name: string): Array<string>;
has(name: string): boolean;
set(name: string, value: string): void;
}
declare class Body {
bodyUsed: boolean;
/*
arrayBuffer(): Promise<ArrayBuffer>;
blob(): Promise<Blob>;
*/
formData(): Promise<FormData>;
json(): Promise<any>;
text(): Promise<string>;
}
declare class Response extends Body {
constructor(body?: BodyInit, init?: ResponseInit);
error(): Response;
redirect(url: string, status: number): Response;
type: ResponseType;
url: string;
status: number;
ok: boolean;
statusText: string;
headers: Headers;
clone(): Response;
}
declare enum ResponseType { "basic", "cors", "default", "error", "opaque" }
declare class ResponseInit {
status: number;
statusText: string;
headers: HeaderInit;
}
declare type BodyInit = Blob|FormData|string;
declare type RequestInfo = Request|string;

View File

@@ -7,6 +7,7 @@
"tns-core-modules/**/*.d.ts"
],
"exclude": [
"tns-core-modules/docs-shims.d.ts",
"tns-platform-declarations/node_modules/",
"tns-platform-declarations/package/",
"tns-core-modules/node_modules/",

View File

@@ -1,6 +1,7 @@
{
"extends": "./tsconfig.shared",
"exclude": [
"tns-core-modules/docs-shims.d.ts",
"tns-platform-declarations/node_modules/",
"tns-platform-declarations/package/",
"tns-core-modules/node_modules/",

View File

@@ -10,6 +10,7 @@
"experimentalDecorators": true
},
"files": [
"tns-core-modules/docs-shims.d.ts",
"tns-core-modules/tns-core-modules.d.ts"
]
}