mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 06:47:03 +00:00
Merge branch 'master' into graphql-v0.13.2
This commit is contained in:
@@ -14,14 +14,14 @@ function ResponseCallback(err: Error | null, response: Azure.ServiceBus.Response
|
||||
const ServiceBus = AzureSB.createServiceBusService('connectionstring');
|
||||
|
||||
// Queues
|
||||
ServiceBus.listQueues('', createResultCallback<Models.Queue[]>());
|
||||
ServiceBus.listQueues(createResultCallback<Models.Queue[]>());
|
||||
ServiceBus.createQueue('test', createResultCallback<Models.Queue>());
|
||||
ServiceBus.createQueueIfNotExists('test', createResultCallback<boolean>());
|
||||
ServiceBus.getQueue('test', createResultCallback<Models.Queue>());
|
||||
ServiceBus.deleteQueue('test', ResponseCallback);
|
||||
|
||||
// Topics
|
||||
ServiceBus.listTopics('', createResultCallback<Models.Topic[]>());
|
||||
ServiceBus.listTopics(createResultCallback<Models.Topic[]>());
|
||||
ServiceBus.createTopic('test', createResultCallback<Models.Topic>());
|
||||
ServiceBus.createTopicIfNotExists('test', createResultCallback<boolean>());
|
||||
ServiceBus.getTopic('test', createResultCallback<Models.Topic>());
|
||||
|
||||
Vendored
+10
-14
@@ -214,15 +214,15 @@ export namespace Azure.ServiceBus {
|
||||
// [x: string]: string | Dictionary<string | object>;
|
||||
// }
|
||||
|
||||
export const ActiveMessageCount = 'd2p1:ActiveMessageCount';
|
||||
export const DeadLetterMessageCount = 'd2p1:DeadLetterMessageCount';
|
||||
export const ScheduledMessageCount = 'd2p1:ScheduledMessageCount';
|
||||
export const TransferMessageCount = 'd2p1:TransferMessageCount';
|
||||
export const TransferDeadLetterMessageCount = 'd2p1:TransferDeadLetterMessageCount';
|
||||
|
||||
export interface Topic extends ExtendedBase {
|
||||
AccessedAt: DateString;
|
||||
CountDetails: {
|
||||
'd2p1:ActiveMessageCount': string;
|
||||
'd2p1:DeadLetterMessageCount': string;
|
||||
'd2p1:ScheduledMessageCount': string;
|
||||
'd2p1:TransferMessageCount': string;
|
||||
'd2p1:TransferDeadLetterMessageCount': string;
|
||||
};
|
||||
CountDetails: { [key: string]: string };
|
||||
EnableSubscriptionPartitioning: string;
|
||||
FilteringMessagesBeforePublishing: string;
|
||||
IsExpress: string;
|
||||
@@ -242,13 +242,7 @@ export namespace Azure.ServiceBus {
|
||||
}
|
||||
|
||||
export interface Subscription extends ExtendedBase {
|
||||
CountDetails: {
|
||||
'd3p1:ActiveMessageCount': string;
|
||||
'd3p1:DeadLetterMessageCount': string;
|
||||
'd3p1:ScheduledMessageCount': string;
|
||||
'd3p1:TransferMessageCount': string;
|
||||
'd3p1:TransferDeadLetterMessageCount': string;
|
||||
};
|
||||
CountDetails: { [key: string]: string };
|
||||
DeadLetteringOnFilterEvaluationExceptions: string;
|
||||
DeadLetteringOnMessageExpiration: string;
|
||||
LockDuration: string;
|
||||
@@ -315,6 +309,8 @@ export namespace Azure.ServiceBus {
|
||||
export type CreateSubscriptionOptions = Partial<ICreateSubscriptionOptions>;
|
||||
export type ListSubscriptionsOptions = Partial<PaginationOptions>;
|
||||
export type ListRulesOptions = Partial<PaginationOptions>;
|
||||
export type ListTopicsOptions = Partial<PaginationOptions>;
|
||||
export type ListQueuesOptions = Partial<PaginationOptions>;
|
||||
export type CreateRuleOptions = Partial<ICreateRuleOptions>;
|
||||
export type CreateNotificationHubOptions = Partial<ICreateNotificationHubOptions>;
|
||||
export type ListNotificationHubsOptions = Partial<PaginationOptions>;
|
||||
|
||||
+6
-2
@@ -11,6 +11,8 @@ import CreateTopicOptions = Azure.ServiceBus.CreateTopicOptions;
|
||||
import ListNotificationHubsOptions = Azure.ServiceBus.ListNotificationHubsOptions;
|
||||
import ListRulesOptions = Azure.ServiceBus.ListRulesOptions;
|
||||
import ListSubscriptionsOptions = Azure.ServiceBus.ListSubscriptionsOptions;
|
||||
import ListTopicsOptions = Azure.ServiceBus.ListTopicsOptions;
|
||||
import ListQueuesOptions = Azure.ServiceBus.ListQueuesOptions;
|
||||
import MessageOrName = Azure.ServiceBus.MessageOrName;
|
||||
import Queue = Azure.ServiceBus.Results.Models.Queue;
|
||||
import ReceiveQueueMessageOptions = Azure.ServiceBus.ReceiveQueueMessageOptions;
|
||||
@@ -88,7 +90,8 @@ declare class ServiceBusService extends ServiceBusServiceBase {
|
||||
public getQueue(queuePath: string,
|
||||
callback: TypedResultAndResponseCallback<Queue>): void;
|
||||
|
||||
public listQueues(queuePath: string,
|
||||
public listQueues(callback: TypedResultAndResponseCallback<Queue[]>): void;
|
||||
public listQueues(options: ListQueuesOptions,
|
||||
callback: TypedResultAndResponseCallback<Queue[]>): void;
|
||||
|
||||
/*
|
||||
@@ -115,7 +118,8 @@ declare class ServiceBusService extends ServiceBusServiceBase {
|
||||
public getTopic(topicPath: string,
|
||||
callback: TypedResultAndResponseCallback<Topic>): void;
|
||||
|
||||
public listTopics(topicPath: string,
|
||||
public listTopics(callback: TypedResultAndResponseCallback<Topic[]>): void;
|
||||
public listTopics(options: ListTopicsOptions,
|
||||
callback: TypedResultAndResponseCallback<Topic[]>): void;
|
||||
|
||||
/*
|
||||
|
||||
+3
-4
@@ -1,14 +1,13 @@
|
||||
/// <reference types="node" />
|
||||
import EventEmitter = NodeJS.EventEmitter;
|
||||
import ServiceClient = require('azure-sb/lib/serviceclient');
|
||||
|
||||
declare class ServiceBusServiceClient extends EventEmitter {
|
||||
declare class ServiceBusServiceClient extends ServiceClient {
|
||||
constructor(accessKey?: string,
|
||||
issuer?: string,
|
||||
sharedAccessKeyName?: string,
|
||||
sharedAccessKeyValue?: string,
|
||||
host?: string,
|
||||
acsHost?: string,
|
||||
authenticationProvider?: object);
|
||||
authenticationProvider?: object);
|
||||
}
|
||||
|
||||
export = ServiceBusServiceClient;
|
||||
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
/// <reference types="node" />
|
||||
import EventEmitter = NodeJS.EventEmitter;
|
||||
declare class ServiceClient extends EventEmitter {
|
||||
public host: string;
|
||||
public port: number;
|
||||
public protocol: string;
|
||||
}
|
||||
export = ServiceClient;
|
||||
@@ -30,6 +30,7 @@
|
||||
"lib/models/subscriptionresult.d.ts",
|
||||
"lib/models/notificationhubresult.d.ts",
|
||||
"lib/models/resourceresult.d.ts",
|
||||
"lib/serviceclient.d.ts",
|
||||
"lib/servicebusserviceclient.d.ts",
|
||||
"lib/gcmservice.d.ts",
|
||||
"lib/wnsservice.d.ts",
|
||||
@@ -38,4 +39,4 @@
|
||||
"azure-sb-tests.ts",
|
||||
"index.d.ts"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,3 +7,10 @@ const b3 = b1.multiply(b2);
|
||||
|
||||
console.log(b3.toHex());
|
||||
// => ae499bfe762edfb416d0ce71447af67ff33d1760cbebd70874be1d7a5564b0439a59808cb1856a91974f7023f72132
|
||||
|
||||
const b4 = BigInteger.valueOf(42);
|
||||
const b5 = BigInteger.valueOf(10);
|
||||
const b6 = b4.multiply(b5);
|
||||
|
||||
console.log(b6);
|
||||
// => BigInteger { '0': 420, '1': 0, t: 1, s: 0 }
|
||||
|
||||
Vendored
+1
-1
@@ -87,7 +87,7 @@ declare class bigi {
|
||||
static fromDERInteger(byteArray?: any): number;
|
||||
static fromHex(hex: string): bigi;
|
||||
static isBigInteger(obj: any, check_ver: any): obj is bigi;
|
||||
static valueOf(i: any): number;
|
||||
static valueOf(i: any): bigi;
|
||||
}
|
||||
declare namespace bigi {
|
||||
interface Constants {
|
||||
|
||||
Vendored
+44
-31
@@ -1,11 +1,11 @@
|
||||
// Type definitions for C3js 0.4
|
||||
// Type definitions for C3js 0.5
|
||||
// Project: http://c3js.org/
|
||||
// Definitions by: Marc Climent <https://github.com/mcliment>
|
||||
// Gerin Jacob <https://github.com/gerinjacob>
|
||||
// Bernd Hacker <https://github.com/denyo>
|
||||
// Dzmitry Shyndzin <https://github.com/dmitryshindin>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.1
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
import * as d3 from "d3";
|
||||
|
||||
@@ -28,7 +28,7 @@ export interface ChartConfiguration {
|
||||
* Note: When chart is not binded, c3 starts observing if chart.element is binded by MutationObserver. In this case, polyfill is required in IE9 and IE10 becuase they do not support
|
||||
* MutationObserver. On the other hand, if chart always will be binded, polyfill will not be required because MutationObserver will never be called.
|
||||
*/
|
||||
bindto?: string | HTMLElement | d3.Selection<any> | null;
|
||||
bindto?: string | HTMLElement | d3.Selection<any, any, any, any> | null;
|
||||
size?: {
|
||||
/**
|
||||
* The desired width of the chart element.
|
||||
@@ -172,16 +172,18 @@ export interface ChartConfiguration {
|
||||
/**
|
||||
* Change the width of bar chart. If ratio is specified, change the width of bar chart by ratio.
|
||||
*/
|
||||
width?: number | {
|
||||
/**
|
||||
* Set the width of each bar by ratio
|
||||
*/
|
||||
ratio: number,
|
||||
/**
|
||||
* Set max width of each bar
|
||||
*/
|
||||
max?: number
|
||||
};
|
||||
width?:
|
||||
| number
|
||||
| {
|
||||
/**
|
||||
* Set the width of each bar by ratio
|
||||
*/
|
||||
ratio: number;
|
||||
/**
|
||||
* Set max width of each bar
|
||||
*/
|
||||
max?: number;
|
||||
};
|
||||
/**
|
||||
* Set if min or max value will be 0 on bar chart.
|
||||
*/
|
||||
@@ -205,7 +207,7 @@ export interface ChartConfiguration {
|
||||
/**
|
||||
* Set threshold to show/hide labels.
|
||||
*/
|
||||
threshold?: number
|
||||
threshold?: number;
|
||||
};
|
||||
/**
|
||||
* Enable or disable expanding pie pieces.
|
||||
@@ -226,7 +228,7 @@ export interface ChartConfiguration {
|
||||
/**
|
||||
* Set threshold to show/hide labels.
|
||||
*/
|
||||
threshold?: number
|
||||
threshold?: number;
|
||||
};
|
||||
/**
|
||||
* Enable or disable expanding pie pieces.
|
||||
@@ -280,7 +282,17 @@ export interface ChartConfiguration {
|
||||
/**
|
||||
* Set custom spline interpolation
|
||||
*/
|
||||
type?: 'linear' | 'linear-closed' | 'basis' | 'basis-open' | 'basis-closed' | 'bundle' | 'cardinal' | 'cardinal-open' | 'cardinal-closed' | 'monotone';
|
||||
type?:
|
||||
| "linear"
|
||||
| "linear-closed"
|
||||
| "basis"
|
||||
| "basis-open"
|
||||
| "basis-closed"
|
||||
| "bundle"
|
||||
| "cardinal"
|
||||
| "cardinal-open"
|
||||
| "cardinal-closed"
|
||||
| "monotone";
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -309,7 +321,7 @@ export interface Data {
|
||||
/**
|
||||
* Choose which JSON object keys correspond to desired data.
|
||||
*/
|
||||
keys?: { x?: string; value: string[]; };
|
||||
keys?: { x?: string; value: string[] };
|
||||
/**
|
||||
* Specify the key of x values in the data.
|
||||
* We can show the data with non-index x values by this option. This option is required when the type of x axis is timeseries. If this option is set on category axis, the values of the data
|
||||
@@ -365,9 +377,7 @@ export interface Data {
|
||||
* - j is the sub index of the data point where the label is shown.
|
||||
* Formatter function can be defined for each data by specifying as an object and D3 formatter function can be set (e.g. d3.format('$'))
|
||||
*/
|
||||
labels?: boolean |
|
||||
{ format: FormatFunction } |
|
||||
{ format: { [key: string]: FormatFunction } };
|
||||
labels?: boolean | { format: FormatFunction } | { format: { [key: string]: FormatFunction } };
|
||||
/**
|
||||
* Define the order of the data.
|
||||
* This option changes the order of stacking the data and pieces of pie/donut. If null specified, it will be the order the data loaded. If function specified, it will be used to sort the data
|
||||
@@ -387,11 +397,11 @@ export interface Data {
|
||||
* This option should a function and the specified function receives color (e.g. '#ff0000') and d that has data parameters like id, value, index, etc. And it must return a string that
|
||||
* represents color (e.g. '#00ff00').
|
||||
*/
|
||||
color?(color: string, d: any): string | d3.Rgb;
|
||||
color?(color: string, d: any): string | d3.RGBColor;
|
||||
/**
|
||||
* Set color for each data.
|
||||
*/
|
||||
colors?: { [key: string]: string | d3.Rgb | ((d: any) => string | d3.Rgb) };
|
||||
colors?: { [key: string]: string | d3.RGBColor | ((d: any) => string | d3.RGBColor) };
|
||||
/**
|
||||
* Hide each data when the chart appears.
|
||||
* If true specified, all of data will be hidden. If multiple ids specified as an array, those will be hidden.
|
||||
@@ -813,7 +823,7 @@ export interface PointOptions {
|
||||
/**
|
||||
* The radius size of each point on focus.
|
||||
*/
|
||||
r?: number
|
||||
r?: number;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -877,7 +887,7 @@ export interface ChartAPI {
|
||||
load(args: {
|
||||
url?: string;
|
||||
json?: {};
|
||||
keys?: { x?: string; value: string[]; }
|
||||
keys?: { x?: string; value: string[] };
|
||||
rows?: PrimitiveArray[];
|
||||
columns?: PrimitiveArray[];
|
||||
xs?: { [key: string]: string };
|
||||
@@ -885,7 +895,7 @@ export interface ChartAPI {
|
||||
classes?: { [key: string]: string };
|
||||
categories?: string[];
|
||||
axes?: { [key: string]: string };
|
||||
colors?: { [key: string]: string | d3.Rgb };
|
||||
colors?: { [key: string]: string | d3.RGBColor };
|
||||
type?: string;
|
||||
types?: { [key: string]: string };
|
||||
unload?: boolean | ArrayOrString;
|
||||
@@ -911,7 +921,7 @@ export interface ChartAPI {
|
||||
*/
|
||||
flow(args: {
|
||||
json?: {};
|
||||
keys?: { x?: string; value: string[]; }
|
||||
keys?: { x?: string; value: string[] };
|
||||
rows?: PrimitiveArray[];
|
||||
columns?: PrimitiveArray[];
|
||||
to?: any;
|
||||
@@ -997,7 +1007,7 @@ export interface ChartAPI {
|
||||
* Get and set colors of the data loaded in the chart.
|
||||
* @param colors If this argument is given, the colors of data will be updated. If not given, the current colors will be returned. The format of this argument is the same as data.colors.
|
||||
*/
|
||||
colors(colors?: { [key: string]: string | d3.Rgb }): { [key: string]: string };
|
||||
colors(colors?: { [key: string]: string | d3.RGBColor }): { [key: string]: string };
|
||||
/**
|
||||
* Get and set axes of the data loaded in the chart.
|
||||
* @param axes If this argument is given, the axes of data will be updated. If not given, the current axes will be returned. The format of this argument is the same as data.axes.
|
||||
@@ -1040,22 +1050,25 @@ export interface ChartAPI {
|
||||
* Get and set axis labels.
|
||||
* @param labels If labels is given, specified axis' label will be updated.
|
||||
*/
|
||||
labels(labels?: { [key: string]: string }): { [key: string]: string }
|
||||
labels(labels?: { [key: string]: string }): { [key: string]: string };
|
||||
/**
|
||||
* Get and set axis min value.
|
||||
* @param min If min is given, specified axis' min value will be updated. If no argument is given, the current min values for each axis will be returned.
|
||||
*/
|
||||
min(min?: number | { [key: string]: number }): number | { [key: string]: number }
|
||||
min(min?: number | { [key: string]: number }): number | { [key: string]: number };
|
||||
/**
|
||||
* Get and set axis max value.
|
||||
* @param max If max is given, specified axis' max value will be updated. If no argument is given, the current max values for each axis will be returned.
|
||||
*/
|
||||
max(max?: number | { [key: string]: number }): number | { [key: string]: number }
|
||||
max(max?: number | { [key: string]: number }): number | { [key: string]: number };
|
||||
/**
|
||||
* Get and set axis min and max value.
|
||||
* @param range If range is given, specified axis' min and max value will be updated. If no argument is given, the current min and max values for each axis will be returned.
|
||||
*/
|
||||
range(range?: { min?: number | { [key: string]: number }; max?: number | { [key: string]: number } }): { min: number | { [key: string]: number }; max: number | { [key: string]: number } }
|
||||
range(range?: {
|
||||
min?: number | { [key: string]: number };
|
||||
max?: number | { [key: string]: number };
|
||||
}): { min: number | { [key: string]: number }; max: number | { [key: string]: number } };
|
||||
};
|
||||
|
||||
legend: {
|
||||
|
||||
+6
-15
@@ -1,29 +1,20 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"lib": ["es6", "dom"],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": false,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"typeRoots": ["../"],
|
||||
"types": [],
|
||||
"paths": {
|
||||
"d3": [
|
||||
"d3/v3"
|
||||
]
|
||||
"d3-scale": ["d3-scale/v1"],
|
||||
"d3": ["d3/v4"]
|
||||
},
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"c3-tests.ts"
|
||||
]
|
||||
}
|
||||
"files": ["index.d.ts", "c3-tests.ts"]
|
||||
}
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
import CircuitBreaker = require('circuit-breaker-js');
|
||||
|
||||
const breaker = new CircuitBreaker();
|
||||
breaker.isOpen();
|
||||
|
||||
const options: CircuitBreaker.Options = {};
|
||||
|
||||
let status: number = CircuitBreaker.CLOSED;
|
||||
status = CircuitBreaker.OPEN;
|
||||
|
||||
breaker.forceOpen();
|
||||
breaker.forceClose();
|
||||
Vendored
+38
@@ -0,0 +1,38 @@
|
||||
// Type definitions for circuit-breaker-js 0.0
|
||||
// Project: http://yammer.github.io/circuit-breaker-js/
|
||||
// Definitions by: Timur Amirov <https://github.com/DeTeam>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export = CircuitBreaker;
|
||||
|
||||
declare namespace CircuitBreaker {
|
||||
interface Options {
|
||||
windowDuration?: number;
|
||||
numBuckets?: number;
|
||||
timeoutDuration?: number;
|
||||
errorThreshold?: number;
|
||||
volumeThreshold?: number;
|
||||
|
||||
onCircuitOpen?: (m: Metrics) => void;
|
||||
onCircuitClose?: (m: Metrics) => void;
|
||||
}
|
||||
|
||||
interface Metrics {
|
||||
totalCount: number;
|
||||
errorCount: number;
|
||||
errorPercentage: number;
|
||||
}
|
||||
}
|
||||
|
||||
declare class CircuitBreaker {
|
||||
static OPEN: 0;
|
||||
static HALF_OPEN: 1;
|
||||
static CLOSED: 2;
|
||||
|
||||
constructor(options?: CircuitBreaker.Options);
|
||||
run(command: () => void, fallback?: () => void): void;
|
||||
forceClose(): void;
|
||||
forceOpen(): void;
|
||||
unforce(): void;
|
||||
isOpen(): boolean;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"circuit-breaker-js-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
@@ -49,3 +49,14 @@ promise1 = d3Fetch.tsv(url);
|
||||
promise1 = d3Fetch.tsv(url, init);
|
||||
promise2 = d3Fetch.tsv<MyType>(url, parseRow);
|
||||
promise2 = d3Fetch.tsv<MyType>(url, init, parseRow);
|
||||
|
||||
let docPromise: Promise<Document>;
|
||||
docPromise = d3Fetch.hmtl(url);
|
||||
docPromise = d3Fetch.hmtl(url, init);
|
||||
|
||||
docPromise = d3Fetch.svg(url);
|
||||
docPromise = d3Fetch.svg(url, init);
|
||||
|
||||
let xmlDocPromise: Promise<XMLDocument>;
|
||||
xmlDocPromise = d3Fetch.xml(url);
|
||||
xmlDocPromise = d3Fetch.xml(url, init);
|
||||
|
||||
Vendored
+32
-2
@@ -1,10 +1,10 @@
|
||||
// Type definitions for d3-fetch 1.0
|
||||
// Type definitions for d3-fetch 1.1
|
||||
// Project: https://d3js.org/d3-fetch/
|
||||
// Definitions by: Hugues Stefanski <https://github.com/ledragon>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
// Last module patch version validated against: 1.0.1
|
||||
// Last module patch version validated against: 1.1.0
|
||||
|
||||
import { DSVParsedArray, DSVRowString, DSVRowAny } from 'd3-dsv';
|
||||
|
||||
@@ -146,6 +146,16 @@ export function dsv<ParsedRow extends DSVRowAny>(
|
||||
row: (rawRow: DSVRowString, index: number, columns: string[]) => ParsedRow | undefined | null
|
||||
): Promise<DSVParsedArray<ParsedRow>>;
|
||||
|
||||
/**
|
||||
* Fetches the file at the specified input URL as text, parses it as HTML and returns a Promise of an HTML DOM Document.
|
||||
*
|
||||
* If init is specified, it is passed along to the underlying call to fetch.
|
||||
*
|
||||
* @param url A valid URL string.
|
||||
* @param init An optional request initialization object.
|
||||
*/
|
||||
export function hmtl(url: string, init?: RequestInit): Promise<Document>;
|
||||
|
||||
/**
|
||||
* Fetches the image at the specified input URL and returns a promise of an HTML image element.
|
||||
*
|
||||
@@ -168,6 +178,16 @@ export function image(url: string, init?: {[key: string]: any}): Promise<HTMLIma
|
||||
*/
|
||||
export function json<ParsedJSONObject extends any>(url: string, init?: RequestInit): Promise<ParsedJSONObject>;
|
||||
|
||||
/**
|
||||
* Fetches the file at the specified input URL as text, parses it as SVG and returns a Promise of an SVG Document.
|
||||
*
|
||||
* If init is specified, it is passed along to the underlying call to fetch.
|
||||
*
|
||||
* @param url A valid URL string.
|
||||
* @param init An optional request initialization object.
|
||||
*/
|
||||
export function svg(url: string, init?: RequestInit): Promise<Document>;
|
||||
|
||||
/**
|
||||
* Fetches the text file at the specified input URL and returns it as a Promise of a string.
|
||||
*
|
||||
@@ -234,3 +254,13 @@ export function tsv<ParsedRow extends DSVRowAny>(
|
||||
init: RequestInit,
|
||||
row: (rawRow: DSVRowString, index: number, columns: string[]) => ParsedRow | undefined | null
|
||||
): Promise<DSVParsedArray<ParsedRow>>;
|
||||
|
||||
/**
|
||||
* Fetches the file at the specified input URL as text, parses it as XML and returns a Promise of an XML Document.
|
||||
*
|
||||
* If init is specified, it is passed along to the underlying call to fetch.
|
||||
*
|
||||
* @param url A valid URL string.
|
||||
* @param init An optional request initialization object.
|
||||
*/
|
||||
export function xml(url: string, init?: RequestInit): Promise<XMLDocument>;
|
||||
|
||||
@@ -148,12 +148,14 @@ dynogels.dynamoDriver(dynamodb);
|
||||
|
||||
// Saving Models To DynamoDB
|
||||
Account.create({ email: 'foo@example.com', name: 'Foo Bar', age: 21 }, (err, acc) => {
|
||||
acc.get('email');
|
||||
const email = acc.get('email') as string;
|
||||
console.log(`Created account ${email}`);
|
||||
});
|
||||
|
||||
const acc = new Account({ email: 'test@example.com', name: 'Test Example' });
|
||||
acc.save((err) => {
|
||||
acc.get('email');
|
||||
const email = acc.get('email') as string;
|
||||
console.log(`Created account ${email}`);
|
||||
});
|
||||
|
||||
BlogPost.create({
|
||||
|
||||
Vendored
+4
-2
@@ -1,7 +1,8 @@
|
||||
// Type definitions for dynogels 8.0
|
||||
// Type definitions for dynogels 9.0
|
||||
// Project: https://github.com/clarkie/dynogels#readme
|
||||
// Definitions by: Spartan Labs <https://github.com/SpartanLabs>
|
||||
// Ramon de Klein <https://github.com/ramondeklein>
|
||||
// Stephen Tuso <https://github.com/stephentuso>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.4
|
||||
|
||||
@@ -153,7 +154,8 @@ export interface ModelConfig {
|
||||
|
||||
// Dynogels Item
|
||||
export interface Item {
|
||||
get(key?: string): { [key: string]: any };
|
||||
get(): { [key: string]: any };
|
||||
get(key: string): any;
|
||||
set(params: {}): Item;
|
||||
save(callback?: DynogelsItemCallback): void;
|
||||
update(options: UpdateItemOptions, callback?: DynogelsItemCallback): void;
|
||||
|
||||
Vendored
+6
@@ -3500,6 +3500,12 @@ declare module '@ember/enumerable' {
|
||||
export default Enumerable;
|
||||
}
|
||||
|
||||
declare module '@ember/error' {
|
||||
import Ember from 'ember';
|
||||
const Error: typeof Ember.Error;
|
||||
export default Error;
|
||||
}
|
||||
|
||||
declare module '@ember/instrumentation' {
|
||||
import Ember from 'ember';
|
||||
export const instrument: typeof Ember.instrument;
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
import { assertType } from "./lib/assert";
|
||||
|
||||
import Ember from "ember";
|
||||
import EmberError from "@ember/error";
|
||||
|
||||
assertType<typeof Ember.Error>(EmberError);
|
||||
@@ -23,6 +23,7 @@
|
||||
"test/lib/assert.ts",
|
||||
"test/application.ts",
|
||||
"test/ember-tests.ts",
|
||||
"test/error.ts",
|
||||
"test/event.ts",
|
||||
"test/extend.ts",
|
||||
"test/create.ts",
|
||||
@@ -49,4 +50,4 @@
|
||||
"test/route.ts",
|
||||
"test/view-utils.ts"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
import EventSource = require("eventsource");
|
||||
|
||||
const eventSource = new EventSource("http://foobar");
|
||||
eventSource.onmessage = (x: any) => {};
|
||||
eventSource.onerror = (x: any) => {};
|
||||
eventSource.onopen = (x: any) => {};
|
||||
eventSource.close();
|
||||
|
||||
import EventSourcePolyfill = require("eventsource/lib/eventsource-polyfill");
|
||||
|
||||
const eventSourcePolyfill = new EventSourcePolyfill("http://foobar");
|
||||
eventSourcePolyfill.onmessage = (x: any) => {};
|
||||
eventSourcePolyfill.onerror = (x: any) => {};
|
||||
eventSourcePolyfill.onopen = (x: any) => {};
|
||||
eventSourcePolyfill.close();
|
||||
Vendored
+35
@@ -0,0 +1,35 @@
|
||||
// Type definitions for eventsource 1.0
|
||||
// Project: http://github.com/EventSource/eventsource
|
||||
// Definitions by: Scott Lee Davis <https://github.com/scottleedavis>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
declare class EventSource {
|
||||
constructor(url: string, eventSourceInitDict?: EventSource.EventSourceInitDict);
|
||||
|
||||
static CLOSED: EventSource.ReadyState;
|
||||
static CONNECTING: EventSource.ReadyState;
|
||||
static OPEN: EventSource.ReadyState;
|
||||
|
||||
url: string;
|
||||
readyState: EventSource.ReadyState;
|
||||
onopen: EventListener;
|
||||
onmessage: EventListener;
|
||||
onerror: EventListener;
|
||||
close(): void;
|
||||
}
|
||||
|
||||
declare namespace EventSource {
|
||||
enum ReadyState {CONNECTING = 0, OPEN = 1, CLOSED = 2}
|
||||
|
||||
interface EventSourceInitDict {
|
||||
withCredentials?: boolean;
|
||||
headers?: object;
|
||||
proxy?: string;
|
||||
https?: object;
|
||||
rejectUnauthorized?: boolean;
|
||||
}
|
||||
}
|
||||
|
||||
export = EventSource;
|
||||
export as namespace EventSource;
|
||||
@@ -0,0 +1,29 @@
|
||||
declare class EventSource {
|
||||
constructor(url: string, eventSourceInitDict?: EventSource.EventSourceInitDict);
|
||||
|
||||
static CLOSED: EventSource.ReadyState;
|
||||
static CONNECTING: EventSource.ReadyState;
|
||||
static OPEN: EventSource.ReadyState;
|
||||
|
||||
url: string;
|
||||
readyState: EventSource.ReadyState;
|
||||
onopen: EventListener;
|
||||
onmessage: EventListener;
|
||||
onerror: EventListener;
|
||||
close(): void;
|
||||
}
|
||||
|
||||
declare namespace EventSource {
|
||||
enum ReadyState {CONNECTING = 0, OPEN = 1, CLOSED = 2}
|
||||
|
||||
interface EventSourceInitDict {
|
||||
withCredentials?: boolean;
|
||||
headers?: object;
|
||||
proxy?: string;
|
||||
https?: object;
|
||||
rejectUnauthorized?: boolean;
|
||||
}
|
||||
}
|
||||
|
||||
export = EventSource;
|
||||
export as namespace EventSource;
|
||||
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"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",
|
||||
"eventsource-tests.ts",
|
||||
"lib/eventsource-polyfill/index.d.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
@@ -72,6 +72,15 @@ FB.ui({
|
||||
console.log(data.payment_id);
|
||||
});
|
||||
|
||||
FB.ui({
|
||||
method: 'pay',
|
||||
action: 'purchaseiap',
|
||||
product_id: 'com.fb.friendsmash.coins.10',
|
||||
developer_payload: 'this_is_a_test_payload'
|
||||
}, response => {
|
||||
console.log(response);
|
||||
});
|
||||
|
||||
FB.ui({
|
||||
method: 'pagetab',
|
||||
redirect_uri: 'YOUR_URL'
|
||||
|
||||
Vendored
+25
-1
@@ -66,6 +66,11 @@ declare namespace facebook {
|
||||
*/
|
||||
ui(params: PayDialogParams, callback: (response: PayDialogResponse) => void): void;
|
||||
|
||||
/**
|
||||
* @see https://developers.facebook.com/docs/games_payments/payments_lite
|
||||
*/
|
||||
ui(params: PaymentsLiteDialogParams, callback: (response: PaymentsLiteDialogResponse) => void): void;
|
||||
|
||||
/**
|
||||
* @see https://developers.facebook.com/docs/videos/live-video/exploring-live
|
||||
*/
|
||||
@@ -154,6 +159,14 @@ declare namespace facebook {
|
||||
request_id?: string;
|
||||
test_currency?: string;
|
||||
}
|
||||
|
||||
interface PaymentsLiteDialogParams extends DialogParams {
|
||||
method: 'pay';
|
||||
action: 'purchaseiap';
|
||||
product_id: string;
|
||||
developer_payload?: string;
|
||||
quantity?: number;
|
||||
}
|
||||
|
||||
interface LiveDialogParams extends DialogParams {
|
||||
method: 'live_broadcast';
|
||||
@@ -173,7 +186,7 @@ declare namespace facebook {
|
||||
authResponse: {
|
||||
accessToken: string;
|
||||
expiresIn: number;
|
||||
grantedScopes: string;
|
||||
grantedScopes: string;
|
||||
signedRequest: string;
|
||||
userID: string;
|
||||
};
|
||||
@@ -199,6 +212,17 @@ declare namespace facebook {
|
||||
signed_request: string;
|
||||
}
|
||||
|
||||
interface PaymentsLiteDialogResponse {
|
||||
developer_payload?: string;
|
||||
payment_id: number;
|
||||
product_id?: string;
|
||||
purchase_time?: number;
|
||||
purchase_token?: string;
|
||||
signed_request?: string;
|
||||
error_code?: number;
|
||||
error_message?: string;
|
||||
}
|
||||
|
||||
interface LiveDialogResponse {
|
||||
id: string;
|
||||
stream_url: string;
|
||||
|
||||
+109
-83
@@ -5,104 +5,130 @@
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
declare namespace I18next {
|
||||
interface I18nextOptions extends i18nextExpressMiddleware.I18nextOptions { }
|
||||
interface I18nextOptions extends i18nextExpressMiddleware.I18nextOptions {}
|
||||
}
|
||||
|
||||
declare namespace i18nextExpressMiddleware {
|
||||
/**
|
||||
* @summary Interface for Language detector options.
|
||||
* @interface
|
||||
*/
|
||||
interface LanguageDetectorOptions {
|
||||
caches?: Array<string>|boolean;
|
||||
cookieDomain?: string;
|
||||
cookieExpirationDate?: Date;
|
||||
lookupCookie?: string;
|
||||
lookupFromPathIndex?: number;
|
||||
lookupQuerystring?: string;
|
||||
lookupSession?: string;
|
||||
order?: Array<string>;
|
||||
}
|
||||
/**
|
||||
* @summary Interface for Language detector options.
|
||||
* @interface
|
||||
*/
|
||||
interface LanguageDetectorOptions {
|
||||
caches?: Array<string> | boolean
|
||||
cookieDomain?: string
|
||||
cookieExpirationDate?: Date
|
||||
lookupCookie?: string
|
||||
lookupFromPathIndex?: number
|
||||
lookupQuerystring?: string
|
||||
lookupSession?: string
|
||||
order?: Array<string>
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary i18next options.
|
||||
* @interface
|
||||
*/
|
||||
interface I18nextOptions {
|
||||
detection?: LanguageDetectorOptions;
|
||||
}
|
||||
/**
|
||||
* @summary i18next options.
|
||||
* @interface
|
||||
*/
|
||||
interface I18nextOptions {
|
||||
detection?: LanguageDetectorOptions
|
||||
}
|
||||
}
|
||||
|
||||
declare module "i18next-express-middleware" {
|
||||
import express = require("express");
|
||||
import i18next = require("i18next");
|
||||
declare module 'i18next-express-middleware' {
|
||||
import express = require('express')
|
||||
import i18next = require('i18next')
|
||||
|
||||
/**
|
||||
* @summary Interface for middleware to use i18next in express.js.
|
||||
* @interface
|
||||
*/
|
||||
export interface i18nextExpressMiddleware {
|
||||
LanguageDetector(): express.Handler
|
||||
missingKeyHandler(): express.Handler
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary Interface for own detection functionality.
|
||||
*/
|
||||
export interface i18nextCustomDetection {
|
||||
name: string
|
||||
lookup: (
|
||||
req: express.Request,
|
||||
res: express.Response,
|
||||
options?: Object
|
||||
) => void
|
||||
cacheUserLanguage: (
|
||||
req: express.Request,
|
||||
res: express.Response,
|
||||
lng?: any,
|
||||
options?: Object
|
||||
) => void
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary Detects user language from current request.
|
||||
* @class
|
||||
*/
|
||||
export class LanguageDetector {
|
||||
/**
|
||||
* @summary Constructor.
|
||||
* @constructor
|
||||
* @param {any} services The services.
|
||||
* @param {Object} options The options.
|
||||
* @param {Object} allOptions The all options.
|
||||
*/
|
||||
constructor(services?: any, options?: Object, allOptions?: Object)
|
||||
|
||||
/**
|
||||
* @summary Interface for middleware to use i18next in express.js.
|
||||
* @interface
|
||||
* @summary Adds detector.
|
||||
* @param {i18nextCustomDetection} detector The detector to add.
|
||||
*/
|
||||
export interface i18nextExpressMiddleware {
|
||||
LanguageDetector(): express.Handler;
|
||||
missingKeyHandler(): express.Handler;
|
||||
}
|
||||
addDetector(detector: i18nextCustomDetection): void
|
||||
|
||||
// NOTE: add documentation
|
||||
cacheUserLanguage(
|
||||
req: express.Request,
|
||||
res: express.Response,
|
||||
detectionOrder: any
|
||||
): void
|
||||
|
||||
/**
|
||||
* @summary Interface for own detection functionality.
|
||||
* @summary Detects the language.
|
||||
* @param {Request} req The HTTP request.
|
||||
* @param {Response} res The HTTP response.
|
||||
* @param {detectionOrder} detectionOrder The detection order.
|
||||
*/
|
||||
export interface i18nextCustomDetection {
|
||||
name: string;
|
||||
lookup: (req: express.Request, res: express.Response, options?: Object) => void;
|
||||
cacheUserLanguage: (req: express.Request, res: express.Response, lng?: any, options?: Object) => void;
|
||||
}
|
||||
detect(
|
||||
req: express.Request,
|
||||
res: express.Response,
|
||||
detectionOrder: any
|
||||
): void
|
||||
|
||||
/**
|
||||
* @summary Detects user language from current request.
|
||||
* @class
|
||||
* @summary Initializes class.
|
||||
* @param {any} services The services.
|
||||
* @param {Object} options The options.
|
||||
* @param {Object} allOptions The all options.
|
||||
*/
|
||||
export class LanguageDetector {
|
||||
/**
|
||||
* @summary Constructor.
|
||||
* @constructor
|
||||
* @param {any} services The services.
|
||||
* @param {Object} options The options.
|
||||
* @param {Object} allOptions The all options.
|
||||
*/
|
||||
constructor(services?: any, options?: Object, allOptions?: Object);
|
||||
init(services: any, options?: Object, allOptions?: Object): void
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary Adds detector.
|
||||
* @param {i18nextCustomDetection} detector The detector to add.
|
||||
*/
|
||||
addDetector(detector: i18nextCustomDetection): void;
|
||||
export function getResourcesHandler(
|
||||
i18next: i18next.i18n,
|
||||
options: Object
|
||||
): express.Handler
|
||||
export function handle(
|
||||
i18next: i18next.i18n,
|
||||
options?: Object
|
||||
): express.Handler
|
||||
|
||||
// NOTE: add documentation
|
||||
cacheUserLanguage(req: express.Request, res: express.Response, detectionOrder: any): void;
|
||||
|
||||
/**
|
||||
* @summary Detects the language.
|
||||
* @param {Request} req The HTTP request.
|
||||
* @param {Response} res The HTTP response.
|
||||
* @param {detectionOrder} detectionOrder The detection order.
|
||||
*/
|
||||
detect(req: express.Request, res: express.Response, detectionOrder: any): void;
|
||||
|
||||
/**
|
||||
* @summary Initializes class.
|
||||
* @param {any} services The services.
|
||||
* @param {Object} options The options.
|
||||
* @param {Object} allOptions The all options.
|
||||
*/
|
||||
init(services: any, options?: Object, allOptions?: Object): void;
|
||||
}
|
||||
|
||||
export function getResourcesHandler(i18next: i18next.i18n, options: Object): express.Handler;
|
||||
export function handle(i18next: i18next.i18n, options?: Object): express.Handler;
|
||||
|
||||
/**
|
||||
* @summary Gets handler for missing key.
|
||||
* @param {I18nextStatic} i18next The i18next.
|
||||
* @param {Object} options The options.
|
||||
* @return {express.Handler} The express handler.
|
||||
*/
|
||||
export function missingKeyHandler(i18next: i18next.i18n, options: Object): express.Handler;
|
||||
/**
|
||||
* @summary Gets handler for missing key.
|
||||
* @param {I18nextStatic} i18next The i18next.
|
||||
* @param {Object} options The options.
|
||||
* @return {express.Handler} The express handler.
|
||||
*/
|
||||
export function missingKeyHandler(
|
||||
i18next: i18next.i18n,
|
||||
options?: Object
|
||||
): express.Handler
|
||||
}
|
||||
|
||||
Vendored
+8
-1
@@ -6,6 +6,7 @@
|
||||
// Qibang <https://github.com/bang88>
|
||||
// Jason Dreyzehner <https://github.com/bitjson>
|
||||
// Synarque <https://github.com/synarque>
|
||||
// Justin Rockwood <https://github.com/jrockwood>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
// TypeScript Version: 2.3
|
||||
@@ -112,6 +113,12 @@ declare namespace inquirer {
|
||||
* The value returned will be added to the Answers hash.
|
||||
*/
|
||||
filter?(input: string): string | Promise<string>;
|
||||
/**
|
||||
* Receive the user input and return the transformed value to be displayed to the user. The
|
||||
* transformation only impacts what is shown while editing. It does not impact the answers
|
||||
* hash.
|
||||
*/
|
||||
transformer?(input: string): string;
|
||||
/**
|
||||
* Receive the current user answers hash and should return true or false depending on whether or
|
||||
* not this question should be asked. The value can also be a simple boolean.
|
||||
@@ -242,7 +249,7 @@ declare namespace inquirer {
|
||||
|
||||
interface ChoiceOption {
|
||||
name?: string;
|
||||
value?: string;
|
||||
value?: any;
|
||||
type?: string;
|
||||
extra?: any;
|
||||
key?: string;
|
||||
|
||||
@@ -584,3 +584,45 @@ inquirer.prompt(
|
||||
console.log(JSON.stringify(answers, null, ' '));
|
||||
}
|
||||
);
|
||||
|
||||
//
|
||||
// Other tests not covered in the examples provided with inquirer
|
||||
//
|
||||
|
||||
// Tests promises from default, choices, validate, filter, and when
|
||||
|
||||
interface AsyncAnswers {
|
||||
choice: 'ONE' | 'TWO' | 'THREE';
|
||||
choseTwo: boolean;
|
||||
confirmation: string;
|
||||
}
|
||||
|
||||
async function testAsyncPrompt(): Promise<void> {
|
||||
const answers: AsyncAnswers = await inquirer.prompt<AsyncAnswers>([
|
||||
{
|
||||
type: 'list',
|
||||
name: 'choice',
|
||||
message: 'How many do you want?',
|
||||
default: () => Promise.resolve('two'),
|
||||
choices: () => Promise.resolve(['one', 'two', 'three']),
|
||||
filter: (input: string) => Promise.resolve(input.toUpperCase()),
|
||||
},
|
||||
{
|
||||
type: 'confirm',
|
||||
name: 'choseTwo',
|
||||
message: 'Are you sure you want two?',
|
||||
when: (choices: AsyncAnswers) => Promise.resolve(choices.choice === 'TWO'),
|
||||
},
|
||||
{
|
||||
type: 'input',
|
||||
name: 'confirmation',
|
||||
message: 'Type YES if you really, really want it',
|
||||
validate: (input: string) => Promise.resolve(input.toUpperCase() === 'YES' ? true : 'Enter YES'),
|
||||
transformer: (input: string) => input.toUpperCase(),
|
||||
},
|
||||
]);
|
||||
|
||||
console.log(JSON.stringify(answers, null, ' '));
|
||||
}
|
||||
|
||||
testAsyncPrompt();
|
||||
|
||||
Vendored
+20
@@ -0,0 +1,20 @@
|
||||
// Type definitions for is-color 1.0
|
||||
// Project: https://github.com/morishitter/is-color
|
||||
// Definitions by: Vitor Luiz Cavalcanti <https://github.com/VitorLuizC>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare function isColor(str: string): boolean;
|
||||
|
||||
declare namespace isColor {
|
||||
function isRgb(str: string): boolean;
|
||||
function isRgba(str: string): boolean;
|
||||
function isHsl(str: string): boolean;
|
||||
function isHsla(str: string): boolean;
|
||||
function isHex(str: string): boolean;
|
||||
function isKeyword(str: string): boolean;
|
||||
function isInherit(str: string): str is 'inherit';
|
||||
function isCurrentColor(str: string): str is ('currentColor' | 'currentcolor');
|
||||
function isTransparent(str: string): str is 'transparent';
|
||||
}
|
||||
|
||||
export = isColor;
|
||||
@@ -0,0 +1,23 @@
|
||||
import isColor = require('is-color');
|
||||
|
||||
isColor('#000');
|
||||
// => boolean
|
||||
|
||||
isColor.isHex('#000');
|
||||
// => boolean
|
||||
isColor.isHsl('#000');
|
||||
// => boolean
|
||||
isColor.isHsla('#000');
|
||||
// => boolean
|
||||
isColor.isRgb('rgb(0, 0, 0)');
|
||||
// => boolean
|
||||
isColor.isRgba('rgba(0,0,0, 0)');
|
||||
// => boolean
|
||||
isColor.isKeyword('red');
|
||||
// => boolean
|
||||
isColor.isInherit('inherit');
|
||||
// => is 'inherit'
|
||||
isColor.isTransparent('transparent');
|
||||
// => is 'transparent'
|
||||
isColor.isCurrentColor('currentColor');
|
||||
// => is 'currentColor'|'currentcolor'
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"is-color-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Vendored
+18
-3
@@ -32,6 +32,11 @@ interface IsStatic {
|
||||
*/
|
||||
error(value: any): boolean;
|
||||
|
||||
/**
|
||||
* Checks if the given value type is function.
|
||||
*/
|
||||
fn(value: any): boolean;
|
||||
|
||||
/**
|
||||
* Checks if the given value type is function.
|
||||
*/
|
||||
@@ -587,7 +592,7 @@ interface IsStaticApi {
|
||||
* Checks if the given value type is arguments.
|
||||
*/
|
||||
arguments(...value: any[]): boolean;
|
||||
|
||||
|
||||
/**
|
||||
* Checks if the given value type is arguments.
|
||||
*/
|
||||
@@ -633,6 +638,16 @@ interface IsStaticApi {
|
||||
*/
|
||||
error(value: any[]): boolean;
|
||||
|
||||
/**
|
||||
* Checks if the given value type is function.
|
||||
*/
|
||||
fn(...value: any[]): boolean;
|
||||
|
||||
/**
|
||||
* Checks if the given value type is function.
|
||||
*/
|
||||
fn(value: any[]): boolean;
|
||||
|
||||
/**
|
||||
* Checks if the given value type is function.
|
||||
*/
|
||||
@@ -1234,12 +1249,12 @@ interface Is extends IsStatic {
|
||||
* Override RegExps if you think they suck.
|
||||
*/
|
||||
setRegexp(value: RegExp, regexp: 'url'): boolean;
|
||||
|
||||
|
||||
/**
|
||||
* Override RegExps if you think they suck.
|
||||
*/
|
||||
setRegexp(value: RegExp, regexp: 'email'): boolean;
|
||||
|
||||
|
||||
/**
|
||||
* Override RegExps if you think they suck.
|
||||
*/
|
||||
|
||||
@@ -36,6 +36,12 @@ is.all.error(new Error(), 'bar');
|
||||
is.any.error(new Error(), 'bar');
|
||||
is.all.error([new Error(), 'foo', 'bar']);
|
||||
|
||||
is.fn(toString);
|
||||
is.not.fn({ foo: 'bar' });
|
||||
is.all.fn(toString, 'bar');
|
||||
is.any.fn(toString, 'bar');
|
||||
is.all.fn([toString, 'foo', 'bar']);
|
||||
|
||||
is.function(toString);
|
||||
is.not.function({ foo: 'bar' });
|
||||
is.all.function(toString, 'bar');
|
||||
|
||||
Vendored
+1
-1
@@ -125,7 +125,7 @@ declare class JSS {
|
||||
): StyleSheet<T>;
|
||||
removeStyleSheet(sheet: StyleSheet<any>): this;
|
||||
setup(options?: Partial<JSSOptions>): this;
|
||||
use(plugin: JSSPlugin): this;
|
||||
use(...plugins: JSSPlugin[]): this;
|
||||
createRule(style: Style, options?: Partial<RuleFactoryOptions>): Rule;
|
||||
createRule(name: string, style: Style, options?: Partial<RuleFactoryOptions>): Rule;
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import {
|
||||
} from 'jss';
|
||||
|
||||
const jss = createJSS().setup({});
|
||||
jss.use({}, {}); // $ExpectType JSS
|
||||
|
||||
const styleSheet = jss.createStyleSheet(
|
||||
{
|
||||
|
||||
Vendored
+233
@@ -0,0 +1,233 @@
|
||||
// Type definitions for jwt-express 1.1
|
||||
// Project: https://github.com/AustP/jwt-express#readme
|
||||
// Definitions by: Nick Paddock <https://github.com/nickp10>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
import express = require("express");
|
||||
import jsonwebtoken = require("jsonwebtoken");
|
||||
|
||||
export interface JWT {
|
||||
/**
|
||||
* Indicates if the JWT is expired. valid will always be false if this is true.
|
||||
*/
|
||||
expired: boolean;
|
||||
|
||||
/**
|
||||
* The jwt-express options.
|
||||
*/
|
||||
options: JWTExpressOptions;
|
||||
|
||||
/**
|
||||
* The payload of the JWT (must be an object). jwt-express will add a stales key-value pair to the payload for stale.
|
||||
*/
|
||||
payload: any;
|
||||
|
||||
/**
|
||||
* The secret used to sign /verify the JWT.
|
||||
*/
|
||||
secret: string;
|
||||
|
||||
/**
|
||||
* Indicates if the JWT is stale. The default timeout before a JWT is considered stale is 15 minutes.
|
||||
*/
|
||||
stale: boolean;
|
||||
|
||||
/**
|
||||
* The signed token of the JWT.
|
||||
*/
|
||||
token: string;
|
||||
|
||||
/**
|
||||
* Indicates if this JWT is valid. This means that the payload hasn't been tampered with and that the JWT hasn't expired yet.
|
||||
*/
|
||||
valid: boolean;
|
||||
|
||||
/**
|
||||
* Resigns this JWT Objects's payload.
|
||||
*
|
||||
* @return this
|
||||
*/
|
||||
resign(): JWT;
|
||||
|
||||
/**
|
||||
* Calls the revoke function defined in the jwt.init() options with this JWT Object as the first parameter.
|
||||
*
|
||||
* @return this
|
||||
*/
|
||||
revoke(): JWT;
|
||||
|
||||
/**
|
||||
* Generates a signed token from the payload.
|
||||
*
|
||||
* @param payload The payload of the JWT (must be an object).
|
||||
* @return this
|
||||
*/
|
||||
sign(payload: any): JWT;
|
||||
|
||||
/**
|
||||
* Stores this JWT in the cookie (if configured to use cookies).
|
||||
*
|
||||
* @param res The response in which to store the JWT.
|
||||
* @return this
|
||||
*/
|
||||
store(res: express.Response): JWT;
|
||||
|
||||
/**
|
||||
* This function is called when the jwt is passed through JSON.stringify.
|
||||
* We don't want the secret or options to be stringified.
|
||||
*
|
||||
* @return The JSON form of the object.
|
||||
*/
|
||||
toJSON(): any;
|
||||
|
||||
/**
|
||||
* Verify the token and load the info into this JWT.
|
||||
*
|
||||
* @param token The signed token to verify.
|
||||
* @return this
|
||||
*/
|
||||
verify(token: string): JWT;
|
||||
}
|
||||
|
||||
export interface JWTExpressOptions {
|
||||
/**
|
||||
* The name of the cookie (default: 'jwt-express')
|
||||
*/
|
||||
cookie?: string;
|
||||
|
||||
/**
|
||||
* Options to use when storing the cookie (default: {httpOnly: true})
|
||||
*/
|
||||
cookieOptions?: express.CookieOptions;
|
||||
|
||||
/**
|
||||
* If true, will use cookies, otherwise will use the Authorization header (default: true)
|
||||
*/
|
||||
cookies?: boolean;
|
||||
|
||||
/**
|
||||
* Indicates if the JWT should be refreshed and stored every request (default: true)
|
||||
*/
|
||||
refresh?: boolean;
|
||||
|
||||
/**
|
||||
* The property of req to populate (default: 'jwt')
|
||||
*/
|
||||
reqProperty?: string;
|
||||
|
||||
/**
|
||||
* jwt.revoke() will call this function (default: function(jwt) {})
|
||||
*/
|
||||
revoke?: (jwt: JWT) => void;
|
||||
|
||||
/**
|
||||
* Options to use when signing the JWT (default: {})
|
||||
*/
|
||||
signOptions?: jsonwebtoken.SignOptions;
|
||||
|
||||
/**
|
||||
* Milliseconds when the jwt will go stale (default: 900000 (15 minutes))
|
||||
*/
|
||||
stales?: number;
|
||||
|
||||
/**
|
||||
* Additional verification. Must return a boolean (default: function(jwt) {return true})
|
||||
*/
|
||||
verify?: (jwt: JWT) => boolean;
|
||||
|
||||
/**
|
||||
* Options to use when verifying the JWT (default: {})
|
||||
*/
|
||||
verifyOptions?: jsonwebtoken.VerifyOptions;
|
||||
}
|
||||
|
||||
export interface JWTExpressError extends Error {
|
||||
name: string;
|
||||
message: string;
|
||||
}
|
||||
|
||||
export let options: JWTExpressOptions;
|
||||
|
||||
/**
|
||||
* Returns a middleware function that ensures a JWT is valid and fresh. Useful to protect
|
||||
* sensitive actions from CSRF. This method will trigger error handling if the JWT is not active.
|
||||
*
|
||||
* @return Express middleware
|
||||
*/
|
||||
export function active(): express.RequestHandler;
|
||||
|
||||
/**
|
||||
* If using cookies, this method will clear the current JWT out of the cookie.
|
||||
*
|
||||
* @return Express middleware
|
||||
*/
|
||||
export function clear(): express.RequestHandler;
|
||||
|
||||
/**
|
||||
* Returns a newly created / signed JWT Object from the payload.
|
||||
*
|
||||
* @param secret
|
||||
* If secret is a string, that string will be used to verify / sign with.
|
||||
* If secret is a function, that function will be called with the payload as its first parameter,
|
||||
* and must return a string which will be used to verify / sign with.
|
||||
* @param payload The payload of the JWT.
|
||||
* @return JWT
|
||||
*/
|
||||
export function create(secret: string | ((payload: any) => string), payload: any): JWT;
|
||||
|
||||
/**
|
||||
* The jwt.init() function returns a middleware function for Express so it must be called inside app.use().
|
||||
* It will automatically read in the JWT from either the cookie or the Authorization header (configured by you)
|
||||
* and add a JWT object to the Request object (req). It will also add the jwt() method to the Response object (res)
|
||||
* to create / store JWTs. jwt.init() must be called before any other jwt method.
|
||||
*
|
||||
* @param secret
|
||||
* If secret is a string, that string will be used to verify / sign with.
|
||||
* If secret is a function, that function will be called with the Express HTTP Request as its first parameter,
|
||||
* and must return a string which will be used to verify / sign with.
|
||||
* @param options The options of jwt-express.
|
||||
* @return Express middleware
|
||||
*/
|
||||
export function init(secret: string | ((req: express.Request) => string), options?: JWTExpressOptions): express.RequestHandler;
|
||||
|
||||
/**
|
||||
* Returns a middleware function that requires the payload to contain / match certain data.
|
||||
* This method will trigger error handling if the JWT fails the requirement.
|
||||
*
|
||||
* @param key
|
||||
* This is they key used to look up the value in the payload.
|
||||
* If only this value is passed to jwt.require(), then the middleware function will check that the value is truthy.
|
||||
* @param operator The operator to compare the information
|
||||
* @param value The value to compare the payload data against
|
||||
* @return Express middleware
|
||||
*/
|
||||
export function require(key: string, operator?: string, value?: any): express.RequestHandler;
|
||||
|
||||
/**
|
||||
* Returns a middleware function that ensures a JWT is valid. This method will trigger error handling if the JWT is not valid.
|
||||
*
|
||||
* @return Express middleware
|
||||
*/
|
||||
export function valid(): express.RequestHandler;
|
||||
|
||||
declare global {
|
||||
namespace Express {
|
||||
interface Request {
|
||||
jwt: JWT;
|
||||
}
|
||||
|
||||
interface Response {
|
||||
/**
|
||||
* Returns a newly created / signed JWT Object from the payload. If you are using cookies,
|
||||
* it will automatically store the JWT in the cookie as well.
|
||||
*
|
||||
* @param payload The payload of the JWT
|
||||
* @return The newly created JWT
|
||||
*/
|
||||
jwt(payload: any): JWT;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
import exp = require("express");
|
||||
import jwt = require("jwt-express");
|
||||
|
||||
const app = exp();
|
||||
|
||||
app.use(jwt.active());
|
||||
app.use(jwt.clear());
|
||||
let jwtObj = jwt.create("Secret", { });
|
||||
jwtObj = jwt.create((p) => "Secret", { });
|
||||
app.use(jwt.init("Secret"));
|
||||
app.use(jwt.init(req => "Secret"));
|
||||
app.use(jwt.init("Secret", {
|
||||
cookie: "jwt-express",
|
||||
cookieOptions: {
|
||||
httpOnly: true
|
||||
},
|
||||
cookies: true,
|
||||
refresh: true,
|
||||
reqProperty: "jwt",
|
||||
revoke: (revokeJWT: jwt.JWT) => { jwtObj = revokeJWT; },
|
||||
signOptions: {
|
||||
expiresIn: "1h"
|
||||
},
|
||||
stales: 1000,
|
||||
verify: (verifyJWT: jwt.JWT) => { jwtObj = verifyJWT; return true; },
|
||||
verifyOptions: {
|
||||
ignoreExpiration: true
|
||||
}
|
||||
}));
|
||||
app.use(jwt.require("key"));
|
||||
app.use(jwt.require("key", "==", "value"));
|
||||
app.use(jwt.valid());
|
||||
|
||||
let resObj: exp.Response = <any> {};
|
||||
app.use((err: jwt.JWTExpressError, req: exp.Request, res: exp.Response, next: exp.NextFunction) => {
|
||||
err.message.startsWith("");
|
||||
err.name.startsWith("");
|
||||
resObj = res;
|
||||
jwtObj = req.jwt;
|
||||
req.jwt.payload;
|
||||
req.hostname.startsWith("");
|
||||
jwtObj = res.jwt({ });
|
||||
});
|
||||
|
||||
jwtObj.expired.valueOf();
|
||||
app.use(jwt.init(req => "Secret", jwtObj.options));
|
||||
jwtObj.payload;
|
||||
jwtObj.secret.startsWith("");
|
||||
jwtObj.stale.valueOf();
|
||||
jwtObj.token.startsWith("");
|
||||
jwtObj.valid.valueOf();
|
||||
|
||||
jwtObj = jwtObj.resign();
|
||||
jwtObj = jwtObj.revoke();
|
||||
jwtObj = jwtObj.sign(jwtObj.payload);
|
||||
jwtObj = jwtObj.store(resObj);
|
||||
jwtObj = jwtObj.verify(jwtObj.token);
|
||||
jwtObj.toJSON();
|
||||
|
||||
app.get("", (req: exp.Request, res: exp.Response, next: exp.NextFunction) => {
|
||||
jwtObj = req.jwt;
|
||||
req.jwt.payload;
|
||||
req.hostname.startsWith("");
|
||||
jwtObj = res.jwt({ });
|
||||
});
|
||||
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"target": "es6",
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictFunctionTypes": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"jwt-express-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Vendored
+28
-1
@@ -8,6 +8,11 @@ office-js
|
||||
Copyright (c) Microsoft Corporation
|
||||
*/
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////
|
||||
//////////////////// Begin Office namespace ////////////////////
|
||||
////////////////////////////////////////////////////////////////
|
||||
|
||||
declare namespace Office {
|
||||
export var context: Context;
|
||||
/**
|
||||
@@ -1548,6 +1553,12 @@ declare namespace Office {
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////
|
||||
///////////////////// End Office namespace /////////////////////
|
||||
////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////
|
||||
@@ -2886,6 +2897,18 @@ declare namespace OfficeExtension {
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////
|
||||
///////////////// End OfficeExtension runtime //////////////////
|
||||
////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////
|
||||
////////////////////// Begin OfficeCore ////////////////////////
|
||||
////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
declare namespace OfficeCore {
|
||||
/**
|
||||
@@ -2960,7 +2983,7 @@ declare namespace OfficeCore {
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////
|
||||
///////////////// End OfficeExtension runtime //////////////////
|
||||
/////////////////////// End OfficeCore /////////////////////////
|
||||
////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
@@ -22317,6 +22340,10 @@ declare namespace OneNote {
|
||||
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////
|
||||
/////////////////////// Begin Visio APIs ///////////////////////
|
||||
////////////////////////////////////////////////////////////////
|
||||
|
||||
Vendored
+177
@@ -0,0 +1,177 @@
|
||||
// Type definitions for Parcel (module API)
|
||||
// Project: https://github.com/parcel/parcel-bundler
|
||||
// Definitions by: Fathy Boundjadj <https://github.com/fathyb>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// Based on @types/webpack-env
|
||||
|
||||
/**
|
||||
* Parcel module API - variables and global functions available inside modules
|
||||
*/
|
||||
|
||||
declare namespace __ParcelModuleApi {
|
||||
interface RequireFunction {
|
||||
/**
|
||||
* Returns the exports from a dependency. The call is sync. No request to the server is fired. The compiler ensures that the dependency is available.
|
||||
*/
|
||||
(path: string): any;
|
||||
<T>(path: string): T;
|
||||
}
|
||||
|
||||
interface Module {
|
||||
exports: any;
|
||||
require(id: string): any;
|
||||
require<T>(id: string): T;
|
||||
id: string;
|
||||
filename: string;
|
||||
loaded: boolean;
|
||||
parent: any;
|
||||
children: any[];
|
||||
hot?: Hot;
|
||||
}
|
||||
type ModuleId = string|number;
|
||||
|
||||
interface Hot {
|
||||
/**
|
||||
* Accept code updates for the specified dependencies. The callback is called when dependencies were replaced.
|
||||
* @param dependencies
|
||||
* @param callback
|
||||
*/
|
||||
accept(dependencies: string[], callback: (updatedDependencies: ModuleId[]) => void): void;
|
||||
/**
|
||||
* Accept code updates for the specified dependencies. The callback is called when dependencies were replaced.
|
||||
* @param dependency
|
||||
* @param callback
|
||||
*/
|
||||
accept(dependency: string, callback: () => void): void;
|
||||
/**
|
||||
* Accept code updates for this module without notification of parents.
|
||||
* This should only be used if the module doesn’t export anything.
|
||||
* The errHandler can be used to handle errors that occur while loading the updated module.
|
||||
* @param errHandler
|
||||
*/
|
||||
accept(errHandler?: (err: Error) => void): void;
|
||||
/**
|
||||
* Do not accept updates for the specified dependencies. If any dependencies is updated, the code update fails with code "decline".
|
||||
*/
|
||||
decline(dependencies: string[]): void;
|
||||
/**
|
||||
* Do not accept updates for the specified dependencies. If any dependencies is updated, the code update fails with code "decline".
|
||||
*/
|
||||
decline(dependency: string): void;
|
||||
/**
|
||||
* Flag the current module as not update-able. If updated the update code would fail with code "decline".
|
||||
*/
|
||||
decline(): void;
|
||||
/**
|
||||
* Add a one time handler, which is executed when the current module code is replaced.
|
||||
* Here you should destroy/remove any persistent resource you have claimed/created.
|
||||
* If you want to transfer state to the new module, add it to data object.
|
||||
* The data will be available at module.hot.data on the new module.
|
||||
* @param callback
|
||||
*/
|
||||
dispose(callback: (data: any) => void): void;
|
||||
dispose(callback: <T>(data: T) => void): void;
|
||||
/**
|
||||
* Add a one time handler, which is executed when the current module code is replaced.
|
||||
* Here you should destroy/remove any persistent resource you have claimed/created.
|
||||
* If you want to transfer state to the new module, add it to data object.
|
||||
* The data will be available at module.hot.data on the new module.
|
||||
* @param callback
|
||||
*/
|
||||
addDisposeHandler(callback: (data: any) => void): void;
|
||||
addDisposeHandler<T>(callback: (data: T) => void): void;
|
||||
/**
|
||||
* Remove a handler.
|
||||
* This can useful to add a temporary dispose handler. You could i. e. replace code while in the middle of a multi-step async function.
|
||||
* @param callback
|
||||
*/
|
||||
removeDisposeHandler(callback: (data: any) => void): void;
|
||||
removeDisposeHandler<T>(callback: (data: T) => void): void;
|
||||
/**
|
||||
* Throws an exceptions if status() is not idle.
|
||||
* Check all currently loaded modules for updates and apply updates if found.
|
||||
* If no update was found, the callback is called with null.
|
||||
* If autoApply is truthy the callback will be called with all modules that were disposed.
|
||||
* apply() is automatically called with autoApply as options parameter.
|
||||
* If autoApply is not set the callback will be called with all modules that will be disposed on apply().
|
||||
* @param autoApply
|
||||
* @param callback
|
||||
*/
|
||||
check(autoApply: boolean, callback: (err: Error, outdatedModules: ModuleId[]) => void): void;
|
||||
/**
|
||||
* Throws an exceptions if status() is not idle.
|
||||
* Check all currently loaded modules for updates and apply updates if found.
|
||||
* If no update was found, the callback is called with null.
|
||||
* The callback will be called with all modules that will be disposed on apply().
|
||||
* @param callback
|
||||
*/
|
||||
check(callback: (err: Error, outdatedModules: ModuleId[]) => void): void;
|
||||
/**
|
||||
* If status() != "ready" it throws an error.
|
||||
* Continue the update process.
|
||||
* @param options
|
||||
* @param callback
|
||||
*/
|
||||
apply(options: AcceptOptions, callback: (err: Error, outdatedModules: ModuleId[]) => void): void;
|
||||
/**
|
||||
* If status() != "ready" it throws an error.
|
||||
* Continue the update process.
|
||||
* @param callback
|
||||
*/
|
||||
apply(callback: (err: Error, outdatedModules: ModuleId[]) => void): void;
|
||||
/**
|
||||
* Return one of idle, check, watch, watch-delay, prepare, ready, dispose, apply, abort or fail.
|
||||
*/
|
||||
status(): string;
|
||||
/** Register a callback on status change. */
|
||||
status(callback: (status: string) => void): void;
|
||||
/** Register a callback on status change. */
|
||||
addStatusHandler(callback: (status: string) => void): void;
|
||||
/**
|
||||
* Remove a registered status change handler.
|
||||
* @param callback
|
||||
*/
|
||||
removeStatusHandler(callback: (status: string) => void): void;
|
||||
|
||||
active: boolean;
|
||||
data: any;
|
||||
}
|
||||
|
||||
interface AcceptOptions {
|
||||
/**
|
||||
* If true the update process continues even if some modules are not accepted (and would bubble to the entry point).
|
||||
*/
|
||||
ignoreUnaccepted?: boolean;
|
||||
/**
|
||||
* Indicates that apply() is automatically called by check function
|
||||
*/
|
||||
autoApply?: boolean;
|
||||
}
|
||||
/**
|
||||
* Inside env you can pass any variable
|
||||
*/
|
||||
interface NodeProcess {
|
||||
env?: any;
|
||||
}
|
||||
|
||||
type __Require1 = (id: string) => any;
|
||||
type __Require2 = <T>(id: string) => T;
|
||||
type RequireLambda = __Require1 & __Require2;
|
||||
}
|
||||
|
||||
interface NodeRequire extends __ParcelModuleApi.RequireFunction {
|
||||
}
|
||||
|
||||
declare var require: NodeRequire;
|
||||
|
||||
interface NodeModule extends __ParcelModuleApi.Module {}
|
||||
|
||||
declare var module: NodeModule;
|
||||
|
||||
/**
|
||||
* Declare process variable
|
||||
*/
|
||||
declare namespace NodeJS {
|
||||
interface Process extends __ParcelModuleApi.NodeProcess {}
|
||||
}
|
||||
declare var process: NodeJS.Process;
|
||||
@@ -0,0 +1,76 @@
|
||||
|
||||
|
||||
interface SomeModule {
|
||||
someMethod(): void;
|
||||
}
|
||||
|
||||
let someModule = require<SomeModule>('./someModule');
|
||||
someModule.someMethod();
|
||||
|
||||
let otherModule = require('./otherModule');
|
||||
otherModule.otherMethod();
|
||||
|
||||
// check if HMR is enabled
|
||||
if(module.hot) {
|
||||
// accept update of dependency
|
||||
module.hot.accept("./handler.js", function() {
|
||||
//...
|
||||
});
|
||||
}
|
||||
|
||||
module.exports = null;
|
||||
|
||||
// check if HMR is enabled
|
||||
if(module.hot) {
|
||||
|
||||
// accept itself
|
||||
module.hot.accept();
|
||||
|
||||
// dispose handler
|
||||
module.hot.dispose(function() {
|
||||
// revoke the side effect
|
||||
//...
|
||||
});
|
||||
}
|
||||
|
||||
class ModuleData {
|
||||
updated: boolean;
|
||||
}
|
||||
|
||||
if (module.hot) {
|
||||
module.hot.accept((err: Error) => {
|
||||
//...
|
||||
});
|
||||
|
||||
module.hot.decline("./someModule");
|
||||
|
||||
module.hot.dispose((data: ModuleData) => {
|
||||
data.updated = true;
|
||||
// ...
|
||||
});
|
||||
|
||||
let disposeHandler: ((data: ModuleData) => void) = data => {
|
||||
// ...
|
||||
};
|
||||
module.hot.addDisposeHandler(disposeHandler);
|
||||
module.hot.removeDisposeHandler(disposeHandler);
|
||||
|
||||
module.hot.check(true, (err: Error, outdatedModules: (string|number)[]) => {
|
||||
// ...
|
||||
});
|
||||
|
||||
module.hot.apply({ ignoreUnaccepted: true }, (err: Error, outdatedModules: (string|number)[]) => {
|
||||
// ...
|
||||
});
|
||||
|
||||
var status: string = module.hot.status();
|
||||
let statusHandler: ((status: string) => void) = status => {
|
||||
// ...
|
||||
};
|
||||
module.hot.status(statusHandler);
|
||||
module.hot.addStatusHandler(statusHandler);
|
||||
module.hot.removeStatusHandler(statusHandler);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": false,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"parcel-env-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"adjacent-overload-signatures": false,
|
||||
"array-type": false,
|
||||
"arrow-return-shorthand": false,
|
||||
"ban-types": false,
|
||||
"callable-types": false,
|
||||
"comment-format": false,
|
||||
"dt-header": false,
|
||||
"eofline": false,
|
||||
"export-just-namespace": false,
|
||||
"import-spacing": false,
|
||||
"interface-name": false,
|
||||
"interface-over-type-literal": false,
|
||||
"jsdoc-format": false,
|
||||
"max-line-length": false,
|
||||
"member-access": false,
|
||||
"new-parens": false,
|
||||
"no-any-union": false,
|
||||
"no-boolean-literal-compare": false,
|
||||
"no-conditional-assignment": false,
|
||||
"no-consecutive-blank-lines": false,
|
||||
"no-construct": false,
|
||||
"no-declare-current-package": false,
|
||||
"no-duplicate-imports": false,
|
||||
"no-duplicate-variable": false,
|
||||
"no-empty-interface": false,
|
||||
"no-for-in-array": false,
|
||||
"no-inferrable-types": false,
|
||||
"no-internal-module": false,
|
||||
"no-irregular-whitespace": false,
|
||||
"no-mergeable-namespace": false,
|
||||
"no-misused-new": false,
|
||||
"no-namespace": false,
|
||||
"no-object-literal-type-assertion": false,
|
||||
"no-padding": false,
|
||||
"no-redundant-jsdoc": false,
|
||||
"no-redundant-jsdoc-2": false,
|
||||
"no-redundant-undefined": false,
|
||||
"no-reference-import": false,
|
||||
"no-relative-import-in-test": false,
|
||||
"no-self-import": false,
|
||||
"no-single-declare-module": false,
|
||||
"no-string-throw": false,
|
||||
"no-unnecessary-callback-wrapper": false,
|
||||
"no-unnecessary-class": false,
|
||||
"no-unnecessary-generics": false,
|
||||
"no-unnecessary-qualifier": false,
|
||||
"no-unnecessary-type-assertion": false,
|
||||
"no-useless-files": false,
|
||||
"no-var-keyword": false,
|
||||
"no-var-requires": false,
|
||||
"no-void-expression": false,
|
||||
"no-trailing-whitespace": false,
|
||||
"object-literal-key-quotes": false,
|
||||
"object-literal-shorthand": false,
|
||||
"one-line": false,
|
||||
"one-variable-per-declaration": false,
|
||||
"only-arrow-functions": false,
|
||||
"prefer-conditional-expression": false,
|
||||
"prefer-const": false,
|
||||
"prefer-declare-function": false,
|
||||
"prefer-for-of": false,
|
||||
"prefer-method-signature": false,
|
||||
"prefer-template": false,
|
||||
"radix": false,
|
||||
"semicolon": false,
|
||||
"space-before-function-paren": false,
|
||||
"space-within-parens": false,
|
||||
"strict-export-declare-modifiers": false,
|
||||
"trim-file": false,
|
||||
"triple-equals": false,
|
||||
"typedef-whitespace": false,
|
||||
"unified-signatures": false,
|
||||
"void-return": false,
|
||||
"whitespace": false
|
||||
}
|
||||
}
|
||||
Vendored
+2
@@ -1481,6 +1481,7 @@ declare namespace R {
|
||||
*/
|
||||
prop<P extends keyof T, T>(p: P, obj: T): T[P];
|
||||
prop<P extends string>(p: P): <T>(obj: Record<P, T>) => T;
|
||||
prop<P extends string, T>(p: P): (obj: Record<P, T>) => T;
|
||||
|
||||
/**
|
||||
* Determines whether the given property of an object has a specific
|
||||
@@ -1519,6 +1520,7 @@ declare namespace R {
|
||||
*/
|
||||
props<P extends string, T>(ps: ReadonlyArray<P>, obj: Record<P, T>): T[];
|
||||
props<P extends string>(ps: ReadonlyArray<P>): <T>(obj: Record<P, T>) => T[];
|
||||
props<P extends string, T>(ps: ReadonlyArray<P>): (obj: Record<P, T>) => T[];
|
||||
|
||||
/**
|
||||
* Returns true if the specified object property satisfies the given predicate; false otherwise.
|
||||
|
||||
@@ -724,7 +724,9 @@ interface Obj {
|
||||
const list: Book[] = [{id: "xyz", title: "A"}, {id: "abc", title: "B"}];
|
||||
const a1 = R.indexBy(R.prop("id"), list);
|
||||
const a2 = R.indexBy(R.prop("id"))(list);
|
||||
const a3 = R.indexBy<{ id: string }>(R.prop<string>("id"))(list);
|
||||
const a3 = R.indexBy<{ id: string }>(R.prop("id"))(list);
|
||||
const a4 = R.indexBy(R.prop<"id", string>("id"))(list);
|
||||
const a5 = R.indexBy<{ id: string }>(R.prop<"id", string>("id"))(list);
|
||||
|
||||
const titlesIndexedByTitles: { [k: string]: string } = R.pipe(
|
||||
R.map((x: Book) => x.title),
|
||||
@@ -1161,7 +1163,8 @@ type Pair = KeyValuePair<string, number>;
|
||||
|
||||
() => {
|
||||
const x = R.prop("x");
|
||||
const a: boolean = R.tryCatch<boolean>(R.prop("x"), R.F)({x: true}); // => true
|
||||
const a: boolean = R.tryCatch<boolean>(R.prop("x"), R.F)({x: true}); // => true
|
||||
const a1: boolean = R.tryCatch(R.prop<"x", true>("x"), R.F)({x: true}); // => true
|
||||
const b: boolean = R.tryCatch<boolean>(R.prop("x"), R.F)(null); // => false
|
||||
const c: boolean = R.tryCatch<boolean>(R.and, R.F)(true, true); // => true
|
||||
};
|
||||
@@ -1754,7 +1757,7 @@ class Rectangle {
|
||||
|
||||
const format = R.converge(
|
||||
R.call, [
|
||||
R.pipe<{}, number, (s: string) => string>(R.prop("indent"), indentN),
|
||||
R.pipe(R.prop<"indent", number>("indent"), indentN),
|
||||
R.prop("value")
|
||||
]
|
||||
);
|
||||
|
||||
Vendored
+8
-2
@@ -1,6 +1,7 @@
|
||||
// Type definitions for react-form 2.12
|
||||
// Type definitions for react-form 2.16
|
||||
// Project: https://github.com/tannerlinsley/react-form#readme
|
||||
// Definitions by: Cameron McAteer <https://github.com/cameron-mcateer>
|
||||
// Mathieu Masy <https://github.com/TiuSh>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.6
|
||||
|
||||
@@ -18,7 +19,7 @@ export interface FormErrors {
|
||||
[key: string]: FormError;
|
||||
}
|
||||
export type NestedErrors = Nested<FormErrors>;
|
||||
export type RenderReturn = JSX.Element | false | null;
|
||||
export type RenderReturn = JSX.Element | false | null | never[];
|
||||
|
||||
export interface FormState {
|
||||
values: FormValues;
|
||||
@@ -29,7 +30,10 @@ export interface FormState {
|
||||
}
|
||||
|
||||
export interface FormProps {
|
||||
component?: React.ReactType<{ formApi: FormApi }>;
|
||||
render?: (formApi: FormApi) => RenderReturn;
|
||||
dontValidateOnMount?: boolean;
|
||||
validateOnSubmit?: boolean;
|
||||
defaultValues?: FormValues;
|
||||
onSubmit?(values: FormValues, submissionEvent: React.SyntheticEvent<any>, formApi: FormApi): void;
|
||||
preSubmit?(values: FormValues, formApi: FormApi): FormValues;
|
||||
@@ -43,6 +47,7 @@ export interface FormProps {
|
||||
[field: string]: (value: FormValue) => Promise<any>
|
||||
};
|
||||
dontPreventDefault?: boolean;
|
||||
getApi?: (formApi: FormApi) => void;
|
||||
}
|
||||
|
||||
export interface FormApi {
|
||||
@@ -137,6 +142,7 @@ export type SelectOptions = Array<{
|
||||
|
||||
export interface SelectProps extends FieldProps, React.SelectHTMLAttributes<HTMLSelectElement> {
|
||||
options: SelectOptions;
|
||||
placeholder?: string;
|
||||
}
|
||||
|
||||
export const Select: React.StatelessComponent<SelectProps>;
|
||||
|
||||
@@ -21,6 +21,50 @@ import {
|
||||
FormApi
|
||||
} from 'react-form';
|
||||
|
||||
// Form Api
|
||||
class FormApiMethods extends React.Component {
|
||||
constructor(props: {}) {
|
||||
super(props);
|
||||
this.state = {};
|
||||
}
|
||||
|
||||
render() {
|
||||
const FormContent = (props: { formApi?: FormApi }) => (
|
||||
<form onSubmit={props.formApi ? props.formApi.submitForm : () => {}}>
|
||||
<Text field="hello" id="hello" />
|
||||
<button type="submit">Submit</button>
|
||||
</form>
|
||||
);
|
||||
|
||||
return (
|
||||
<div>
|
||||
<Form>
|
||||
{ formApi => (
|
||||
<form onSubmit={formApi.submitForm}>
|
||||
<Text field="hello" id="hello" />
|
||||
<button type="submit">Submit</button>
|
||||
</form>
|
||||
)}
|
||||
</Form>
|
||||
|
||||
<Form render={ formApi => (
|
||||
<form onSubmit={formApi.submitForm}>
|
||||
<Text field="hello" id="hello" />
|
||||
<button type="submit">Submit</button>
|
||||
</form>
|
||||
)}>
|
||||
</Form>
|
||||
|
||||
<Form>
|
||||
<FormContent />
|
||||
</Form>
|
||||
|
||||
<Form component={FormContent} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// Basic Form Example
|
||||
const statusOptions = [
|
||||
{
|
||||
|
||||
@@ -22,4 +22,4 @@
|
||||
"index.d.ts",
|
||||
"react-form-tests.tsx"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+51
-5
@@ -6,6 +6,7 @@
|
||||
// Tim Wang <https://github.com/timwangdev>
|
||||
// Kamal Mahyuddin <https://github.com/kamal>
|
||||
// Naoufal El Yousfi <https://github.com/nelyousfi>
|
||||
// Alex Dunne <https://github.com/alexdunne>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.6
|
||||
|
||||
@@ -8258,26 +8259,71 @@ interface ImageEditorStatic {
|
||||
): void;
|
||||
}
|
||||
|
||||
export interface ARTShapeProps {
|
||||
d: string;
|
||||
strokeWidth: number;
|
||||
export interface ARTNodeMixin {
|
||||
opacity?: number;
|
||||
originX?: number;
|
||||
originY?: number;
|
||||
scaleX?: number;
|
||||
scaleY?: number;
|
||||
scale?: number;
|
||||
title?: string;
|
||||
x?: number;
|
||||
y?: number;
|
||||
visible?: boolean;
|
||||
}
|
||||
|
||||
export interface ARTGroupProps extends ARTNodeMixin {
|
||||
width?: number;
|
||||
height?: number;
|
||||
}
|
||||
|
||||
export interface ARTClippingRectangleProps extends ARTNodeMixin {
|
||||
width?: number;
|
||||
height?: number;
|
||||
}
|
||||
|
||||
export interface ARTRenderableMixin extends ARTNodeMixin {
|
||||
fill?: string;
|
||||
stroke?: string;
|
||||
strokeCap?: "butt" | "square" | "round";
|
||||
strokeDash?: number[];
|
||||
stroke: string;
|
||||
strokeJoin?: "bevel" | "miter" | "round";
|
||||
strokeWidth?: number;
|
||||
}
|
||||
|
||||
export interface ARTShapeProps extends ARTRenderableMixin {
|
||||
d: string;
|
||||
width?: number;
|
||||
height?: number;
|
||||
}
|
||||
|
||||
export interface ARTTextProps extends ARTRenderableMixin {
|
||||
font?: string;
|
||||
alignment?: string;
|
||||
}
|
||||
|
||||
export interface ARTSurfaceProps {
|
||||
style: StyleProp<ViewStyle>;
|
||||
style?: StyleProp<ViewStyle>;
|
||||
width: number;
|
||||
height: number;
|
||||
}
|
||||
|
||||
export interface ClippingRectangleStatic extends React.ComponentClass<ARTClippingRectangleProps> {}
|
||||
|
||||
export interface GroupStatic extends React.ComponentClass<ARTGroupProps> {}
|
||||
|
||||
export interface ShapeStatic extends React.ComponentClass<ARTShapeProps> {}
|
||||
|
||||
export interface SurfaceStatic extends React.ComponentClass<ARTSurfaceProps> {}
|
||||
|
||||
export interface ARTTextStatic extends React.ComponentClass<ARTTextProps> {}
|
||||
|
||||
export interface ARTStatic {
|
||||
ClippingRectangle: ClippingRectangleStatic;
|
||||
Group: GroupStatic;
|
||||
Shape: ShapeStatic;
|
||||
Surface: SurfaceStatic;
|
||||
Text: ARTTextStatic;
|
||||
}
|
||||
|
||||
export interface KeyboardStatic extends NativeEventEmitter {
|
||||
|
||||
Vendored
+34
-29
@@ -1,4 +1,4 @@
|
||||
// Type definitions for react-navigation 1.2
|
||||
// Type definitions for react-navigation 1.5
|
||||
// Project: https://github.com/react-navigation/react-navigation
|
||||
// Definitions by: Huhuanming <https://github.com/huhuanming>
|
||||
// mhcgrq <https://github.com/mhcgrq>
|
||||
@@ -45,7 +45,6 @@ export interface HeaderProps extends NavigationSceneRendererProps {
|
||||
mode: HeaderMode;
|
||||
router: NavigationRouter<
|
||||
NavigationState,
|
||||
NavigationAction,
|
||||
NavigationStackScreenOptions
|
||||
>;
|
||||
getScreenDetails: (navigationScene: NavigationScene) => NavigationScreenDetails<
|
||||
@@ -75,9 +74,9 @@ export interface NavigationState {
|
||||
routes: any[];
|
||||
}
|
||||
|
||||
export type NavigationRoute = NavigationLeafRoute | NavigationStateRoute;
|
||||
export type NavigationRoute<Params = NavigationParams> = NavigationLeafRoute<Params> | NavigationStateRoute<Params>;
|
||||
|
||||
export interface NavigationLeafRoute {
|
||||
export interface NavigationLeafRoute<Params> {
|
||||
/**
|
||||
* React's key used by some navigators. No need to specify these manually,
|
||||
* they will be defined by the router.
|
||||
@@ -96,23 +95,23 @@ export interface NavigationLeafRoute {
|
||||
* Params passed to this route when navigating to it,
|
||||
* e.g. `{ car_id: 123 }` in a route that displays a car.
|
||||
*/
|
||||
params?: NavigationParams;
|
||||
params?: Params;
|
||||
}
|
||||
|
||||
export type NavigationStateRoute = NavigationLeafRoute & NavigationState;
|
||||
export type NavigationStateRoute<NavigationLeafRouteParams> = NavigationLeafRoute<NavigationLeafRouteParams> & NavigationState;
|
||||
|
||||
export type NavigationScreenOptionsGetter<Options> = (
|
||||
navigation: NavigationScreenProp<NavigationRoute>,
|
||||
navigation: NavigationScreenProp<NavigationRoute<any>>,
|
||||
screenProps?: { [key: string]: any }
|
||||
) => Options;
|
||||
|
||||
export interface NavigationRouter<State, Action, Options> {
|
||||
export interface NavigationRouter<State = NavigationState, Options = {}> {
|
||||
/**
|
||||
* The reducer that outputs the new navigation state for a given action, with
|
||||
* an optional previous state. When the action is considered handled but the
|
||||
* state is unchanged, the output state is null.
|
||||
*/
|
||||
getStateForAction: (action: Action, lastState?: State) => (State | null);
|
||||
getStateForAction: (action: NavigationAction, lastState?: State) => (State | null);
|
||||
|
||||
/**
|
||||
* Maps a URI-like string to an action. This can be mapped to a state
|
||||
@@ -121,7 +120,7 @@ export interface NavigationRouter<State, Action, Options> {
|
||||
getActionForPathAndParams: (
|
||||
path: string,
|
||||
params?: NavigationParams
|
||||
) => (Action | null);
|
||||
) => (NavigationAction | null);
|
||||
|
||||
getPathAndParamsForState: (
|
||||
state: State
|
||||
@@ -175,16 +174,22 @@ export type NavigationScreenConfig<Options> =
|
||||
|
||||
export type NavigationComponent =
|
||||
NavigationScreenComponent<any, any>
|
||||
| NavigationNavigator<any, any, any, any>;
|
||||
| NavigationNavigator<any, any, any>;
|
||||
|
||||
export interface NavigationScreenComponent<T, Options> extends React.ComponentClass<T> {
|
||||
navigationOptions?: NavigationScreenConfig<Options>;
|
||||
}
|
||||
export type NavigationScreenComponent<
|
||||
Options = {},
|
||||
Props = {}
|
||||
> = React.ComponentType<NavigationNavigatorProps<Options, NavigationState> & Props> &
|
||||
({} | { navigationOptions: NavigationScreenConfig<Options> });
|
||||
|
||||
export interface NavigationNavigator<T, State, Action, Options> extends React.ComponentClass<T> {
|
||||
router?: NavigationRouter<State, Action, Options>;
|
||||
navigationOptions?: NavigationScreenConfig<Options>;
|
||||
}
|
||||
export type NavigationNavigator<
|
||||
State = NavigationState,
|
||||
Options = {},
|
||||
Props = {}
|
||||
> = React.ComponentType<NavigationNavigatorProps<Options, State> & Props> & {
|
||||
router: NavigationRouter<State, Options>,
|
||||
navigationOptions?: NavigationScreenConfig<Options>,
|
||||
};
|
||||
|
||||
export interface NavigationParams {
|
||||
[key: string]: any;
|
||||
@@ -452,10 +457,10 @@ export interface NavigationScreenProp<S, P = NavigationParams> {
|
||||
popToTop: (params?: { immediate?: boolean }) => boolean;
|
||||
}
|
||||
|
||||
export interface NavigationNavigatorProps<S = {}> {
|
||||
export interface NavigationNavigatorProps<O = {}, S = {}> {
|
||||
navigation?: NavigationProp<S>;
|
||||
screenProps?: { [key: string]: any };
|
||||
navigationOptions?: any;
|
||||
navigationOptions?: O;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -587,7 +592,7 @@ export interface NavigationContainerProps {
|
||||
export interface NavigationContainer extends React.ComponentClass<
|
||||
NavigationContainerProps & NavigationNavigatorProps<any>
|
||||
> {
|
||||
router: NavigationRouter<any, any, any>;
|
||||
router: NavigationRouter<any, any>;
|
||||
screenProps: { [key: string]: any };
|
||||
navigationOptions: any;
|
||||
state: { nav: NavigationState | null };
|
||||
@@ -810,7 +815,7 @@ export class Transitioner extends React.Component<
|
||||
export function TabRouter(
|
||||
routeConfigs: NavigationRouteConfigMap,
|
||||
config: NavigationTabRouterConfig
|
||||
): NavigationRouter<any, any, any>;
|
||||
): NavigationRouter<any, any>;
|
||||
|
||||
/**
|
||||
* Stack Router
|
||||
@@ -820,19 +825,19 @@ export function TabRouter(
|
||||
export function StackRouter(
|
||||
routeConfigs: NavigationRouteConfigMap,
|
||||
config: NavigationTabRouterConfig
|
||||
): NavigationRouter<any, any, any>;
|
||||
): NavigationRouter<any, any>;
|
||||
|
||||
/**
|
||||
* Create Navigator
|
||||
*
|
||||
* @see https://github.com/react-navigation/react-navigation/blob/master/src/navigators/createNavigator.js
|
||||
*/
|
||||
export function createNavigator<C, S, A, Options>(
|
||||
router: NavigationRouter<S, A, Options>,
|
||||
export function createNavigator<C, S, Options>(
|
||||
router: NavigationRouter<S, Options>,
|
||||
routeConfigs?: NavigationRouteConfigMap,
|
||||
navigatorConfig?: {} | null,
|
||||
navigatorType?: NavigatorType
|
||||
): (NavigationView: React.ComponentClass<C>) => NavigationNavigator<C, S, A, Options>;
|
||||
): (NavigationView: React.ComponentClass<C>) => NavigationNavigator<C, S, Options>;
|
||||
|
||||
/**
|
||||
* Create an HOC that injects the navigation and manages the navigation state
|
||||
@@ -843,7 +848,7 @@ export function createNavigator<C, S, A, Options>(
|
||||
* @see https://github.com/react-navigation/react-navigation/blob/master/src/createNavigationContainer.js
|
||||
*/
|
||||
export function createNavigationContainer(
|
||||
Component: NavigationNavigator<any, any, any, any>
|
||||
Component: NavigationNavigator<any, any, any>
|
||||
): NavigationContainer;
|
||||
/**
|
||||
* END MANUAL DEFINITIONS OUTSIDE OF TYPEDEFINITION.JS
|
||||
@@ -853,8 +858,8 @@ export function createNavigationContainer(
|
||||
* BEGIN CUSTOM CONVENIENCE INTERFACES
|
||||
*/
|
||||
|
||||
export interface NavigationScreenProps {
|
||||
navigation: NavigationScreenProp<NavigationRoute>;
|
||||
export interface NavigationScreenProps<Params = NavigationParams> {
|
||||
navigation: NavigationScreenProp<NavigationRoute<Params>>;
|
||||
screenProps?: { [key: string]: any };
|
||||
navigationOptions?: NavigationScreenConfig<any>;
|
||||
}
|
||||
|
||||
@@ -36,6 +36,7 @@ import {
|
||||
NavigationParams,
|
||||
NavigationPopAction,
|
||||
NavigationPopToTopAction,
|
||||
NavigationScreenComponent,
|
||||
} from 'react-navigation';
|
||||
|
||||
// Constants
|
||||
@@ -48,14 +49,19 @@ const viewStyle: ViewStyle = {
|
||||
|
||||
const ROUTE_NAME_START_SCREEN = "StartScreen";
|
||||
|
||||
interface StartScreenNavigationParams {
|
||||
id: number;
|
||||
s: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @desc Simple screen component class with typed component props that should
|
||||
* receive the navigation prop from the AppNavigator.
|
||||
*/
|
||||
class StartScreen extends React.Component<NavigationScreenProps> {
|
||||
class StartScreen extends React.Component<NavigationScreenProps<StartScreenNavigationParams>> {
|
||||
render() {
|
||||
// Implicit type checks.
|
||||
const navigationStateParams = this.props.navigation.state.params;
|
||||
const navigationStateParams: StartScreenNavigationParams | undefined = this.props.navigation.state.params;
|
||||
const id = this.props.navigation.state.params && this.props.navigation.state.params.id;
|
||||
const s = this.props.navigation.state.params && this.props.navigation.state.params.s;
|
||||
|
||||
@@ -84,10 +90,15 @@ class StartScreen extends React.Component<NavigationScreenProps> {
|
||||
|
||||
const ROUTE_NAME_NEXT_SCREEN = "NextScreen";
|
||||
|
||||
class NextScreen extends React.Component<NavigationScreenProps> {
|
||||
interface NextScreenNavigationParams {
|
||||
id: number;
|
||||
name: string;
|
||||
}
|
||||
|
||||
class NextScreen extends React.Component<NavigationScreenProps<NextScreenNavigationParams>> {
|
||||
render() {
|
||||
// Implicit type checks.
|
||||
const navigationStateParams = this.props.navigation.state.params;
|
||||
const navigationStateParams: NextScreenNavigationParams | undefined = this.props.navigation.state.params;
|
||||
const id = this.props.navigation.state.params && this.props.navigation.state.params.id;
|
||||
const name = this.props.navigation.state.params && this.props.navigation.state.params.name;
|
||||
|
||||
@@ -100,7 +111,7 @@ class NextScreen extends React.Component<NavigationScreenProps> {
|
||||
const navigationOptions = {
|
||||
headerBackTitle: null,
|
||||
};
|
||||
const initialRouteParams: NavigationParams = {
|
||||
const initialRouteParams: StartScreenNavigationParams = {
|
||||
id: 1,
|
||||
s: "Start",
|
||||
};
|
||||
@@ -123,6 +134,16 @@ export const AppNavigator = StackNavigator(
|
||||
},
|
||||
);
|
||||
|
||||
const StatelessScreen: NavigationScreenComponent = () => <View />;
|
||||
|
||||
const SimpleStackNavigator = StackNavigator(
|
||||
{
|
||||
simple: {
|
||||
screen: StatelessScreen,
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
/**
|
||||
* Router.
|
||||
*/
|
||||
|
||||
Vendored
+7
-1
@@ -1,4 +1,4 @@
|
||||
// Type definitions for React 16.0
|
||||
// Type definitions for React 16.1
|
||||
// Project: http://facebook.github.io/react/
|
||||
// Definitions by: Asana <https://asana.com>
|
||||
// AssureSign <http://www.assuresign.com>
|
||||
@@ -2451,6 +2451,7 @@ declare namespace React {
|
||||
defaultChecked?: boolean;
|
||||
defaultValue?: string | string[];
|
||||
suppressContentEditableWarning?: boolean;
|
||||
suppressHydrationWarning?: boolean;
|
||||
|
||||
// Standard HTML Attributes
|
||||
accessKey?: string;
|
||||
@@ -2534,6 +2535,11 @@ declare namespace React {
|
||||
* @see aria-colindex @see aria-rowspan.
|
||||
*/
|
||||
'aria-colspan'?: number;
|
||||
/**
|
||||
* Identifies the element (or elements) whose contents or presence are controlled by the current element.
|
||||
* @see aria-owns.
|
||||
*/
|
||||
'aria-controls'?: string;
|
||||
/** Indicates the element that represents the current item within a container or set of related elements. */
|
||||
'aria-current'?: boolean | 'false' | 'true' | 'page' | 'step' | 'location' | 'date' | 'time';
|
||||
/**
|
||||
|
||||
@@ -37,6 +37,7 @@ StatelessComponent2.defaultProps = {
|
||||
defaultValue="some value"
|
||||
contentEditable
|
||||
suppressContentEditableWarning
|
||||
suppressHydrationWarning
|
||||
>
|
||||
<b>foo</b>
|
||||
</div>;
|
||||
|
||||
Vendored
+5
@@ -2481,6 +2481,11 @@ declare namespace React {
|
||||
* @see aria-colindex @see aria-rowspan.
|
||||
*/
|
||||
'aria-colspan'?: number;
|
||||
/**
|
||||
* Identifies the element (or elements) whose contents or presence are controlled by the current element.
|
||||
* @see aria-owns.
|
||||
*/
|
||||
'aria-controls'?: string;
|
||||
/** Indicates the element that represents the current item within a container or set of related elements. */
|
||||
'aria-current'?: boolean | 'false' | 'true' | 'page' | 'step' | 'location' | 'date' | 'time';
|
||||
/**
|
||||
|
||||
Vendored
+15
-1
@@ -2,6 +2,7 @@
|
||||
// Project: https://github.com/mapbox/node-sqlite3
|
||||
// Definitions by: Nick Malaguti <https://github.com/nmalaguti>
|
||||
// Sumant Manne <https://github.com/dpyro>
|
||||
// Behind The Math <https://github.com/BehindTheMath>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="node" />
|
||||
@@ -83,6 +84,19 @@ export class Database extends events.EventEmitter {
|
||||
on(event: "error", listener: (err: Error) => void): this;
|
||||
on(event: "open" | "close", listener: () => void): this;
|
||||
on(event: string, listener: (...args: any[]) => void): this;
|
||||
|
||||
configure(option: "busyTimeout", value: number): void;
|
||||
}
|
||||
|
||||
export function verbose(): void;
|
||||
export function verbose(): sqlite3;
|
||||
|
||||
export interface sqlite3 {
|
||||
OPEN_READONLY: number;
|
||||
OPEN_READWRITE: number;
|
||||
OPEN_CREATE: number;
|
||||
cached: typeof cached;
|
||||
RunResult: RunResult;
|
||||
Statement: typeof Statement;
|
||||
Database: typeof Database;
|
||||
verbose(): this;
|
||||
}
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
import sqlite3 = require('sqlite3');
|
||||
sqlite3.verbose();
|
||||
import * as sqlite from 'sqlite3';
|
||||
const sqlite3 = sqlite.verbose();
|
||||
|
||||
let db: sqlite3.Database = new sqlite3.Database('chain.sqlite3', () => {});
|
||||
let db: sqlite.Database = new sqlite3.Database('chain.sqlite3', () => {});
|
||||
|
||||
function createDb() {
|
||||
console.log("createDb chain");
|
||||
db = new sqlite3.Database('chain.sqlite3', createTable);
|
||||
db = new sqlite3.Database('chain.sqlite3', createTable);
|
||||
db.configure("busyTimeout", 1000);
|
||||
}
|
||||
|
||||
function createTable() {
|
||||
|
||||
Vendored
+2
-1
@@ -1,6 +1,7 @@
|
||||
// Type definitions for stellar-sdk 0.8
|
||||
// Project: https://github.com/stellar/js-stellar-sdk
|
||||
// Definitions by: Carl Foster <https://github.com/carl-foster>
|
||||
// Triston Jones <https://github.com/tristonj>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.4
|
||||
|
||||
@@ -596,7 +597,7 @@ export namespace Operation {
|
||||
}
|
||||
interface ChangeTrustOptions {
|
||||
asset: Asset;
|
||||
limit: string;
|
||||
limit?: string;
|
||||
source?: string;
|
||||
}
|
||||
function changeTrust(options: ChangeTrustOptions): xdr.Operation<ChangeTrust>;
|
||||
|
||||
Vendored
+18
@@ -9,6 +9,9 @@ export declare abstract class Tapable {
|
||||
[propName: string]: Tapable.Handler[]
|
||||
}
|
||||
|
||||
/** @deprecated Private internals. Do not use directly */
|
||||
_pluginCompat: Hook;
|
||||
|
||||
/**
|
||||
* @deprecated Tapable.plugin is deprecated. Use new API on `.hooks` instead
|
||||
* Register plugin(s)
|
||||
@@ -275,7 +278,9 @@ export class HookInterceptor {
|
||||
context: boolean;
|
||||
}
|
||||
|
||||
/** A HookMap is a helper class for a Map with Hooks */
|
||||
export class HookMap<T1 = any, T2 = any, T3 = any> {
|
||||
constructor(fn: () => Hook);
|
||||
get: (key: any) => Hook<T1, T2, T3> | undefined;
|
||||
for: (key: any) => Hook<T1, T2, T3>;
|
||||
tap: (key: any, name: string | Tap, fn: (arg1: T1, arg2: T2, arg3: T3, ...args: any[]) => any) => void;
|
||||
@@ -287,3 +292,16 @@ export class HookMap<T1 = any, T2 = any, T3 = any> {
|
||||
export class HookMapInterceptor<T1 = any, T2 = any, T3 = any> {
|
||||
factory: (key: any, hook: Hook<T1, T2, T3>) => Hook<T1, T2, T3>;
|
||||
}
|
||||
|
||||
/**
|
||||
* A helper Hook-like class to redirect taps to multiple other hooks
|
||||
*
|
||||
* ```
|
||||
* const { MultiHook } = require("tapable");
|
||||
*
|
||||
* this.hooks.allHooks = new MultiHook([this.hooks.hookA, this.hooks.hookB]);
|
||||
* ```
|
||||
*/
|
||||
export class MultiHook {
|
||||
constructor(hooks: Hook[])
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import {Tapable} from "tapable";
|
||||
import {Tapable, MultiHook, SyncHook} from "tapable";
|
||||
|
||||
class DllPlugin {
|
||||
apply(compiler: Compiler) {
|
||||
@@ -43,3 +43,5 @@ compiler.applyPluginsAsyncWaterfall('doSomething', 'a', callback);
|
||||
compiler.applyPluginsParallel('doSomething', 'a', 'b');
|
||||
compiler.applyPluginsParallelBailResult('doSomething', 'a', 'b');
|
||||
compiler.applyPluginsParallelBailResult1('doSomething', 'a', callback);
|
||||
|
||||
const multi = new MultiHook([new SyncHook(['hi'])]);
|
||||
|
||||
Vendored
+1
@@ -260,6 +260,7 @@ declare module 'twit' {
|
||||
long?: number,
|
||||
follow?: boolean,
|
||||
include_email?: boolean,
|
||||
cursor?: number,
|
||||
}
|
||||
export interface PromiseResponse {
|
||||
data: Response,
|
||||
|
||||
Vendored
+1
@@ -80,6 +80,7 @@ export interface Twix {
|
||||
|
||||
asDuration(period: string): Duration;
|
||||
isValid(): boolean;
|
||||
toDate(): Date;
|
||||
}
|
||||
|
||||
export interface TwixStatic {
|
||||
|
||||
Vendored
+5
@@ -162,6 +162,11 @@ interface VRFrameData {
|
||||
readonly timestamp: number;
|
||||
}
|
||||
|
||||
declare var VRFrameData: {
|
||||
prototype: VRFrameData
|
||||
new(): VRFrameData
|
||||
}
|
||||
|
||||
interface VRPose {
|
||||
readonly angularAcceleration: Float32Array | null;
|
||||
readonly angularVelocity: Float32Array | null;
|
||||
|
||||
Vendored
+1
-1
@@ -4,7 +4,7 @@
|
||||
// Jay Anslow <https://github.com/janslow>
|
||||
// Ika <https://github.com/ikatyang>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
import { EventEmitter } from 'events';
|
||||
import * as inquirer from 'inquirer';
|
||||
|
||||
Vendored
+1
-1
@@ -2,7 +2,7 @@
|
||||
// Project: https://github.com/yeoman/yeoman-test
|
||||
// Definitions by: Ika <https://github.com/ikatyang>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
import { EventEmitter } from 'events';
|
||||
import Generator = require('yeoman-generator');
|
||||
|
||||
Reference in New Issue
Block a user