Skip to content

Commit 9113fa9

Browse files
committed
Use TypeScript 2.1 for the docs build
Until TypeDoc supports TS 2.2
1 parent 7bb457e commit 9113fa9

5 files changed

Lines changed: 72 additions & 0 deletions

File tree

gruntfile.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ module.exports = function(grunt) {
9090
var dtsFiles = grunt.file.expand({cwd: srcDir }, [
9191
"**/*.d.ts",
9292
//Exclude the d.ts files in the apps folder - these are part of the apps and are already packed there!
93+
"!docs-shims.d.ts",
9394
"!node-tests/**",
9495
"!org.nativescript.widgets.d.ts",
9596
"!android17.d.ts",

tns-core-modules/docs-shims.d.ts

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
declare type Promise<T> = any;
2+
declare type Set<T> = any;
3+
declare type Map<K, V> = any;
4+
5+
declare class Request {
6+
constructor(input: string|Request, init?: RequestInit);
7+
method: string;
8+
url: string;
9+
headers: Headers;
10+
context: RequestContext;
11+
referrer: string;
12+
mode: RequestMode;
13+
credentials: RequestCredentials;
14+
cache: RequestCache;
15+
}
16+
17+
interface RequestInit {
18+
method?: string;
19+
headers?: HeaderInit|{ [index: string]: string };
20+
body?: BodyInit;
21+
mode?: RequestMode;
22+
credentials?: RequestCredentials;
23+
cache?: RequestCache;
24+
}
25+
26+
declare class Headers {
27+
append(name: string, value: string): void;
28+
delete(name: string): void;
29+
get(name: string): string;
30+
getAll(name: string): Array<string>;
31+
has(name: string): boolean;
32+
set(name: string, value: string): void;
33+
}
34+
35+
declare class Body {
36+
bodyUsed: boolean;
37+
/*
38+
arrayBuffer(): Promise<ArrayBuffer>;
39+
blob(): Promise<Blob>;
40+
*/
41+
formData(): Promise<FormData>;
42+
json(): Promise<any>;
43+
text(): Promise<string>;
44+
}
45+
46+
declare class Response extends Body {
47+
constructor(body?: BodyInit, init?: ResponseInit);
48+
error(): Response;
49+
redirect(url: string, status: number): Response;
50+
type: ResponseType;
51+
url: string;
52+
status: number;
53+
ok: boolean;
54+
statusText: string;
55+
headers: Headers;
56+
clone(): Response;
57+
}
58+
59+
declare enum ResponseType { "basic", "cors", "default", "error", "opaque" }
60+
61+
declare class ResponseInit {
62+
status: number;
63+
statusText: string;
64+
headers: HeaderInit;
65+
}
66+
67+
declare type BodyInit = Blob|FormData|string;
68+
declare type RequestInfo = Request|string;

tsconfig.base-dts.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"tns-core-modules/**/*.d.ts"
88
],
99
"exclude": [
10+
"tns-core-modules/docs-shims.d.ts",
1011
"tns-platform-declarations/node_modules/",
1112
"tns-platform-declarations/package/",
1213
"tns-core-modules/node_modules/",

tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"extends": "./tsconfig.shared",
33
"exclude": [
4+
"tns-core-modules/docs-shims.d.ts",
45
"tns-platform-declarations/node_modules/",
56
"tns-platform-declarations/package/",
67
"tns-core-modules/node_modules/",

tsconfig.typedoc.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"experimentalDecorators": true
1111
},
1212
"files": [
13+
"tns-core-modules/docs-shims.d.ts",
1314
"tns-core-modules/tns-core-modules.d.ts"
1415
]
1516
}

0 commit comments

Comments
 (0)