Skip to content

Commit 047d14a

Browse files
Merge domain-task repo into this one
1 parent 32349fa commit 047d14a

File tree

15 files changed

+289
-10
lines changed

15 files changed

+289
-10
lines changed

samples/react/MusicStore/ReactApp/fx/domain-task.d.ts

Lines changed: 0 additions & 10 deletions
This file was deleted.

samples/react/MusicStore/tsd.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@
3737
},
3838
"redux-thunk/redux-thunk.d.ts": {
3939
"commit": "e69fe60f2d6377ea4fae539493997b098f52cad1"
40+
},
41+
"whatwg-fetch/whatwg-fetch.d.ts": {
42+
"commit": "f4b1797c1201b6c575668f5d7ea12d9b1ab21846"
4043
}
4144
}
4245
}

samples/react/MusicStore/typings/tsd.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@
99
/// <reference path="react-router-bootstrap/react-router-bootstrap.d.ts" />
1010
/// <reference path="react-router-redux/react-router-redux.d.ts" />
1111
/// <reference path="redux-thunk/redux-thunk.d.ts" />
12+
/// <reference path="whatwg-fetch/whatwg-fetch.d.ts" />
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
// Type definitions for fetch API
2+
// Project: https://github.com/github/fetch
3+
// Definitions by: Ryan Graham <https://github.com/ryan-codingintrigue>
4+
// Definitions: https://github.com/borisyankov/DefinitelyTyped
5+
6+
declare class Request extends Body {
7+
constructor(input: string|Request, init?:RequestInit);
8+
method: string;
9+
url: string;
10+
headers: Headers;
11+
context: string|RequestContext;
12+
referrer: string;
13+
mode: string|RequestMode;
14+
credentials: string|RequestCredentials;
15+
cache: string|RequestCache;
16+
}
17+
18+
interface RequestInit {
19+
method?: string;
20+
headers?: HeaderInit|{ [index: string]: string };
21+
body?: BodyInit;
22+
mode?: string|RequestMode;
23+
credentials?: string|RequestCredentials;
24+
cache?: string|RequestCache;
25+
}
26+
27+
declare enum RequestContext {
28+
"audio", "beacon", "cspreport", "download", "embed", "eventsource", "favicon", "fetch",
29+
"font", "form", "frame", "hyperlink", "iframe", "image", "imageset", "import",
30+
"internal", "location", "manifest", "object", "ping", "plugin", "prefetch", "script",
31+
"serviceworker", "sharedworker", "subresource", "style", "track", "video", "worker",
32+
"xmlhttprequest", "xslt"
33+
}
34+
declare enum RequestMode { "same-origin", "no-cors", "cors" }
35+
declare enum RequestCredentials { "omit", "same-origin", "include" }
36+
declare enum RequestCache { "default", "no-store", "reload", "no-cache", "force-cache", "only-if-cached" }
37+
38+
declare class Headers {
39+
append(name: string, value: string): void;
40+
delete(name: string):void;
41+
get(name: string): string;
42+
getAll(name: string): Array<string>;
43+
has(name: string): boolean;
44+
set(name: string, value: string): void;
45+
}
46+
47+
declare class Body {
48+
bodyUsed: boolean;
49+
arrayBuffer(): Promise<ArrayBuffer>;
50+
blob(): Promise<Blob>;
51+
formData(): Promise<FormData>;
52+
json(): Promise<any>;
53+
json<T>(): Promise<T>;
54+
text(): Promise<string>;
55+
}
56+
declare class Response extends Body {
57+
constructor(body?: BodyInit, init?: ResponseInit);
58+
error(): Response;
59+
redirect(url: string, status: number): Response;
60+
type: string|ResponseType;
61+
url: string;
62+
status: number;
63+
ok: boolean;
64+
statusText: string;
65+
headers: Headers;
66+
clone(): Response;
67+
}
68+
69+
declare enum ResponseType { "basic", "cors", "default", "error", "opaque" }
70+
71+
interface ResponseInit {
72+
status: number;
73+
statusText?: string;
74+
headers?: HeaderInit;
75+
}
76+
77+
declare type HeaderInit = Headers|Array<string>;
78+
declare type BodyInit = Blob|FormData|string;
79+
declare type RequestInfo = Request|string;
80+
81+
interface Window {
82+
fetch(url: string|Request, init?: RequestInit): Promise<Response>;
83+
}
84+
85+
declare var fetch: typeof window.fetch;
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/typings/
2+
/node_modules/
3+
/*.js
4+
/*.d.ts
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
!/*.js
2+
!/*.d.ts
3+
/typings/
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
Copyright (c) .NET Foundation. All rights reserved.
2+
3+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
4+
these files except in compliance with the License. You may obtain a copy of the
5+
License at
6+
7+
http://www.apache.org/licenses/LICENSE-2.0
8+
9+
Unless required by applicable law or agreed to in writing, software distributed
10+
under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
11+
CONDITIONS OF ANY KIND, either express or implied. See the License for the
12+
specific language governing permissions and limitations under the License.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
TODO
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"name": "domain-task",
3+
"version": "1.0.0",
4+
"description": "Tracks outstanding operations for a logical thread of execution",
5+
"main": "main.js",
6+
"scripts": {
7+
"prepublish": "tsd update && tsc && echo 'Finished building NPM package \"domain-task\"'",
8+
"test": "echo \"Error: no test specified\" && exit 1"
9+
},
10+
"author": "Microsoft",
11+
"license": "Apache-2.0",
12+
"dependencies": {
13+
"domain-context": "^0.5.1",
14+
"isomorphic-fetch": "^2.2.1"
15+
}
16+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
declare module 'domain' {
2+
var active: Domain;
3+
}
4+
5+
declare module 'domain-context' {
6+
function get(key: string): any;
7+
function set(key: string, value: any): void;
8+
function runInNewDomain(code: () => void): void;
9+
}

0 commit comments

Comments
 (0)