Skip to content

Commit

Permalink
More complete JSON value type
Browse files Browse the repository at this point in the history
  • Loading branch information
mike-north committed Jan 11, 2018
1 parent 7101a31 commit a35e2c8
Show file tree
Hide file tree
Showing 3 changed files with 181 additions and 22 deletions.
13 changes: 12 additions & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
import FakeXMLHttpRequest from "fake-xml-http-request";
import { Params, QueryParams } from "route-recognizer";
import * as JSON from 'json-typescript';
// export type JSONPrimitive = string | number | boolean | null;
// export interface JSONObject {
// [member: string]: JSONValue;
// [member: number]: JSONValue;
// }
// export interface JSONArray extends Array<JSONValue> {}

// export type JSONValue = JSONPrimitive | JSONObject | JSONArray;


type SetupCallback = (this: Server) => void;
interface SetupConfig {
forcePassthrough: boolean;
Expand All @@ -25,7 +36,7 @@ export type RequestHandler = (
async?: boolean
) => void;

export type ResponseData = [number, { [k: string]: string }, string];
export type ResponseData = [number, JSON.Value, string];
interface ExtraRequestData {
params: Params;
queryParams: QueryParams;
Expand Down
187 changes: 167 additions & 20 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pretender",
"version": "2.0.0",
"version": "2.0.1",
"main": "./pretender.js",
"license": "MIT",
"engines": {
Expand Down Expand Up @@ -38,6 +38,7 @@
},
"dependencies": {
"fake-xml-http-request": "^2.0.0",
"json-typescript": "^1.0.0",
"route-recognizer": "^0.3.3"
},
"jspm": {
Expand Down

0 comments on commit a35e2c8

Please sign in to comment.