mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-11 20:40:20 +00:00
Merge branch 'master' into master
This commit is contained in:
@@ -1,2 +1,7 @@
|
||||
# Auto detect text files and perform LF normalization
|
||||
* text=auto
|
||||
|
||||
# Checkout NPM package files with forced LF lineendings
|
||||
# to prevent git conflicts when running npm commands
|
||||
package.json text eol=lf
|
||||
package-lock.json text eol=lf
|
||||
|
||||
@@ -174,7 +174,7 @@
|
||||
"sourceRepoURL": "https://github.com/MikeMcl/bignumber.js/",
|
||||
"asOfVersion": "5.0.0"
|
||||
},
|
||||
{
|
||||
{
|
||||
"libraryName": "bingmaps",
|
||||
"typingsPackageName": "bingmaps",
|
||||
"sourceRepoURL": "https://github.com/Microsoft/Bing-Maps-V8-TypeScript-Definitions",
|
||||
@@ -234,6 +234,12 @@
|
||||
"sourceRepoURL": "https://github.com/saltyrtc/chunked-dc-js",
|
||||
"asOfVersion": "0.2.2"
|
||||
},
|
||||
{
|
||||
"libraryName": "colors.js (colors)",
|
||||
"typingsPackageName": "colors",
|
||||
"sourceRepoURL": "https://github.com/Marak/colors.js",
|
||||
"asOfVersion": "1.2.1"
|
||||
},
|
||||
{
|
||||
"libraryName": "commander",
|
||||
"typingsPackageName": "commander",
|
||||
|
||||
Vendored
+6
@@ -1,4 +1,6 @@
|
||||
/// <reference types="node" />
|
||||
/// <reference types="lodash" />
|
||||
/// <reference types="benchmark" />
|
||||
|
||||
declare namespace adone {
|
||||
const _null: symbol;
|
||||
@@ -104,4 +106,8 @@ declare namespace adone {
|
||||
export const expect: assertion.I.ExpectFunction;
|
||||
|
||||
export const std: typeof nodestd;
|
||||
|
||||
export const lodash: _.LoDashStatic;
|
||||
|
||||
export const benchmark: typeof tbenchmark;
|
||||
}
|
||||
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
import Benchmark = require("benchmark");
|
||||
|
||||
export { Benchmark };
|
||||
|
||||
export as namespace tbenchmark;
|
||||
Vendored
+38
-26
@@ -1158,37 +1158,35 @@ declare namespace adone {
|
||||
*/
|
||||
function watch(paths: string | string[], options?: I.Watcher.ConstructorOptions): Watcher;
|
||||
|
||||
namespace is {
|
||||
/**
|
||||
* Returns true if the given path refers to a file
|
||||
*/
|
||||
function file(path: string): Promise<boolean>;
|
||||
/**
|
||||
* Returns true if the given path refers to a file
|
||||
*/
|
||||
function isFile(path: string): Promise<boolean>;
|
||||
|
||||
/**
|
||||
* Returns true if the given path refers to a file
|
||||
*/
|
||||
function fileSync(path: string): boolean;
|
||||
/**
|
||||
* Returns true if the given path refers to a file
|
||||
*/
|
||||
function isFileSync(path: string): boolean;
|
||||
|
||||
/**
|
||||
* Returns true if the given path refers to a direcotry
|
||||
*/
|
||||
function directory(path: string): Promise<boolean>;
|
||||
/**
|
||||
* Returns true if the given path refers to a direcotry
|
||||
*/
|
||||
function isDirectory(path: string): Promise<boolean>;
|
||||
|
||||
/**
|
||||
* Returns true if the given path refers to a direcotry
|
||||
*/
|
||||
function directorySync(path: string): boolean;
|
||||
/**
|
||||
* Returns true if the given path refers to a direcotry
|
||||
*/
|
||||
function isDirectorySync(path: string): boolean;
|
||||
|
||||
/**
|
||||
* Returns true if the given path refers to an executable file
|
||||
*/
|
||||
function executable(path: string): Promise<boolean>;
|
||||
/**
|
||||
* Returns true if the given path refers to an executable file
|
||||
*/
|
||||
function isExecutable(path: string): Promise<boolean>;
|
||||
|
||||
/**
|
||||
* Returns true if the given path refers to an executable file
|
||||
*/
|
||||
function executableSync(path: string): boolean;
|
||||
}
|
||||
/**
|
||||
* Returns true if the given path refers to an executable file
|
||||
*/
|
||||
function isExecutableSync(path: string): boolean;
|
||||
|
||||
namespace I.Which {
|
||||
interface Options {
|
||||
@@ -1920,5 +1918,19 @@ declare namespace adone {
|
||||
* Creates a new TailWatcher instance with the given arguments
|
||||
*/
|
||||
function watchTail(filename: string, options?: I.TailWatcher.ConstructorOptions): TailWatcher;
|
||||
|
||||
namespace I {
|
||||
interface WriteFileAtomicOptions {
|
||||
chown?: {
|
||||
gid?: number;
|
||||
uid?: number;
|
||||
};
|
||||
encoding?: string | null;
|
||||
fsync?: boolean;
|
||||
mode?: number;
|
||||
}
|
||||
}
|
||||
|
||||
function writeFileAtomic(filename: string, data: Buffer | string | Uint8Array, options?: I.WriteFileAtomicOptions): Promise<void>;
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+4
@@ -676,5 +676,9 @@ declare namespace adone {
|
||||
export function emitter(obj: any): obj is event.Emitter;
|
||||
|
||||
export function asyncEmitter(obj: any): obj is event.AsyncEmitter;
|
||||
|
||||
export const openbsd: boolean;
|
||||
|
||||
export const aix: boolean;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -602,13 +602,12 @@ namespace fsTests {
|
||||
}
|
||||
|
||||
namespace isTests {
|
||||
const { is } = fs;
|
||||
is.file("hello").then((x: boolean) => {});
|
||||
{ const a: boolean = is.fileSync("hello"); }
|
||||
is.directory("hello").then((x: boolean) => {});
|
||||
{ const a: boolean = is.directorySync("hello"); }
|
||||
is.executable("hello").then((x: boolean) => {});
|
||||
{ const a: boolean = is.executableSync("hello"); }
|
||||
fs.isFile("hello").then((x: boolean) => {});
|
||||
{ const a: boolean = fs.isFileSync("hello"); }
|
||||
fs.isDirectory("hello").then((x: boolean) => {});
|
||||
{ const a: boolean = fs.isDirectorySync("hello"); }
|
||||
fs.isExecutable("hello").then((x: boolean) => {});
|
||||
{ const a: boolean = fs.isExecutableSync("hello"); }
|
||||
}
|
||||
|
||||
namespace whichTests {
|
||||
@@ -944,4 +943,17 @@ namespace fsTests {
|
||||
fs.watchTail("file", { separator: /\n/ });
|
||||
fs.watchTail("file", { useWatchFile: true });
|
||||
}
|
||||
|
||||
namespace writeFileAtomicTests {
|
||||
fs.writeFileAtomic("a", "b").then(() => {});
|
||||
fs.writeFileAtomic("a", Buffer.from("b")).then(() => {});
|
||||
fs.writeFileAtomic("a", new Uint8Array(10)).then(() => {});
|
||||
fs.writeFileAtomic("a", "a", {}).then(() => {});
|
||||
fs.writeFileAtomic("a", "a", { chown: {} }).then(() => {});
|
||||
fs.writeFileAtomic("a", "a", { chown: { gid: 0 } }).then(() => {});
|
||||
fs.writeFileAtomic("a", "a", { chown: { uid: 0 } }).then(() => {});
|
||||
fs.writeFileAtomic("a", "a", { encoding: "utf8" }).then(() => {});
|
||||
fs.writeFileAtomic("a", "a", { fsync: false }).then(() => {});
|
||||
fs.writeFileAtomic("a", "a", { mode: 0o666 }).then(() => {});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -336,6 +336,8 @@ namespace isTests {
|
||||
{ const a: boolean = is.freebsd; }
|
||||
{ const a: boolean = is.darwin; }
|
||||
{ const a: boolean = is.sunos; }
|
||||
{ const a: boolean = is.openbsd; }
|
||||
{ const a: boolean = is.aix; }
|
||||
{ const a: boolean = is.uppercase("abc"); }
|
||||
{ const a: boolean = is.lowercase("abc"); }
|
||||
{ const a: boolean = is.digits("012"); }
|
||||
|
||||
@@ -54,4 +54,15 @@ namespace AdoneRootTests {
|
||||
obj = adone.package;
|
||||
{ const a: typeof adone.assertion.assert = adone.assert; }
|
||||
{ const a: typeof adone.assertion.expect = adone.expect; }
|
||||
|
||||
namespace lodashTests {
|
||||
adone.lodash.get({}, "a");
|
||||
adone.lodash.defaults({}, {});
|
||||
adone.lodash.zip([]);
|
||||
}
|
||||
|
||||
namespace benchmarkTests {
|
||||
const b = new adone.benchmark.Benchmark.Suite();
|
||||
b.add(() => {}).add("", () => {}).run();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
"files": [
|
||||
"adone-tests.ts",
|
||||
"adone.d.ts",
|
||||
"benchmark.d.ts",
|
||||
"glosses/archives.d.ts",
|
||||
"glosses/assertion.d.ts",
|
||||
"glosses/collections/array_set.d.ts",
|
||||
|
||||
@@ -64,6 +64,6 @@ archiver.setModule(() => {});
|
||||
archiver.pointer();
|
||||
archiver.use(() => {});
|
||||
|
||||
archiver.finalize().then();
|
||||
archiver.finalize();
|
||||
|
||||
archiver.symlink('./path', './target');
|
||||
|
||||
Vendored
+1
-1
@@ -35,7 +35,7 @@ declare namespace archiver {
|
||||
directory(dirpath: string, destpath: false | string, data?: EntryData | EntryDataFunction): this;
|
||||
file(filename: string, data: EntryData): this;
|
||||
glob(pattern: string, options?: glob.IOptions, data?: EntryData): this;
|
||||
finalize(): Promise<void>;
|
||||
finalize(): void;
|
||||
|
||||
setFormat(format: string): this;
|
||||
setModule(module: Function): this;
|
||||
|
||||
Vendored
+2
@@ -2,6 +2,7 @@
|
||||
// Project: https://github.com/Atmosphere/atmosphere-javascript
|
||||
// Definitions by: Kai Toedter <https://github.com/toedter>
|
||||
// Fedor Kirpichev <https://github.com/Mory1879>
|
||||
// Jorge Beltran <https://github.com/Scipion>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
// Use this typings in future instead of deprecated 'atmosphere'.
|
||||
@@ -65,6 +66,7 @@ declare namespace Atmosphere {
|
||||
maxReconnectOnClose?: number;
|
||||
enableProtocol?: boolean;
|
||||
pollingInterval?: number;
|
||||
webSocketUrl?: string;
|
||||
|
||||
onError?: (response?:Response) => void;
|
||||
onClose?: (response?:Response) => void;
|
||||
|
||||
Vendored
+2
-1
@@ -1,4 +1,4 @@
|
||||
// Type definitions for auth0-lock 10.16
|
||||
// Type definitions for auth0-lock 11.4
|
||||
// Project: http://auth0.com
|
||||
// Definitions by: Brian Caruso <https://github.com/carusology>
|
||||
// Dan Caddigan <https://github.com/goldcaddy77>
|
||||
@@ -143,6 +143,7 @@ interface Auth0LockConstructorOptions {
|
||||
socialButtonStyle?: "big" | "small";
|
||||
theme?: Auth0LockThemeOptions;
|
||||
usernameStyle?: string;
|
||||
_enableImpersonation?: boolean;
|
||||
}
|
||||
|
||||
interface Auth0LockFlashMessageOptions {
|
||||
|
||||
Vendored
+1
-1
@@ -90,7 +90,7 @@ export interface AttributeValue {
|
||||
// Context
|
||||
// http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_streams_StreamRecord.html
|
||||
export interface StreamRecord {
|
||||
ApproximateCreationTime?: number;
|
||||
ApproximateCreationDateTime?: number;
|
||||
Keys?: { [key: string]: AttributeValue };
|
||||
NewImage?: { [key: string]: AttributeValue };
|
||||
OldImage?: { [key: string]: AttributeValue };
|
||||
|
||||
@@ -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"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+8
-5
@@ -1,6 +1,9 @@
|
||||
// Type definitions for Marionette 3.3
|
||||
// Project: https://github.com/marionettejs/
|
||||
// Definitions by: Zeeshan Hamid <https://github.com/zhamid>, Natan Vivo <https://github.com/nvivo>, Sven Tschui <https://github.com/sventschui>
|
||||
// Definitions by: Zeeshan Hamid <https://github.com/zhamid>,
|
||||
// Natan Vivo <https://github.com/nvivo>,
|
||||
// Sven Tschui <https://github.com/sventschui>,
|
||||
// Volker Nauruhn <https://github.com/razorness>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
@@ -1394,27 +1397,27 @@ export class CollectionView<TModel extends Backbone.Model, TView extends View<TM
|
||||
* instance is about to be added to the collection view. It provides
|
||||
* access to the view instance for the child that was added.
|
||||
*/
|
||||
onBeforeAddChild(childView: TView): void;
|
||||
onBeforeAddChild(collectionView: CollectionView<TModel, TView, TCollection>, childView: TView): void;
|
||||
|
||||
/**
|
||||
* This callback function allows you to know when a child / child view
|
||||
* instance has been added to the collection view. It provides access to
|
||||
* the view instance for the child that was added.
|
||||
*/
|
||||
onAddChild(childView: TView): void;
|
||||
onAddChild(collectionView: CollectionView<TModel, TView, TCollection>, childView: TView): void;
|
||||
|
||||
/**
|
||||
* This callback function allows you to know when a childView instance is
|
||||
* about to be removed from the collectionView. It provides access to the
|
||||
* view instance for the child that was removed.
|
||||
*/
|
||||
onBeforeRemoveChild(childView: TView): void;
|
||||
onBeforeRemoveChild(collectionView: CollectionView<TModel, TView, TCollection>, childView: TView): void;
|
||||
|
||||
/**
|
||||
* This callback function allows you to know when a child / childView
|
||||
* instance has been deleted or removed from the collection.
|
||||
*/
|
||||
onRemoveChild(childView: TView): void;
|
||||
onRemoveChild(collectionView: CollectionView<TModel, TView, TCollection>, childView: TView): void;
|
||||
|
||||
/**
|
||||
* Automatically destroys this Collection's children and cleans up
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
import * as base64url from 'base64-url';
|
||||
|
||||
base64url.encode('Node.js is awesome.'); // $ExpectType string
|
||||
base64url.decode('Tm9kZS5qcyBpcyBhd2Vzb21lLg'); // $ExpectType string
|
||||
base64url.escape('This+is/goingto+escape=='); // $ExpectType string
|
||||
base64url.unescape('This-is_goingto-escape'); // $ExpectType string
|
||||
|
||||
base64url.encode('string to encode', 'ascii'); // $ExpectType string
|
||||
base64url.decode('string to decode', 'ascii'); // $ExpectType string
|
||||
Vendored
+9
@@ -0,0 +1,9 @@
|
||||
// Type definitions for base64-url 2.2
|
||||
// Project: https://github.com/joaquimserafim/base64-url
|
||||
// Definitions by: Uri Shaked <https://github.com/urish>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export function decode(value: string, encoding?: string): string;
|
||||
export function encode(value: string, encoding?: string): string;
|
||||
export function escape(value: string): string;
|
||||
export function unescape(value: string): string;
|
||||
@@ -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",
|
||||
"base64-url-tests.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 {
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
/// <reference types="mocha" />
|
||||
/// <reference types="node" />
|
||||
import assert = require('assert');
|
||||
import { BinTree, RBTree } from 'bintrees';
|
||||
|
||||
// Declaring shims removes mocha dependency. These tests are never executed, only typechecked, so this is fine.
|
||||
declare function describe(description: string, callback: () => void): void;
|
||||
declare function it(description: string, callback: () => void): void;
|
||||
|
||||
describe('bintrees', () => {
|
||||
it('builds a simple tree', () => {
|
||||
let treeA = new RBTree((a: number, b: number) => a - b);
|
||||
|
||||
Vendored
+4
@@ -71,6 +71,10 @@ export class ECPair {
|
||||
|
||||
d: BigInteger;
|
||||
|
||||
readonly compressed: boolean;
|
||||
|
||||
readonly network: Network;
|
||||
|
||||
getAddress(): string;
|
||||
|
||||
getNetwork(): Network;
|
||||
|
||||
Vendored
+6
-5
@@ -4,6 +4,7 @@
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// Definitions by: SINTEF-9012 <https://github.com/SINTEF-9012>
|
||||
|
||||
/// <reference types="node" />
|
||||
import Long = require("long");
|
||||
|
||||
declare namespace ByteBuffer {}
|
||||
@@ -70,7 +71,7 @@ declare class ByteBuffer
|
||||
/**
|
||||
* Backing buffer.
|
||||
*/
|
||||
buffer: ArrayBuffer;
|
||||
buffer: Buffer;
|
||||
|
||||
/**
|
||||
* Absolute limit of the contained data. Set to the backing buffer's capacity upon allocation.
|
||||
@@ -135,12 +136,12 @@ declare class ByteBuffer
|
||||
/**
|
||||
* Calculates the actual number of bytes required to store a 32bit base 128 variable-length integer.
|
||||
*/
|
||||
static calculateVariant32( value: number ): number;
|
||||
static calculateVarint32( value: number ): number;
|
||||
|
||||
/**
|
||||
* Calculates the actual number of bytes required to store a 64bit base 128 variable-length integer.
|
||||
*/
|
||||
static calculateVariant64( value: number | Long ): number;
|
||||
static calculateVarint64( value: number | Long ): number;
|
||||
|
||||
/**
|
||||
* Concatenates multiple ByteBuffers into one.
|
||||
@@ -340,7 +341,7 @@ declare class ByteBuffer
|
||||
/**
|
||||
* Reads a length as uint32 prefixed UTF8 encoded string.
|
||||
*/
|
||||
readIString( offset?: number ): string;
|
||||
readIString( offset?: number ): string | { string: string; length: number };
|
||||
|
||||
/**
|
||||
* Reads a 32bit signed integer.This is an alias of ByteBuffer#readInt32.
|
||||
@@ -385,7 +386,7 @@ declare class ByteBuffer
|
||||
/**
|
||||
* Reads an UTF8 encoded string.
|
||||
*/
|
||||
readUTF8String( chars: number, offset?: number ): string;
|
||||
readUTF8String( chars: number, metrics?: number, offset?: number ): string | { string: string; length: number };
|
||||
|
||||
/**
|
||||
* Reads a 16bit unsigned integer.
|
||||
|
||||
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"]
|
||||
}
|
||||
|
||||
Vendored
+1
@@ -2,6 +2,7 @@
|
||||
// Project: https://github.com/suchipi/chai-jest-snapshot#readme
|
||||
// Definitions by: Matt Perry <https://github.com/mattvperry>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.1
|
||||
|
||||
/// <reference types="chai" />
|
||||
/// <reference types="mocha" />
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import * as chai from 'chai';
|
||||
import * as spies from 'chai-spies';
|
||||
import * as Mocha from 'mocha';
|
||||
|
||||
function original(): void {
|
||||
// do something cool
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
|
||||
/// <reference types="mocha" />
|
||||
|
||||
var should = chai.should();
|
||||
var assert = chai.assert;
|
||||
var expect = chai.expect;
|
||||
@@ -8,6 +6,11 @@ var expect = chai.expect;
|
||||
import chai_string = require("chai-string");
|
||||
chai.use(chai_string);
|
||||
|
||||
// Stub mocha functions
|
||||
const {describe, it, before, after, beforeEach, afterEach} = null as any as {
|
||||
[s: string]: ((s: string, cb: (done: any) => void) => void) & ((cb: (done: any) => void) => void) & {only: any, skip: any};
|
||||
};
|
||||
|
||||
describe('chai-string', function() {
|
||||
|
||||
describe('#startsWith', function() {
|
||||
|
||||
Vendored
+1
-1
@@ -1189,7 +1189,7 @@ declare namespace chrome.system.display {
|
||||
* @param {string} id The display's unique identifier.
|
||||
* @param {(success) => void} callback Optional callback to inform the caller that the touch calibration has ended. The argument of the callback informs if the calibration was a success or not.
|
||||
*/
|
||||
export function showNativeTouchCalibration(id: string, callback: (success) => void): void;
|
||||
export function showNativeTouchCalibration(id: string, callback: (success: boolean) => void): void;
|
||||
|
||||
/**
|
||||
* @description Starts custom touch calibration for a display. This should be called when using a custom UX for collecting calibration data. If another touch calibration is already in progress this will throw an error.
|
||||
|
||||
Vendored
+20
@@ -1678,6 +1678,17 @@ declare namespace chrome.devtools.inspectedWindow {
|
||||
* Parameter exceptionInfo: An object providing details if an exception occurred while evaluating the expression.
|
||||
*/
|
||||
export function eval<T>(expression: string, callback?: (result: T, exceptionInfo: EvaluationExceptionInfo) => void): void;
|
||||
/**
|
||||
* Evaluates a JavaScript expression in the context of the main frame of the inspected page. The expression must evaluate to a JSON-compliant object, otherwise an exception is thrown. The eval function can report either a DevTools-side error or a JavaScript exception that occurs during evaluation. In either case, the result parameter of the callback is undefined. In the case of a DevTools-side error, the isException parameter is non-null and has isError set to true and code set to an error code. In the case of a JavaScript error, isException is set to true and value is set to the string value of thrown object.
|
||||
* @param expression An expression to evaluate.
|
||||
* @param options The options parameter can contain one or more options.
|
||||
* @param callback A function called when evaluation completes.
|
||||
* If you specify the callback parameter, it should be a function that looks like this:
|
||||
* function(object result, object exceptionInfo) {...};
|
||||
* Parameter result: The result of evaluation.
|
||||
* Parameter exceptionInfo: An object providing details if an exception occurred while evaluating the expression.
|
||||
*/
|
||||
export function eval<T>(expression: string, options: EvalOptions, callback?: (result: T, exceptionInfo: EvaluationExceptionInfo) => void): void;
|
||||
/**
|
||||
* Retrieves the list of resources from the inspected page.
|
||||
* @param callback A function that receives the list of resources when the request completes.
|
||||
@@ -1690,6 +1701,15 @@ declare namespace chrome.devtools.inspectedWindow {
|
||||
export var onResourceAdded: ResourceAddedEvent;
|
||||
/** Fired when a new revision of the resource is committed (e.g. user saves an edited version of the resource in the Developer Tools). */
|
||||
export var onResourceContentCommitted: ResourceContentCommittedEvent;
|
||||
|
||||
export interface EvalOptions {
|
||||
/** If specified, the expression is evaluated on the iframe whose URL matches the one specified. By default, the expression is evaluated in the top frame of the inspected page. */
|
||||
frameURL?: string;
|
||||
/** Evaluate the expression in the context of the content script of the calling extension, provided that the content script is already injected into the inspected page. If not, the expression is not evaluated and the callback is invoked with the exception parameter set to an object that has the isError field set to true and the code field set to E_NOTFOUND. */
|
||||
useContentScriptContext?: boolean;
|
||||
/** Evaluate the expression in the context of a content script of an extension that matches the specified origin. If given, contextSecurityOrigin overrides the 'true' setting on userContentScriptContext. */
|
||||
contextSecurityOrigin?: string;
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////
|
||||
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
import Cleave = require("../");
|
||||
|
||||
// Credit Card Options
|
||||
export type CreditCardType =
|
||||
| "amex"
|
||||
| "dankort"
|
||||
| "diners"
|
||||
| "discover"
|
||||
| "instapayment"
|
||||
| "jcb"
|
||||
| "maestro"
|
||||
| "mastercard"
|
||||
| "uatp"
|
||||
| "unknown"
|
||||
| "unionPay"
|
||||
| "mir"
|
||||
| "visa";
|
||||
|
||||
export type CreditCardTypeChangeHandler = (this: Cleave, type: CreditCardType) => void;
|
||||
@@ -1,19 +1,4 @@
|
||||
// Credit Card Options
|
||||
export type CreditCardType =
|
||||
| "amex"
|
||||
| "dankort"
|
||||
| "diners"
|
||||
| "discover"
|
||||
| "instapayment"
|
||||
| "jcb"
|
||||
| "maestro"
|
||||
| "mastercard"
|
||||
| "uatp"
|
||||
| "unknown"
|
||||
| "unionPay"
|
||||
| "mir"
|
||||
| "visa";
|
||||
export type CreditCardTypeChangeHandler = (owner: HTMLInputElement, type: CreditCardType) => void;
|
||||
import { CreditCardTypeChangeHandler } from "./creditCard";
|
||||
|
||||
export interface CleaveOptions {
|
||||
creditCard?: boolean;
|
||||
@@ -21,7 +21,8 @@
|
||||
"files": [
|
||||
"cleave.js-tests.tsx",
|
||||
"index.d.ts",
|
||||
"options.d.ts",
|
||||
"options/creditCard.d.ts",
|
||||
"options/index.d.ts",
|
||||
"react/index.d.ts"
|
||||
]
|
||||
}
|
||||
Vendored
+1
-1
@@ -669,7 +669,7 @@ declare namespace CodeMirror {
|
||||
|
||||
/** Returns a {from, to} object (both holding document positions), indicating the current position of the marked range,
|
||||
or undefined if the marker is no longer in the document. */
|
||||
find(): CodeMirror.Range;
|
||||
find(): {from: CodeMirror.Position, to: CodeMirror.Position};
|
||||
|
||||
/** Returns an object representing the options for the marker. If copyWidget is given true, it will clone the value of the replacedWith option, if any. */
|
||||
getOptions(copyWidget: boolean): CodeMirror.TextMarkerOptions;
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
import colors = require("colors");
|
||||
import { zalgo } from "colors/safe";
|
||||
|
||||
let str: string;
|
||||
|
||||
str = zalgo("");
|
||||
|
||||
colors.enabled = true;
|
||||
|
||||
str = colors.black.underline('test');
|
||||
str = colors.rainbow.black.blue.gray('test');
|
||||
str = colors.random.reset.bgWhite.dim('test');
|
||||
str = colors.random.reset.bgWhite.strip('test');
|
||||
str = 'test'.black.underline;
|
||||
str = 'test'.rainbow.black.blue.gray;
|
||||
str = 'test'.random.reset.bgWhite.dim;
|
||||
str = 'test'.random.reset.bgWhite.dim.stripColors;
|
||||
|
||||
colors.enabled = false;
|
||||
|
||||
str = colors.black.underline('test');
|
||||
Vendored
-133
@@ -1,133 +0,0 @@
|
||||
// Type definitions for Colors.js 1.1
|
||||
// Project: https://github.com/Marak/colors.js
|
||||
// Definitions by: Bart van der Schoor <https://github.com/Bartvds>, Staffan Eketorp <https://github.com/staeke>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export interface Color {
|
||||
(text: string): string;
|
||||
|
||||
strip: Color;
|
||||
stripColors: Color;
|
||||
|
||||
black: Color;
|
||||
red: Color;
|
||||
green: Color;
|
||||
yellow: Color;
|
||||
blue: Color;
|
||||
magenta: Color;
|
||||
cyan: Color;
|
||||
white: Color;
|
||||
gray: Color;
|
||||
grey: Color;
|
||||
|
||||
bgBlack: Color;
|
||||
bgRed: Color;
|
||||
bgGreen: Color;
|
||||
bgYellow: Color;
|
||||
bgBlue: Color;
|
||||
bgMagenta: Color;
|
||||
bgCyan: Color;
|
||||
bgWhite: Color;
|
||||
|
||||
reset: Color;
|
||||
bold: Color;
|
||||
dim: Color;
|
||||
italic: Color;
|
||||
underline: Color;
|
||||
inverse: Color;
|
||||
hidden: Color;
|
||||
strikethrough: Color;
|
||||
|
||||
rainbow: Color;
|
||||
zebra: Color;
|
||||
america: Color;
|
||||
trap: Color;
|
||||
random: Color;
|
||||
zalgo: Color;
|
||||
}
|
||||
|
||||
export function setTheme(theme: any): void;
|
||||
|
||||
export let enabled: boolean;
|
||||
|
||||
export const strip: Color;
|
||||
export const stripColors: Color;
|
||||
|
||||
export const black: Color;
|
||||
export const red: Color;
|
||||
export const green: Color;
|
||||
export const yellow: Color;
|
||||
export const blue: Color;
|
||||
export const magenta: Color;
|
||||
export const cyan: Color;
|
||||
export const white: Color;
|
||||
export const gray: Color;
|
||||
export const grey: Color;
|
||||
|
||||
export const bgBlack: Color;
|
||||
export const bgRed: Color;
|
||||
export const bgGreen: Color;
|
||||
export const bgYellow: Color;
|
||||
export const bgBlue: Color;
|
||||
export const bgMagenta: Color;
|
||||
export const bgCyan: Color;
|
||||
export const bgWhite: Color;
|
||||
|
||||
export const reset: Color;
|
||||
export const bold: Color;
|
||||
export const dim: Color;
|
||||
export const italic: Color;
|
||||
export const underline: Color;
|
||||
export const inverse: Color;
|
||||
export const hidden: Color;
|
||||
export const strikethrough: Color;
|
||||
|
||||
export const rainbow: Color;
|
||||
export const zebra: Color;
|
||||
export const america: Color;
|
||||
export const trap: Color;
|
||||
export const random: Color;
|
||||
export const zalgo: Color;
|
||||
|
||||
declare global {
|
||||
interface String {
|
||||
strip: string;
|
||||
stripColors: string;
|
||||
|
||||
black: string;
|
||||
red: string;
|
||||
green: string;
|
||||
yellow: string;
|
||||
blue: string;
|
||||
magenta: string;
|
||||
cyan: string;
|
||||
white: string;
|
||||
gray: string;
|
||||
grey: string;
|
||||
|
||||
bgBlack: string;
|
||||
bgRed: string;
|
||||
bgGreen: string;
|
||||
bgYellow: string;
|
||||
bgBlue: string;
|
||||
bgMagenta: string;
|
||||
bgCyan: string;
|
||||
bgWhite: string;
|
||||
|
||||
reset: string;
|
||||
bold: string;
|
||||
dim: string;
|
||||
italic: string;
|
||||
underline: string;
|
||||
inverse: string;
|
||||
hidden: string;
|
||||
strikethrough: string;
|
||||
|
||||
rainbow: string;
|
||||
zebra: string;
|
||||
america: string;
|
||||
trap: string;
|
||||
random: string;
|
||||
zalgo: string;
|
||||
}
|
||||
}
|
||||
Vendored
-40
@@ -1,40 +0,0 @@
|
||||
export const enabled: boolean;
|
||||
|
||||
export function strip(str: string): string;
|
||||
export function stripColors(str: string): string;
|
||||
|
||||
export function black(str: string): string;
|
||||
export function red(str: string): string;
|
||||
export function green(str: string): string;
|
||||
export function yellow(str: string): string;
|
||||
export function blue(str: string): string;
|
||||
export function magenta(str: string): string;
|
||||
export function cyan(str: string): string;
|
||||
export function white(str: string): string;
|
||||
export function gray(str: string): string;
|
||||
export function grey(str: string): string;
|
||||
|
||||
export function bgBlack(str: string): string;
|
||||
export function bgRed(str: string): string;
|
||||
export function bgGreen(str: string): string;
|
||||
export function bgYellow(str: string): string;
|
||||
export function bgBlue(str: string): string;
|
||||
export function bgMagenta(str: string): string;
|
||||
export function bgCyan(str: string): string;
|
||||
export function bgWhite(str: string): string;
|
||||
|
||||
export function reset(str: string): string;
|
||||
export function bold(str: string): string;
|
||||
export function dim(str: string): string;
|
||||
export function italic(str: string): string;
|
||||
export function underline(str: string): string;
|
||||
export function inverse(str: string): string;
|
||||
export function hidden(str: string): string;
|
||||
export function strikethrough(str: string): string;
|
||||
|
||||
export function rainbow(str: string): string;
|
||||
export function zebra(str: string): string;
|
||||
export function america(str: string): string;
|
||||
export function trap(str: string): string;
|
||||
export function random(str: string): string;
|
||||
export function zalgo(str: string): string;
|
||||
@@ -0,0 +1,41 @@
|
||||
import cosmiconfig = require("cosmiconfig");
|
||||
|
||||
const asyncExplorer = cosmiconfig("yourModuleName", {
|
||||
packageProp: "yourModuleName",
|
||||
rc: ".yourModuleNamerc",
|
||||
js: "yourModuleName.config.js",
|
||||
rcStrictJson: false,
|
||||
rcExtensions: false,
|
||||
stopDir: "someDir",
|
||||
cache: true,
|
||||
sync: false,
|
||||
transform: ({ config, filePath }) => ({ config, filePath }),
|
||||
format: "js"
|
||||
});
|
||||
|
||||
Promise.all([
|
||||
asyncExplorer.load(),
|
||||
asyncExplorer.load("start/search/here"),
|
||||
asyncExplorer.load(null, "load/this/file.json")
|
||||
]).then(result => result);
|
||||
|
||||
asyncExplorer.load().then(({ config, filePath }) => ({ config, filePath }));
|
||||
|
||||
asyncExplorer.clearFileCache();
|
||||
asyncExplorer.clearDirectoryCache();
|
||||
asyncExplorer.clearCaches();
|
||||
|
||||
const syncExplorer = cosmiconfig("yourModuleName", {
|
||||
packageProp: "yourModuleName",
|
||||
rc: ".yourModuleNamerc",
|
||||
js: "yourModuleName.config.js",
|
||||
rcStrictJson: false,
|
||||
rcExtensions: false,
|
||||
stopDir: "someDir",
|
||||
cache: true,
|
||||
sync: true,
|
||||
transform: ({ config, filePath }) => ({ config, filePath }),
|
||||
format: "js"
|
||||
});
|
||||
|
||||
const { config, filePath } = syncExplorer.load();
|
||||
Vendored
+63
@@ -0,0 +1,63 @@
|
||||
// Type definitions for cosmiconfig 4.0
|
||||
// Project: https://github.com/davidtheclark/cosmiconfig
|
||||
// Definitions by: ozum <https://github.com/ozum>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
interface Result {
|
||||
config: object;
|
||||
filePath: string;
|
||||
}
|
||||
|
||||
interface Options {
|
||||
packageProp?: string | false;
|
||||
rc?: string | false;
|
||||
js?: string | false;
|
||||
rcStrictJson?: boolean;
|
||||
rcExtensions?: boolean;
|
||||
stopDir?: string;
|
||||
cache?: boolean;
|
||||
transform?: (result: Result) => Promise<Result> | Result;
|
||||
configPath?: string;
|
||||
format?: "json" | "yaml" | "js";
|
||||
}
|
||||
|
||||
// Default is false and makes load() method async
|
||||
interface AsyncOptions extends Options {
|
||||
sync?: false;
|
||||
}
|
||||
|
||||
// Makes load() method sync
|
||||
interface SyncOptions extends Options {
|
||||
sync: true;
|
||||
}
|
||||
|
||||
interface Explorer {
|
||||
clearFileCache(): void;
|
||||
clearDirectoryCache(): void;
|
||||
clearCaches(): void;
|
||||
}
|
||||
|
||||
interface AsyncExplorer extends Explorer {
|
||||
// You should provide either searchPath or configPath for load method. To disallow both, overloaded definitions added.
|
||||
load(searchPath?: string): Promise<Result>;
|
||||
load(searchPath: null | undefined, configPath?: string): Promise<Result>;
|
||||
}
|
||||
|
||||
interface SyncExplorer extends Explorer {
|
||||
// You should provide either searchPath or configPath for load method. To disallow both, overloaded definitions added.
|
||||
load(searchPath?: string): Result;
|
||||
load(searchPath: null | undefined, configPath?: string): Result;
|
||||
}
|
||||
|
||||
declare function cosmiconfig(
|
||||
moduleName: string,
|
||||
options: SyncOptions
|
||||
): SyncExplorer;
|
||||
|
||||
declare function cosmiconfig(
|
||||
moduleName: string,
|
||||
options?: AsyncOptions
|
||||
): AsyncExplorer;
|
||||
|
||||
export = cosmiconfig;
|
||||
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": ["es6"],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": ["../"],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": ["index.d.ts", "cosmiconfig-tests.ts"]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
@@ -1,8 +1,12 @@
|
||||
/// <reference types="mocha" />
|
||||
|
||||
declare function equal<T>(a: T, b: T): void;
|
||||
declare function deepEqual<T>(a: T, b: T): void;
|
||||
|
||||
// Stub mocha functions
|
||||
const {describe, it, before, after, beforeEach, afterEach} = null as any as {
|
||||
[s: string]: ((s: string, cb: (done: any) => void) => void) & ((cb: (done: any) => void) => void) & {only: any, skip: any};
|
||||
};
|
||||
|
||||
import * as createError from 'create-error';
|
||||
|
||||
// Example taken from https://github.com/tgriesser/create-error/blob/0.3.1/README.md#use
|
||||
|
||||
@@ -395,6 +395,9 @@ constructedProjection = constructedProjection.translate([480, 250]);
|
||||
const center: [number, number] = constructedProjection.center();
|
||||
constructedProjection = constructedProjection.center([0, 0]);
|
||||
|
||||
const angle = constructedProjection.angle();
|
||||
constructedProjection = constructedProjection.angle(45);
|
||||
|
||||
const rotate: [number, number, number] = constructedProjection.rotate();
|
||||
constructedProjection = constructedProjection.rotate([0, 0]);
|
||||
constructedProjection = constructedProjection.rotate([0, 0, 0]);
|
||||
|
||||
Vendored
+11
-3
@@ -1,10 +1,10 @@
|
||||
// Type definitions for D3JS d3-geo module 1.9
|
||||
// Type definitions for D3JS d3-geo module 1.10
|
||||
// Project: https://github.com/d3/d3-geo/
|
||||
// Definitions by: Hugues Stefanski <https://github.com/Ledragon>, Tom Wanzek <https://github.com/tomwanzek>, Alex Ford <https://github.com/gustavderdrache>, Boris Yankov <https://github.com/borisyankov>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
// Last module patch version validated against: 1.9.0
|
||||
// Last module patch version validated against: 1.10.0
|
||||
|
||||
import * as GeoJSON from 'geojson';
|
||||
|
||||
@@ -887,7 +887,15 @@ export interface GeoProjection extends GeoStreamWrapper {
|
||||
* @param precision A numeric value in pixels to use as the threshold for the projection’s adaptive resampling.
|
||||
*/
|
||||
precision(precision: number): this;
|
||||
|
||||
/**
|
||||
* Returns the projection’s current angle, which defaults to 0°.
|
||||
*/
|
||||
angle(): number;
|
||||
/**
|
||||
* Sets the projection’s post-projection planar rotation angle to the specified angle in degrees and returns the projection.
|
||||
* @param angle The new rotation angle of the projection.
|
||||
*/
|
||||
angle(angle: number): this;
|
||||
/**
|
||||
* Returns the current rotation [lambda, phi, gamma] specifying the rotation angles in degrees about each spherical axis.
|
||||
* (These correspond to yaw, pitch and roll.) which defaults [0, 0, 0].
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
/// <reference types="mocha" />
|
||||
/// <reference types="chai" />
|
||||
|
||||
// Stub mocha functions
|
||||
const {describe, it, before, after, beforeEach, afterEach} = null as any as {
|
||||
[s: string]: ((s: string, cb: (done: any) => void) => void) & ((cb: (done: any) => void) => void) & {only: any, skip: any};
|
||||
};
|
||||
|
||||
var expect = chai.expect;
|
||||
describe('Skeleton', function(){
|
||||
var element: Element, $element: d3.Selection<any>, $svg: d3.Selection<any>, skeleton: d3kit.Skeleton;
|
||||
|
||||
Vendored
+29
-27
@@ -7,33 +7,35 @@
|
||||
|
||||
export = decompress;
|
||||
|
||||
declare function decompress(input: string | Buffer, output: string, opts?: Options): Promise<File>;
|
||||
declare function decompress(input: string | Buffer, output: string, opts?: decompress.DecompressOptions): Promise<decompress.File>;
|
||||
|
||||
interface File {
|
||||
data: Buffer;
|
||||
mode: number;
|
||||
mtime: string;
|
||||
path: string;
|
||||
type: string;
|
||||
}
|
||||
declare namespace decompress {
|
||||
interface File {
|
||||
data: Buffer;
|
||||
mode: number;
|
||||
mtime: string;
|
||||
path: string;
|
||||
type: string;
|
||||
}
|
||||
|
||||
interface Options {
|
||||
/**
|
||||
* Filter out files before extracting
|
||||
*/
|
||||
filter?(file: File): boolean;
|
||||
/**
|
||||
* Map files before extracting
|
||||
*/
|
||||
map?(file: File): File;
|
||||
/**
|
||||
* Array of plugins to use.
|
||||
* Default: [decompressTar(), decompressTarbz2(), decompressTargz(), decompressUnzip()]
|
||||
*/
|
||||
plugins?: any[];
|
||||
/**
|
||||
* Remove leading directory components from extracted files.
|
||||
* Default: 0
|
||||
*/
|
||||
strip?: number;
|
||||
interface DecompressOptions {
|
||||
/**
|
||||
* Filter out files before extracting
|
||||
*/
|
||||
filter?(file: File): boolean;
|
||||
/**
|
||||
* Map files before extracting
|
||||
*/
|
||||
map?(file: File): File;
|
||||
/**
|
||||
* Array of plugins to use.
|
||||
* Default: [decompressTar(), decompressTarbz2(), decompressTargz(), decompressUnzip()]
|
||||
*/
|
||||
plugins?: any[];
|
||||
/**
|
||||
* Remove leading directory components from extracted files.
|
||||
* Default: 0
|
||||
*/
|
||||
strip?: number;
|
||||
}
|
||||
}
|
||||
|
||||
+33
-25
@@ -1,39 +1,47 @@
|
||||
import del = require("del");
|
||||
import del = require('del');
|
||||
|
||||
let paths = ["build", "dist/**/*.js"];
|
||||
let paths = ['build', 'dist/**/*.js'];
|
||||
|
||||
del(["tmp/*.js", "!tmp/unicorn.js"]);
|
||||
del(["tmp/*.js", "!tmp/unicorn.js"], {force: true});
|
||||
del(["tmp/*.js", "!tmp/unicorn.js"], {dryRun: true});
|
||||
del(["tmp/*.js", "!tmp/unicorn.js"], {concurrency: 20});
|
||||
del(["tmp/*.js", "!tmp/unicorn.js"], {cwd: ''});
|
||||
del(['tmp/*.js', '!tmp/unicorn.js']);
|
||||
del(['tmp/*.js', '!tmp/unicorn.js'], { force: true });
|
||||
del(['tmp/*.js', '!tmp/unicorn.js'], { dryRun: true });
|
||||
del(['tmp/*.js', '!tmp/unicorn.js'], { concurrency: 20 });
|
||||
del(['tmp/*.js', '!tmp/unicorn.js'], { cwd: '' });
|
||||
|
||||
del(["tmp/*.js", "!tmp/unicorn.js"]).then((paths: string[]) => {
|
||||
del(['tmp/*.js', '!tmp/unicorn.js']).then((paths: string[]) => {
|
||||
console.log('Deleted files/folders:\n', paths.join('\n'));
|
||||
});
|
||||
|
||||
del(["tmp/*.js", "!tmp/unicorn.js"], {force: true}).then((paths: string[]) => {
|
||||
del(['tmp/*.js', '!tmp/unicorn.js'], { force: true }).then(
|
||||
(paths: string[]) => {
|
||||
console.log('Deleted files/folders:\n', paths.join('\n'));
|
||||
}
|
||||
);
|
||||
|
||||
del('tmp/*.js');
|
||||
del('tmp/*.js', { force: true });
|
||||
del('tmp/*.js', { dryRun: true });
|
||||
del('tmp/*.js', { concurrency: 20 });
|
||||
del('tmp/*.js', { cwd: '' });
|
||||
del('tmp/*.js').then((paths: string[]) => {
|
||||
console.log('Deleted files/folders:\n', paths.join('\n'));
|
||||
});
|
||||
|
||||
del("tmp/*.js");
|
||||
del("tmp/*.js", {force: true});
|
||||
del("tmp/*.js", {dryRun: true});
|
||||
del("tmp/*.js", {concurrency: 20});
|
||||
del("tmp/*.js", {cwd: ''});
|
||||
del("tmp/*.js").then((paths: string[]) => {
|
||||
del('tmp/*.js', { force: true }).then((paths: string[]) => {
|
||||
console.log('Deleted files/folders:\n', paths.join('\n'));
|
||||
});
|
||||
|
||||
del("tmp/*.js", {force: true}).then((paths: string[]) => {
|
||||
console.log('Deleted files/folders:\n', paths.join('\n'));
|
||||
});
|
||||
paths = del.sync(['tmp/*.js', '!tmp/unicorn.js']);
|
||||
paths = del.sync(['tmp/*.js', '!tmp/unicorn.js'], { force: true });
|
||||
|
||||
paths = del.sync(["tmp/*.js", "!tmp/unicorn.js"]);
|
||||
paths = del.sync(["tmp/*.js", "!tmp/unicorn.js"], {force: true});
|
||||
paths = del.sync('tmp/*.js');
|
||||
paths = del.sync('tmp/*.js', { force: true });
|
||||
paths = del.sync('tmp/*.js', { dryRun: true });
|
||||
paths = del.sync('tmp/*.js', { concurrency: 20 });
|
||||
paths = del.sync('tmp/*.js', { cwd: '' });
|
||||
|
||||
paths = del.sync("tmp/*.js");
|
||||
paths = del.sync("tmp/*.js", {force: true});
|
||||
paths = del.sync("tmp/*.js", {dryRun: true});
|
||||
paths = del.sync("tmp/*.js", {concurrency: 20});
|
||||
paths = del.sync("tmp/*.js", {cwd: ''});
|
||||
const immutable: ReadonlyArray<string> = ['tmp/*.js', '!tmp/unicorn.js'];
|
||||
const mutable = del(immutable);
|
||||
const mutablePaths = del.sync(immutable);
|
||||
mutable.then(paths => paths.push('test'));
|
||||
mutablePaths.push('test');
|
||||
|
||||
Vendored
+10
-3
@@ -3,14 +3,21 @@
|
||||
// Definitions by: Asana <https://asana.com>
|
||||
// Aya Morisawa <https://github.com/AyaMorisawa>
|
||||
// BendingBender <https://github.com/BendingBender>
|
||||
// Jason Dreyzehner <https://github.com/bitjson>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
import glob = require("glob");
|
||||
import glob = require('glob');
|
||||
|
||||
declare function del(patterns: string | string[], options?: del.Options): Promise<string[]>;
|
||||
declare function del(
|
||||
patterns: string | ReadonlyArray<string>,
|
||||
options?: del.Options
|
||||
): Promise<string[]>;
|
||||
|
||||
declare namespace del {
|
||||
function sync(patterns: string | string[], options?: Options): string[];
|
||||
function sync(
|
||||
patterns: string | ReadonlyArray<string>,
|
||||
options?: Options
|
||||
): string[];
|
||||
|
||||
interface Options extends glob.IOptions {
|
||||
force?: boolean;
|
||||
|
||||
Vendored
+20
-30
@@ -2,41 +2,31 @@
|
||||
// Project: https://github.com/kevva/download
|
||||
// Definitions by: Nico Jansen <https://github.com/nicojs>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
/// <reference types="node" />
|
||||
import { DecompressOptions } from 'decompress';
|
||||
import { GotBodyOptions, TimeoutOptions } from 'got';
|
||||
|
||||
interface TimeoutOptions {
|
||||
connect?: number;
|
||||
socket?: number;
|
||||
request?: number;
|
||||
}
|
||||
type RetryFunction = (retry: number, error: any) => number;
|
||||
declare namespace download {
|
||||
type RetryFunction = (retry: number, error: any) => number;
|
||||
|
||||
interface DownloadOptions {
|
||||
body?: string | Buffer | NodeJS.ReadableStream;
|
||||
encoding?: string | null;
|
||||
query?: string | object;
|
||||
timeout?: number | TimeoutOptions;
|
||||
retries?: number | RetryFunction;
|
||||
followRedirect?: boolean;
|
||||
decompress?: boolean;
|
||||
useElectronNet?: boolean;
|
||||
/**
|
||||
* If set to true, try extracting the file using decompress.
|
||||
*/
|
||||
extract?: boolean;
|
||||
/**
|
||||
* Name of the saved file.
|
||||
*/
|
||||
filename?: string;
|
||||
/**
|
||||
* Proxy endpoint
|
||||
*/
|
||||
proxy?: string;
|
||||
interface DownloadOptions extends DecompressOptions, GotBodyOptions<string> {
|
||||
/**
|
||||
* If set to true, try extracting the file using decompress.
|
||||
*/
|
||||
extract?: boolean;
|
||||
/**
|
||||
* Name of the saved file.
|
||||
*/
|
||||
filename?: string;
|
||||
/**
|
||||
* Proxy endpoint
|
||||
*/
|
||||
proxy?: string;
|
||||
}
|
||||
}
|
||||
|
||||
declare namespace download {}
|
||||
declare function download(url: string, destination?: string, options?: DownloadOptions): Promise<Buffer> & NodeJS.WritableStream & NodeJS.ReadableStream;
|
||||
declare function download(url: string, destination?: string, options?: download.DownloadOptions): Promise<Buffer> & NodeJS.WritableStream & NodeJS.ReadableStream;
|
||||
|
||||
export = download;
|
||||
|
||||
@@ -22,7 +22,8 @@ import {
|
||||
DraftEntityMutability,
|
||||
DraftEntityType,
|
||||
convertFromHTML,
|
||||
convertToRaw
|
||||
convertToRaw,
|
||||
CompositeDecorator,
|
||||
} from 'draft-js';
|
||||
|
||||
const SPLIT_HEADER_BLOCK = 'split-header-block';
|
||||
@@ -38,6 +39,14 @@ export const KEYCODES: Record<KeyName, KeyCode> = {
|
||||
|
||||
type SyntheticKeyboardEvent = React.KeyboardEvent<{}>;
|
||||
|
||||
const HANDLE_REGEX = /\@[\w]+/g;
|
||||
|
||||
class HandleSpan extends React.Component {
|
||||
render() {
|
||||
return <span>{this.props.children}</span>
|
||||
}
|
||||
}
|
||||
|
||||
class RichEditorExample extends React.Component<{}, { editorState: EditorState }> {
|
||||
constructor() {
|
||||
super({});
|
||||
@@ -51,8 +60,22 @@ class RichEditorExample extends React.Component<{}, { editorState: EditorState }
|
||||
blocksFromHTML.contentBlocks,
|
||||
blocksFromHTML.entityMap,
|
||||
);
|
||||
|
||||
this.state = { editorState: EditorState.createWithContent(state) };
|
||||
const decorator = new CompositeDecorator([{
|
||||
strategy: (
|
||||
block: ContentBlock,
|
||||
callback: (start: number, end: number) => void,
|
||||
contentState: ContentState
|
||||
) => {
|
||||
const text = block.getText();
|
||||
let matchArr, start;
|
||||
while ((matchArr = HANDLE_REGEX.exec(text)) !== null) {
|
||||
start = matchArr.index;
|
||||
callback(start, start + matchArr[0].length);
|
||||
}
|
||||
},
|
||||
component: HandleSpan,
|
||||
}]);
|
||||
this.state = { editorState: EditorState.createWithContent(state, decorator) };
|
||||
}
|
||||
|
||||
onChange: (editorState: EditorState) => void = (editorState: EditorState) => this.setState({ editorState });
|
||||
|
||||
Vendored
+6
-3
@@ -1,4 +1,4 @@
|
||||
// Type definitions for Draft.js v0.10.4
|
||||
// Type definitions for Draft.js v0.10.5
|
||||
// Project: https://facebook.github.io/draft-js/
|
||||
// Definitions by: Dmitry Rogozhny <https://github.com/dmitryrogozhny>
|
||||
// Eelco Lempsink <https://github.com/eelco>
|
||||
@@ -7,6 +7,7 @@
|
||||
// Michael Wu <https://github.com/michael-yx-wu>
|
||||
// Willis Plummer <https://github.com/willisplummer>
|
||||
// Santiago Vilar <https://github.com/smvilar>
|
||||
// Ulf Schwekendiek <https://github.com/sulf>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.6
|
||||
|
||||
@@ -398,7 +399,7 @@ declare namespace Draft {
|
||||
/**
|
||||
* Given a `ContentBlock`, return an immutable List of decorator keys.
|
||||
*/
|
||||
getDecorations(block: ContentBlock): Immutable.List<string>;
|
||||
getDecorations(block: ContentBlock, contentState: ContentState): Immutable.List<string>;
|
||||
|
||||
/**
|
||||
* Given a decorator key, return the component to use when rendering
|
||||
@@ -456,7 +457,7 @@ declare namespace Draft {
|
||||
class CompositeDraftDecorator {
|
||||
constructor(decorators: Array<DraftDecorator>);
|
||||
|
||||
getDecorations(block: ContentBlock): Immutable.List<string>;
|
||||
getDecorations(block: ContentBlock, contentState: ContentState): Immutable.List<string>;
|
||||
getComponentForKey(key: string): Function;
|
||||
getPropsForKey(key: string): Object;
|
||||
}
|
||||
@@ -957,6 +958,7 @@ import ContentBlock = Draft.Model.ImmutableData.ContentBlock;
|
||||
import ContentState = Draft.Model.ImmutableData.ContentState;
|
||||
import SelectionState = Draft.Model.ImmutableData.SelectionState;
|
||||
import DraftInlineStyle = Draft.Model.ImmutableData.DraftInlineStyle;
|
||||
import BlockMap = Draft.Model.ImmutableData.BlockMap;
|
||||
|
||||
import AtomicBlockUtils = Draft.Model.Modifier.AtomicBlockUtils;
|
||||
import KeyBindingUtil = Draft.Component.Utils.KeyBindingUtil;
|
||||
@@ -1005,6 +1007,7 @@ export {
|
||||
ContentState,
|
||||
SelectionState,
|
||||
DraftInlineStyle,
|
||||
BlockMap,
|
||||
|
||||
AtomicBlockUtils,
|
||||
KeyBindingUtil,
|
||||
|
||||
Vendored
+7
-7
@@ -1,5 +1,5 @@
|
||||
/*!
|
||||
* Dynamsoft WebTwain PDF Addon
|
||||
* Based on Dynamsoft WebTwain JavaScript Intellisense
|
||||
* Product: Dynamsoft Web Twain
|
||||
* Web Site: http://www.dynamsoft.com
|
||||
*
|
||||
@@ -25,7 +25,7 @@ interface PDF {
|
||||
* The function to call when the download succeeds. Please refer to the function prototype OnSuccess.
|
||||
* @param {function} optionalAsyncFailureFunc optional.
|
||||
* The function to call when the download fails. Please refer to the function prototype OnFailure.
|
||||
* @return {bool}
|
||||
* @return {boolean}
|
||||
*/
|
||||
Download(remoteFile: string,
|
||||
optionalAsyncSuccessFunc?: () => void,
|
||||
@@ -35,7 +35,7 @@ interface PDF {
|
||||
* Input the password to decrypt PDF files using PDF Rasterizer add-on.
|
||||
* @method Dynamsoft.WebTwain#SetPassword
|
||||
* @param {string} password Specifies the PDF password.
|
||||
* @return {bool}
|
||||
* @return {boolean}
|
||||
*/
|
||||
SetPassword(password: string): boolean;
|
||||
|
||||
@@ -43,7 +43,7 @@ interface PDF {
|
||||
* Set the image convert mode for PDF Rasterizer in Dynamic Web TWAIN.
|
||||
* @method Dynamsoft.WebTwain#SetConvertMode
|
||||
* @param {EnumDWT_ConverMode} convertMode Specifies the image convert mode.
|
||||
* @return {bool}
|
||||
* @return {boolean}
|
||||
*/
|
||||
SetConvertMode(convertMode: EnumDWT_ConverMode): boolean;
|
||||
|
||||
@@ -51,7 +51,7 @@ interface PDF {
|
||||
* Set the output resolution for the PDF Rasterizer in Dynamic Web TWAIN.
|
||||
* @method Dynamsoft.WebTwain#ReadRect
|
||||
* @param {float} fResolution Specifies the resolution for convert image from PDF file.
|
||||
* @return {bool}
|
||||
* @return {boolean}
|
||||
*/
|
||||
SetResolution(fResolution: number): boolean;
|
||||
|
||||
@@ -59,7 +59,7 @@ interface PDF {
|
||||
* Judges whether the local PDF is text-based or not.
|
||||
* @method Dynamsoft.WebTwain#ReadRect
|
||||
* @param {string} localFile specifies the local path of the target PDF.
|
||||
* @return {bool}
|
||||
* @return {boolean}
|
||||
*/
|
||||
IsTextBasedPDF(localFile: string): boolean;
|
||||
}
|
||||
@@ -69,5 +69,5 @@ interface WebTwainAddon {
|
||||
}
|
||||
|
||||
interface WebTwain {
|
||||
Addon: WebTwainAddon;
|
||||
Addon: WebTwainAddon;
|
||||
}
|
||||
|
||||
Vendored
+1947
-1731
File diff suppressed because it is too large
Load Diff
@@ -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
+2
-2
@@ -71,7 +71,7 @@ declare module 'ember-data' {
|
||||
inverse?: string | null;
|
||||
polymorphic?: boolean;
|
||||
}
|
||||
): Ember.ComputedProperty<ModelRegistry[K] & PromiseObject<ModelRegistry[K]>>;
|
||||
): Ember.ComputedProperty<ModelRegistry[K] & PromiseObject<ModelRegistry[K]>, ModelRegistry[K]>;
|
||||
/**
|
||||
* `DS.hasMany` is used to define One-To-Many and Many-To-Many
|
||||
* relationships on a [DS.Model](/api/data/classes/DS.Model.html).
|
||||
@@ -91,7 +91,7 @@ declare module 'ember-data' {
|
||||
inverse?: string | null;
|
||||
polymorphic?: boolean;
|
||||
}
|
||||
): Ember.ComputedProperty<PromiseManyArray<ModelRegistry[K]>>;
|
||||
): Ember.ComputedProperty<PromiseManyArray<ModelRegistry[K]>, Ember.Array<ModelRegistry[K]>>;
|
||||
/**
|
||||
* This method normalizes a modelName into the format Ember Data uses
|
||||
* internally.
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import DS from 'ember-data';
|
||||
import { assertType } from './lib/assert';
|
||||
|
||||
declare const store: DS.Store;
|
||||
|
||||
class Folder extends DS.Model {
|
||||
name = DS.attr('string');
|
||||
children = DS.hasMany('folder', { inverse: 'parent' });
|
||||
@@ -19,4 +21,9 @@ assertType<string>(folder.get('parent').get('name'));
|
||||
folder.get('parent').then(parent => {
|
||||
assertType<Folder>(parent);
|
||||
assertType<string>(parent.get('name'));
|
||||
folder.set('parent', parent);
|
||||
});
|
||||
|
||||
folder.set('parent', folder);
|
||||
folder.set('parent', folder.get('parent'));
|
||||
folder.set('parent', store.findRecord('folder', 3));
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import Ember from 'ember';
|
||||
import DS from 'ember-data';
|
||||
import { assertType } from './lib/assert';
|
||||
|
||||
@@ -44,6 +45,10 @@ blogPost.get('commentsAsync').then(comments => {
|
||||
assertType<string>(comments.get('firstObject')!.get('text'));
|
||||
});
|
||||
|
||||
blogPost.set('commentsAsync', blogPost.get('commentsAsync'));
|
||||
blogPost.set('commentsAsync', Ember.A());
|
||||
blogPost.set('commentsAsync', Ember.A([ comment! ]));
|
||||
|
||||
class PaymentMethod extends DS.Model {}
|
||||
declare module 'ember-data' {
|
||||
interface ModelRegistry {
|
||||
|
||||
Vendored
-13
@@ -62,17 +62,4 @@ declare module 'mocha' {
|
||||
// augment test callback context
|
||||
interface ITestCallbackContext extends TestContext {}
|
||||
interface IHookCallbackContext extends TestContext {}
|
||||
|
||||
// re-export mocha globals as named exports
|
||||
export const describe: Mocha.IContextDefinition;
|
||||
export const context: Mocha.IContextDefinition;
|
||||
export const it: Mocha.ITestDefinition;
|
||||
export const setup: mochaSetup;
|
||||
export const teardown: mochaTeardown;
|
||||
export const suiteSetup: mochaSuiteSetup;
|
||||
export const suiteTeardown: mochaSuiteTeardown;
|
||||
export const before: mochaBefore;
|
||||
export const after: mochaAfter;
|
||||
export const beforeEach: mochaBeforeEach;
|
||||
export const afterEach: mochaAfterEach;
|
||||
}
|
||||
|
||||
Vendored
+27
-20
@@ -28,7 +28,8 @@ declare module 'ember' {
|
||||
/**
|
||||
* Deconstructs computed properties into the types which would be returned by `.get()`.
|
||||
*/
|
||||
type ComputedProperties<T> = { [K in keyof T]: Ember.ComputedProperty<T[K]> | ModuleComputed<T[K]> | T[K] };
|
||||
type ComputedPropertyGetters<T> = { [K in keyof T]: Ember.ComputedProperty<T[K], any> | ModuleComputed<T[K], any> | T[K] };
|
||||
type ComputedPropertySetters<T> = { [K in keyof T]: Ember.ComputedProperty<any, T[K]> | ModuleComputed<any, T[K]> | T[K] };
|
||||
|
||||
/**
|
||||
* Check that any arguments to `create()` match the type's properties.
|
||||
@@ -683,7 +684,7 @@ declare module 'ember' {
|
||||
will be cached. You can specify various properties that your computed property is dependent on.
|
||||
This will force the cached result to be recomputed if the dependencies are modified.
|
||||
**/
|
||||
class ComputedProperty<T> {
|
||||
class ComputedProperty<Get, Set = Get> {
|
||||
/**
|
||||
* Call on a computed property to set it into non-cached mode. When in this
|
||||
* mode the computed property will not automatically cache the return value.
|
||||
@@ -812,7 +813,7 @@ declare module 'ember' {
|
||||
static create<Instance>(this: EmberClassConstructor<Instance>): Fix<Instance>;
|
||||
|
||||
static create<Instance, Args, T1 extends EmberInstanceArguments<Args>>(
|
||||
this: EmberClassConstructor<Instance & ComputedProperties<Args>>,
|
||||
this: EmberClassConstructor<Instance & ComputedPropertyGetters<Args>>,
|
||||
arg1: T1 & ThisType<Fix<T1 & Instance>>
|
||||
): Fix<Instance & T1>;
|
||||
|
||||
@@ -822,7 +823,7 @@ declare module 'ember' {
|
||||
T1 extends EmberInstanceArguments<Args>,
|
||||
T2 extends EmberInstanceArguments<Args>
|
||||
>(
|
||||
this: EmberClassConstructor<Instance & ComputedProperties<Args>>,
|
||||
this: EmberClassConstructor<Instance & ComputedPropertyGetters<Args>>,
|
||||
arg1: T1 & ThisType<Fix<Instance & T1>>,
|
||||
arg2: T2 & ThisType<Fix<Instance & T1 & T2>>
|
||||
): Fix<Instance & T1 & T2>;
|
||||
@@ -834,7 +835,7 @@ declare module 'ember' {
|
||||
T2 extends EmberInstanceArguments<Args>,
|
||||
T3 extends EmberInstanceArguments<Args>
|
||||
>(
|
||||
this: EmberClassConstructor<Instance & ComputedProperties<Args>>,
|
||||
this: EmberClassConstructor<Instance & ComputedPropertyGetters<Args>>,
|
||||
arg1: T1 & ThisType<Fix<Instance & T1>>,
|
||||
arg2: T2 & ThisType<Fix<Instance & T1 & T2>>,
|
||||
arg3: T3 & ThisType<Fix<Instance & T1 & T2 & T3>>
|
||||
@@ -1641,27 +1642,27 @@ declare module 'ember' {
|
||||
/**
|
||||
* Retrieves the value of a property from the object.
|
||||
*/
|
||||
get<T, K extends keyof T>(this: ComputedProperties<T>, key: K): T[K];
|
||||
get<T, K extends keyof T>(this: ComputedPropertyGetters<T>, key: K): T[K];
|
||||
/**
|
||||
* To get the values of multiple properties at once, call `getProperties`
|
||||
* with a list of strings or an array:
|
||||
*/
|
||||
getProperties<T, K extends keyof T>(this: ComputedProperties<T>, list: K[]): Pick<T, K>;
|
||||
getProperties<T, K extends keyof T>(this: ComputedPropertyGetters<T>, list: K[]): Pick<T, K>;
|
||||
getProperties<T, K extends keyof T>(
|
||||
this: ComputedProperties<T>,
|
||||
this: ComputedPropertyGetters<T>,
|
||||
...list: K[]
|
||||
): Pick<T, K>;
|
||||
/**
|
||||
* Sets the provided key or path to the value.
|
||||
*/
|
||||
set<T, K extends keyof T>(this: ComputedProperties<T>, key: K, value: T[K]): T[K];
|
||||
set<T, K extends keyof T>(this: ComputedPropertySetters<T>, key: K, value: T[K]): T[K];
|
||||
/**
|
||||
* Sets a list of properties at once. These properties are set inside
|
||||
* a single `beginPropertyChanges` and `endPropertyChanges` batch, so
|
||||
* observers will be buffered.
|
||||
*/
|
||||
setProperties<T, K extends keyof T>(
|
||||
this: ComputedProperties<T>,
|
||||
this: ComputedPropertySetters<T>,
|
||||
hash: Pick<T, K>
|
||||
): Pick<T, K>;
|
||||
/**
|
||||
@@ -1692,7 +1693,7 @@ declare module 'ember' {
|
||||
* property returns `undefined`.
|
||||
*/
|
||||
getWithDefault<T, K extends keyof T>(
|
||||
this: ComputedProperties<T>,
|
||||
this: ComputedPropertyGetters<T>,
|
||||
key: K,
|
||||
defaultValue: T[K]
|
||||
): T[K];
|
||||
@@ -1715,7 +1716,7 @@ declare module 'ember' {
|
||||
* without accidentally invoking it if it is intended to be
|
||||
* generated lazily.
|
||||
*/
|
||||
cacheFor<T, K extends keyof T>(this: ComputedProperties<T>, key: K): T[K] | undefined;
|
||||
cacheFor<T, K extends keyof T>(this: ComputedPropertyGetters<T>, key: K): T[K] | undefined;
|
||||
}
|
||||
const Observable: Mixin<Observable, Ember.CoreObject>;
|
||||
/**
|
||||
@@ -2989,7 +2990,7 @@ declare module 'ember' {
|
||||
* it to be created.
|
||||
*/
|
||||
function cacheFor<T, K extends keyof T>(
|
||||
obj: ComputedProperties<T>,
|
||||
obj: ComputedPropertyGetters<T>,
|
||||
key: K
|
||||
): T[K] | undefined;
|
||||
/**
|
||||
@@ -3028,12 +3029,12 @@ declare module 'ember' {
|
||||
* with an object followed by a list of strings or an array:
|
||||
*/
|
||||
function getProperties<T, K extends keyof T>(
|
||||
obj: ComputedProperties<T>,
|
||||
obj: ComputedPropertyGetters<T>,
|
||||
list: K[]
|
||||
): Pick<T, K>;
|
||||
function getProperties<T, K extends keyof T>(obj: T, list: K[]): Pick<T, K>; // for dynamic K
|
||||
function getProperties<T, K extends keyof T>(
|
||||
obj: ComputedProperties<T>,
|
||||
obj: ComputedPropertyGetters<T>,
|
||||
...list: K[]
|
||||
): Pick<T, K>;
|
||||
function getProperties<T, K extends keyof T>(obj: T, ...list: K[]): Pick<T, K>; // for dynamic K
|
||||
@@ -3120,14 +3121,14 @@ declare module 'ember' {
|
||||
* the function will be invoked. If the property is not defined but the
|
||||
* object implements the `unknownProperty` method then that will be invoked.
|
||||
*/
|
||||
function get<T, K extends keyof T>(obj: ComputedProperties<T>, key: K): T[K];
|
||||
function get<T, K extends keyof T>(obj: ComputedPropertyGetters<T>, key: K): T[K];
|
||||
function get<T, K extends keyof T>(obj: T, key: K): T[K]; // for dynamic K
|
||||
/**
|
||||
* Retrieves the value of a property from an Object, or a default value in the
|
||||
* case that the property returns `undefined`.
|
||||
*/
|
||||
function getWithDefault<T, K extends keyof T>(
|
||||
obj: ComputedProperties<T>,
|
||||
obj: ComputedPropertyGetters<T>,
|
||||
key: K,
|
||||
defaultValue: T[K]
|
||||
): T[K];
|
||||
@@ -3139,7 +3140,7 @@ declare module 'ember' {
|
||||
* method then that will be invoked as well.
|
||||
*/
|
||||
function set<T, K extends keyof T, V extends T[K]>(
|
||||
obj: ComputedProperties<T>,
|
||||
obj: ComputedPropertySetters<T>,
|
||||
key: K,
|
||||
value: V
|
||||
): V;
|
||||
@@ -3155,7 +3156,7 @@ declare module 'ember' {
|
||||
* observers will be buffered.
|
||||
*/
|
||||
function setProperties<T, K extends keyof T>(
|
||||
obj: ComputedProperties<T>,
|
||||
obj: ComputedPropertySetters<T>,
|
||||
hash: Pick<T, K>
|
||||
): Pick<T, K>;
|
||||
function setProperties<T, K extends keyof T>(obj: T, hash: Pick<T, K>): Pick<T, K>; // for dynamic K
|
||||
@@ -3499,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;
|
||||
@@ -3534,7 +3541,7 @@ declare module '@ember/object' {
|
||||
|
||||
declare module '@ember/object/computed' {
|
||||
import Ember from 'ember';
|
||||
export default class ComputedProperty<T> extends Ember.ComputedProperty<T> { }
|
||||
export default class ComputedProperty<Get, Set = Get> extends Ember.ComputedProperty<Get, Set> { }
|
||||
export const alias: typeof Ember.computed.alias;
|
||||
export const and: typeof Ember.computed.and;
|
||||
export const bool: typeof Ember.computed.bool;
|
||||
|
||||
@@ -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,4 @@
|
||||
import * as assert from "assert";
|
||||
import * as etherUtil from "ethereumjs-util";
|
||||
|
||||
assert.ok(etherUtil.isValidAddress("0x0bfe6d9a4d4a73857db6fac276669ba45ee69b48"));
|
||||
Vendored
+83
@@ -0,0 +1,83 @@
|
||||
// Type definitions for ethereumjs-util 5.1
|
||||
// Project: https://github.com/ethereumjs/ethereumjs-util#readme
|
||||
// Definitions by: Juan J. Jimenez-Anca <https://github.com/cortopy>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
// TODO: import types for [`BN`](https://github.com/indutny/bn.js)
|
||||
// TODO: MAX_INTEGER as type of BN
|
||||
// TODO: import types for [`rlp`](https://github.com/ethereumjs/rlp)
|
||||
// TODO: import types for [`secp256k1`](https://github.com/cryptocoinjs/secp256k1-node/)
|
||||
|
||||
export const SHA3_NULL_S: string;
|
||||
|
||||
export const SHA3_RLP_ARRAY_S: string;
|
||||
|
||||
export const SHA3_RLP_S: string;
|
||||
|
||||
export function addHexPrefix(str: string): string;
|
||||
|
||||
export function arrayContainsArray(superset: any, subset: any, some: any): any;
|
||||
|
||||
export function baToJSON(ba: Buffer | string[]): Buffer | string[];
|
||||
|
||||
export function bufferToHex(buf: Buffer): string;
|
||||
|
||||
export function bufferToInt(buf: Buffer): string;
|
||||
|
||||
export function defineProperties(self: {[k: string]: any}, fields: string[], data: {[k: string]: any}): {[k: string]: any};
|
||||
|
||||
export function ecrecover(msgHash: Buffer, v: number, r: Buffer, s: Buffer): Buffer;
|
||||
|
||||
export function ecsign(msgHash: Buffer, privateKey: Buffer): {[k: string]: any};
|
||||
|
||||
export function fromRpcSig(sig: string): {[k: string]: any};
|
||||
|
||||
export function fromSigned(num: Buffer): any;
|
||||
|
||||
export function generateAddress(from: Buffer, nonce: Buffer): Buffer;
|
||||
|
||||
export function hashPersonalMessage(message: string): Buffer;
|
||||
|
||||
export function importPublic(publicKey: Buffer): Buffer;
|
||||
|
||||
export function isValidAddress(address: string): boolean;
|
||||
|
||||
export function isValidChecksumAddress(address: Buffer): boolean;
|
||||
|
||||
export function isValidPrivate(privateKey: Buffer): boolean;
|
||||
|
||||
export function isValidPublic(publicKey: Buffer, sanitize?: boolean): any;
|
||||
|
||||
export function isValidSignature(v: Buffer, r: Buffer, s: Buffer, homestead?: boolean): boolean;
|
||||
|
||||
export function privateToAddress(privateKey: Buffer): Buffer;
|
||||
|
||||
export function privateToPublic(privateKey: Buffer): Buffer;
|
||||
|
||||
export function pubToAddress(pubKey: Buffer, sanitize: boolean): Buffer;
|
||||
|
||||
export function ripemd160(a: Buffer | any[] | string | number, padded: boolean): Buffer;
|
||||
|
||||
export function rlphash(a: Buffer | any[] | string | number): Buffer;
|
||||
|
||||
export function setLengthLeft(msg: Buffer | any[], length: number, right?: boolean): Buffer | any[];
|
||||
|
||||
export function setLengthRight(msg: Buffer | any[], length: number): Buffer | any[];
|
||||
|
||||
export function sha256(a: Buffer | any[] | string | number): Buffer;
|
||||
|
||||
export function sha3(a: Buffer | any[] | string | number, bits?: number): Buffer;
|
||||
|
||||
export function toBuffer(v: any): Buffer;
|
||||
|
||||
export function toChecksumAddress(address: string): string;
|
||||
|
||||
export function toRpcSig(v: number, r: Buffer, s: Buffer): string;
|
||||
|
||||
export function toUnsigned(num: any): Buffer;
|
||||
|
||||
export function unpad<T extends Buffer | any[] | string>(a: T): T;
|
||||
|
||||
export function zeros(bytes: number): Buffer;
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": false,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"ethereumjs-util-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json"
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
import * as ExecutionEnvironment from 'exenv';
|
||||
|
||||
JSON.stringify(ExecutionEnvironment.canUseDOM);
|
||||
JSON.stringify(ExecutionEnvironment.canUseEventListeners);
|
||||
JSON.stringify(ExecutionEnvironment.canUseViewport);
|
||||
JSON.stringify(ExecutionEnvironment.canUseWorkers);
|
||||
Vendored
+10
@@ -0,0 +1,10 @@
|
||||
// Type definitions for exenv 1.2
|
||||
// Project: https://github.com/JedWatson/exenv
|
||||
// Definitions by: Christian Chown <https://github.com/christianchown>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.6
|
||||
|
||||
export const canUseDOM: boolean;
|
||||
export const canUseEventListeners: boolean;
|
||||
export const canUseViewport: boolean;
|
||||
export const canUseWorkers: boolean;
|
||||
@@ -2,7 +2,7 @@
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es5"
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
@@ -18,7 +18,6 @@
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"colors-tests.ts",
|
||||
"safe.d.ts"
|
||||
"exenv-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
@@ -1,8 +1,11 @@
|
||||
/// <reference types="mocha"" />
|
||||
|
||||
import { Expectation, Extension, Spy, createSpy, isSpy, assert, spyOn, extend, restoreSpies } from 'expect';
|
||||
import * as expect from 'expect';
|
||||
|
||||
// Stub mocha functions
|
||||
const {describe, it, before, after, beforeEach, afterEach} = null as any as {
|
||||
[s: string]: ((s: string, cb: (done: any) => void) => void) & ((cb: (done: any) => void) => void) & {only: any, skip: any};
|
||||
};
|
||||
|
||||
describe('chaining assertions', () => {
|
||||
it('should allow chaining for array-like applications', () => {
|
||||
expect([ 1, 2, 'foo', 3 ])
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
/// <reference types="mocha" />
|
||||
|
||||
// transplant from https://github.com/spmason/expectations/blob/695c25bd35bb1751533a8082a5aa378e3e1b381f/test/expect.tests.js
|
||||
|
||||
var root = this;
|
||||
|
||||
// Stub mocha functions
|
||||
const {describe, it, before, after, beforeEach, afterEach} = null as any as {
|
||||
[s: string]: ((s: string, cb: (done: any) => void) => void) & ((cb: (done: any) => void) => void) & {only: any, skip: any};
|
||||
};
|
||||
|
||||
describe('expect', ()=> {
|
||||
describe('toEqual', ()=> {
|
||||
it('can expect true to be true', ()=> {
|
||||
|
||||
@@ -1,31 +1,45 @@
|
||||
import express = require('express');
|
||||
import 'express-session';
|
||||
import graphqlHTTP = require('express-graphql');
|
||||
import { GraphQLSchema } from 'graphql/type/schema';
|
||||
|
||||
const app = express();
|
||||
const schema = {};
|
||||
const schema: GraphQLSchema = {
|
||||
getQueryType: null,
|
||||
getMutationType: null,
|
||||
getSubscriptionType: null,
|
||||
getTypeMap: null,
|
||||
getType: null,
|
||||
getPossibleTypes: null,
|
||||
isPossibleType: null,
|
||||
getDirective: null,
|
||||
getDirectives: null,
|
||||
};
|
||||
|
||||
const graphqlOption: graphqlHTTP.OptionsObj = {
|
||||
const graphqlOption: graphqlHTTP.OptionsData = {
|
||||
graphiql: true,
|
||||
schema: schema,
|
||||
schema,
|
||||
formatError: (error: Error) => ({
|
||||
message: error.message
|
||||
}),
|
||||
extensions: (args) => { }
|
||||
validationRules: [() => false, () => true],
|
||||
extensions: ({ document, variables, operationName, result }) => ({ key: "value", key2: "value"}),
|
||||
};
|
||||
|
||||
const graphqlOptionRequest = (request: express.Request, response: express.Response): graphqlHTTP.OptionsObj => ({
|
||||
const graphqlOptionRequest = (request: express.Request): graphqlHTTP.OptionsData => ({
|
||||
graphiql: true,
|
||||
schema: schema,
|
||||
context: request.session
|
||||
schema,
|
||||
context: request.session,
|
||||
validationRules: [() => false, () => true],
|
||||
});
|
||||
|
||||
const graphqlOptionRequestAsync = async (request: express.Request, response: express.Response): Promise<graphqlHTTP.OptionsObj> => {
|
||||
const graphqlOptionRequestAsync = async (request: express.Request): Promise<graphqlHTTP.OptionsData> => {
|
||||
return {
|
||||
graphiql: true,
|
||||
schema: await Promise.resolve(schema),
|
||||
context: request.session,
|
||||
extensions: async (args) => { }
|
||||
extensions: async (args) => { },
|
||||
validationRules: [() => false, () => true],
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
Vendored
+63
-23
@@ -1,14 +1,15 @@
|
||||
// Type definitions for express-graphql
|
||||
// Project: https://www.npmjs.org/package/express-graphql
|
||||
// Type definitions for express-graphql 0.6
|
||||
// Project: https://github.com/graphql/express-graphql
|
||||
// Definitions by: Isman Usoh <https://github.com/isman-usoh>
|
||||
// Nitin Tutlani <https://github.com/nitintutlani>
|
||||
// Daniel Fader <https://github.com/hubel>
|
||||
// Ehsan Ziya <https://github.com/zya>
|
||||
// Margus Lamp <https://github.com/mlamp>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
import { Request, Response } from "express";
|
||||
|
||||
import { DocumentNode, GraphQLSchema, GraphQLError } from 'graphql';
|
||||
export = graphqlHTTP;
|
||||
|
||||
declare namespace graphqlHTTP {
|
||||
@@ -16,60 +17,99 @@ declare namespace graphqlHTTP {
|
||||
* Used to configure the graphQLHTTP middleware by providing a schema
|
||||
* and other configuration options.
|
||||
*/
|
||||
export type Options = ((req: Request, res: Response) => OptionsObj) | ((req: Request, res: Response) => Promise<OptionsObj>) | OptionsObj
|
||||
export type OptionsObj = {
|
||||
export type Options = ((request: Request,
|
||||
response: Response,
|
||||
params?: GraphQLParams) => OptionsResult) | OptionsResult;
|
||||
export type OptionsResult = OptionsData | Promise<OptionsData>;
|
||||
export interface OptionsData {
|
||||
/**
|
||||
* A GraphQL schema from graphql-js.
|
||||
*/
|
||||
schema: Object,
|
||||
schema: GraphQLSchema;
|
||||
|
||||
/**
|
||||
* A value to pass as the context to the graphql() function.
|
||||
*/
|
||||
context?: Object,
|
||||
context?: any;
|
||||
|
||||
/**
|
||||
* An object to pass as the rootValue to the graphql() function.
|
||||
*/
|
||||
rootValue?: Object,
|
||||
rootValue?: any;
|
||||
|
||||
/**
|
||||
* A boolean to configure whether the output should be pretty-printed.
|
||||
*/
|
||||
pretty?: boolean,
|
||||
pretty?: boolean;
|
||||
|
||||
/**
|
||||
* An optional function which will be used to format any errors produced by
|
||||
* fulfilling a GraphQL operation. If no function is provided, GraphQL's
|
||||
* default spec-compliant `formatError` function will be used.
|
||||
*/
|
||||
formatError?: Function,
|
||||
formatError?: (error: GraphQLError) => any;
|
||||
|
||||
/**
|
||||
* An optional array of validation rules that will be applied on the document
|
||||
* in additional to those defined by the GraphQL spec.
|
||||
*/
|
||||
validationRules?: any[];
|
||||
|
||||
/**
|
||||
* An optional function for adding additional metadata to the GraphQL response
|
||||
* as a key-value object. The result will be added to "extensions" field in
|
||||
* the resulting JSON. This is often a useful place to add development time
|
||||
* info such as the runtime of a query or the amount of resources consumed.
|
||||
*
|
||||
* Information about the request is provided to be used.
|
||||
*
|
||||
* This function may be async.
|
||||
*/
|
||||
extensions?: (info: RequestInfo) => { [key: string]: any };
|
||||
|
||||
/**
|
||||
* A boolean to optionally enable GraphiQL mode.
|
||||
*/
|
||||
graphiql?: boolean,
|
||||
graphiql?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* All information about a GraphQL request.
|
||||
*/
|
||||
export interface RequestInfo {
|
||||
/**
|
||||
* The parsed GraphQL document.
|
||||
*/
|
||||
document?: DocumentNode;
|
||||
|
||||
/**
|
||||
* An optional function for adding additional metadata to the GraphQL response as a key-value object.
|
||||
* The result will be added to "extensions" field in the resulting JSON.
|
||||
* The variable values used at runtime.
|
||||
*/
|
||||
extensions?: ((args: ExtenstionsArgs) => any) | ((args: ExtenstionsArgs) => Promise<any>);
|
||||
variables?: { [name: string]: any };
|
||||
|
||||
};
|
||||
/**
|
||||
* The (optional) operation name requested.
|
||||
*/
|
||||
operationName?: string;
|
||||
|
||||
interface ExtenstionsArgs {
|
||||
document: object,
|
||||
variables: object,
|
||||
operationName: any,
|
||||
result: object
|
||||
/**
|
||||
* The result of executing the operation.
|
||||
*/
|
||||
result?: any;
|
||||
}
|
||||
|
||||
export interface GraphQLParams {
|
||||
query?: string;
|
||||
variables?: { [name: string]: any };
|
||||
operationName?: string;
|
||||
raw?: boolean;
|
||||
}
|
||||
|
||||
type Middleware = (request: Request, response: Response) => void;
|
||||
}
|
||||
|
||||
/**
|
||||
* Middleware for express; takes an options object or function as input to
|
||||
* configure behavior, and returns an express middleware.
|
||||
*/
|
||||
* Middleware for express; takes an options object or function as input to
|
||||
* configure behavior, and returns an express middleware.
|
||||
*/
|
||||
declare function graphqlHTTP(options: graphqlHTTP.Options): graphqlHTTP.Middleware;
|
||||
|
||||
@@ -1,79 +1,6 @@
|
||||
{
|
||||
"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
|
||||
"strict-export-declare-modifiers": false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,6 +13,25 @@ app.use(jwt({
|
||||
userProperty: 'auth'
|
||||
}));
|
||||
|
||||
app.use(jwt({
|
||||
secret: (req: express.Request,
|
||||
payload: any,
|
||||
done: (err: any, secret: string) => void) => {
|
||||
done(null, 'shhhhhhared-secret');
|
||||
},
|
||||
userProperty: 'auth'
|
||||
}));
|
||||
|
||||
app.use(jwt({
|
||||
secret: (req: express.Request,
|
||||
header: any,
|
||||
payload: any,
|
||||
done: (err: any, secret: string) => void) => {
|
||||
done(null, 'shhhhhhared-secret');
|
||||
},
|
||||
userProperty: 'auth'
|
||||
}));
|
||||
|
||||
var jwtCheck = jwt({
|
||||
secret: 'shhhhhhared-secret'
|
||||
});
|
||||
@@ -28,4 +47,4 @@ app.use(function (err: any, req: express.Request, res: express.Response, next: e
|
||||
} else {
|
||||
next(err);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Vendored
+4
-2
@@ -12,8 +12,10 @@ export = jwt;
|
||||
declare function jwt(options: jwt.Options): jwt.RequestHandler;
|
||||
declare namespace jwt {
|
||||
export type secretType = string | Buffer
|
||||
export interface SecretCallbackLong {
|
||||
(req: express.Request, header: any, payload: any, done: (err: any, secret?: secretType) => void): void;
|
||||
}
|
||||
export interface SecretCallback {
|
||||
(req: express.Request, header: any, payload: any, done: (err: any, secret?: boolean) => void): void;
|
||||
(req: express.Request, payload: any, done: (err: any, secret?: secretType) => void): void;
|
||||
}
|
||||
|
||||
@@ -25,7 +27,7 @@ declare namespace jwt {
|
||||
(req: express.Request): any;
|
||||
}
|
||||
export interface Options {
|
||||
secret: secretType | SecretCallback;
|
||||
secret: secretType | SecretCallback | SecretCallbackLong;
|
||||
userProperty?: string;
|
||||
skip?: string[];
|
||||
credentialsRequired?: boolean;
|
||||
|
||||
@@ -14,10 +14,15 @@
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"paths": {
|
||||
"uglify-js": [
|
||||
"uglify-js/v2"
|
||||
]
|
||||
}
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"express-minify-tests.ts"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
class FBInstantTest {
|
||||
winStreak: number;
|
||||
|
||||
init() {
|
||||
FBInstant.initializeAsync().then(() => {
|
||||
FBInstant.setLoadingProgress(100);
|
||||
FBInstant.startGameAsync().then(() => {
|
||||
this.startGame();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
startGame() {
|
||||
const contextId = FBInstant.context.getID();
|
||||
const contextType = FBInstant.context.getType();
|
||||
|
||||
const playerName = FBInstant.player.getName();
|
||||
const playerPic = FBInstant.player.getPhoto();
|
||||
const playerId = FBInstant.player.getID();
|
||||
}
|
||||
|
||||
saveState() {
|
||||
FBInstant.player.setDataAsync({
|
||||
score: this.winStreak
|
||||
});
|
||||
}
|
||||
|
||||
getState() {
|
||||
FBInstant.player.getDataAsync(['score'])
|
||||
.then((data) => {
|
||||
if (typeof data['score'] !== 'undefined') {
|
||||
this.winStreak = +data['score'];
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
update() {
|
||||
FBInstant.updateAsync({
|
||||
action: 'CUSTOM',
|
||||
cta: 'Play',
|
||||
image: '',
|
||||
text: {
|
||||
default: 'Edgar played their move',
|
||||
localizations: {
|
||||
en_US: 'Edgar played their move',
|
||||
es_LA: '\u00A1Edgar jug\u00F3 su jugada!'
|
||||
}
|
||||
},
|
||||
template: 'play_turn',
|
||||
data: { myReplayData: '...' },
|
||||
strategy: 'IMMEDIATE',
|
||||
notification: 'NO_PUSH'
|
||||
}).then(() => {
|
||||
// closes the game after the update is posted.
|
||||
FBInstant.quit();
|
||||
});
|
||||
}
|
||||
}
|
||||
+221
@@ -0,0 +1,221 @@
|
||||
// Type definitions for facebook-instant-games 6.1
|
||||
// Project: https://developers.facebook.com/docs/games/instant-games
|
||||
// Definitions by: Menushka Weeratunga <https://github.com/menushka>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare namespace FBInstant {
|
||||
let player: Player;
|
||||
let context: Context;
|
||||
let payments: Payments;
|
||||
|
||||
function getLocale(): string;
|
||||
function getPlatform(): string;
|
||||
function getSDKVersion(): string;
|
||||
function initializeAsync(): Promise<any>;
|
||||
function setLoadingProgress(progress: number): void;
|
||||
function getSupportedAPIs(): string[];
|
||||
function getEntryPointData(): any;
|
||||
function getEntryPointAsync(): Promise<string>;
|
||||
function setSessionData(sessionData: any): void;
|
||||
function startGameAsync(): Promise<any>;
|
||||
function shareAsync(payload: SharePayload): Promise<void>;
|
||||
function updateAsync(payload: UpdatePayload | LeaderboardUpdatePayload): Promise<void>;
|
||||
function switchGameAsync(appID: string, data?: string): Promise<void>;
|
||||
function canCreateShortcutAsync(): Promise<boolean>;
|
||||
function createShortcutAsync(): Promise<void>;
|
||||
function quit(): void;
|
||||
function logEvent(eventName: string, valueToSum?: number, parameter?: any): APIError;
|
||||
function onPause(func: () => void): void;
|
||||
function getInterstitialAdAsync(placementID: string): Promise<AdInstance>;
|
||||
function getRewardedVideoAsync(placementID: string): Promise<AdInstance>;
|
||||
function matchPlayerAsync(matchTag?: string, switchContextWhenMatched?: boolean): Promise<void>;
|
||||
function checkCanPlayerMatchAsync(): Promise<boolean>;
|
||||
function getLeaderboardAsync(name: string): Promise<Leaderboard>;
|
||||
|
||||
interface Player {
|
||||
getID(): string;
|
||||
getSignedPlayerInfoAsync(requestPayload: string): Promise<SignedPlayerInfo>;
|
||||
canSubscribeBotAsync(): Promise<boolean>;
|
||||
subscribeBotAsync(): Promise<void>;
|
||||
getName(): string;
|
||||
getPhoto(): string;
|
||||
getDataAsync(keys?: string[]): Promise<DataObject>;
|
||||
setDataAsync(data: DataObject): Promise<void>;
|
||||
flushDataAsync(): Promise<void>;
|
||||
getStatsAsync(keys?: string[]): Promise<StatsObject>;
|
||||
setStatsAsync(stats: StatsObject): Promise<void>;
|
||||
incrementStatsAsync(increments: IncrementObject): Promise<StatsObject>;
|
||||
getConnectedPlayersAsync(): Promise<ConnectedPlayer[]>;
|
||||
}
|
||||
|
||||
interface Context {
|
||||
getID(): string;
|
||||
getType(): Type;
|
||||
isSizeBetween(minSize: number, maxSize: number): ContextSizeResponse;
|
||||
switchAsync(id: string): Promise<void>;
|
||||
chooseAsync(options: ContextOptions): Promise<void>;
|
||||
createAsync(playerID: string): Promise<void>;
|
||||
getPlayersAsync(): Promise<ContextPlayer[]>;
|
||||
}
|
||||
|
||||
interface Leaderboard {
|
||||
getName(): string;
|
||||
getContextID(): string;
|
||||
getEntryCountAsync(): Promise<number>;
|
||||
setScoreAsync(score: number, extraData: string): Promise<LeaderboardEntry>;
|
||||
getPlayerEntryAsync(): Promise<LeaderboardEntry>;
|
||||
getEntriesAsync(count: number, offset: number): Promise<LeaderboardEntry[]>;
|
||||
}
|
||||
|
||||
interface LeaderboardEntry {
|
||||
getScore(): number;
|
||||
getFormattedScore(): string;
|
||||
getTimestamp(): number;
|
||||
getRank(): number;
|
||||
getExtraData(): string;
|
||||
getPlayer(): LeaderboardPlayer;
|
||||
}
|
||||
|
||||
interface LeaderboardPlayer {
|
||||
getName(): string;
|
||||
getPhoto(): string;
|
||||
getID(): string;
|
||||
}
|
||||
|
||||
interface ConnectedPlayer {
|
||||
getID(): string;
|
||||
getName(): string;
|
||||
getPhoto(): string;
|
||||
}
|
||||
|
||||
interface SignedPlayerInfo {
|
||||
getPlayerID(): string;
|
||||
getSignature(): string;
|
||||
}
|
||||
|
||||
interface ContextPlayer {
|
||||
getID(): string;
|
||||
getName(): string;
|
||||
getPhoto(): string;
|
||||
}
|
||||
|
||||
interface AdInstance {
|
||||
getPlacementID(): string;
|
||||
loadAsync(): Promise<void>;
|
||||
showAsync(): Promise<void>;
|
||||
}
|
||||
|
||||
interface Payments {
|
||||
purchaseAsync(purchaseConfig: PurchaseConfig): Promise<Purchase>;
|
||||
getPurchasesAsync(): Promise<Purchase[]>;
|
||||
consumePurchaseAsync(purchaseToken: string): Promise<void>;
|
||||
onReady(callback: () => void): void;
|
||||
}
|
||||
|
||||
interface Product {
|
||||
title: string;
|
||||
productID: string;
|
||||
description?: string;
|
||||
imageURI?: string;
|
||||
price: string;
|
||||
priceCurrencyCode: string;
|
||||
}
|
||||
|
||||
interface ContextSizeResponse {
|
||||
answer: boolean;
|
||||
minSize?: number;
|
||||
maxSize?: number;
|
||||
}
|
||||
|
||||
interface Purchase {
|
||||
developerPayload?: string;
|
||||
paymentID: string;
|
||||
productID: string;
|
||||
purchaseTime: string;
|
||||
purchaseToken: string;
|
||||
signedRequest: SignedPurchaseRequest;
|
||||
}
|
||||
|
||||
interface ContextOptions {
|
||||
filters?: ContextFilter[];
|
||||
maxSize?: number;
|
||||
minSize?: number;
|
||||
}
|
||||
|
||||
interface SharePayload {
|
||||
intent?: Intent;
|
||||
image?: string;
|
||||
text?: string;
|
||||
data?: any;
|
||||
}
|
||||
|
||||
interface APIError {
|
||||
code: ErrorCodeType;
|
||||
message: string;
|
||||
}
|
||||
|
||||
interface PurchaseConfig {
|
||||
productID: string;
|
||||
developerPayload?: string;
|
||||
}
|
||||
|
||||
interface UpdatePayload {
|
||||
action?: UpdateAction;
|
||||
template?: string;
|
||||
cta?: (string | LocalizableContent);
|
||||
image?: string;
|
||||
text?: (string | LocalizableContent);
|
||||
data?: any;
|
||||
strategy?: string;
|
||||
notification?: string;
|
||||
}
|
||||
|
||||
interface LeaderboardUpdatePayload {
|
||||
action: UpdateAction;
|
||||
name: string;
|
||||
text?: string;
|
||||
}
|
||||
|
||||
interface LocalizableContent {
|
||||
default: string;
|
||||
localizations: LocalizationsDict;
|
||||
}
|
||||
|
||||
interface DataObject { [ key: string ]: string | number; }
|
||||
|
||||
interface StatsObject { [ key: string ]: number; }
|
||||
|
||||
interface IncrementObject { [ key: string ]: number; }
|
||||
|
||||
type LocalizationsDict = any;
|
||||
|
||||
type SignedPurchaseRequest = string;
|
||||
|
||||
type ContextFilter = "NEW_CONTEXT_ONLY" | "INCLUDE_EXISTING_CHALLENGES" | "NEW_PLAYERS_ONLY";
|
||||
|
||||
type UpdateAction = "CUSTOM" | "LEADERBOARD";
|
||||
|
||||
type Platform = "IOS" | "ANDROID" | "WEB" | "MOBILE_WEB";
|
||||
|
||||
type Type = "POST" | "THREAD" | "GROUP" | "SOLO";
|
||||
|
||||
type Intent = "INVITE" | "REQUEST" | "CHALLENGE" | "SHARE";
|
||||
|
||||
type ErrorCodeType = "ADS_FREQUENT_LOAD" |
|
||||
"ADS_NO_FILL" |
|
||||
"ADS_NOT_LOADED" |
|
||||
"ADS_TOO_MANY_INSTANCES" |
|
||||
"ANALYTICS_POST_EXCEPTION" |
|
||||
"CLIENT_REQUIRES_UPDATE" |
|
||||
"CLIENT_UNSUPPORTED_OPERATION" |
|
||||
"INVALID_OPERATION" |
|
||||
"INVALID_PARAM" |
|
||||
"LEADERBOARD_NOT_FOUND" |
|
||||
"LEADERBOARD_WRONG_CONTEXT" |
|
||||
"NETWORK_FAILURE" |
|
||||
"PENDING_REQUEST" |
|
||||
"RATE_LIMITED" |
|
||||
"SAME_CONTEXT" |
|
||||
"UNKNOWN" |
|
||||
"USER_INPUT";
|
||||
}
|
||||
@@ -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",
|
||||
"facebook-instant-games-tests.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;
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
///<reference types="node" />
|
||||
///<reference types="mocha" />
|
||||
|
||||
'use strict';
|
||||
|
||||
@@ -11,6 +10,11 @@ import { EventEmitter, EventSubscription } from 'fbemitter';
|
||||
import * as util from 'util';
|
||||
import * as assert from 'assert';
|
||||
|
||||
// Stub mocha functions
|
||||
const {describe, it, before, after, beforeEach, afterEach} = null as any as {
|
||||
[s: string]: ((s: string, cb: (done: any) => void) => void) & ((cb: (done: any) => void) => void) & {only: any, skip: any};
|
||||
};
|
||||
|
||||
describe('EventEmitter', function tests() {
|
||||
'use strict';
|
||||
|
||||
|
||||
+3
-1
@@ -3,8 +3,10 @@
|
||||
// Definitions by: Abraao Alves <https://github.com/AbraaoAlves>, Jan Lohage <https://github.com/j2L4e>
|
||||
// Definitions: https://github.com/feathersjs-ecosystem/feathers-typescript
|
||||
// TypeScript Version: 2.3
|
||||
import * as self from '@feathersjs/authentication-client';
|
||||
|
||||
export default function feathersAuthClient(config?: FeathersAuthClientConfig): () => void;
|
||||
declare const feathersAuthClient: ((config?: FeathersAuthClientConfig) => () => void) & typeof self;
|
||||
export default feathersAuthClient;
|
||||
|
||||
export interface FeathersAuthClientConfig {
|
||||
storage?: Storage;
|
||||
|
||||
+3
-1
@@ -6,8 +6,10 @@
|
||||
|
||||
import { Application } from '@feathersjs/feathers';
|
||||
import { Request } from 'express';
|
||||
import * as self from '@feathersjs/authentication-jwt';
|
||||
|
||||
export default function feathersAuthenticationJwt(options?: FeathersAuthenticationJWTOptions): () => void;
|
||||
declare const feathersAuthenticationJwt: ((options?: FeathersAuthenticationJWTOptions) => () => void) & typeof self;
|
||||
export default feathersAuthenticationJwt;
|
||||
|
||||
export interface FeathersAuthenticationJWTOptions {
|
||||
/**
|
||||
|
||||
+3
-1
@@ -10,8 +10,10 @@ import {
|
||||
Paginated
|
||||
} from '@feathersjs/feathers';
|
||||
import { Request } from 'express';
|
||||
import * as self from '@feathersjs/authentication-local';
|
||||
|
||||
export default function feathersAuthenticationLocal(options?: FeathersAuthenticationLocalOptions): () => void;
|
||||
declare const feathersAuthenticationLocal: ((options?: FeathersAuthenticationLocalOptions) => () => void) & typeof self;
|
||||
export default feathersAuthenticationLocal;
|
||||
|
||||
export interface FeathersAuthenticationLocalOptions {
|
||||
/**
|
||||
|
||||
+3
-1
@@ -9,8 +9,10 @@ import {
|
||||
Paginated
|
||||
} from '@feathersjs/feathers';
|
||||
import { Request } from 'express';
|
||||
import * as self from '@feathersjs/authentication-oauth1';
|
||||
|
||||
export default function feathersAuthenticationOAuth1(options?: FeathersAuthenticationOAuth1Options): () => void;
|
||||
declare const feathersAuthenticationOAuth1: ((options?: FeathersAuthenticationOAuth1Options) => () => void) & typeof self;
|
||||
export default feathersAuthenticationOAuth1;
|
||||
|
||||
export interface FeathersAuthenticationOAuth1Options {
|
||||
/**
|
||||
|
||||
+3
-1
@@ -9,8 +9,10 @@ import {
|
||||
Paginated
|
||||
} from '@feathersjs/feathers';
|
||||
import { Request } from 'express';
|
||||
import * as self from '@feathersjs/authentication-oauth2';
|
||||
|
||||
export default function feathersAuthenticationOAuth2(options?: FeathersAuthenticationOAuth2Options): () => void;
|
||||
declare const feathersAuthenticationOAuth2: ((options?: FeathersAuthenticationOAuth2Options) => () => void) & typeof self;
|
||||
export default feathersAuthenticationOAuth2;
|
||||
|
||||
export interface FeathersAuthenticationOAuth2Options {
|
||||
/**
|
||||
|
||||
+3
-1
@@ -4,8 +4,10 @@
|
||||
// Definitions: https://github.com/feathersjs-ecosystem/feathers-typescript
|
||||
|
||||
import { Hook } from '@feathersjs/feathers';
|
||||
import * as self from '@feathersjs/authentication';
|
||||
|
||||
export default function feathersAuthentication(config?: FeathersAuthenticationOptions): () => void;
|
||||
declare const feathersAuthentication: ((config?: FeathersAuthenticationOptions) => () => void) & typeof self;
|
||||
export default feathersAuthentication;
|
||||
|
||||
export const hooks: AuthHooks.Hooks;
|
||||
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
import feathers, { Application } from '@feathersjs/feathers';
|
||||
import feathersExpress, { original, rest, notFound, errorHandler } from '@feathersjs/express';
|
||||
import feathersExpress, * as express from '@feathersjs/express';
|
||||
|
||||
const app = feathersExpress(feathers());
|
||||
|
||||
app.configure(rest());
|
||||
app.use(notFound());
|
||||
app.use(errorHandler());
|
||||
app.use(express.json());
|
||||
app.use(express.urlencoded({ extended: true }));
|
||||
app.use('/', express.static('./public'));
|
||||
app.configure(express.rest());
|
||||
app.use(express.notFound());
|
||||
app.use(express.errorHandler({ logger: console }));
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user