mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-13 21:40:21 +00:00
Merge branch 'master'
This commit is contained in:
Vendored
+1
@@ -9,6 +9,7 @@
|
||||
|
||||
import * as angular from 'angular';
|
||||
|
||||
export type gettextCatalog = angular.gettext.gettextCatalog;
|
||||
|
||||
declare module 'angular' {
|
||||
export namespace gettext {
|
||||
|
||||
+4
@@ -8,6 +8,10 @@
|
||||
|
||||
import * as angular from 'angular';
|
||||
|
||||
export type ILocalStorageServiceProvider = angular.local.storage.ILocalStorageServiceProvider;
|
||||
export type ILocalStorageService = angular.local.storage.ILocalStorageService;
|
||||
export type ICookie = angular.local.storage.ICookie;
|
||||
|
||||
declare module 'angular' {
|
||||
export namespace local.storage {
|
||||
interface ILocalStorageServiceProvider extends angular.IServiceProvider {
|
||||
|
||||
Vendored
+3
-3
@@ -1,4 +1,4 @@
|
||||
// Type definitions for Angular Translate (pascalprecht.translate module) 2.15
|
||||
// Type definitions for Angular Translate (pascalprecht.translate module) 2.16
|
||||
// Project: https://github.com/PascalPrecht/angular-translate
|
||||
// Definitions by: Michel Salib <https://github.com/michelsalib>, Gabriel Gil <https://github.com/GabrielGil>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
@@ -47,8 +47,8 @@ declare module 'angular' {
|
||||
}
|
||||
|
||||
interface ITranslateService {
|
||||
(translationId: string, interpolateParams?: any, interpolationId?: string, defaultTranslationText?: string, forceLanguage?: string): angular.IPromise<string>;
|
||||
(translationId: string[], interpolateParams?: any, interpolationId?: string, defaultTranslationText?: string, forceLanguage?: string): angular.IPromise<{ [key: string]: string }>;
|
||||
(translationId: string, interpolateParams?: any, interpolationId?: string, defaultTranslationText?: string, forceLanguage?: string, sanitizeStrategy?: string): angular.IPromise<string>;
|
||||
(translationId: string[], interpolateParams?: any, interpolationId?: string, defaultTranslationText?: string, forceLanguage?: string, sanitizeStrategy?: string): angular.IPromise<{ [key: string]: string }>;
|
||||
cloakClassName(): string;
|
||||
cloakClassName(name: string): ITranslateProvider;
|
||||
fallbackLanguage(langKey?: string): string;
|
||||
|
||||
Vendored
+71
@@ -4,6 +4,7 @@
|
||||
// Georgii Dolzhykov <https://github.com/thorn0>
|
||||
// Caleb St-Denis <https://github.com/calebstdenis>
|
||||
// Leonard Thieu <https://github.com/leonard-thieu>
|
||||
// Steffen Kowalski <https://github.com/scipper>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
@@ -484,6 +485,76 @@ declare namespace angular {
|
||||
$broadcast(name: string, ...args: any[]): IAngularEvent;
|
||||
$destroy(): void;
|
||||
$digest(): void;
|
||||
|
||||
/**
|
||||
* Suspend watchers of this scope subtree so that they will not be invoked during digest.
|
||||
*
|
||||
* This can be used to optimize your application when you know that running those watchers
|
||||
* is redundant.
|
||||
*
|
||||
* **Warning**
|
||||
*
|
||||
* Suspending scopes from the digest cycle can have unwanted and difficult to debug results.
|
||||
* Only use this approach if you are confident that you know what you are doing and have
|
||||
* ample tests to ensure that bindings get updated as you expect.
|
||||
*
|
||||
* Some of the things to consider are:
|
||||
*
|
||||
* * Any external event on a directive/component will not trigger a digest while the hosting
|
||||
* scope is suspended - even if the event handler calls `$apply()` or `$rootScope.$digest()`.
|
||||
* * Transcluded content exists on a scope that inherits from outside a directive but exists
|
||||
* as a child of the directive's containing scope. If the containing scope is suspended the
|
||||
* transcluded scope will also be suspended, even if the scope from which the transcluded
|
||||
* scope inherits is not suspended.
|
||||
* * Multiple directives trying to manage the suspended status of a scope can confuse each other:
|
||||
* * A call to `$suspend()` on an already suspended scope is a no-op.
|
||||
* * A call to `$resume()` on a non-suspended scope is a no-op.
|
||||
* * If two directives suspend a scope, then one of them resumes the scope, the scope will no
|
||||
* longer be suspended. This could result in the other directive believing a scope to be
|
||||
* suspended when it is not.
|
||||
* * If a parent scope is suspended then all its descendants will be also excluded from future
|
||||
* digests whether or not they have been suspended themselves. Note that this also applies to
|
||||
* isolate child scopes.
|
||||
* * Calling `$digest()` directly on a descendant of a suspended scope will still run the watchers
|
||||
* for that scope and its descendants. When digesting we only check whether the current scope is
|
||||
* locally suspended, rather than checking whether it has a suspended ancestor.
|
||||
* * Calling `$resume()` on a scope that has a suspended ancestor will not cause the scope to be
|
||||
* included in future digests until all its ancestors have been resumed.
|
||||
* * Resolved promises, e.g. from explicit `$q` deferreds and `$http` calls, trigger `$apply()`
|
||||
* against the `$rootScope` and so will still trigger a global digest even if the promise was
|
||||
* initiated by a component that lives on a suspended scope.
|
||||
*/
|
||||
$suspend(): void;
|
||||
|
||||
/**
|
||||
* Call this method to determine if this scope has been explicitly suspended. It will not
|
||||
* tell you whether an ancestor has been suspended.
|
||||
* To determine if this scope will be excluded from a digest triggered at the $rootScope,
|
||||
* for example, you must check all its ancestors:
|
||||
*
|
||||
* ```
|
||||
* function isExcludedFromDigest(scope) {
|
||||
* while(scope) {
|
||||
* if (scope.$isSuspended()) return true;
|
||||
* scope = scope.$parent;
|
||||
* }
|
||||
* return false;
|
||||
* ```
|
||||
*
|
||||
* Be aware that a scope may not be included in digests if it has a suspended ancestor,
|
||||
* even if `$isSuspended()` returns false.
|
||||
*
|
||||
* @returns true if the current scope has been suspended.
|
||||
*/
|
||||
$isSuspended(): boolean;
|
||||
|
||||
/**
|
||||
* Resume watchers of this scope subtree in case it was suspended.
|
||||
*
|
||||
* See {$rootScope.Scope#$suspend} for information about the dangers of using this approach.
|
||||
*/
|
||||
$resume(): void;
|
||||
|
||||
/**
|
||||
* Dispatches an event name upwards through the scope hierarchy notifying the registered $rootScope.Scope listeners.
|
||||
*
|
||||
|
||||
@@ -39,7 +39,10 @@ const showOptions : Auth0LockShowOptions = {
|
||||
type: "error",
|
||||
text: "an error has occurred"
|
||||
},
|
||||
rememberLastLogin: false
|
||||
rememberLastLogin: false,
|
||||
languageDictionary: {
|
||||
title: "test"
|
||||
}
|
||||
};
|
||||
|
||||
lock.show(showOptions);
|
||||
|
||||
Vendored
+1
@@ -161,6 +161,7 @@ interface Auth0LockShowOptions {
|
||||
initialScreen?: "login" | "signUp" | "forgotPassword";
|
||||
flashMessage?: Auth0LockFlashMessageOptions;
|
||||
rememberLastLogin?: boolean;
|
||||
languageDictionary?: any;
|
||||
}
|
||||
|
||||
interface AuthResult {
|
||||
|
||||
Vendored
+2
-1
@@ -350,6 +350,7 @@ export interface Identity {
|
||||
user_id: string;
|
||||
provider: string;
|
||||
isSocial: boolean;
|
||||
access_token?: string;
|
||||
profileData?: {
|
||||
email?: string;
|
||||
email_verified?: boolean;
|
||||
@@ -882,4 +883,4 @@ export class UsersManager {
|
||||
|
||||
impersonate(userId: string, settings: ImpersonateSettingOptions): Promise<any>;
|
||||
impersonate(userId: string, settings: ImpersonateSettingOptions, cb: (err: Error, data: any) => void): void;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import browserSync = require("browser-sync");
|
||||
import { EventEmitter } from "events";
|
||||
|
||||
(() => {
|
||||
//make sure that the interfaces are correctly exposed
|
||||
@@ -391,6 +392,57 @@ bs.init({
|
||||
|
||||
bs.reload();
|
||||
|
||||
browserSync.use(
|
||||
{
|
||||
plugin: function(opts: object, bs: browserSync.BrowserSyncInstance) {
|
||||
console.log(opts);
|
||||
},
|
||||
"plugin:name": "test"
|
||||
},
|
||||
{ files: "*.css" }
|
||||
);
|
||||
|
||||
browserSync.use({
|
||||
plugin: function(opts: object, bs: browserSync.BrowserSyncInstance) {
|
||||
console.log(bs.name);
|
||||
}
|
||||
});
|
||||
|
||||
browserSync(
|
||||
{
|
||||
server: {
|
||||
baseDir: "test/fixtures"
|
||||
},
|
||||
logLevel: "silent",
|
||||
open: false
|
||||
}
|
||||
);
|
||||
|
||||
var instanceName = "TestInstance";
|
||||
var namedInstance = browserSync.create(instanceName);
|
||||
namedInstance.init({
|
||||
server: { index: "./app" },
|
||||
https: true
|
||||
});
|
||||
|
||||
console.log(namedInstance.getOption("https")); // Should output true.
|
||||
|
||||
var existingInstance = browserSync.get(instanceName);
|
||||
|
||||
browserSync.create("InstanceWithEventEmitter", new EventEmitter());
|
||||
|
||||
// Should output something greater than 0.
|
||||
console.log(browserSync.instances.length);
|
||||
|
||||
browserSync.reset();
|
||||
|
||||
// Should output 0.
|
||||
console.log(browserSync.instances.length);
|
||||
|
||||
var cleanupTestInstance = browserSync.create("CleanupTest");
|
||||
cleanupTestInstance.cleanup();
|
||||
console.log(cleanupTestInstance.active); // Should output false.
|
||||
|
||||
function browserSyncInit(): browserSync.BrowserSyncInstance {
|
||||
var browser = browserSync.create();
|
||||
browser.init();
|
||||
|
||||
Vendored
+44
-15
@@ -456,11 +456,15 @@ declare namespace browserSync {
|
||||
* depending on your use-case.
|
||||
*/
|
||||
(config?: Options, callback?: (err: Error, bs: object) => any): BrowserSyncInstance;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
instances: Array<BrowserSyncInstance>;
|
||||
/**
|
||||
* Create a Browsersync instance
|
||||
* @param name an identifier that can used for retrieval later
|
||||
*/
|
||||
create(name?: string): BrowserSyncInstance;
|
||||
create(name?: string, emitter?: NodeJS.EventEmitter): BrowserSyncInstance;
|
||||
/**
|
||||
* Get a single instance by name. This is useful if you have your build scripts in separate files
|
||||
* @param name the identifier used for retrieval
|
||||
@@ -471,6 +475,11 @@ declare namespace browserSync {
|
||||
* @param name the name of the instance
|
||||
*/
|
||||
has(name: string): boolean;
|
||||
/**
|
||||
* Reset the state of the module.
|
||||
* (should only be needed for test environments)
|
||||
*/
|
||||
reset(): void;
|
||||
}
|
||||
|
||||
interface BrowserSyncInstance {
|
||||
@@ -481,6 +490,24 @@ declare namespace browserSync {
|
||||
* depending on your use-case.
|
||||
*/
|
||||
init(config?: Options, callback?: (err: Error, bs: object) => any): BrowserSyncInstance;
|
||||
/**
|
||||
* This method will close any running server, stop file watching & exit the current process.
|
||||
*/
|
||||
exit(): void;
|
||||
/**
|
||||
* Helper method for browser notifications
|
||||
* @param message Can be a simple message such as 'Connected' or HTML
|
||||
* @param timeout How long the message will remain in the browser. @since 1.3.0
|
||||
*/
|
||||
notify(message: string, timeout?: number): void;
|
||||
/**
|
||||
* Method to pause file change events
|
||||
*/
|
||||
pause(): void;
|
||||
/**
|
||||
* Method to resume paused watchers
|
||||
*/
|
||||
resume(): void;
|
||||
/**
|
||||
* Reload the browser
|
||||
* The reload method will inform all browsers about changed files and will either cause the browser
|
||||
@@ -510,28 +537,30 @@ declare namespace browserSync {
|
||||
*/
|
||||
stream(opts?: StreamOptions): NodeJS.ReadWriteStream;
|
||||
/**
|
||||
* Helper method for browser notifications
|
||||
* @param message Can be a simple message such as 'Connected' or HTML
|
||||
* @param timeout How long the message will remain in the browser. @since 1.3.0
|
||||
* Instance Cleanup.
|
||||
*/
|
||||
notify(message: string, timeout?: number): void;
|
||||
cleanup(fn?: (error: NodeJS.ErrnoException, bs: BrowserSyncInstance) => void): void;
|
||||
/**
|
||||
* This method will close any running server, stop file watching & exit the current process.
|
||||
* Register a plugin.
|
||||
* Must implement at least a 'plugin' property that returns
|
||||
* callable function.
|
||||
*
|
||||
* @method use
|
||||
* @param {object} module The object to be `required`.
|
||||
* @param {object} options The
|
||||
* @param {any} cb A callback function that will return any errors.
|
||||
*/
|
||||
exit(): void;
|
||||
use(module: { "plugin:name"?: string, plugin: (opts: object, bs: BrowserSyncInstance) => any }, options?: object, cb?: any): void;
|
||||
/**
|
||||
* Callback helper to examine what options have been set.
|
||||
* @param {string} name The key to search options map for.
|
||||
*/
|
||||
getOption(name: string): any;
|
||||
/**
|
||||
* Stand alone file-watcher. Use this along with Browsersync to create your own, minimal build system
|
||||
*/
|
||||
watch(patterns: string, opts?: chokidar.WatchOptions, fn?: (event: string, file: fs.Stats) => any)
|
||||
: NodeJS.EventEmitter;
|
||||
/**
|
||||
* Method to pause file change events
|
||||
*/
|
||||
pause(): void;
|
||||
/**
|
||||
* Method to resume paused watchers
|
||||
*/
|
||||
resume(): void;
|
||||
/**
|
||||
* The internal Event Emitter used by the running Browsersync instance (if there is one). You can use
|
||||
* this to emit your own events, such as changed files, logging etc.
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
import BufferReader from 'buffer-reader';
|
||||
|
||||
const buffer = new Buffer(1000);
|
||||
const reader = new BufferReader(buffer);
|
||||
reader.append(new Buffer(1));
|
||||
reader.tell();
|
||||
reader.seek(1);
|
||||
reader.move(2);
|
||||
reader.restAll();
|
||||
reader.nextBuffer(2);
|
||||
reader.nextString(5);
|
||||
reader.nextString(5, 'utf8');
|
||||
reader.nextStringZero();
|
||||
reader.nextStringZero('utf8');
|
||||
reader.nextInt8();
|
||||
reader.nextUInt8();
|
||||
reader.nextInt16LE();
|
||||
reader.nextUInt16LE();
|
||||
reader.nextInt16BE();
|
||||
reader.nextUInt16BE();
|
||||
reader.nextInt32LE();
|
||||
reader.nextUInt32LE();
|
||||
reader.nextInt32BE();
|
||||
reader.nextUInt32BE();
|
||||
reader.nextFloatLE();
|
||||
reader.nextFloatBE();
|
||||
reader.nextDouble32LE();
|
||||
reader.nextDouble32BE();
|
||||
Vendored
+111
@@ -0,0 +1,111 @@
|
||||
// Type definitions for buffer-reader 0.1
|
||||
// Project: https://github.com/villadora/node-buffer-reader
|
||||
// Definitions by: nrlquaker <https://github.com/nrlquaker>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.7
|
||||
|
||||
/// <reference types="node"/>
|
||||
|
||||
export = BufferReader;
|
||||
|
||||
declare class BufferReader {
|
||||
/**
|
||||
* Create a new reader, if no buffer provided, a empty buffer will be used.
|
||||
*/
|
||||
constructor(buffer?: Buffer)
|
||||
/**
|
||||
* Append new buffer to the end of current reader.
|
||||
* @param buffer buffer to append
|
||||
*/
|
||||
append(buffer: Buffer): void;
|
||||
/**
|
||||
* Return current position of the reader.
|
||||
*/
|
||||
tell(): number;
|
||||
/**
|
||||
* Set new position of the reader, if the pos is invalid, an exception will be raised.
|
||||
* @param position new position
|
||||
*/
|
||||
seek(position: number): void;
|
||||
/**
|
||||
* Move the position of reader by offset, offset can be negative; it can be used to skip some bytes.
|
||||
* @param offset offset to move by
|
||||
*/
|
||||
move(offset: number): void;
|
||||
/**
|
||||
* Get all the remaining bytes as a Buffer.
|
||||
*/
|
||||
restAll(): Buffer;
|
||||
/**
|
||||
* Read a buffer with specified length.
|
||||
* @param length specified length
|
||||
*/
|
||||
nextBuffer(length: number): Buffer;
|
||||
/**
|
||||
* Read next length of bytes as String, encoding default is 'utf8'.
|
||||
* @param length length of the string to read
|
||||
* @param encoding encoding of the string
|
||||
*/
|
||||
nextString(length: number, encoding?: string): string;
|
||||
/**
|
||||
* Read next bytes till the end of buffer as null-terminated string, encoding default is 'utf8'.
|
||||
* @param encoding encoding of the string
|
||||
*/
|
||||
nextStringZero(encoding?: string): string;
|
||||
/**
|
||||
* Read next bytes as Int8, the value is just as the same format Buffer in nodejs doc.
|
||||
*/
|
||||
nextInt8(): number;
|
||||
/**
|
||||
* Read next bytes as UInt8, the value is just as the same format Buffer in nodejs doc.
|
||||
*/
|
||||
nextUInt8(): number;
|
||||
/**
|
||||
* Read next bytes as Int16LE, the value is just as the same format Buffer in nodejs doc.
|
||||
*/
|
||||
nextInt16LE(): number;
|
||||
/**
|
||||
* Read next bytes as UInt16LE, the value is just as the same format Buffer in nodejs doc.
|
||||
*/
|
||||
nextUInt16LE(): number;
|
||||
/**
|
||||
* Read next bytes as Int16BE, the value is just as the same format Buffer in nodejs doc.
|
||||
*/
|
||||
nextInt16BE(): number;
|
||||
/**
|
||||
* Read next bytes as UInt16BE, the value is just as the same format Buffer in nodejs doc.
|
||||
*/
|
||||
nextUInt16BE(): number;
|
||||
/**
|
||||
* Read next bytes as Int32LE, the value is just as the same format Buffer in nodejs doc.
|
||||
*/
|
||||
nextInt32LE(): number;
|
||||
/**
|
||||
* Read next bytes as UInt32LE, the value is just as the same format Buffer in nodejs doc.
|
||||
*/
|
||||
nextUInt32LE(): number;
|
||||
/**
|
||||
* Read next bytes as Int32BE, the value is just as the same format Buffer in nodejs doc.
|
||||
*/
|
||||
nextInt32BE(): number;
|
||||
/**
|
||||
* Read next bytes as UInt32BE, the value is just as the same format Buffer in nodejs doc.
|
||||
*/
|
||||
nextUInt32BE(): number;
|
||||
/**
|
||||
* Read next bytes as FloatLE, the value is just as the same format Buffer in nodejs doc.
|
||||
*/
|
||||
nextFloatLE(): number;
|
||||
/**
|
||||
* Read next bytes as FloatBE, the value is just as the same format Buffer in nodejs doc.
|
||||
*/
|
||||
nextFloatBE(): number;
|
||||
/**
|
||||
* Read next bytes as Double32LE, the value is just as the same format Buffer in nodejs doc.
|
||||
*/
|
||||
nextDouble32LE(): number;
|
||||
/**
|
||||
* Read next bytes as Double32BE, the value is just as the same format Buffer in nodejs doc.
|
||||
*/
|
||||
nextDouble32BE(): number;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"esModuleInterop": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"buffer-reader-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
@@ -1361,6 +1361,39 @@ suite('assert', () => {
|
||||
assert.notDeepEqual(circularObject, secondCircularObject);
|
||||
});
|
||||
|
||||
test('deepStrictEqual', () => {
|
||||
assert.deepStrictEqual({tea: 'chai'}, {tea: 'chai'});
|
||||
assert.throws(() => assert.deepStrictEqual({tea: 'chai'}, {tea: 'black'}));
|
||||
|
||||
const obja = Object.create({tea: 'chai'});
|
||||
const objb = Object.create({tea: 'chai'});
|
||||
|
||||
assert.deepStrictEqual(obja, objb);
|
||||
|
||||
const obj1 = Object.create({tea: 'chai'});
|
||||
const obj2 = Object.create({tea: 'black'});
|
||||
|
||||
assert.throws(() => assert.deepStrictEqual(obj1, obj2));
|
||||
});
|
||||
|
||||
test('deepStrictEqual (ordering)', () => {
|
||||
const a = {a: 'b', c: 'd'};
|
||||
const b = {c: 'd', a: 'b'};
|
||||
assert.deepStrictEqual(a, b);
|
||||
});
|
||||
|
||||
test('deepStrictEqual (circular)', () => {
|
||||
const circularObject: any = {};
|
||||
const secondCircularObject: any = {};
|
||||
circularObject.field = circularObject;
|
||||
secondCircularObject.field = secondCircularObject;
|
||||
|
||||
assert.deepStrictEqual(circularObject, secondCircularObject);
|
||||
|
||||
secondCircularObject.field2 = secondCircularObject;
|
||||
assert.deepStrictEqual(circularObject, secondCircularObject);
|
||||
});
|
||||
|
||||
test('isNull', () => {
|
||||
assert.isNull(null);
|
||||
assert.isNull(undefined);
|
||||
|
||||
Vendored
+12
-2
@@ -353,7 +353,7 @@ declare namespace Chai {
|
||||
notStrictEqual<T>(actual: T, expected: T, message?: string): void;
|
||||
|
||||
/**
|
||||
* Asserts that actual is deeply equal to expected.
|
||||
* Asserts that actual is deeply equal (==) to expected.
|
||||
*
|
||||
* @type T Type of the objects.
|
||||
* @param actual Actual value.
|
||||
@@ -363,7 +363,7 @@ declare namespace Chai {
|
||||
deepEqual<T>(actual: T, expected: T, message?: string): void;
|
||||
|
||||
/**
|
||||
* Asserts that actual is not deeply equal to expected.
|
||||
* Asserts that actual is not deeply equal (==) to expected.
|
||||
*
|
||||
* @type T Type of the objects.
|
||||
* @param actual Actual value.
|
||||
@@ -372,6 +372,16 @@ declare namespace Chai {
|
||||
*/
|
||||
notDeepEqual<T>(actual: T, expected: T, message?: string): void;
|
||||
|
||||
/**
|
||||
* Asserts that actual is deeply strict equal (===) to expected.
|
||||
*
|
||||
* @type T Type of the objects.
|
||||
* @param actual Actual value.
|
||||
* @param expected Potential expected value.
|
||||
* @param message Message to display on error.
|
||||
*/
|
||||
deepStrictEqual<T>(actual: T, expected: T, message?: string): void;
|
||||
|
||||
/**
|
||||
* Asserts valueToCheck is strictly greater than (>) valueToBeAbove.
|
||||
*
|
||||
|
||||
Vendored
+1
@@ -506,6 +506,7 @@ declare namespace Chart {
|
||||
}
|
||||
|
||||
interface CommonAxe {
|
||||
bounds?: string;
|
||||
type?: ScaleType | string;
|
||||
display?: boolean;
|
||||
id?: string;
|
||||
|
||||
@@ -367,9 +367,15 @@ declare namespace cast.framework.events {
|
||||
total?: number,
|
||||
whenSkippable?: number,
|
||||
endedReason?: EndedReason,
|
||||
breakClipId?: string
|
||||
breakClipId?: string,
|
||||
breakId?: string
|
||||
);
|
||||
|
||||
/**
|
||||
* The break's id. Refer to Break.id
|
||||
*/
|
||||
breakId?: string;
|
||||
|
||||
/**
|
||||
* The break clip's id. Refer to BreakClip.id
|
||||
*/
|
||||
|
||||
@@ -8,7 +8,8 @@ import {
|
||||
} from "chromecast-caf-receiver/cast.framework.system";
|
||||
import {
|
||||
RequestEvent,
|
||||
Event
|
||||
Event,
|
||||
BreaksEvent
|
||||
} from "chromecast-caf-receiver/cast.framework.events";
|
||||
import {
|
||||
QueueBase,
|
||||
@@ -29,12 +30,16 @@ import {
|
||||
MediaMetadata
|
||||
} from "chromecast-caf-receiver/cast.framework.messages";
|
||||
|
||||
const breaksEvent = new BreaksEvent('BREAK_STARTED');
|
||||
breaksEvent.breakId = 'some-break-id';
|
||||
breaksEvent.breakClipId = 'some-break-clip-id';
|
||||
|
||||
const track = new Track(1, "TEXT");
|
||||
const breakClip = new BreakClip("id");
|
||||
const adBreak = new Break("id", ["id"], 1);
|
||||
const rEvent = new RequestEvent("BITRATE_CHANGED", { requestId: 2 });
|
||||
const pManager = new PlayerManager();
|
||||
pManager.addEventListener("STALLED", () => {});
|
||||
pManager.addEventListener("STALLED", () => { });
|
||||
const ttManager = new TextTracksManager();
|
||||
const qManager = new QueueManager();
|
||||
const qBase = new QueueBase();
|
||||
@@ -47,10 +52,10 @@ const breakManager: BreakManager = {
|
||||
getBreakClips: () => [breakClip],
|
||||
getBreaks: () => [adBreak],
|
||||
getPlayWatchedBreak: () => true,
|
||||
setBreakClipLoadInterceptor: () => {},
|
||||
setBreakSeekInterceptor: () => {},
|
||||
setPlayWatchedBreak: () => {},
|
||||
setVastTrackingInterceptor: () => {}
|
||||
setBreakClipLoadInterceptor: () => { },
|
||||
setBreakSeekInterceptor: () => { },
|
||||
setPlayWatchedBreak: () => { },
|
||||
setVastTrackingInterceptor: () => { }
|
||||
};
|
||||
|
||||
const lrd: LoadRequestData = {
|
||||
@@ -103,4 +108,4 @@ const pData: PlayerData = {
|
||||
whenSkippable: 321
|
||||
};
|
||||
const binder = new PlayerDataBinder(pData);
|
||||
binder.addEventListener("ANY_CHANGE", e => {});
|
||||
binder.addEventListener("ANY_CHANGE", e => { });
|
||||
|
||||
@@ -1,6 +1,26 @@
|
||||
'use strict';
|
||||
import cytoscape = require('cytoscape');
|
||||
|
||||
// TODO: document all aliases as aliases, not as duplicates!
|
||||
|
||||
const assert = (tag: boolean) => { if (!tag) throw new Error(); };
|
||||
const aliases = (...obj: Array<{}>) => { if (obj.slice(1).some((alias) => alias !== obj[0])) throw new Error(); };
|
||||
const events = (obj: any) => {
|
||||
aliases(obj.on, obj.bind, obj.listen, obj.addListener);
|
||||
aliases(obj.promiseOn, obj.pon);
|
||||
aliases(obj.off, obj.unbind, obj.unlisten, obj.removeListener);
|
||||
aliases(obj.emit, obj.trigger);
|
||||
};
|
||||
|
||||
// definitions
|
||||
function oneOf<A, B, C, D, E>(a: A, b: B, c: C, d: D, e: E): A | B | C | D | E;
|
||||
function oneOf<A, B, C, D>(a: A, b: B, c: C, d: D): A | B | C | D;
|
||||
function oneOf<A, B, C>(a: A, b: B, c: C): A | B | C;
|
||||
function oneOf<A, B>(a: A, b: B): A | B;
|
||||
function oneOf<T>(...array: T[]): T {
|
||||
return array[0];
|
||||
}
|
||||
|
||||
import cytoscape = require('cytoscape');
|
||||
const parentCSS = {
|
||||
'padding-top': '10px',
|
||||
'padding-left': '10px',
|
||||
@@ -69,6 +89,34 @@ const cy = cytoscape({
|
||||
]
|
||||
},
|
||||
|
||||
// initial viewport state:
|
||||
zoom: 1,
|
||||
pan: { x: 0, y: 0 },
|
||||
|
||||
// interaction options:
|
||||
minZoom: 1e-50,
|
||||
maxZoom: 1e50,
|
||||
zoomingEnabled: true,
|
||||
userZoomingEnabled: true,
|
||||
panningEnabled: true,
|
||||
userPanningEnabled: true,
|
||||
selectionType: 'single',
|
||||
touchTapThreshold: 8,
|
||||
desktopTapThreshold: 4,
|
||||
autolock: false,
|
||||
autoungrabify: false,
|
||||
|
||||
// rendering options:
|
||||
headless: false,
|
||||
styleEnabled: true,
|
||||
hideEdgesOnViewport: false,
|
||||
hideLabelsOnViewport: false,
|
||||
textureOnViewport: false,
|
||||
motionBlur: false,
|
||||
motionBlurOpacity: 0.2,
|
||||
wheelSensitivity: 1,
|
||||
pixelRatio: 'auto',
|
||||
|
||||
layout: {
|
||||
name: 'preset',
|
||||
padding: 5
|
||||
@@ -80,6 +128,42 @@ cy.on('zoom', (event) => {
|
||||
cy.nodes('$node > node').style('opacity', 0);
|
||||
}
|
||||
});
|
||||
cy.off('zoom');
|
||||
events(cy);
|
||||
|
||||
cy.add({ data: { id: 'g' }, position: {x: 200, y: 150} });
|
||||
cy.add([
|
||||
{ data: { id: 'h' }, position: {x: 250, y: 100} }
|
||||
]);
|
||||
const nodesBeforeDelete = cy.nodes();
|
||||
const edgesBeforeDelete = cy.edges();
|
||||
|
||||
const removed = cy.remove('#g #h');
|
||||
cy.add(removed);
|
||||
const diffNodes = nodesBeforeDelete.diff(cy.nodes());
|
||||
const diffEdges = edgesBeforeDelete.diff(cy.edges());
|
||||
assert(diffNodes.left.size() === 0 && diffNodes.right.size() === 0 && diffNodes.both.size() === cy.nodes().size());
|
||||
assert(nodesBeforeDelete.same(cy.nodes()));
|
||||
assert(edgesBeforeDelete.same(cy.edges()));
|
||||
|
||||
const gh = cy.collection().add(cy.$id('g')).union(cy.getElementById('h'));
|
||||
const gh2 = cy.$('#g #h');
|
||||
const gh3 = cy.nodes('#g #h');
|
||||
assert(gh2.same(gh));
|
||||
assert(gh3.same(gh));
|
||||
assert(gh.same(removed));
|
||||
|
||||
assert(cy.container() === null); // headless mode!
|
||||
|
||||
cy.center();
|
||||
cy.center(gh);
|
||||
aliases(cy.center, cy.centre);
|
||||
|
||||
cy.fit(cy.$('#a #b #h'));
|
||||
|
||||
const {x1, y1, x2, y2, w, h} = cy.extent();
|
||||
|
||||
aliases(cy.resize, cy.invalidateDimensions);
|
||||
|
||||
cy.animate({
|
||||
fit: {
|
||||
@@ -89,8 +173,323 @@ cy.animate({
|
||||
duration: 500
|
||||
});
|
||||
|
||||
const node = cy.nodes()[0];
|
||||
cy.animate({
|
||||
center: {eles: node},
|
||||
center: {eles: cy.nodes()[0]},
|
||||
duration: 500
|
||||
});
|
||||
|
||||
const anim = cy.animation({
|
||||
zoom: {
|
||||
level: 1,
|
||||
position: {x: 0, y: 0}
|
||||
},
|
||||
pan: {x: 100, y: 100},
|
||||
duration: 100,
|
||||
easing: 'ease'
|
||||
});
|
||||
cy.stop(true, true);
|
||||
anim.play();
|
||||
assert(anim.playing());
|
||||
anim.progress(anim.progress() + 50);
|
||||
anim.time(anim.time() - 50);
|
||||
anim.stop();
|
||||
|
||||
aliases(cy.layout, cy.createLayout, cy.makeLayout);
|
||||
|
||||
// Preconfigured data for layouts (as it could be passed)
|
||||
const boundingBox = oneOf({x1: 0, x2: 100, y1: 0, y2: 100}, {x1: 0, w: 100, y1: 0, h: 100});
|
||||
const positions = oneOf({a: {x: 100, y: 100}}, (node: cytoscape.NodeCollection): cytoscape.Position => ({x: 100, y: 100}));
|
||||
|
||||
// TODO: uncomment after we have the way to add layout options properties from extensions
|
||||
// const layouts = [
|
||||
// cy.layout({
|
||||
// name: 'null',
|
||||
// ready: () => {},
|
||||
// stop: () => {}
|
||||
// }),
|
||||
// cy.layout({
|
||||
// name: 'random',
|
||||
// fit: true,
|
||||
// padding: 30,
|
||||
// boundingBox,
|
||||
// animate: false,
|
||||
// animationDuration: 500,
|
||||
// animationEasing: 'ease-in',
|
||||
// animateFilter: (node, i) => true,
|
||||
// transform: (node, position) => position
|
||||
// }),
|
||||
// cy.layout({
|
||||
// name: 'preset',
|
||||
// positions,
|
||||
// zoom: 1,
|
||||
// pan: {x: 100, y: 100},
|
||||
// fit: false,
|
||||
// padding: 30,
|
||||
// animate: false,
|
||||
// animationDuration: 500,
|
||||
// animationEasing: 'ease-out',
|
||||
// animateFilter: (node, i) => true,
|
||||
// transform: (node, position) => position
|
||||
// }),
|
||||
// cy.layout({
|
||||
// name: 'grid',
|
||||
// fit: true,
|
||||
// padding: 30,
|
||||
// boundingBox,
|
||||
// avoidOverlap: true,
|
||||
// avoidOverlapPadding: 10,
|
||||
// nodeDimensionsIncludeLabels: false,
|
||||
// spacingFactor: oneOf(1, undefined),
|
||||
// condense: false,
|
||||
// rows: oneOf(10, undefined),
|
||||
// cols: oneOf(10, undefined),
|
||||
// position: (node) => ({ row: 1, col: 1 }),
|
||||
// sort: (a, b) => 1,
|
||||
// animate: false,
|
||||
// animationDuration: 500,
|
||||
// animationEasing: 'ease-in-out',
|
||||
// animateFilter: (node, i) => true,
|
||||
// transform: (node, position) => position
|
||||
// }),
|
||||
// cy.layout({
|
||||
// name: 'circle',
|
||||
// fit: true,
|
||||
// padding: 30,
|
||||
// boundingBox,
|
||||
// avoidOverlap: true,
|
||||
// nodeDimensionsIncludeLabels: false,
|
||||
// spacingFactor: oneOf(1, undefined),
|
||||
// radius: oneOf(1, undefined),
|
||||
// startAngle: 3 / 2 * Math.PI,
|
||||
// sweep: oneOf(6, undefined),
|
||||
// clockwise: true,
|
||||
// sort: (a, b) => 1,
|
||||
// animate: false,
|
||||
// animationDuration: 500,
|
||||
// animationEasing: 'ease-in-sine',
|
||||
// animateFilter: (node, i) => true,
|
||||
// transform: (node, position) => position
|
||||
// }),
|
||||
// cy.layout({
|
||||
// name: 'concentric',
|
||||
// fit: true,
|
||||
// padding: 30,
|
||||
// startAngle: 3 / 2 * Math.PI,
|
||||
// sweep: oneOf(6, undefined),
|
||||
// clockwise: true,
|
||||
// equidistant: false,
|
||||
// minNodeSpacing: 10,
|
||||
// boundingBox,
|
||||
// avoidOverlap: true,
|
||||
// nodeDimensionsIncludeLabels: false,
|
||||
// height: oneOf(500, undefined),
|
||||
// width: oneOf(500, undefined),
|
||||
// spacingFactor: oneOf(1, undefined),
|
||||
// concentric: (node) => 1,
|
||||
// levelWidth: (nodes) => 1,
|
||||
// animate: false,
|
||||
// animationDuration: 500,
|
||||
// animationEasing: 'ease-out-sine',
|
||||
// animateFilter: (node, i) => true,
|
||||
// transform: (node, position) => position
|
||||
// }),
|
||||
// cy.layout({
|
||||
// name: 'breadthfirst',
|
||||
// fit: true,
|
||||
// directed: false,
|
||||
// padding: 30,
|
||||
// circle: false,
|
||||
// spacingFactor: 1.75,
|
||||
// boundingBox,
|
||||
// avoidOverlap: true,
|
||||
// nodeDimensionsIncludeLabels: false,
|
||||
// maximalAdjustments: 0,
|
||||
// animate: false,
|
||||
// animationDuration: 500,
|
||||
// animationEasing: 'ease-in-out-sine',
|
||||
// animateFilter: (node, i) => true,
|
||||
// transform: (node, position) => position
|
||||
// }),
|
||||
// cy.layout({
|
||||
// name: 'cose',
|
||||
// ready: () => {},
|
||||
// stop: () => {},
|
||||
// animate: oneOf(true, false, 'end'),
|
||||
// animationEasing: oneOf('ease-in-quad', undefined),
|
||||
// animationDuration: oneOf(500, undefined),
|
||||
// animateFilter: function ( node, i ){ return true; },
|
||||
// animationThreshold: 250,
|
||||
// refresh: 20,
|
||||
// fit: true,
|
||||
// padding: 30,
|
||||
// boundingBox: undefined,
|
||||
// nodeDimensionsIncludeLabels: false,
|
||||
// randomize: false,
|
||||
// componentSpacing: 40,
|
||||
// nodeRepulsion: (node) => 2048,
|
||||
// nodeOverlap: 4,
|
||||
// idealEdgeLength: (edge) => 32,
|
||||
// edgeElasticity: (edge) => 32,
|
||||
// nestingFactor: 1.2,
|
||||
// gravity: 1,
|
||||
// numIter: 1000,
|
||||
// initialTemp: 1000,
|
||||
// coolingFactor: 0.99,
|
||||
// minTemp: 1.0,
|
||||
// weaver: false
|
||||
// })
|
||||
// ];
|
||||
// const lay = layouts[0];
|
||||
// aliases(lay.run, lay.start);
|
||||
// events(lay);
|
||||
// layouts.map(layout => {
|
||||
// layout.run();
|
||||
// layout.stop();
|
||||
// });
|
||||
|
||||
// TODO: cy.style
|
||||
|
||||
cy.png({
|
||||
output: oneOf('base64uri', 'base64', 'blob', undefined),
|
||||
bg: oneOf('#ffffff', undefined),
|
||||
full: true,
|
||||
scale: 2,
|
||||
maxWidth: 100,
|
||||
maxHeight: 100
|
||||
});
|
||||
aliases(cy.jpg, cy.jpeg);
|
||||
cy.jpg({
|
||||
output: oneOf('base64uri', 'base64', 'blob', undefined),
|
||||
bg: oneOf('#ffffff', undefined),
|
||||
full: true,
|
||||
scale: 2,
|
||||
maxWidth: 100,
|
||||
maxHeight: 100,
|
||||
quality: 0.5
|
||||
});
|
||||
cy.json(cy.json());
|
||||
|
||||
// Types possible to call methods
|
||||
const ele = oneOf(cy.nodes()[0], cy.edges()[0]);
|
||||
const eles = cy.elements();
|
||||
const node = cy.nodes()[0];
|
||||
const nodes = cy.nodes();
|
||||
const edge = cy.edges()[0];
|
||||
const edges = cy.edges();
|
||||
|
||||
assert(ele.cy() === cy);
|
||||
eles.remove();
|
||||
assert(eles.removed());
|
||||
assert(!eles.inside());
|
||||
eles.restore();
|
||||
|
||||
([ele, eles, node, nodes, edge, edges] as cytoscape.CollectionReturnValue[]).forEach((elem) => {
|
||||
aliases(elem.clone, elem.copy);
|
||||
events(elem);
|
||||
aliases(elem.data, elem.attr);
|
||||
aliases(elem.removeData, elem.removeAttr);
|
||||
});
|
||||
// TODO: tests for data flow
|
||||
|
||||
const loops = oneOf(true, false);
|
||||
node.degree(loops); node.indegree(loops); node.outdegree(loops);
|
||||
nodes.totalDegree(loops); nodes.minDegree(loops); nodes.maxDegree(loops);
|
||||
nodes.minIndegree(loops); nodes.maxIndegree(loops); nodes.minOutdegree(loops); nodes.maxOutdegree(loops);
|
||||
|
||||
// tslint:disable-next-line:ban-types
|
||||
const getsetPos = <T extends Function>(func: T): T => {
|
||||
func('x', func('x'));
|
||||
func(func());
|
||||
func({x: 100, y: 100});
|
||||
return func;
|
||||
};
|
||||
|
||||
aliases(node.modelPosition, node.point, node.position);
|
||||
getsetPos(node.position);
|
||||
|
||||
nodes.shift('x', 100);
|
||||
nodes.shift({x: -100, y: 0});
|
||||
|
||||
aliases(nodes.modelPositions, nodes.positions, nodes.points);
|
||||
nodes.positions((node, i) => Object.assign(node.position(), {x: node.position('x') + i}));
|
||||
|
||||
aliases(node.renderedPosition, node.renderedPoint);
|
||||
getsetPos(node.renderedPoint);
|
||||
|
||||
// TODO: tests for compound nodes (relativePosition, in particular)
|
||||
|
||||
const sizes: number[] = [
|
||||
ele.width(), ele.outerWidth(), ele.renderedWidth(), ele.renderedOuterWidth(),
|
||||
ele.height(), ele.outerHeight(), ele.renderedHeight(), ele.renderedOuterHeight()
|
||||
];
|
||||
|
||||
aliases(eles.boundingBox, eles.boundingbox);
|
||||
aliases(eles.renderedBoundingBox, eles.renderedBoundingbox);
|
||||
|
||||
const flags: boolean[] = [
|
||||
node.grabbed(), node.grabbable(), node.locked(), ele.active(),
|
||||
];
|
||||
|
||||
const edgePoints: cytoscape.Position[] = [
|
||||
...edge.controlPoints(), ...edge.segmentPoints(), edge.sourceEndpoint(), edge.targetEndpoint(), edge.midpoint()
|
||||
];
|
||||
|
||||
aliases(eles.layout, eles.createLayout, eles.makeLayout);
|
||||
const layout = eles.layout({name: 'random'}).run();
|
||||
|
||||
eles.select();
|
||||
assert(ele.selected()); // as we selected all, and this too
|
||||
aliases(eles.unselect, eles.deselect);
|
||||
eles.selectify();
|
||||
assert(ele.selectable());
|
||||
eles.unselectify();
|
||||
|
||||
eles.addClass('test');
|
||||
eles.toggleClass('test', oneOf(true, false, undefined));
|
||||
eles.removeClass('test');
|
||||
eles.classes(oneOf('test', undefined));
|
||||
eles.flashClass('test flash', oneOf(1000, undefined));
|
||||
assert(ele.hasClass('test'));
|
||||
|
||||
eles.style('background-color', 'green');
|
||||
Object.keys(eles.style()).map(key => eles.style(key));
|
||||
eles.style(eles.style());
|
||||
aliases(eles.style, eles.css);
|
||||
aliases(ele.renderedCss, ele.renderedStyle);
|
||||
|
||||
eles.anySame(nodes);
|
||||
aliases(eles.contains, eles.has);
|
||||
aliases(eles.allAreNeighbors, eles.allAreNeighbours);
|
||||
eles.is('#g');
|
||||
eles.allAre('#g');
|
||||
eles.some((el, i, els) => true);
|
||||
eles.every((el, i, els) => true);
|
||||
|
||||
aliases(eles.forEach, eles.each);
|
||||
const selected: cytoscape.SingularElementArgument[] = [eles.eq(0), eles.first(), eles.last()];
|
||||
const collSel = cy.collection(selected);
|
||||
const selectedNodes: cytoscape.NodeSingular[] = [nodes.eq(0), nodes.first(), nodes.last()];
|
||||
const collNodes = cy.collection(selectedNodes);
|
||||
const selectedEdges: cytoscape.EdgeSingular[] = [edges.eq(0), edges.first(), edges.last()];
|
||||
eles.slice(0, -1);
|
||||
eles.toArray();
|
||||
|
||||
aliases(eles.getElementById, eles.$id);
|
||||
aliases(eles.union, eles.add, eles.or, eles.u, eles['+'], eles['|']);
|
||||
aliases(eles.difference, eles.not, eles.subtract, eles.relativeComplement, eles['\\'], eles['!'], eles['-']);
|
||||
aliases(eles.absoluteComplement, eles.abscomp, eles.complement);
|
||||
aliases(eles.intersection, eles.intersect, eles.and, eles.n, eles['&'], eles['.']);
|
||||
aliases(eles.symmetricDifference, eles.symdiff, eles.xor, eles['^'], eles['(+)'], eles['(-)']);
|
||||
cy.collection([nodes[0]]).union(nodes[1]).union(eles.$id('g'));
|
||||
eles.difference(collNodes).abscomp().intersection(collSel).symdiff(collNodes);
|
||||
const diff = collSel.diff(collNodes);
|
||||
cy.collection().merge(diff.left).merge(diff.right).merge(diff.both).unmerge(collSel).filter((ele, i, eles) => true);
|
||||
|
||||
eles.sort((a, b) => 1).map((ele, i, eles) => [i, ele]);
|
||||
eles.reduce<any[]>((prev, ele, i, eles) => [...prev, [ele, i]], []).concat(['finish']);
|
||||
const min = eles.min((ele, i, eles) => ele.id.length + i); min.ele.scratch('min', min.value);
|
||||
const max = eles.max((ele, i, eles) => ele.id.length + i); max.ele.scratch('max', max.value);
|
||||
|
||||
// TODO: traversing (need to actively check the nodes/edeges distinction)
|
||||
// TODO: algorithms
|
||||
// TODO: compound nodes (there aren't any in current test case)
|
||||
|
||||
Vendored
+389
-135
File diff suppressed because it is too large
Load Diff
Vendored
+1
-1
@@ -3277,7 +3277,7 @@ declare namespace d3 {
|
||||
round(round: boolean): Treemap<T>;
|
||||
|
||||
sticky(): boolean;
|
||||
sticky(sticky: boolean): boolean;
|
||||
sticky(sticky: boolean): Treemap<T>;
|
||||
|
||||
mode(): string;
|
||||
mode(mode: "squarify"): Treemap<T>;
|
||||
|
||||
Regular → Executable
+21
@@ -19,3 +19,24 @@ decompress('unicorn.zip', 'dist', {
|
||||
}).then((files: decompress.File[]) => {
|
||||
console.log('done!');
|
||||
});
|
||||
|
||||
// Test decompress with no output to filesystem
|
||||
decompress('unicorn.zip')
|
||||
.then(
|
||||
(files: decompress.File[]) => {
|
||||
console.log(`Decompressed ${files.length} files with no write to filesystem`);
|
||||
}
|
||||
);
|
||||
|
||||
// Test decompress with DecompressOptions as second argument
|
||||
decompress(
|
||||
'unicorn.zip',
|
||||
{
|
||||
filter: file => path.extname(file.path) !== '.exe'
|
||||
}
|
||||
)
|
||||
.then(
|
||||
(files: decompress.File[]) => {
|
||||
console.log(`Decompressed ${files.length} files with filter options`);
|
||||
}
|
||||
);
|
||||
|
||||
+2
-1
@@ -1,13 +1,14 @@
|
||||
// Type definitions for decompress 4.2
|
||||
// Project: https://github.com/kevva/decompress#readme
|
||||
// Definitions by: York Yao <https://github.com/plantain-00>
|
||||
// Jesse Bethke <https://github.com/jbethke>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
export = decompress;
|
||||
|
||||
declare function decompress(input: string | Buffer, output: string, opts?: decompress.DecompressOptions): Promise<decompress.File[]>;
|
||||
declare function decompress(input: string | Buffer, output?: string | decompress.DecompressOptions, opts?: decompress.DecompressOptions): Promise<decompress.File[]>;
|
||||
|
||||
declare namespace decompress {
|
||||
interface File {
|
||||
|
||||
Vendored
+19
-11
@@ -1,15 +1,15 @@
|
||||
// Type definitions for ethereumjs-util 5.1
|
||||
// Type definitions for ethereumjs-util 5.2
|
||||
// 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/)
|
||||
|
||||
import BN = require("bn.js");
|
||||
|
||||
export const SHA3_NULL_S: string;
|
||||
|
||||
export const SHA3_RLP_ARRAY_S: string;
|
||||
@@ -18,13 +18,11 @@ 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 | Uint8Array | string[]): Buffer | Uint8Array | string[];
|
||||
export function baToJSON(ba: Buffer | Uint8Array | string[]): Buffer | Uint8Array | string[] | null;
|
||||
|
||||
export function bufferToHex(buf: Buffer | Uint8Array): string;
|
||||
|
||||
export function bufferToInt(buf: Buffer | Uint8Array): string;
|
||||
export function bufferToInt(buf: Buffer | Uint8Array): number;
|
||||
|
||||
export function defineProperties(self: {[k: string]: any}, fields: string[], data: {[k: string]: any}): {[k: string]: any};
|
||||
|
||||
@@ -34,14 +32,16 @@ export function ecsign(msgHash: Buffer | Uint8Array, privateKey: Buffer | Uint8A
|
||||
|
||||
export function fromRpcSig(sig: string): {[k: string]: any};
|
||||
|
||||
export function fromSigned(num: Buffer | Uint8Array): any;
|
||||
export function fromSigned(num: Buffer | Uint8Array): BN;
|
||||
|
||||
export function generateAddress(from: Buffer | Uint8Array, nonce: Buffer | Uint8Array): Buffer | Uint8Array;
|
||||
|
||||
export function hashPersonalMessage(message: string): Buffer | Uint8Array;
|
||||
export function hashPersonalMessage(message: Buffer | Uint8Array | any[]): Buffer | Uint8Array;
|
||||
|
||||
export function importPublic(publicKey: Buffer | Uint8Array): Buffer | Uint8Array;
|
||||
|
||||
export function isPrecompiled(address: Buffer | Uint8Array): boolean;
|
||||
|
||||
export function isValidAddress(address: string): boolean;
|
||||
|
||||
export function isValidChecksumAddress(address: Buffer | Uint8Array): boolean;
|
||||
@@ -52,11 +52,17 @@ export function isValidPublic(publicKey: Buffer | Uint8Array, sanitize?: boolean
|
||||
|
||||
export function isValidSignature(v: Buffer | Uint8Array, r: Buffer | Uint8Array, s: Buffer | Uint8Array, homestead?: boolean): boolean;
|
||||
|
||||
export function isZeroAddress(address: string): boolean;
|
||||
|
||||
export function keccak(a: Buffer | Uint8Array | any[] | string | number, bits?: number): Buffer | Uint8Array;
|
||||
|
||||
export function keccak256(a: Buffer | Uint8Array | any[] | string | number): Buffer | Uint8Array;
|
||||
|
||||
export function privateToAddress(privateKey: Buffer | Uint8Array): Buffer | Uint8Array;
|
||||
|
||||
export function privateToPublic(privateKey: Buffer | Uint8Array): Buffer | Uint8Array;
|
||||
|
||||
export function pubToAddress(pubKey: Buffer | Uint8Array, sanitize: boolean): Buffer | Uint8Array;
|
||||
export function pubToAddress(pubKey: Buffer | Uint8Array, sanitize?: boolean): Buffer | Uint8Array;
|
||||
|
||||
export function ripemd160(a: Buffer | Uint8Array | any[] | string | number, padded: boolean): Buffer | Uint8Array;
|
||||
|
||||
@@ -76,8 +82,10 @@ export function toChecksumAddress(address: string): string;
|
||||
|
||||
export function toRpcSig(v: number, r: Buffer | Uint8Array, s: Buffer | Uint8Array): string;
|
||||
|
||||
export function toUnsigned(num: any): Buffer | Uint8Array;
|
||||
export function toUnsigned(num: BN): Buffer | Uint8Array;
|
||||
|
||||
export function unpad<T extends Buffer | Uint8Array | any[] | string>(a: T): T;
|
||||
|
||||
export function zeros(bytes: number): Buffer | Uint8Array;
|
||||
|
||||
export function zeroAddress(): string;
|
||||
|
||||
Vendored
+16
-3
@@ -7,6 +7,7 @@
|
||||
// Fernando Helwanger <https://github.com/fhelwanger>
|
||||
// Umidbek Karimov <https://github.com/umidbekkarimov>
|
||||
// Moshe Feuchtwanger <https://github.com/moshfeu>
|
||||
// Michael Prokopchuk <https://github.com/prokopcm>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.6
|
||||
|
||||
@@ -1390,12 +1391,24 @@ export namespace Font {
|
||||
}
|
||||
|
||||
// #region GLView
|
||||
export interface ExpoWebGLRenderingContext extends WebGLRenderingContext {
|
||||
endFrameEXP(): void;
|
||||
}
|
||||
|
||||
/**
|
||||
* GLView
|
||||
* A View that acts as an OpenGL ES render target. On mounting, an OpenGL ES
|
||||
* context is created. Its drawing buffer is presented as the contents of
|
||||
* the View every frame.
|
||||
*/
|
||||
export interface GLViewProps extends ViewProps {
|
||||
onContextCreate(): void;
|
||||
msaaSamples: number;
|
||||
/**
|
||||
* A function that will be called when the OpenGL ES context is created.
|
||||
* Passes an object with a WebGLRenderingContext interface as an argument.
|
||||
*/
|
||||
onContextCreate(gl: ExpoWebGLRenderingContext): void;
|
||||
|
||||
/** Number of MSAA samples to use on iOS. Defaults to 4. Ignored on Android. */
|
||||
msaaSamples?: number;
|
||||
}
|
||||
|
||||
export class GLView extends Component<GLViewProps, { msaaSamples: number }> { }
|
||||
|
||||
@@ -82,6 +82,10 @@ declare namespace GoogleAppsScript {
|
||||
* Sets the URL to navigate to when the action is activated.
|
||||
*/
|
||||
setOpenLink(openLink: OpenLink): ActionResponseBuilder;
|
||||
/**
|
||||
* Sets a flag to indicate that this action changed the existing data state.
|
||||
*/
|
||||
setStateChanged(stateChanged: boolean): ActionResponseBuilder;
|
||||
}
|
||||
|
||||
export interface AuthorizationAction {
|
||||
|
||||
Vendored
+5
@@ -32,6 +32,11 @@ export interface IFrameOptions {
|
||||
* CSS margin attribute, for example '8px 3em'. A number value is converted into px.
|
||||
*/
|
||||
bodyMargin?: number | string;
|
||||
/**
|
||||
* Override the default body padding style in the iFrame. A string can be any valid value for the
|
||||
* CSS margin attribute, for example '8px 3em'. A number value is converted into px.
|
||||
*/
|
||||
bodyPadding?: number | string;
|
||||
/**
|
||||
* When set to true, only allow incoming messages from the domain listed in the src property of the iFrame tag.
|
||||
* If your iFrame navigates between different domains, ports or protocols; then you will need to
|
||||
|
||||
Vendored
+160
-2
@@ -1,4 +1,4 @@
|
||||
// Type definitions for Jest 23.0
|
||||
// Type definitions for Jest 23.1
|
||||
// Project: http://facebook.github.io/jest/
|
||||
// Definitions by: Asana <https://asana.com>
|
||||
// Ivo Stratev <https://github.com/NoHomey>
|
||||
@@ -12,9 +12,9 @@
|
||||
// Douglas Duteil <https://github.com/douglasduteil>
|
||||
// Ahn <https://github.com/ahnpnl>
|
||||
// Josh Goldberg <https://github.com/joshuakgoldberg>
|
||||
// Bradley Ayers <https://github.com/bradleyayers>
|
||||
// Jeff Lau <https://github.com/UselessPickles>
|
||||
// Andrew Makarov <https://github.com/r3nya>
|
||||
// Martin Hochel <https://github.com/hotell>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
@@ -873,6 +873,164 @@ declare namespace jest {
|
||||
|
||||
type SnapshotUpdateState = 'all' | 'new' | 'none';
|
||||
|
||||
interface DefaultOptions {
|
||||
automock: boolean;
|
||||
bail: boolean;
|
||||
browser: boolean;
|
||||
cache: boolean;
|
||||
cacheDirectory: Path;
|
||||
changedFilesWithAncestor: boolean;
|
||||
clearMocks: boolean;
|
||||
collectCoverage: boolean;
|
||||
collectCoverageFrom: Maybe<string[]>;
|
||||
coverageDirectory: Maybe<string>;
|
||||
coveragePathIgnorePatterns: string[];
|
||||
coverageReporters: string[];
|
||||
coverageThreshold: Maybe<{global: {[key: string]: number}}>;
|
||||
errorOnDeprecated: boolean;
|
||||
expand: boolean;
|
||||
filter: Maybe<Path>;
|
||||
forceCoverageMatch: Glob[];
|
||||
globals: ConfigGlobals;
|
||||
globalSetup: Maybe<string>;
|
||||
globalTeardown: Maybe<string>;
|
||||
haste: HasteConfig;
|
||||
detectLeaks: boolean;
|
||||
detectOpenHandles: boolean;
|
||||
moduleDirectories: string[];
|
||||
moduleFileExtensions: string[];
|
||||
moduleNameMapper: {[key: string]: string};
|
||||
modulePathIgnorePatterns: string[];
|
||||
noStackTrace: boolean;
|
||||
notify: boolean;
|
||||
notifyMode: string;
|
||||
preset: Maybe<string>;
|
||||
projects: Maybe<Array<string | ProjectConfig>>;
|
||||
resetMocks: boolean;
|
||||
resetModules: boolean;
|
||||
resolver: Maybe<Path>;
|
||||
restoreMocks: boolean;
|
||||
rootDir: Maybe<Path>;
|
||||
roots: Maybe<Path[]>;
|
||||
runner: string;
|
||||
runTestsByPath: boolean;
|
||||
setupFiles: Path[];
|
||||
setupTestFrameworkScriptFile: Maybe<Path>;
|
||||
skipFilter: boolean;
|
||||
snapshotSerializers: Path[];
|
||||
testEnvironment: string;
|
||||
testEnvironmentOptions: object;
|
||||
testFailureExitCode: string | number;
|
||||
testLocationInResults: boolean;
|
||||
testMatch: Glob[];
|
||||
testPathIgnorePatterns: string[];
|
||||
testRegex: string;
|
||||
testResultsProcessor: Maybe<string>;
|
||||
testRunner: Maybe<string>;
|
||||
testURL: string;
|
||||
timers: 'real' | 'fake';
|
||||
transform: Maybe<{[key: string]: string}>;
|
||||
transformIgnorePatterns: Glob[];
|
||||
watchPathIgnorePatterns: string[];
|
||||
useStderr: boolean;
|
||||
verbose: Maybe<boolean>;
|
||||
watch: boolean;
|
||||
watchman: boolean;
|
||||
}
|
||||
|
||||
interface InitialOptions {
|
||||
automock?: boolean;
|
||||
bail?: boolean;
|
||||
browser?: boolean;
|
||||
cache?: boolean;
|
||||
cacheDirectory?: Path;
|
||||
clearMocks?: boolean;
|
||||
changedFilesWithAncestor?: boolean;
|
||||
changedSince?: string;
|
||||
collectCoverage?: boolean;
|
||||
collectCoverageFrom?: Glob[];
|
||||
collectCoverageOnlyFrom?: {[key: string]: boolean};
|
||||
coverageDirectory?: string;
|
||||
coveragePathIgnorePatterns?: string[];
|
||||
coverageReporters?: string[];
|
||||
coverageThreshold?: {global: {[key: string]: number}};
|
||||
detectLeaks?: boolean;
|
||||
detectOpenHandles?: boolean;
|
||||
displayName?: string;
|
||||
expand?: boolean;
|
||||
filter?: Path;
|
||||
findRelatedTests?: boolean;
|
||||
forceCoverageMatch?: Glob[];
|
||||
forceExit?: boolean;
|
||||
json?: boolean;
|
||||
globals?: ConfigGlobals;
|
||||
globalSetup?: Maybe<string>;
|
||||
globalTeardown?: Maybe<string>;
|
||||
haste?: HasteConfig;
|
||||
reporters?: Array<ReporterConfig | string>;
|
||||
logHeapUsage?: boolean;
|
||||
lastCommit?: boolean;
|
||||
listTests?: boolean;
|
||||
mapCoverage?: boolean;
|
||||
moduleDirectories?: string[];
|
||||
moduleFileExtensions?: string[];
|
||||
moduleLoader?: Path;
|
||||
moduleNameMapper?: {[key: string]: string};
|
||||
modulePathIgnorePatterns?: string[];
|
||||
modulePaths?: string[];
|
||||
name?: string;
|
||||
noStackTrace?: boolean;
|
||||
notify?: boolean;
|
||||
notifyMode?: string;
|
||||
onlyChanged?: boolean;
|
||||
outputFile?: Path;
|
||||
passWithNoTests?: boolean;
|
||||
preprocessorIgnorePatterns?: Glob[];
|
||||
preset?: Maybe<string>;
|
||||
projects?: Glob[];
|
||||
replname?: Maybe<string>;
|
||||
resetMocks?: boolean;
|
||||
resetModules?: boolean;
|
||||
resolver?: Maybe<Path>;
|
||||
restoreMocks?: boolean;
|
||||
rootDir?: Path;
|
||||
roots?: Path[];
|
||||
runner?: string;
|
||||
runTestsByPath?: boolean;
|
||||
scriptPreprocessor?: string;
|
||||
setupFiles?: Path[];
|
||||
setupTestFrameworkScriptFile?: Path;
|
||||
silent?: boolean;
|
||||
skipFilter?: boolean;
|
||||
skipNodeResolution?: boolean;
|
||||
snapshotSerializers?: Path[];
|
||||
errorOnDeprecated?: boolean;
|
||||
testEnvironment?: string;
|
||||
testEnvironmentOptions?: object;
|
||||
testFailureExitCode?: string | number;
|
||||
testLocationInResults?: boolean;
|
||||
testMatch?: Glob[];
|
||||
testNamePattern?: string;
|
||||
testPathDirs?: Path[];
|
||||
testPathIgnorePatterns?: string[];
|
||||
testRegex?: string;
|
||||
testResultsProcessor?: Maybe<string>;
|
||||
testRunner?: string;
|
||||
testURL?: string;
|
||||
timers?: 'real' | 'fake';
|
||||
transform?: {[key: string]: string};
|
||||
transformIgnorePatterns?: Glob[];
|
||||
watchPathIgnorePatterns?: string[];
|
||||
unmockedModulePathPatterns?: string[];
|
||||
updateSnapshot?: boolean;
|
||||
useStderr?: boolean;
|
||||
verbose?: Maybe<boolean>;
|
||||
watch?: boolean;
|
||||
watchAll?: boolean;
|
||||
watchman?: boolean;
|
||||
watchPlugins?: string[];
|
||||
}
|
||||
|
||||
interface GlobalConfig {
|
||||
bail: boolean;
|
||||
collectCoverage: boolean;
|
||||
|
||||
+142
-119
@@ -617,126 +617,132 @@ describe("", () => {
|
||||
|
||||
/* Test framework and config */
|
||||
|
||||
const globalConfig: jest.GlobalConfig = {
|
||||
bail: true,
|
||||
collectCoverage: false,
|
||||
collectCoverageFrom: ["glob"],
|
||||
collectCoverageOnlyFrom: {
|
||||
abc: true,
|
||||
def: false,
|
||||
},
|
||||
coverageDirectory: "",
|
||||
coverageReporters: [""],
|
||||
coverageThreshold: {
|
||||
global: {
|
||||
abc: 90,
|
||||
def: 100,
|
||||
},
|
||||
},
|
||||
expand: true,
|
||||
forceExit: false,
|
||||
logHeapUsage: true,
|
||||
mapCoverage: false,
|
||||
noStackTrace: true,
|
||||
notify: false,
|
||||
projects: ["projects"],
|
||||
replname: "",
|
||||
reporters: [
|
||||
["abc", {}],
|
||||
["def", {}],
|
||||
],
|
||||
rootDir: "path",
|
||||
silent: true,
|
||||
testNamePattern: "",
|
||||
testPathPattern: "",
|
||||
testResultsProcessor: "",
|
||||
updateSnapshot: "all" as "all" | "new" | "none",
|
||||
useStderr: true,
|
||||
verbose: false,
|
||||
watch: true,
|
||||
watchman: false,
|
||||
};
|
||||
|
||||
const projectConfig: jest.ProjectConfig = {
|
||||
automock: true,
|
||||
browser: false,
|
||||
cache: true,
|
||||
cacheDirectory: "",
|
||||
clearMocks: true,
|
||||
coveragePathIgnorePatterns: [""],
|
||||
cwd: "",
|
||||
detectLeaks: true,
|
||||
displayName: "",
|
||||
forceCoverageMatch: ["abc", "def"],
|
||||
globals: {
|
||||
"ts-jest": {},
|
||||
},
|
||||
haste: {
|
||||
defaultPlatform: "",
|
||||
hasteImplModulePath: "",
|
||||
platforms: ["win95", "win2000", "clippy"],
|
||||
providesModuleNodeModules: ["abc", "def"],
|
||||
},
|
||||
moduleDirectories: ["", ""],
|
||||
moduleFileExtensions: [".ts", ".json"],
|
||||
moduleLoader: "laoder",
|
||||
moduleNameMapper: [
|
||||
["abc", "def"],
|
||||
["ghi", "jkl"],
|
||||
],
|
||||
modulePathIgnorePatterns: ["abc", "def"],
|
||||
modulePaths: ["abc", "def"],
|
||||
name: "",
|
||||
resetMocks: true,
|
||||
resetModules: false,
|
||||
resolver: "",
|
||||
rootDir: "",
|
||||
roots: ["", ""],
|
||||
runner: "",
|
||||
setupFiles: ["abc", "def"],
|
||||
setupTestFrameworkScriptFile: "",
|
||||
skipNodeResolution: true,
|
||||
snapshotSerializers: ["abc", "def"],
|
||||
testEnvironment: "",
|
||||
testEnvironmentOptions: {},
|
||||
testLocationInResults: true,
|
||||
testMatch: [".test.ts"],
|
||||
testPathIgnorePatterns: ["*.spec.*"],
|
||||
testRegex: "abc",
|
||||
testRunner: "m",
|
||||
testURL: "localhost:3000",
|
||||
timers: "real",
|
||||
transform: [
|
||||
["abc", "def"],
|
||||
],
|
||||
transformIgnorePatterns: ["", ""],
|
||||
unmockedModulePathPatterns: ["abc"],
|
||||
watchPathIgnorePatterns: ["def"],
|
||||
};
|
||||
|
||||
const environment = {
|
||||
global: {},
|
||||
fakeTimers: {
|
||||
clearAllTimers() { },
|
||||
runAllImmediates() { },
|
||||
runAllTicks() { },
|
||||
runAllTimers() { },
|
||||
runTimersToTime(time: number) { },
|
||||
advanceTimersByTime(time: number) { },
|
||||
runOnlyPendingTimers() { },
|
||||
runWithRealTimers(callback: () => void) {
|
||||
callback();
|
||||
},
|
||||
useFakeTimers() { },
|
||||
useRealTimers() { },
|
||||
},
|
||||
testFilePath: "",
|
||||
moduleMocker: {},
|
||||
dispose() {},
|
||||
runScript(script: "") {
|
||||
return {};
|
||||
},
|
||||
};
|
||||
|
||||
const workTestFramework = async (testFramework: jest.TestFramework): Promise<jest.TestResult> => {
|
||||
return testFramework(
|
||||
{
|
||||
bail: true,
|
||||
collectCoverage: false,
|
||||
collectCoverageFrom: ["glob"],
|
||||
collectCoverageOnlyFrom: {
|
||||
abc: true,
|
||||
def: false,
|
||||
},
|
||||
coverageDirectory: "",
|
||||
coverageReporters: [""],
|
||||
coverageThreshold: {
|
||||
global: {
|
||||
abc: 90,
|
||||
def: 100,
|
||||
},
|
||||
},
|
||||
expand: true,
|
||||
forceExit: false,
|
||||
logHeapUsage: true,
|
||||
mapCoverage: false,
|
||||
noStackTrace: true,
|
||||
notify: false,
|
||||
projects: ["projects"],
|
||||
replname: "",
|
||||
reporters: [
|
||||
["abc", {}],
|
||||
["def", {}],
|
||||
],
|
||||
rootDir: "path",
|
||||
silent: true,
|
||||
testNamePattern: "",
|
||||
testPathPattern: "",
|
||||
testResultsProcessor: "",
|
||||
updateSnapshot: "all" as "all" | "new" | "none",
|
||||
useStderr: true,
|
||||
verbose: false,
|
||||
watch: true,
|
||||
watchman: false,
|
||||
},
|
||||
{
|
||||
automock: true,
|
||||
browser: false,
|
||||
cache: true,
|
||||
cacheDirectory: "",
|
||||
clearMocks: true,
|
||||
coveragePathIgnorePatterns: [""],
|
||||
cwd: "",
|
||||
detectLeaks: true,
|
||||
displayName: "",
|
||||
forceCoverageMatch: ["abc", "def"],
|
||||
globals: {
|
||||
"ts-jest": {},
|
||||
},
|
||||
haste: {
|
||||
defaultPlatform: "",
|
||||
hasteImplModulePath: "",
|
||||
platforms: ["win95", "win2000", "clippy"],
|
||||
providesModuleNodeModules: ["abc", "def"],
|
||||
},
|
||||
moduleDirectories: ["", ""],
|
||||
moduleFileExtensions: [".ts", ".json"],
|
||||
moduleLoader: "laoder",
|
||||
moduleNameMapper: [
|
||||
["abc", "def"],
|
||||
["ghi", "jkl"],
|
||||
],
|
||||
modulePathIgnorePatterns: ["abc", "def"],
|
||||
modulePaths: ["abc", "def"],
|
||||
name: "",
|
||||
resetMocks: true,
|
||||
resetModules: false,
|
||||
resolver: "",
|
||||
rootDir: "",
|
||||
roots: ["", ""],
|
||||
runner: "",
|
||||
setupFiles: ["abc", "def"],
|
||||
setupTestFrameworkScriptFile: "",
|
||||
skipNodeResolution: true,
|
||||
snapshotSerializers: ["abc", "def"],
|
||||
testEnvironment: "",
|
||||
testEnvironmentOptions: {},
|
||||
testLocationInResults: true,
|
||||
testMatch: [".test.ts"],
|
||||
testPathIgnorePatterns: ["*.spec.*"],
|
||||
testRegex: "abc",
|
||||
testRunner: "m",
|
||||
testURL: "localhost:3000",
|
||||
timers: "real",
|
||||
transform: [
|
||||
["abc", "def"],
|
||||
],
|
||||
transformIgnorePatterns: ["", ""],
|
||||
unmockedModulePathPatterns: ["abc"],
|
||||
watchPathIgnorePatterns: ["def"],
|
||||
},
|
||||
{
|
||||
global: {},
|
||||
fakeTimers: {
|
||||
clearAllTimers() { },
|
||||
runAllImmediates() { },
|
||||
runAllTicks() { },
|
||||
runAllTimers() { },
|
||||
runTimersToTime(time: number) { },
|
||||
advanceTimersByTime(time: number) { },
|
||||
runOnlyPendingTimers() { },
|
||||
runWithRealTimers(callback: () => void) {
|
||||
callback();
|
||||
},
|
||||
useFakeTimers() { },
|
||||
useRealTimers() { },
|
||||
},
|
||||
testFilePath: "",
|
||||
moduleMocker: {},
|
||||
dispose() {},
|
||||
runScript(script: "") {
|
||||
return {};
|
||||
},
|
||||
},
|
||||
globalConfig,
|
||||
projectConfig,
|
||||
environment,
|
||||
{},
|
||||
"testPath"
|
||||
);
|
||||
@@ -932,4 +938,21 @@ let matchersUtil2: jasmine.MatchersUtil = {
|
||||
equals: (a: {}, b: {}, customTesters?: jasmine.CustomEqualityTester[]) => false,
|
||||
};
|
||||
|
||||
matchersUtil2 = matchersUtil1;
|
||||
// Jest config
|
||||
|
||||
const testJestConfig = (defaults: jest.DefaultOptions) => {
|
||||
const config: jest.InitialOptions = {
|
||||
transform: {
|
||||
'^.+\\.(ts|tsx)$': 'ts-jest'
|
||||
},
|
||||
testMatch: [
|
||||
...defaults.testMatch,
|
||||
'**/__tests__/**/*.ts?(x)',
|
||||
'**/?(*.)+(spec|test).ts?(x)'
|
||||
],
|
||||
moduleFileExtensions: [...defaults.moduleFileExtensions, 'ts', 'tsx'],
|
||||
globals: {
|
||||
'ts-jest': {}
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
Vendored
+26
-2
@@ -1,11 +1,28 @@
|
||||
// Type definitions for jQuery Mockjax 2.0.1
|
||||
// Type definitions for jQuery Mockjax 2.3.0
|
||||
// Project: https://github.com/jakerella/jquery-mockjax
|
||||
// Definitions by: Laszlo Jakab <https://github.com/laszlojakab>, Vladimir Đokić <https://github.com/vladeck>
|
||||
// Definitions by:
|
||||
// Laszlo Jakab <https://github.com/laszlojakab>,
|
||||
// Vladimir Đokić <https://github.com/vladeck>,
|
||||
// James Johnson <https://github.com/hasaki>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
/// <reference types="jquery" />
|
||||
|
||||
type MockJaxLoggingFunction = (message?: any, ...additionalParameters: any[]) => void;
|
||||
|
||||
interface MockJaxStandardLogger {
|
||||
error?: MockJaxLoggingFunction;
|
||||
warn?: MockJaxLoggingFunction;
|
||||
info?: MockJaxLoggingFunction;
|
||||
log?: MockJaxLoggingFunction;
|
||||
debug?: MockJaxLoggingFunction;
|
||||
}
|
||||
|
||||
interface MockJaxCustomLogger {
|
||||
[key: string]: MockJaxLoggingFunction;
|
||||
}
|
||||
|
||||
interface MockJaxSettingsHeaders {
|
||||
[key: string]: string;
|
||||
}
|
||||
@@ -33,15 +50,22 @@ interface MockJaxSettings {
|
||||
onAfterSuccess?: Function;
|
||||
onAfterError?: Function;
|
||||
onAfterComplete?: Function;
|
||||
logger?: MockJaxStandardLogger | MockJaxCustomLogger;
|
||||
logLevelMethods?: string[];
|
||||
namespace?: string;
|
||||
throwUnmocked?: boolean;
|
||||
retainAjaxCalls?: boolean;
|
||||
}
|
||||
|
||||
interface MockJaxStatic {
|
||||
(options: MockJaxSettings): number;
|
||||
(options: MockJaxSettings[]): number[];
|
||||
handler(id?: number): any;
|
||||
clear(id?: number): void;
|
||||
mockedAjaxCalls(): any[];
|
||||
unfiredHandlers(): any[];
|
||||
unmockedAjaxCalls(): any[];
|
||||
clearRetainedAjaxCalls(): void;
|
||||
}
|
||||
|
||||
interface JQueryStatic {
|
||||
|
||||
@@ -192,6 +192,81 @@ class Tests {
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
t('Standard logger type gets called', (assert) => {
|
||||
let done = assert.async();
|
||||
let wasLoggerCalled = false;
|
||||
|
||||
let logFunction = () => wasLoggerCalled = true;
|
||||
|
||||
let settings: MockJaxSettings = {
|
||||
url: '/custom-logging-function',
|
||||
logging: true,
|
||||
logger: {
|
||||
error: logFunction,
|
||||
warn: logFunction,
|
||||
info: logFunction,
|
||||
log: logFunction,
|
||||
debug: logFunction
|
||||
}
|
||||
};
|
||||
|
||||
$.mockjax(settings);
|
||||
|
||||
$.ajax({
|
||||
url: '/custom-logging-function',
|
||||
error: self._noErrorCallbackExpected,
|
||||
complete: (xhr) => {
|
||||
assert.equal(wasLoggerCalled, true, 'Standard logger was called');
|
||||
done();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
t('Custom logger object gets called', (assert) => {
|
||||
let done = assert.async();
|
||||
let wasLoggerCalled = false;
|
||||
|
||||
let logFunction = () => wasLoggerCalled = true;
|
||||
|
||||
let settings: MockJaxSettings = {
|
||||
url: '/custom-logging-function',
|
||||
logging: true,
|
||||
logger: {
|
||||
customName: logFunction
|
||||
},
|
||||
logLevelMethods: ['customName', 'customName', 'customName', 'customName', 'customName']
|
||||
};
|
||||
|
||||
$.mockjax(settings);
|
||||
|
||||
$.ajax({
|
||||
url: '/custom-logging-function',
|
||||
error: self._noErrorCallbackExpected,
|
||||
complete: (xhr) => {
|
||||
assert.equal(wasLoggerCalled, true, 'Custom logger was called');
|
||||
done();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
t('Throws when ajax call is not mocked', (assert) => {
|
||||
let done = assert.async();
|
||||
|
||||
$.mockjaxSettings.throwUnmocked = true;
|
||||
|
||||
$.ajax({
|
||||
url: '/unmocked-ajax-call',
|
||||
error: (error) => {
|
||||
assert.ok(error, 'Expected the call to fail because it was not mocked');
|
||||
done();
|
||||
},
|
||||
complete: (xhr) => {
|
||||
assert.ok(false, 'Expected a failure');
|
||||
done();
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Vendored
+1
@@ -208,6 +208,7 @@ declare module 'luxon' {
|
||||
toLocaleParts(options?: DateTimeFormatOptions): any[];
|
||||
toLocaleString(options?: DateTimeFormatOptions): string;
|
||||
toObject(options?: { includeConfig?: boolean }): DateObject;
|
||||
toMillis(): number;
|
||||
toRFC2822(): string;
|
||||
toSQL(options?: Object): string;
|
||||
toSQLDate(): string;
|
||||
|
||||
@@ -54,6 +54,8 @@ DateTime.utc();
|
||||
DateTime.local().toUTC();
|
||||
DateTime.utc().toLocal();
|
||||
|
||||
DateTime.fromMillis(1527780819458).toMillis();
|
||||
|
||||
/* Duration */
|
||||
const dur = Duration.fromObject({ hours: 2, minutes: 7 });
|
||||
dt.plus(dur);
|
||||
|
||||
Vendored
+9
-1
@@ -36,6 +36,7 @@ declare namespace math { // tslint:disable-line strict-export-declare-modifiers
|
||||
version: string;
|
||||
|
||||
expression: MathNode;
|
||||
json: MathJsJson;
|
||||
|
||||
config: (options: any) => void;
|
||||
|
||||
@@ -543,7 +544,7 @@ declare namespace math { // tslint:disable-line strict-export-declare-modifiers
|
||||
/**
|
||||
* Create a number or convert a string, boolean, or unit to a number. When value is a matrix, all elements will be converted to number.
|
||||
*/
|
||||
number(value?: string|number|boolean|MathArray|Matrix|Unit|BigNumber): number|MathArray|Matrix;
|
||||
number(value?: string|number|boolean|MathArray|Matrix|Unit|BigNumber|Fraction): number|MathArray|Matrix;
|
||||
number(unit: Unit, valuelessUnit: Unit|string): number|MathArray|Matrix;
|
||||
|
||||
/**
|
||||
@@ -2249,4 +2250,11 @@ declare namespace math { // tslint:disable-line strict-export-declare-modifiers
|
||||
valueOf(): any;
|
||||
toString(): string;
|
||||
}
|
||||
|
||||
interface MathJsJson {
|
||||
/**
|
||||
* Returns reviver function that can be used as reviver in JSON.parse function.
|
||||
*/
|
||||
reviver(): (key: any, value: any) => any;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -365,3 +365,15 @@ Expression tree examples
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
JSON serialization/deserialization
|
||||
*/
|
||||
{
|
||||
const data = {
|
||||
bigNumber: math.bignumber('1.5')
|
||||
};
|
||||
const stringified = JSON.stringify(data);
|
||||
const parsed = JSON.parse(stringified, math.json.reviver);
|
||||
parsed.bigNumber === math.bignumber('1.5'); // true
|
||||
}
|
||||
|
||||
@@ -781,3 +781,8 @@ DDPRateLimiter.addRule({ userId: 'foo' }, 5, 1000);
|
||||
DDPRateLimiter.addRule({ userId: userId => userId == 'foo' }, 5, 1000);
|
||||
|
||||
Template.instance().autorun(() => { }).stop();
|
||||
|
||||
// Mongo Collection without connection (local collection)
|
||||
const collectionWithoutConnection = new Mongo.Collection<MonkeyDAO>("monkey", {
|
||||
connection: null
|
||||
});
|
||||
|
||||
Vendored
+2
-2
@@ -124,7 +124,7 @@ declare module Mongo {
|
||||
var Collection: CollectionStatic;
|
||||
interface CollectionStatic {
|
||||
new <T>(name: string, options?: {
|
||||
connection?: Object;
|
||||
connection?: Object | null;
|
||||
idGeneration?: string;
|
||||
transform?: Function;
|
||||
}): Collection<T>;
|
||||
@@ -348,7 +348,7 @@ declare module "meteor/mongo" {
|
||||
var Collection: CollectionStatic;
|
||||
interface CollectionStatic {
|
||||
new <T>(name: string, options?: {
|
||||
connection?: Object;
|
||||
connection?: Object | null;
|
||||
idGeneration?: string;
|
||||
transform?: Function;
|
||||
}): Collection<T>;
|
||||
|
||||
Vendored
+7
-7
@@ -103,7 +103,10 @@ declare module "mongoose" {
|
||||
export function createConnection(): Connection;
|
||||
export function createConnection(uri: string,
|
||||
options?: ConnectionOptions
|
||||
): Connection;
|
||||
): Connection & {
|
||||
then: Promise<Connection>["then"];
|
||||
catch: Promise<Connection>["catch"];
|
||||
};
|
||||
|
||||
/**
|
||||
* Disconnects all connections.
|
||||
@@ -201,7 +204,7 @@ declare module "mongoose" {
|
||||
*/
|
||||
open(connection_string: string, database?: string, port?: number,
|
||||
options?: ConnectionOpenOptions, callback?: (err: any) => void): any;
|
||||
|
||||
|
||||
/**
|
||||
* Opens the connection to MongoDB.
|
||||
* @param mongodb://uri or the host to which you are connecting
|
||||
@@ -451,9 +454,6 @@ declare module "mongoose" {
|
||||
|
||||
/** Expose the possible connection states. */
|
||||
static STATES: any;
|
||||
|
||||
then: Promise<Connection>["then"];
|
||||
catch: Promise<Connection>["catch"];
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -2727,9 +2727,9 @@ declare module "mongoose" {
|
||||
* This function does not trigger save middleware.
|
||||
* @param docs Documents to insert.
|
||||
* @param options Optional settings.
|
||||
* @param options.ordered if true, will fail fast on the first error encountered.
|
||||
* @param options.ordered if true, will fail fast on the first error encountered.
|
||||
* If false, will insert all the documents it can and report errors later.
|
||||
* @param options.rawResult if false, the returned promise resolves to the documents that passed mongoose document validation.
|
||||
* @param options.rawResult if false, the returned promise resolves to the documents that passed mongoose document validation.
|
||||
* If `false`, will return the [raw result from the MongoDB driver](http://mongodb.github.io/node-mongodb-native/2.2/api/Collection.html#~insertWriteOpCallback)
|
||||
* with a `mongoose` property that contains `validationErrors` if this is an unordered `insertMany`.
|
||||
*/
|
||||
|
||||
@@ -161,6 +161,13 @@ mongoose.Connection.STATES.hasOwnProperty('');
|
||||
conn1.on('data', cb);
|
||||
conn1.addListener('close', cb);
|
||||
|
||||
// The connection returned by useDb is *not* thenable.
|
||||
// From https://github.com/DefinitelyTyped/DefinitelyTyped/pull/26057#issuecomment-396150819
|
||||
const getDB = async (tenant: string)=> {
|
||||
return conn1.useDb(tenant);
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* section error/validation.js
|
||||
* http://mongoosejs.com/docs/api.html#error-validation-js
|
||||
|
||||
Vendored
+2
@@ -71,6 +71,8 @@ declare namespace multer {
|
||||
fields(fields: Field[]): express.RequestHandler;
|
||||
/** Accepts all files that comes over the wire. An array of files will be stored in req.files. */
|
||||
any(): express.RequestHandler;
|
||||
/** Accept only text fields. If any file upload is made, error with code “LIMIT_UNEXPECTED_FILE” will be issued. This is the same as doing upload.fields([]). */
|
||||
none(): express.RequestHandler;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Vendored
+18
@@ -0,0 +1,18 @@
|
||||
import * as React from "react";
|
||||
import { NextContext } from ".";
|
||||
import { SingletonRouter } from "./router";
|
||||
|
||||
export interface AppComponentProps {
|
||||
Component: React.ComponentType<any>;
|
||||
pageProps: any;
|
||||
}
|
||||
|
||||
export interface AppComponentContext {
|
||||
Component: React.ComponentType<any>;
|
||||
router: SingletonRouter;
|
||||
ctx: NextContext;
|
||||
}
|
||||
|
||||
export class Container extends React.Component {}
|
||||
|
||||
export default class App<TProps = {}> extends React.Component<TProps & AppComponentProps> {}
|
||||
Vendored
+14
-27
@@ -1,30 +1,5 @@
|
||||
import * as React from "react";
|
||||
import * as http from "http";
|
||||
|
||||
export interface Context {
|
||||
err?: Error;
|
||||
req: http.IncomingMessage;
|
||||
res: http.ServerResponse;
|
||||
pathname: string;
|
||||
query?: {
|
||||
[key: string]:
|
||||
| boolean
|
||||
| boolean[]
|
||||
| number
|
||||
| number[]
|
||||
| string
|
||||
| string[];
|
||||
};
|
||||
asPath: string;
|
||||
|
||||
renderPage(
|
||||
enhancer?: (page: React.Component) => React.ComponentType<any>
|
||||
): {
|
||||
html?: string;
|
||||
head: Array<React.ReactElement<any>>;
|
||||
errorHtml: string;
|
||||
};
|
||||
}
|
||||
import { NextContext } from ".";
|
||||
|
||||
export interface DocumentProps {
|
||||
__NEXT_DATA__?: any;
|
||||
@@ -38,9 +13,21 @@ export interface DocumentProps {
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
/**
|
||||
* Context object used inside `Document`
|
||||
*/
|
||||
export interface NextDocumentContext extends NextContext {
|
||||
/** A callback that executes the actual React rendering logic (synchronously) */
|
||||
renderPage(
|
||||
cb?: (enhancer: () => JSX.Element) => React.ComponentType<any>
|
||||
): {
|
||||
[key: string]: any
|
||||
};
|
||||
}
|
||||
|
||||
export class Head extends React.Component<any> {}
|
||||
export class Main extends React.Component {}
|
||||
export class NextScript extends React.Component {}
|
||||
export default class extends React.Component<DocumentProps> {
|
||||
static getInitialProps(ctx: Context): DocumentProps;
|
||||
static getInitialProps(ctx: NextContext): DocumentProps;
|
||||
}
|
||||
|
||||
Vendored
+51
-12
@@ -1,7 +1,9 @@
|
||||
// Type definitions for next 2.4
|
||||
// Type definitions for next 6.0
|
||||
// Project: https://github.com/zeit/next.js
|
||||
// Definitions by: Drew Hays <https://github.com/dru89>
|
||||
// Brice BERNARD <https://github.com/brikou>
|
||||
// James Hegedus <https://github.com/jthegedus>
|
||||
// Resi Respati <https://github.com/resir014>
|
||||
// Scott Jones <https://github.com/scottdj92>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.6
|
||||
@@ -11,7 +13,44 @@
|
||||
import * as http from "http";
|
||||
import * as url from "url";
|
||||
|
||||
import { Response as NodeResponse } from "node-fetch";
|
||||
|
||||
declare namespace next {
|
||||
/**
|
||||
* Context object used in methods like `getInitialProps()`
|
||||
* <<https://github.com/zeit/next.js/issues/1651>>
|
||||
*/
|
||||
interface NextContext {
|
||||
/** path section of URL */
|
||||
pathname: string;
|
||||
/** query string section of URL parsed as an object */
|
||||
query: {
|
||||
[key: string]:
|
||||
| boolean
|
||||
| boolean[]
|
||||
| number
|
||||
| number[]
|
||||
| string
|
||||
| string[];
|
||||
};
|
||||
/** String of the actual path (including the query) shows in the browser */
|
||||
asPath: string;
|
||||
/** HTTP request object (server only) */
|
||||
req?: http.IncomingMessage;
|
||||
/** HTTP response object (server only) */
|
||||
res?: http.ServerResponse;
|
||||
/** Fetch Response object (client only) - from https://developer.mozilla.org/en-US/docs/Web/API/Response */
|
||||
jsonPageRes?: NodeResponse;
|
||||
/** Error object if any error is encountered during the rendering */
|
||||
err?: Error;
|
||||
}
|
||||
|
||||
type NextSFC<TProps = {}> = NextStatelessComponent<TProps>;
|
||||
interface NextStatelessComponent<TProps = {}>
|
||||
extends React.StatelessComponent<TProps> {
|
||||
getInitialProps?: (ctx: NextContext) => Promise<TProps>;
|
||||
}
|
||||
|
||||
type UrlLike = url.UrlObject | url.Url;
|
||||
|
||||
interface ServerConfig {
|
||||
@@ -41,12 +80,12 @@ declare namespace next {
|
||||
handleRequest(
|
||||
req: http.IncomingMessage,
|
||||
res: http.ServerResponse,
|
||||
parsedUrl?: UrlLike,
|
||||
parsedUrl?: UrlLike
|
||||
): Promise<void>;
|
||||
getRequestHandler(): (
|
||||
req: http.IncomingMessage,
|
||||
res: http.ServerResponse,
|
||||
parsedUrl?: UrlLike,
|
||||
parsedUrl?: UrlLike
|
||||
) => Promise<void>;
|
||||
prepare(): Promise<void>;
|
||||
close(): Promise<void>;
|
||||
@@ -55,7 +94,7 @@ declare namespace next {
|
||||
run(
|
||||
req: http.IncomingMessage,
|
||||
res: http.ServerResponse,
|
||||
parsedUrl: UrlLike,
|
||||
parsedUrl: UrlLike
|
||||
): Promise<void>;
|
||||
|
||||
render(
|
||||
@@ -71,7 +110,7 @@ declare namespace next {
|
||||
| string
|
||||
| string[];
|
||||
},
|
||||
parsedUrl?: UrlLike,
|
||||
parsedUrl?: UrlLike
|
||||
): Promise<void>;
|
||||
renderError(
|
||||
err: any,
|
||||
@@ -86,12 +125,12 @@ declare namespace next {
|
||||
| number[]
|
||||
| string
|
||||
| string[];
|
||||
},
|
||||
}
|
||||
): Promise<void>;
|
||||
render404(
|
||||
req: http.IncomingMessage,
|
||||
res: http.ServerResponse,
|
||||
parsedUrl: UrlLike,
|
||||
parsedUrl: UrlLike
|
||||
): Promise<void>;
|
||||
renderToHTML(
|
||||
req: http.IncomingMessage,
|
||||
@@ -105,7 +144,7 @@ declare namespace next {
|
||||
| number[]
|
||||
| string
|
||||
| string[];
|
||||
},
|
||||
}
|
||||
): Promise<string>;
|
||||
renderErrorToHTML(
|
||||
err: any,
|
||||
@@ -120,13 +159,13 @@ declare namespace next {
|
||||
| number[]
|
||||
| string
|
||||
| string[];
|
||||
},
|
||||
}
|
||||
): Promise<string>;
|
||||
|
||||
serveStatic(
|
||||
req: http.IncomingMessage,
|
||||
res: http.ServerResponse,
|
||||
path: string,
|
||||
path: string
|
||||
): Promise<void>;
|
||||
isServeableUrl(path: string): boolean;
|
||||
isInternalUrl(req: http.IncomingMessage): boolean;
|
||||
@@ -135,12 +174,12 @@ declare namespace next {
|
||||
getCompilationError(
|
||||
page: string,
|
||||
req: http.IncomingMessage,
|
||||
res: http.ServerResponse,
|
||||
res: http.ServerResponse
|
||||
): Promise<any>;
|
||||
handleBuildHash(
|
||||
filename: string,
|
||||
hash: string,
|
||||
res: http.ServerResponse,
|
||||
res: http.ServerResponse
|
||||
): void;
|
||||
send404(res: http.ServerResponse): void;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
import * as React from "react";
|
||||
import App, { Container } from "next/app";
|
||||
|
||||
interface NextComponentProps {
|
||||
example: string;
|
||||
}
|
||||
|
||||
class TestApp extends App<NextComponentProps> {
|
||||
static async getInitialProps({ Component, router, ctx }: any) {
|
||||
let pageProps = {};
|
||||
|
||||
if (Component.getInitialProps) {
|
||||
pageProps = await Component.getInitialProps(ctx);
|
||||
}
|
||||
|
||||
return { pageProps };
|
||||
}
|
||||
|
||||
render() {
|
||||
const { Component, pageProps } = this.props;
|
||||
return (
|
||||
<Container>
|
||||
<Component {...pageProps} />
|
||||
</Container>
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
import * as React from "react";
|
||||
import { NextStatelessComponent, NextContext } from "next";
|
||||
|
||||
interface NextComponentProps {
|
||||
example: string;
|
||||
}
|
||||
|
||||
class ClassNext extends React.Component<NextComponentProps> {
|
||||
static async getInitialProps(ctx: NextContext) {
|
||||
const { example } = ctx.query;
|
||||
return { example };
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<div>I'm a class component! {this.props.example}</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
const StatelessNext: NextStatelessComponent<NextComponentProps> = ({ example }) => (
|
||||
<div>I'm a stateless component! {example}</div>
|
||||
);
|
||||
|
||||
StatelessNext.getInitialProps = async ({ query }: NextContext) => {
|
||||
const { example } = query;
|
||||
return { example: example as string };
|
||||
};
|
||||
@@ -1,12 +1,40 @@
|
||||
import Document, * as document from "next/document";
|
||||
import Document, { Head, Main, NextScript, NextDocumentContext } from 'next/document';
|
||||
import * as React from "react";
|
||||
|
||||
const results = (
|
||||
<Document any="property" should="work" here>
|
||||
<document.Head some="more" properties>
|
||||
<Head some="more" properties>
|
||||
<meta name="description" content="Head can have children, too!" />
|
||||
</document.Head>
|
||||
<document.Main />
|
||||
<document.NextScript />
|
||||
</Head>
|
||||
<Main />
|
||||
<NextScript />
|
||||
</Document>
|
||||
);
|
||||
|
||||
const Wrapper: React.SFC = ({ children }) => <React.Fragment>{children}</React.Fragment>;
|
||||
|
||||
export default class MyDocument extends Document {
|
||||
static async getInitialProps({ renderPage }: NextDocumentContext) {
|
||||
// Without callback
|
||||
const page = renderPage();
|
||||
// With callback
|
||||
const differentPage = renderPage(App => props => <Wrapper><App {...props} /></Wrapper>);
|
||||
const style = {};
|
||||
return { ...page, style };
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<html>
|
||||
<Head>
|
||||
<title>My page</title>
|
||||
<style id='cxs-style' dangerouslySetInnerHTML={{ __html: this.props.style }} />
|
||||
</Head>
|
||||
<body>
|
||||
<Main />
|
||||
<NextScript />
|
||||
</body>
|
||||
</html>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"app.d.ts",
|
||||
"document.d.ts",
|
||||
"dynamic.d.ts",
|
||||
"error.d.ts",
|
||||
@@ -28,11 +29,13 @@
|
||||
"router.d.ts",
|
||||
"config.d.ts",
|
||||
"test/next-tests.ts",
|
||||
"test/next-app-tests.tsx",
|
||||
"test/next-error-tests.tsx",
|
||||
"test/next-head-tests.tsx",
|
||||
"test/next-document-tests.tsx",
|
||||
"test/next-link-tests.tsx",
|
||||
"test/next-dynamic-tests.tsx",
|
||||
"test/next-router-tests.tsx"
|
||||
"test/next-router-tests.tsx",
|
||||
"test/next-component-tests.tsx"
|
||||
]
|
||||
}
|
||||
|
||||
Vendored
+33
-23
@@ -24,6 +24,7 @@
|
||||
// Hoàng Văn Khải <https://github.com/KSXGitHub>
|
||||
// Alexander T. <https://github.com/a-tarasyuk>
|
||||
// Lishude <https://github.com/islishude>
|
||||
// Andrew Makarov <https://github.com/r3nya>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/** inspector module types */
|
||||
@@ -2540,6 +2541,12 @@ declare module "dns" {
|
||||
export function __promisify__(hostname: string, options?: LookupOptions | number): Promise<{ address: string | LookupAddress[], family?: number }>;
|
||||
}
|
||||
|
||||
export function lookupService(address: string, port: number, callback: (err: NodeJS.ErrnoException, hostname: string, service: string) => void): void;
|
||||
|
||||
export namespace lookupService {
|
||||
export function __promisify__(address: string, port: number): Promise<{ hostname: string, service: string }>;
|
||||
}
|
||||
|
||||
export interface ResolveOptions {
|
||||
ttl: boolean;
|
||||
}
|
||||
@@ -6849,12 +6856,15 @@ declare module "http2" {
|
||||
import { IncomingHttpHeaders as Http1IncomingHttpHeaders, OutgoingHttpHeaders } from "http";
|
||||
export { OutgoingHttpHeaders } from "http";
|
||||
|
||||
export interface IncomingHttpStatusHeader {
|
||||
":status"?: number;
|
||||
}
|
||||
|
||||
export interface IncomingHttpHeaders extends Http1IncomingHttpHeaders {
|
||||
':path'?: string;
|
||||
':method'?: string;
|
||||
':status'?: string;
|
||||
':authority'?: string;
|
||||
':scheme'?: string;
|
||||
":path"?: string;
|
||||
":method"?: string;
|
||||
":authority"?: string;
|
||||
":scheme"?: string;
|
||||
}
|
||||
|
||||
// Http2Stream
|
||||
@@ -7001,34 +7011,34 @@ declare module "http2" {
|
||||
|
||||
export interface ClientHttp2Stream extends Http2Stream {
|
||||
addListener(event: string, listener: (...args: any[]) => void): this;
|
||||
addListener(event: "headers", listener: (headers: IncomingHttpHeaders, flags: number) => void): this;
|
||||
addListener(event: "headers", listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this;
|
||||
addListener(event: "push", listener: (headers: IncomingHttpHeaders, flags: number) => void): this;
|
||||
addListener(event: "response", listener: (headers: IncomingHttpHeaders, flags: number) => void): this;
|
||||
addListener(event: "response", listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this;
|
||||
|
||||
emit(event: string | symbol, ...args: any[]): boolean;
|
||||
emit(event: "headers", headers: IncomingHttpHeaders, flags: number): boolean;
|
||||
emit(event: "headers", headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number): boolean;
|
||||
emit(event: "push", headers: IncomingHttpHeaders, flags: number): boolean;
|
||||
emit(event: "response", headers: IncomingHttpHeaders, flags: number): boolean;
|
||||
emit(event: "response", headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number): boolean;
|
||||
|
||||
on(event: string, listener: (...args: any[]) => void): this;
|
||||
on(event: "headers", listener: (headers: IncomingHttpHeaders, flags: number) => void): this;
|
||||
on(event: "headers", listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this;
|
||||
on(event: "push", listener: (headers: IncomingHttpHeaders, flags: number) => void): this;
|
||||
on(event: "response", listener: (headers: IncomingHttpHeaders, flags: number) => void): this;
|
||||
on(event: "response", listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this;
|
||||
|
||||
once(event: string, listener: (...args: any[]) => void): this;
|
||||
once(event: "headers", listener: (headers: IncomingHttpHeaders, flags: number) => void): this;
|
||||
once(event: "headers", listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this;
|
||||
once(event: "push", listener: (headers: IncomingHttpHeaders, flags: number) => void): this;
|
||||
once(event: "response", listener: (headers: IncomingHttpHeaders, flags: number) => void): this;
|
||||
once(event: "response", listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this;
|
||||
|
||||
prependListener(event: string, listener: (...args: any[]) => void): this;
|
||||
prependListener(event: "headers", listener: (headers: IncomingHttpHeaders, flags: number) => void): this;
|
||||
prependListener(event: "headers", listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this;
|
||||
prependListener(event: "push", listener: (headers: IncomingHttpHeaders, flags: number) => void): this;
|
||||
prependListener(event: "response", listener: (headers: IncomingHttpHeaders, flags: number) => void): this;
|
||||
prependListener(event: "response", listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this;
|
||||
|
||||
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
||||
prependOnceListener(event: "headers", listener: (headers: IncomingHttpHeaders, flags: number) => void): this;
|
||||
prependOnceListener(event: "headers", listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this;
|
||||
prependOnceListener(event: "push", listener: (headers: IncomingHttpHeaders, flags: number) => void): this;
|
||||
prependOnceListener(event: "response", listener: (headers: IncomingHttpHeaders, flags: number) => void): this;
|
||||
prependOnceListener(event: "response", listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this;
|
||||
}
|
||||
|
||||
export interface ServerHttp2Stream extends Http2Stream {
|
||||
@@ -7156,32 +7166,32 @@ declare module "http2" {
|
||||
addListener(event: string, listener: (...args: any[]) => void): this;
|
||||
addListener(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this;
|
||||
addListener(event: "connect", listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this;
|
||||
addListener(event: "stream", listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this;
|
||||
addListener(event: "stream", listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this;
|
||||
|
||||
emit(event: string | symbol, ...args: any[]): boolean;
|
||||
emit(event: "altsvc", alt: string, origin: string, stream: number): boolean;
|
||||
emit(event: "connect", session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket): boolean;
|
||||
emit(event: "stream", stream: ClientHttp2Stream, headers: IncomingHttpHeaders, flags: number): boolean;
|
||||
emit(event: "stream", stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number): boolean;
|
||||
|
||||
on(event: string, listener: (...args: any[]) => void): this;
|
||||
on(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this;
|
||||
on(event: "connect", listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this;
|
||||
on(event: "stream", listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this;
|
||||
on(event: "stream", listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this;
|
||||
|
||||
once(event: string, listener: (...args: any[]) => void): this;
|
||||
once(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this;
|
||||
once(event: "connect", listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this;
|
||||
once(event: "stream", listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this;
|
||||
once(event: "stream", listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this;
|
||||
|
||||
prependListener(event: string, listener: (...args: any[]) => void): this;
|
||||
prependListener(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this;
|
||||
prependListener(event: "connect", listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this;
|
||||
prependListener(event: "stream", listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this;
|
||||
prependListener(event: "stream", listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this;
|
||||
|
||||
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
||||
prependOnceListener(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this;
|
||||
prependOnceListener(event: "connect", listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this;
|
||||
prependOnceListener(event: "stream", listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this;
|
||||
prependOnceListener(event: "stream", listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this;
|
||||
}
|
||||
|
||||
export interface AlternativeServiceOptions {
|
||||
|
||||
@@ -3114,6 +3114,12 @@ namespace dns_tests {
|
||||
const _family: number | undefined = family;
|
||||
});
|
||||
|
||||
dns.lookupService("127.0.0.1", 0, (err, hostname, service) => {
|
||||
const _err: NodeJS.ErrnoException = err;
|
||||
const _hostname: string = hostname;
|
||||
const _service: string = service;
|
||||
});
|
||||
|
||||
dns.resolve("nodejs.org", (err, addresses) => {
|
||||
const _addresses: string[] = addresses;
|
||||
});
|
||||
@@ -3561,7 +3567,9 @@ namespace http2_tests {
|
||||
let clientHttp2Stream: http2.ClientHttp2Stream;
|
||||
clientHttp2Stream.on('headers', (headers: http2.IncomingHttpHeaders, flags: number) => {});
|
||||
clientHttp2Stream.on('push', (headers: http2.IncomingHttpHeaders, flags: number) => {});
|
||||
clientHttp2Stream.on('response', (headers: http2.IncomingHttpHeaders, flags: number) => {});
|
||||
clientHttp2Stream.on('response', (headers: http2.IncomingHttpHeaders & http2.IncomingHttpStatusHeader, flags: number) => {
|
||||
const s: number = headers[':status'];
|
||||
});
|
||||
|
||||
// ServerHttp2Stream
|
||||
let serverHttp2Stream: http2.ServerHttp2Stream;
|
||||
|
||||
Vendored
+8
-1
@@ -3,6 +3,7 @@
|
||||
// Definitions by: Microsoft TypeScript <http://typescriptlang.org>
|
||||
// DefinitelyTyped <https://github.com/DefinitelyTyped/DefinitelyTyped>
|
||||
// Sebastian Silbermann <https://github.com/eps1lon>
|
||||
// Sander Koenders <https://github.com/Archcry>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/************************************************
|
||||
@@ -407,6 +408,10 @@ declare namespace NodeJS {
|
||||
isTTY?: true;
|
||||
}
|
||||
|
||||
export interface ProcessEnv {
|
||||
[key: string]: string | undefined;
|
||||
}
|
||||
|
||||
export interface Process extends EventEmitter {
|
||||
stdout: Socket;
|
||||
stderr: Socket;
|
||||
@@ -418,7 +423,7 @@ declare namespace NodeJS {
|
||||
chdir(directory: string): void;
|
||||
cwd(): string;
|
||||
debugPort: number;
|
||||
env: any;
|
||||
env: ProcessEnv;
|
||||
exit(code?: number): void;
|
||||
exitCode: number;
|
||||
getgid(): number;
|
||||
@@ -1445,6 +1450,8 @@ declare module "dns" {
|
||||
export function lookup(hostname: string, options: LookupOptions, callback: (err: NodeJS.ErrnoException, address: string | LookupAddress[], family: number) => void): void;
|
||||
export function lookup(hostname: string, callback: (err: NodeJS.ErrnoException, address: string, family: number) => void): void;
|
||||
|
||||
export function lookupService(address: string, port: number, callback: (err: NodeJS.ErrnoException, hostname: string, service: string) => void): void;
|
||||
|
||||
export interface MxRecord {
|
||||
priority: number;
|
||||
exchange: string;
|
||||
|
||||
@@ -734,19 +734,7 @@ namespace path_tests {
|
||||
// returns
|
||||
// ['foo', 'bar', 'baz']
|
||||
|
||||
console.log(process.env.PATH)
|
||||
// '/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin'
|
||||
|
||||
process.env.PATH.split(path.delimiter)
|
||||
// returns
|
||||
// ['/usr/bin', '/bin', '/usr/sbin', '/sbin', '/usr/local/bin']
|
||||
|
||||
console.log(process.env.PATH)
|
||||
// 'C:\Windows\system32;C:\Windows;C:\Program Files\nodejs\'
|
||||
|
||||
process.env.PATH.split(path.delimiter)
|
||||
// returns
|
||||
// ['C:\Windows\system32', 'C:\Windows', 'C:\Program Files\nodejs\']
|
||||
process.env["PATH"]; // $ExpectType string
|
||||
|
||||
path.parse('/home/user/dir/file.txt')
|
||||
// returns
|
||||
@@ -1196,6 +1184,12 @@ namespace dns_tests {
|
||||
const _family: number | undefined = family;
|
||||
});
|
||||
|
||||
dns.lookupService("127.0.0.1", 0, (err, hostname, service) => {
|
||||
const _err: NodeJS.ErrnoException = err;
|
||||
const _hostname: string = hostname;
|
||||
const _service: string = service;
|
||||
});
|
||||
|
||||
dns.resolve("nodejs.org", (err, addresses) => {
|
||||
const _addresses: string[] = addresses;
|
||||
});
|
||||
|
||||
Vendored
+8
-1
@@ -7,6 +7,7 @@
|
||||
// Sebastian Silbermann <https://github.com/eps1lon>
|
||||
// Alorel <https://github.com/Alorel>
|
||||
// Hoàng Văn Khải <https://github.com/KSXGitHub>
|
||||
// Sander Koenders <https://github.com/Archcry>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/************************************************
|
||||
@@ -460,6 +461,10 @@ declare namespace NodeJS {
|
||||
isTTY?: true;
|
||||
}
|
||||
|
||||
export interface ProcessEnv {
|
||||
[key: string]: string | undefined;
|
||||
}
|
||||
|
||||
export interface WriteStream extends Socket {
|
||||
columns?: number;
|
||||
rows?: number;
|
||||
@@ -482,7 +487,7 @@ declare namespace NodeJS {
|
||||
cwd(): string;
|
||||
debugPort: number;
|
||||
emitWarning(warning: string | Error, name?: string, ctor?: Function): void;
|
||||
env: any;
|
||||
env: ProcessEnv;
|
||||
exit(code?: number): void;
|
||||
exitCode: number;
|
||||
getgid(): number;
|
||||
@@ -2057,6 +2062,8 @@ declare module "dns" {
|
||||
export function lookup(hostname: string, options: LookupOptions, callback: (err: NodeJS.ErrnoException, address: string | LookupAddress[], family: number) => void): void;
|
||||
export function lookup(hostname: string, callback: (err: NodeJS.ErrnoException, address: string, family: number) => void): void;
|
||||
|
||||
export function lookupService(address: string, port: number, callback: (err: NodeJS.ErrnoException, hostname: string, service: string) => void): void;
|
||||
|
||||
export interface MxRecord {
|
||||
priority: number;
|
||||
exchange: string;
|
||||
|
||||
@@ -1364,19 +1364,7 @@ namespace path_tests {
|
||||
// returns
|
||||
// ['foo', 'bar', 'baz']
|
||||
|
||||
console.log(process.env.PATH)
|
||||
// '/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin'
|
||||
|
||||
process.env.PATH.split(path.delimiter)
|
||||
// returns
|
||||
// ['/usr/bin', '/bin', '/usr/sbin', '/sbin', '/usr/local/bin']
|
||||
|
||||
console.log(process.env.PATH)
|
||||
// 'C:\Windows\system32;C:\Windows;C:\Program Files\nodejs\'
|
||||
|
||||
process.env.PATH.split(path.delimiter)
|
||||
// returns
|
||||
// ['C:\Windows\system32', 'C:\Windows', 'C:\Program Files\nodejs\']
|
||||
process.env["PATH"]; // $ExpectType string
|
||||
|
||||
path.parse('/home/user/dir/file.txt')
|
||||
// returns
|
||||
@@ -2407,6 +2395,12 @@ namespace dns_tests {
|
||||
const _family: number | undefined = family;
|
||||
});
|
||||
|
||||
dns.lookupService("127.0.0.1", 0, (err, hostname, service) => {
|
||||
const _err: NodeJS.ErrnoException = err;
|
||||
const _hostname: string = hostname;
|
||||
const _service: string = service;
|
||||
});
|
||||
|
||||
dns.resolve("nodejs.org", (err, addresses) => {
|
||||
const _addresses: string[] = addresses;
|
||||
});
|
||||
|
||||
Vendored
+8
-1
@@ -7,6 +7,7 @@
|
||||
// Wilco Bakker <https://github.com/WilcoBakker>
|
||||
// Sebastian Silbermann <https://github.com/eps1lon>
|
||||
// Hoàng Văn Khải <https://github.com/KSXGitHub>
|
||||
// Sander Koenders <https://github.com/Archcry>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/************************************************
|
||||
@@ -456,6 +457,10 @@ declare namespace NodeJS {
|
||||
isTTY?: true;
|
||||
}
|
||||
|
||||
export interface ProcessEnv {
|
||||
[key: string]: string | undefined;
|
||||
}
|
||||
|
||||
export interface WriteStream extends Socket {
|
||||
columns?: number;
|
||||
rows?: number;
|
||||
@@ -479,7 +484,7 @@ declare namespace NodeJS {
|
||||
cwd(): string;
|
||||
debugPort: number;
|
||||
emitWarning(warning: string | Error, name?: string, ctor?: Function): void;
|
||||
env: any;
|
||||
env: ProcessEnv;
|
||||
exit(code?: number): never;
|
||||
exitCode: number;
|
||||
getgid(): number;
|
||||
@@ -2100,6 +2105,8 @@ declare module "dns" {
|
||||
export function lookup(hostname: string, options: LookupOptions, callback: (err: NodeJS.ErrnoException, address: string | LookupAddress[], family: number) => void): void;
|
||||
export function lookup(hostname: string, callback: (err: NodeJS.ErrnoException, address: string, family: number) => void): void;
|
||||
|
||||
export function lookupService(address: string, port: number, callback: (err: NodeJS.ErrnoException, hostname: string, service: string) => void): void;
|
||||
|
||||
export interface ResolveOptions {
|
||||
ttl: boolean;
|
||||
}
|
||||
|
||||
@@ -1346,19 +1346,7 @@ namespace path_tests {
|
||||
// returns
|
||||
// ['foo', 'bar', 'baz']
|
||||
|
||||
console.log(process.env.PATH)
|
||||
// '/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin'
|
||||
|
||||
process.env.PATH.split(path.delimiter)
|
||||
// returns
|
||||
// ['/usr/bin', '/bin', '/usr/sbin', '/sbin', '/usr/local/bin']
|
||||
|
||||
console.log(process.env.PATH)
|
||||
// 'C:\Windows\system32;C:\Windows;C:\Program Files\nodejs\'
|
||||
|
||||
process.env.PATH.split(path.delimiter)
|
||||
// returns
|
||||
// ['C:\Windows\system32', 'C:\Windows', 'C:\Program Files\nodejs\']
|
||||
process.env["PATH"]; // $ExpectType string
|
||||
|
||||
path.parse('/home/user/dir/file.txt')
|
||||
// returns
|
||||
@@ -2398,6 +2386,12 @@ namespace dns_tests {
|
||||
const _family: number | undefined = family;
|
||||
});
|
||||
|
||||
dns.lookupService("127.0.0.1", 0, (err, hostname, service) => {
|
||||
const _err: NodeJS.ErrnoException = err;
|
||||
const _hostname: string = hostname;
|
||||
const _service: string = service;
|
||||
});
|
||||
|
||||
dns.resolve("nodejs.org", (err, addresses) => {
|
||||
const _addresses: string[] = addresses;
|
||||
});
|
||||
|
||||
Vendored
+7
@@ -21,6 +21,7 @@
|
||||
// Bruno Scheufler <https://github.com/brunoscheufler>
|
||||
// Hoàng Văn Khải <https://github.com/KSXGitHub>
|
||||
// Lishude <https://github.com/islishude>
|
||||
// Andrew Makarov <https://github.com/r3nya>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.1
|
||||
|
||||
@@ -2444,6 +2445,12 @@ declare module "dns" {
|
||||
export function __promisify__(hostname: string, options?: LookupOptions | number): Promise<{ address: string | LookupAddress[], family?: number }>;
|
||||
}
|
||||
|
||||
export function lookupService(address: string, port: number, callback: (err: NodeJS.ErrnoException, hostname: string, service: string) => void): void;
|
||||
|
||||
export namespace lookupService {
|
||||
export function __promisify__(address: string, port: number): Promise<{ hostname: string, service: string }>;
|
||||
}
|
||||
|
||||
export interface ResolveOptions {
|
||||
ttl: boolean;
|
||||
}
|
||||
|
||||
@@ -3075,6 +3075,12 @@ namespace dns_tests {
|
||||
const _family: number | undefined = family;
|
||||
});
|
||||
|
||||
dns.lookupService("127.0.0.1", 0, (err, hostname, service) => {
|
||||
const _err: NodeJS.ErrnoException = err;
|
||||
const _hostname: string = hostname;
|
||||
const _service: string = service;
|
||||
});
|
||||
|
||||
dns.resolve("nodejs.org", (err, addresses) => {
|
||||
const _addresses: string[] = addresses;
|
||||
});
|
||||
|
||||
Vendored
+7
@@ -24,6 +24,7 @@
|
||||
// Hoàng Văn Khải <https://github.com/KSXGitHub>
|
||||
// Alexander T. <https://github.com/a-tarasyuk>
|
||||
// Lishude <https://github.com/islishude>
|
||||
// Andrew Makarov <https://github.com/r3nya>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/** inspector module types */
|
||||
@@ -2525,6 +2526,12 @@ declare module "dns" {
|
||||
export function __promisify__(hostname: string, options?: LookupOptions | number): Promise<{ address: string | LookupAddress[], family?: number }>;
|
||||
}
|
||||
|
||||
export function lookupService(address: string, port: number, callback: (err: NodeJS.ErrnoException, hostname: string, service: string) => void): void;
|
||||
|
||||
export namespace lookupService {
|
||||
export function __promisify__(address: string, port: number): Promise<{ hostname: string, service: string }>;
|
||||
}
|
||||
|
||||
export interface ResolveOptions {
|
||||
ttl: boolean;
|
||||
}
|
||||
|
||||
@@ -3108,6 +3108,12 @@ namespace dns_tests {
|
||||
const _family: number | undefined = family;
|
||||
});
|
||||
|
||||
dns.lookupService("127.0.0.1", 0, (err, hostname, service) => {
|
||||
const _err: NodeJS.ErrnoException = err;
|
||||
const _hostname: string = hostname;
|
||||
const _service: string = service;
|
||||
});
|
||||
|
||||
dns.resolve("nodejs.org", (err, addresses) => {
|
||||
const _addresses: string[] = addresses;
|
||||
});
|
||||
|
||||
Vendored
+211
-81
@@ -5851,7 +5851,7 @@ declare namespace Office {
|
||||
*
|
||||
* The prependAsync method inserts the specified string at the beginning of the item body. After insertion, the cursor is returned to its original place, relative to the inserted content.
|
||||
*
|
||||
* When including links in HTML markup, you can disable online link preview by setting the id attribute on the anchor (<a>) to LPNoLP.
|
||||
* When including links in HTML markup, you can disable online link preview by setting the id attribute on the anchor (<a>) to "LPNoLP" (please see the Examples section for a sample).
|
||||
*
|
||||
* [Api set: Mailbox 1.1]
|
||||
*
|
||||
@@ -5859,6 +5859,11 @@ declare namespace Office {
|
||||
* {@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}: ReadWriteItem
|
||||
* Applicable Outlook mode: Compose
|
||||
* Errors: DataExceedsMaximumSize - The data parameter is longer than 1,000,000 characters.
|
||||
*
|
||||
* In addition to the main signature, this method also has these signatures:
|
||||
* prependAsync(data: string, options: AsyncContextOptions & CoercionTypeOptions): void;
|
||||
* prependAsync(data: string, callback: (result: AsyncResult) => void): void;
|
||||
* prependAsync(data: string): void;
|
||||
*
|
||||
* @param data The string to be inserted at the beginning of the body. The string is limited to 1,000,000 characters.
|
||||
* @param options Optional. An object literal that contains one or more of the following properties.
|
||||
@@ -5872,7 +5877,7 @@ declare namespace Office {
|
||||
*
|
||||
* The prependAsync method inserts the specified string at the beginning of the item body. After insertion, the cursor is returned to its original place, relative to the inserted content.
|
||||
*
|
||||
* When including links in HTML markup, you can disable online link preview by setting the id attribute on the anchor (<a>) to LPNoLP.
|
||||
* When including links in HTML markup, you can disable online link preview by setting the id attribute on the anchor (<a>) to "LPNoLP" (please see the Examples section for a sample).
|
||||
*
|
||||
* [Api set: Mailbox 1.1]
|
||||
*
|
||||
@@ -5892,7 +5897,7 @@ declare namespace Office {
|
||||
*
|
||||
* The prependAsync method inserts the specified string at the beginning of the item body. After insertion, the cursor is returned to its original place, relative to the inserted content.
|
||||
*
|
||||
* When including links in HTML markup, you can disable online link preview by setting the id attribute on the anchor (<a>) to LPNoLP.
|
||||
* When including links in HTML markup, you can disable online link preview by setting the id attribute on the anchor (<a>) to "LPNoLP" (please see the Examples section for a sample).
|
||||
*
|
||||
* [Api set: Mailbox 1.1]
|
||||
*
|
||||
@@ -5910,7 +5915,7 @@ declare namespace Office {
|
||||
*
|
||||
* The prependAsync method inserts the specified string at the beginning of the item body. After insertion, the cursor is returned to its original place, relative to the inserted content.
|
||||
*
|
||||
* When including links in HTML markup, you can disable online link preview by setting the id attribute on the anchor (<a>) to LPNoLP.
|
||||
* When including links in HTML markup, you can disable online link preview by setting the id attribute on the anchor (<a>) to "LPNoLP" (please see the Examples section for a sample).
|
||||
*
|
||||
* [Api set: Mailbox 1.1]
|
||||
*
|
||||
@@ -5927,7 +5932,7 @@ declare namespace Office {
|
||||
*
|
||||
* When working with HTML-formatted bodies, it is important to note that the Body.getAsync and Body.setAsync methods are not idempotent. The value returned from the getAsync method will not necessarily be exactly the same as the value that was passed in the setAsync method previously. The client may modify the value passed to setAsync in order to make it render efficiently with its rendering engine.
|
||||
*
|
||||
* When including links in HTML markup, you can disable online link preview by setting the id attribute on the anchor (<a>) to LPNoLP.
|
||||
* When including links in HTML markup, you can disable online link preview by setting the id attribute on the anchor (<a>) to "LPNoLP" (please see the Examples section for a sample).
|
||||
*
|
||||
* [Api set: Mailbox 1.3]
|
||||
*
|
||||
@@ -5939,6 +5944,11 @@ declare namespace Office {
|
||||
* Errors: DataExceedsMaximumSize - The data parameter is longer than 1,000,000 characters.
|
||||
*
|
||||
* InvalidFormatError - The options.coercionType parameter is set to Office.CoercionType.Html and the message body is in plain text.
|
||||
*
|
||||
* In addition to the main signature, this method also has these signatures:
|
||||
* setAsync(data: string, options: AsyncContextOptions & CoercionTypeOptions): void;
|
||||
* setAsync(data: string, callback: (result: AsyncResult) => void): void;
|
||||
* setAsync(data: string): void; *
|
||||
*
|
||||
* @param data The string that will replace the existing body. The string is limited to 1,000,000 characters.
|
||||
* @param options Optional. An object literal that contains one or more of the following properties.
|
||||
@@ -5952,7 +5962,7 @@ declare namespace Office {
|
||||
*
|
||||
* When working with HTML-formatted bodies, it is important to note that the Body.getAsync and Body.setAsync methods are not idempotent. The value returned from the getAsync method will not necessarily be exactly the same as the value that was passed in the setAsync method previously. The client may modify the value passed to setAsync in order to make it render efficiently with its rendering engine.
|
||||
*
|
||||
* When including links in HTML markup, you can disable online link preview by setting the id attribute on the anchor (<a>) to LPNoLP.
|
||||
* When including links in HTML markup, you can disable online link preview by setting the id attribute on the anchor (<a>) to "LPNoLP" (please see the Examples section for a sample).
|
||||
*
|
||||
* [Api set: Mailbox 1.3]
|
||||
*
|
||||
@@ -5976,7 +5986,7 @@ declare namespace Office {
|
||||
*
|
||||
* When working with HTML-formatted bodies, it is important to note that the Body.getAsync and Body.setAsync methods are not idempotent. The value returned from the getAsync method will not necessarily be exactly the same as the value that was passed in the setAsync method previously. The client may modify the value passed to setAsync in order to make it render efficiently with its rendering engine.
|
||||
*
|
||||
* When including links in HTML markup, you can disable online link preview by setting the id attribute on the anchor (<a>) to LPNoLP.
|
||||
* When including links in HTML markup, you can disable online link preview by setting the id attribute on the anchor (<a>) to "LPNoLP" (please see the Examples section for a sample).
|
||||
*
|
||||
* [Api set: Mailbox 1.3]
|
||||
*
|
||||
@@ -5998,7 +6008,7 @@ declare namespace Office {
|
||||
*
|
||||
* When working with HTML-formatted bodies, it is important to note that the Body.getAsync and Body.setAsync methods are not idempotent. The value returned from the getAsync method will not necessarily be exactly the same as the value that was passed in the setAsync method previously. The client may modify the value passed to setAsync in order to make it render efficiently with its rendering engine.
|
||||
*
|
||||
* When including links in HTML markup, you can disable online link preview by setting the id attribute on the anchor (<a>) to LPNoLP.
|
||||
* When including links in HTML markup, you can disable online link preview by setting the id attribute on the anchor (<a>) to "LPNoLP" (please see the Examples section for a sample).
|
||||
*
|
||||
* [Api set: Mailbox 1.3]
|
||||
*
|
||||
@@ -6020,7 +6030,7 @@ declare namespace Office {
|
||||
*
|
||||
* The setSelectedDataAsync method inserts the specified string at the cursor location in the body of the item, or, if text is selected in the editor, it replaces the selected text. If the cursor was never in the body of the item, or if the body of the item lost focus in the UI, the string will be inserted at the top of the body content. After insertion, the cursor is placed at the end of the inserted content.
|
||||
*
|
||||
* When including links in HTML markup, you can disable online link preview by setting the id attribute on the anchor (<a>) to LPNoLP.
|
||||
* When including links in HTML markup, you can disable online link preview by setting the id attribute on the anchor (<a>) to "LPNoLP" (please see the Examples section for a sample).
|
||||
*
|
||||
* [Api set: Mailbox 1.1]
|
||||
*
|
||||
@@ -6032,7 +6042,12 @@ declare namespace Office {
|
||||
* Errors: DataExceedsMaximumSize - The data parameter is longer than 1,000,000 characters.
|
||||
*
|
||||
* InvalidFormatError - The options.coercionType parameter is set to Office.CoercionType.Html and the message body is in plain text.
|
||||
*
|
||||
*
|
||||
* In addition to the main signature, this method also has these signatures:
|
||||
* setSelectedDataAsync(data: string, options: AsyncContextOptions & CoercionTypeOptions): void;
|
||||
* setSelectedDataAsync(data: string, callback: (result: AsyncResult) => void): void;
|
||||
* setSelectedDataAsync(data: string): void; *
|
||||
* *
|
||||
* @param data The string that will replace the existing body. The string is limited to 1,000,000 characters.
|
||||
* @param options Optional. An object literal that contains one or more of the following properties.
|
||||
* asyncContext: Developers can provide any object they wish to access in the callback method.
|
||||
@@ -6045,7 +6060,7 @@ declare namespace Office {
|
||||
*
|
||||
* The setSelectedDataAsync method inserts the specified string at the cursor location in the body of the item, or, if text is selected in the editor, it replaces the selected text. If the cursor was never in the body of the item, or if the body of the item lost focus in the UI, the string will be inserted at the top of the body content. After insertion, the cursor is placed at the end of the inserted content.
|
||||
*
|
||||
* When including links in HTML markup, you can disable online link preview by setting the id attribute on the anchor (<a>) to LPNoLP.
|
||||
* When including links in HTML markup, you can disable online link preview by setting the id attribute on the anchor (<a>) to "LPNoLP" (please see the Examples section for a sample).
|
||||
*
|
||||
* [Api set: Mailbox 1.1]
|
||||
*
|
||||
@@ -6069,7 +6084,7 @@ declare namespace Office {
|
||||
*
|
||||
* The setSelectedDataAsync method inserts the specified string at the cursor location in the body of the item, or, if text is selected in the editor, it replaces the selected text. If the cursor was never in the body of the item, or if the body of the item lost focus in the UI, the string will be inserted at the top of the body content. After insertion, the cursor is placed at the end of the inserted content.
|
||||
*
|
||||
* When including links in HTML markup, you can disable online link preview by setting the id attribute on the anchor (<a>) to LPNoLP.
|
||||
* When including links in HTML markup, you can disable online link preview by setting the id attribute on the anchor (<a>) to "LPNoLP" (please see the Examples section for a sample).
|
||||
*
|
||||
* [Api set: Mailbox 1.1]
|
||||
*
|
||||
@@ -6091,7 +6106,7 @@ declare namespace Office {
|
||||
*
|
||||
* The setSelectedDataAsync method inserts the specified string at the cursor location in the body of the item, or, if text is selected in the editor, it replaces the selected text. If the cursor was never in the body of the item, or if the body of the item lost focus in the UI, the string will be inserted at the top of the body content. After insertion, the cursor is placed at the end of the inserted content.
|
||||
*
|
||||
* When including links in HTML markup, you can disable online link preview by setting the id attribute on the anchor (<a>) to LPNoLP.
|
||||
* When including links in HTML markup, you can disable online link preview by setting the id attribute on the anchor (<a>) to "LPNoLP" (please see the Examples section for a sample).
|
||||
*
|
||||
* [Api set: Mailbox 1.1]
|
||||
*
|
||||
@@ -6410,6 +6425,9 @@ declare namespace Office {
|
||||
*
|
||||
* Applicable Outlook mode: Compose
|
||||
*
|
||||
* In addition to this signature, the method also has the following signatures:
|
||||
* getAsync(callback?: (result: AsyncResult) => void): void;
|
||||
*
|
||||
* @param options An object literal that contains one or more of the following properties.
|
||||
* asyncContext: Developers can provide any object they wish to access in the callback method.
|
||||
* @param callback When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object.
|
||||
@@ -6899,6 +6917,9 @@ declare namespace Office {
|
||||
*
|
||||
* Applicable Outlook mode: Compose or read
|
||||
*
|
||||
* In addition to this signature, the method also has the following signatures:
|
||||
* addHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void;
|
||||
*
|
||||
* @param eventType The event that should invoke the handler.
|
||||
* @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to addHandlerAsync.
|
||||
* @param options Optional. An object literal that contains one or more of the following properties.
|
||||
@@ -6959,6 +6980,9 @@ declare namespace Office {
|
||||
*
|
||||
* Applicable Outlook mode: Compose or read
|
||||
*
|
||||
* In addition to this signature, the method also has the following signatures:
|
||||
* removeHandlerAsync(eventType:EventType, handler: any, callback?: (result: AsyncResult) => void): void;
|
||||
*
|
||||
* @param eventType The event that should invoke the handler.
|
||||
* @param handler The function to handle the event. The function must accept a single parameter, which is an object literal. The type property on the parameter will match the eventType parameter passed to removeHandlerAsync.
|
||||
* @param options Optional. An object literal that contains one or more of the following properties.
|
||||
@@ -7027,6 +7051,11 @@ declare namespace Office {
|
||||
* FileTypeNotSupported - The attachment has an extension that is not allowed.
|
||||
*
|
||||
* NumberOfAttachmentsExceeded - The message or appointment has too many attachments.
|
||||
*
|
||||
* In addition to this signature, the method also has the following signatures:
|
||||
* addFileAttachmentAsync(uri: string, attachmentName: string): void;
|
||||
* addFileAttachmentAsync(uri: string, attachmentName: string, options: AsyncContextOptions): void;
|
||||
* addFileAttachmentAsync(uri: string, attachmentName: string, callback: (result: AsyncResult) => void): void;
|
||||
*
|
||||
* @param uri The URI that provides the location of the file to attach to the message or appointment. The maximum length is 2048 characters.
|
||||
* @param attachmentName The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters.
|
||||
@@ -7138,6 +7167,11 @@ declare namespace Office {
|
||||
* Errors:
|
||||
*
|
||||
* NumberOfAttachmentsExceeded - The message or appointment has too many attachments.
|
||||
*
|
||||
* In addition to the main signature, this method also has these signatures:
|
||||
* addItemAttachmentAsync(itemId: any, attachmentName: string): void;
|
||||
* addItemAttachmentAsync(itemId: any, attachmentName: string, options: AsyncContextOptions): void;
|
||||
* addItemAttachmentAsync(itemId: any, attachmentName: string, callback: (result: AsyncResult) => void): void;
|
||||
*
|
||||
* @param itemId The Exchange identifier of the item to attach. The maximum length is 100 characters.
|
||||
* @param attachmentName The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters.
|
||||
@@ -7260,7 +7294,34 @@ declare namespace Office {
|
||||
* @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. On success, the initialization data is provided in the asyncResult.value property as a string. If there is no initialization context, the asyncResult object will contain an Error object with its code property set to 9020 and its name property set to GenericResponseError.
|
||||
*/
|
||||
getInitializationContextAsync(options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void;
|
||||
/**
|
||||
/**
|
||||
* Asynchronously returns selected data from the subject or body of a message.
|
||||
*
|
||||
* If there is no selection but the cursor is in the body or subject, the method returns null for the selected data. If a field other than the body or subject is selected, the method returns the InvalidSelection error.
|
||||
*
|
||||
* To access the selected data from the callback method, call asyncResult.value.data. To access the source property that the selection comes from, call asyncResult.value.sourceProperty, which will be either body or subject.
|
||||
*
|
||||
* [Api set: Mailbox 1.0]
|
||||
*
|
||||
* @returns
|
||||
* The selected data as a string with format determined by coercionType.
|
||||
*
|
||||
* @remarks
|
||||
*
|
||||
* {@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}: ReadWriteItem
|
||||
*
|
||||
* Applicable Outlook mode: Compose
|
||||
*
|
||||
* In addition to this signature, the method also has these signatures:
|
||||
* getSelectedDataAsync(coercionType: CoercionType, callback: (result: AsyncResult) => void): void;
|
||||
*
|
||||
* @param coercionType Requests a format for the data. If Text, the method returns the plain text as a string , removing any HTML tags present. If HTML, the method returns the selected text, whether it is plaintext or HTML.
|
||||
* @param options An object literal that contains one or more of the following properties.
|
||||
* asyncContext: Developers can provide any object they wish to access in the callback method.
|
||||
* @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult.
|
||||
*/
|
||||
getSelectedDataAsync(coercionType: CoercionType, options: AsyncContextOptions, callback: (result: AsyncResult) => void): void;
|
||||
/**
|
||||
* Asynchronously returns selected data from the subject or body of a message.
|
||||
*
|
||||
* If there is no selection but the cursor is in the body or subject, the method returns null for the selected data. If a field other than the body or subject is selected, the method returns the InvalidSelection error.
|
||||
@@ -7282,30 +7343,6 @@ declare namespace Office {
|
||||
* @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult.
|
||||
*/
|
||||
getSelectedDataAsync(coercionType: CoercionType, callback: (result: AsyncResult) => void): void;
|
||||
/**
|
||||
* Asynchronously returns selected data from the subject or body of a message.
|
||||
*
|
||||
* If there is no selection but the cursor is in the body or subject, the method returns null for the selected data. If a field other than the body or subject is selected, the method returns the InvalidSelection error.
|
||||
*
|
||||
* To access the selected data from the callback method, call asyncResult.value.data. To access the source property that the selection comes from, call asyncResult.value.sourceProperty, which will be either body or subject.
|
||||
*
|
||||
* [Api set: Mailbox 1.0]
|
||||
*
|
||||
* @returns
|
||||
* The selected data as a string with format determined by coercionType.
|
||||
*
|
||||
* @remarks
|
||||
*
|
||||
* {@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}: ReadWriteItem
|
||||
*
|
||||
* Applicable Outlook mode: Compose
|
||||
*
|
||||
* @param coercionType Requests a format for the data. If Text, the method returns the plain text as a string , removing any HTML tags present. If HTML, the method returns the selected text, whether it is plaintext or HTML.
|
||||
* @param options An object literal that contains one or more of the following properties.
|
||||
* asyncContext: Developers can provide any object they wish to access in the callback method.
|
||||
* @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult.
|
||||
*/
|
||||
getSelectedDataAsync(coercionType: CoercionType, options: AsyncContextOptions, callback: (result: AsyncResult) => void): void;
|
||||
/**
|
||||
* Removes an attachment from a message or appointment.
|
||||
*
|
||||
@@ -7320,6 +7357,11 @@ declare namespace Office {
|
||||
* Applicable Outlook mode: Compose
|
||||
*
|
||||
* Errors: InvalidAttachmentId - The attachment identifier does not exist.
|
||||
*
|
||||
* In addition to this signature, the method also has the following signatures:
|
||||
* removeAttachmentAsync(attachmentIndex: string): void;
|
||||
* removeAttachmentAsync(attachmentIndex: string, options: AsyncContextOptions): void;
|
||||
* removeAttachmentAsync(attachmentIndex: string, callback: (result: AsyncResult) => void): void;
|
||||
*
|
||||
* @param attachmentIndex The identifier of the attachment to remove. The maximum length of the string is 100 characters.
|
||||
* @param options Optional. An object literal that contains one or more of the following properties.
|
||||
@@ -7409,6 +7451,11 @@ declare namespace Office {
|
||||
* Applicable Outlook mode: Compose
|
||||
*
|
||||
* Errors: InvalidAttachmentId - The attachment identifier does not exist.
|
||||
*
|
||||
* In addition to this signature, the method also has the following signatures:
|
||||
* saveAsync(): void;
|
||||
* saveAsync(options: AsyncContextOptions): void;
|
||||
* saveAsync(callback: (result: AsyncResult) => void): void;
|
||||
*
|
||||
* @param options Optional. An object literal that contains one or more of the following properties.
|
||||
* asyncContext: Developers can provide any object they wish to access in the callback method.
|
||||
@@ -7513,8 +7560,13 @@ declare namespace Office {
|
||||
* Applicable Outlook mode: Compose
|
||||
*
|
||||
* Errors: InvalidAttachmentId - The attachment identifier does not exist.
|
||||
*
|
||||
* In addition to this signature, the method also has the following signatures:
|
||||
* setSelectedDataAsync(data: string): void;
|
||||
* setSelectedDataAsync(data: string, options: AsyncContextOptions & CoercionTypeOptions): void;
|
||||
* setSelectedDataAsync(data: string, callback: (result: AsyncResult) => void): void;
|
||||
*
|
||||
* @param data The data to be inserted. Data is not to exceed 1,000,000 characters. If more than 1,000,000 characters are passed in, an ArgumentOutOfRange exception is thrown.
|
||||
* @param data The data to be inserted. Data is not to exceed 1,000,000 characters. If more than 1,000,000 characters are passed in, an ArgumentOutOfRange exception is thrown.
|
||||
* @param options Optional. An object literal that contains one or more of the following properties.
|
||||
* asyncContext: Developers can provide any object they wish to access in the callback method.
|
||||
* coercionType: If text, the current style is applied in Outlook Web App and Outlook. If the field is an HTML editor, only the text data is inserted, even if the data is HTML. If html and the field supports HTML (the subject doesn't), the current style is applied in Outlook Web App and the default style is applied in Outlook. If the field is a text field, an InvalidDataFormat error is returned. If coercionType is not set, the result depends on the field: if the field is HTML then HTML is used; if the field is text, then plain text is used.
|
||||
@@ -7726,6 +7778,9 @@ declare namespace Office {
|
||||
*
|
||||
* Applicable Outlook mode: Read
|
||||
*
|
||||
* In addition to this signature, the method also has the following signatures:
|
||||
* getInitializationContextAsync(callback?: (result: AsyncResult) => void): void;
|
||||
*
|
||||
* @param options Optional. An object literal that contains one or more of the following properties.
|
||||
* asyncContext: Developers can provide any object they wish to access in the callback method.
|
||||
* @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object. On success, the initialization data is provided in the asyncResult.value property as a string. If there is no initialization context, the asyncResult object will contain an Error object with its code property set to 9020 and its name property set to GenericResponseError.
|
||||
@@ -8129,6 +8184,10 @@ declare namespace Office {
|
||||
* {@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}: ReadItem
|
||||
*
|
||||
* Applicable Outlook mode: Compose
|
||||
*
|
||||
* In addition to this signature, the method also has the following signatures:
|
||||
* getAsync(callback: (result: AsyncResult) => void): void;
|
||||
*
|
||||
*/
|
||||
getAsync(options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void;
|
||||
/**
|
||||
@@ -8164,6 +8223,11 @@ declare namespace Office {
|
||||
* Applicable Outlook mode: Compose
|
||||
*
|
||||
* Errors: DataExceedsMaximumSize - The location parameter is longer than 255 characters.
|
||||
*
|
||||
* In addition to this signature, the method also has the following signatures:
|
||||
* setAsync(location: string): void;
|
||||
* setAsync(location: string, options: AsyncContextOptions): void;
|
||||
* setAsync(location: string, callback: (result: AsyncResult) => void): void;
|
||||
*/
|
||||
setAsync(location: string, options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void;
|
||||
/**
|
||||
@@ -8220,7 +8284,6 @@ declare namespace Office {
|
||||
* Errors: DataExceedsMaximumSize - The location parameter is longer than 255 characters.
|
||||
*/
|
||||
setAsync(location: string, callback: (result: AsyncResult) => void): void;
|
||||
|
||||
}
|
||||
/**
|
||||
* Provides access to the Outlook Add-in object model for Microsoft Outlook and Microsoft Outlook on the web.
|
||||
@@ -8504,6 +8567,10 @@ declare namespace Office {
|
||||
* {@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}: ReadItem
|
||||
*
|
||||
* Applicable Outlook mode: Compose and read
|
||||
*
|
||||
* In addition to this signature, the method has the following signature:
|
||||
* getCallbackTokenAsync(callback: (result: AsyncResult) => void): void;
|
||||
* getCallbackTokenAsync(callback: (result: AsyncResult) => void, userContext?: any): void;
|
||||
*
|
||||
* @param options An object literal that contains one or more of the following properties.
|
||||
* isRest: Determines if the token provided will be used for the Outlook REST APIs or Exchange Web Services. Default value is false.
|
||||
@@ -8717,6 +8784,12 @@ declare namespace Office {
|
||||
* {@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}: ReadItem
|
||||
*
|
||||
* Applicable Outlook mode: Compose or read
|
||||
*
|
||||
* In addition to this signature, the method also has the following signatures:
|
||||
* addAsync(key: string, JSONmessage: NotificationMessageDetails): void;
|
||||
* addAsync(key: string, JSONmessage: NotificationMessageDetails, options: AsyncContextOptions): void;
|
||||
* addAsync(key: string, JSONmessage: NotificationMessageDetails, callback: (result: AsyncResult) => void): void;
|
||||
*
|
||||
*/
|
||||
addAsync(key: string, JSONmessage: NotificationMessageDetails, options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void;
|
||||
/**
|
||||
@@ -8779,6 +8852,9 @@ declare namespace Office {
|
||||
* {@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}: ReadItem
|
||||
*
|
||||
* Applicable Outlook mode: Compose or read
|
||||
*
|
||||
* In addition to the main signature, this method also has these signatures:
|
||||
* getAllAsync(callback: (result: AsyncResult) => void): void;
|
||||
*
|
||||
* @param options Optional. An object literal that contains one or more of the following properties.
|
||||
* asyncContext: Developers can provide any object they wish to access in the callback method.
|
||||
@@ -8807,6 +8883,11 @@ declare namespace Office {
|
||||
* {@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}: ReadItem
|
||||
*
|
||||
* Applicable Outlook mode: Compose or read
|
||||
*
|
||||
* In addition to the main signature, this method also has these signatures:
|
||||
* removeAsync(key: string): void;
|
||||
* removeAsync(key: string, options: AsyncContextOptions): void;
|
||||
* removeAsync(key: string, callback: (result: AsyncResult) => void): void; *
|
||||
*
|
||||
* @param key The key for the notification message to remove.
|
||||
* @param options Optional. An object literal that contains one or more of the following properties.
|
||||
@@ -8867,6 +8948,11 @@ declare namespace Office {
|
||||
* {@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}: ReadItem
|
||||
*
|
||||
* Applicable Outlook mode: Compose or read
|
||||
*
|
||||
* In addition to the main signature, this method also has these signatures:
|
||||
* replaceAsync(key: string, JSONmessage: NotificationMessageDetails): void;
|
||||
* replaceAsync(key: string, JSONmessage: NotificationMessageDetails, options: AsyncContextOptions): void;
|
||||
* replaceAsync(key: string, JSONmessage: NotificationMessageDetails, callback: (result: AsyncResult) => void): void;
|
||||
*
|
||||
* @param key The key for the notification message to replace. It can't be longer than 32 characters.
|
||||
* @param JSONmessage A JSON object that contains the new notification message to replace the existing message. It contains a NotificationMessageDetails object.
|
||||
@@ -8981,6 +9067,11 @@ declare namespace Office {
|
||||
* Applicable Outlook mode: Compose
|
||||
*
|
||||
* Errors: NumberOfRecipientsExceeded - The number of recipients exceeded 100 entries.
|
||||
*
|
||||
* In addition to the main signature, this method also has these signatures:
|
||||
* addAsync(recipients: (string | EmailUser | EmailAddressDetails)[]): void;
|
||||
* addAsync(recipients: (string | EmailUser | EmailAddressDetails)[], options: AsyncContextOptions): void;
|
||||
* addAsync(recipients: (string | EmailUser | EmailAddressDetails)[], callback: (result: AsyncResult) => void): void;
|
||||
*
|
||||
* @param recipients The recipients to add to the recipients list.
|
||||
* @param options Optional. An object literal that contains one or more of the following properties.
|
||||
@@ -9060,7 +9151,26 @@ declare namespace Office {
|
||||
* @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult. If adding the recipients fails, the asyncResult.error property will contain an error code.
|
||||
*/
|
||||
addAsync(recipients: (string | EmailUser | EmailAddressDetails)[], callback: (result: AsyncResult) => void): void;
|
||||
|
||||
/**
|
||||
* Gets a recipient list for an appointment or message.
|
||||
*
|
||||
* When the call completes, the asyncResult.value property will contain an array of EmailAddressDetails objects.
|
||||
*
|
||||
* [Api set: Mailbox 1.1]
|
||||
*
|
||||
* @remarks
|
||||
* {@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}: ReadItem
|
||||
*
|
||||
* Applicable Outlook mode: Compose
|
||||
*
|
||||
* In addition to the main signature, this method also has these signatures:
|
||||
* getAsync(callback: (result: AsyncResult) => void): void;
|
||||
*
|
||||
* @param options An object literal that contains one or more of the following properties.
|
||||
* asyncContext: Developers can provide any object they wish to access in the callback method.
|
||||
* @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult.
|
||||
*/
|
||||
getAsync(options: AsyncContextOptions, callback: (result: AsyncResult) => void): void;
|
||||
/**
|
||||
* Gets a recipient list for an appointment or message.
|
||||
*
|
||||
@@ -9076,23 +9186,6 @@ declare namespace Office {
|
||||
* @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult.
|
||||
*/
|
||||
getAsync(callback: (result: AsyncResult) => void): void;
|
||||
/**
|
||||
* Gets a recipient list for an appointment or message.
|
||||
*
|
||||
* When the call completes, the asyncResult.value property will contain an array of EmailAddressDetails objects.
|
||||
*
|
||||
* [Api set: Mailbox 1.1]
|
||||
*
|
||||
* @remarks
|
||||
* {@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}: ReadItem
|
||||
*
|
||||
* Applicable Outlook mode: Compose
|
||||
*
|
||||
* @param options An object literal that contains one or more of the following properties.
|
||||
* asyncContext: Developers can provide any object they wish to access in the callback method.
|
||||
* @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult.
|
||||
*/
|
||||
getAsync(options: AsyncContextOptions, callback: (result: AsyncResult) => void): void;
|
||||
/**
|
||||
* Sets a recipient list for an appointment or message.
|
||||
*
|
||||
@@ -9114,6 +9207,11 @@ declare namespace Office {
|
||||
* Applicable Outlook mode: Compose
|
||||
*
|
||||
* Errors: NumberOfRecipientsExceeded - The number of recipients exceeded 100 entries.
|
||||
*
|
||||
* In addition to the main signature, this method also has these signatures:
|
||||
* setAsync(recipients: (string | EmailUser | EmailAddressDetails)[]): void;
|
||||
* setAsync(recipients: (string | EmailUser | EmailAddressDetails)[], options: AsyncContextOptions): void;
|
||||
* setAsync(recipients: (string | EmailUser | EmailAddressDetails)[], callback: (result: AsyncResult) => void): void;
|
||||
*
|
||||
* @param recipients The recipients to add to the recipients list.
|
||||
* @param options Optional. An object literal that contains one or more of the following properties.
|
||||
@@ -9288,6 +9386,9 @@ declare namespace Office {
|
||||
*
|
||||
* Applicable Outlook mode: Compose or read
|
||||
*
|
||||
* In addition to the main signature, this method also has these signatures:
|
||||
* getAsync(callback?: (result: AsyncResult) => void): void;
|
||||
*
|
||||
* @param options Optional. An object literal that contains one or more of the following properties.
|
||||
* asyncContext: Developers can provide any object they wish to access in the callback method.
|
||||
* @param callback Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an AsyncResult object.
|
||||
@@ -9326,6 +9427,9 @@ declare namespace Office {
|
||||
*
|
||||
* Errors: InvalidEndTime - The appointment end time is before its start time.
|
||||
*
|
||||
* In addition to the main signature, this method also has these signatures:
|
||||
* setAsync(recurrencePattern: Recurrence, callback?: (result: AsyncResult) => void): void;
|
||||
*
|
||||
* @param recurrencePattern A recurrence object.
|
||||
* @param options Optional. An object literal that contains one or more of the following properties.
|
||||
* asyncContext: Developers can provide any object they wish to access in the callback method.
|
||||
@@ -9619,12 +9723,15 @@ declare namespace Office {
|
||||
*
|
||||
* Errors: Invalid date format - The date is not in an acceptable format.
|
||||
*
|
||||
* In addition to the main signature, this method also has these signatures:
|
||||
* setEndDate(date: string): void;
|
||||
* Where date is the end date of the recurring appointment series represented in the {@link https://www.iso.org/iso-8601-date-and-time-format.html | ISO 8601} date format: "YYYY-MM-DD".
|
||||
*
|
||||
* @param year The year value of the end date.
|
||||
* @param month The month value of the end date. Valid range is 0-11 where 0 represents the 1st month and 11 represents the 12th month.
|
||||
* @param day The day value of the end date.
|
||||
*/
|
||||
setEndDate(year: number, month: number, day: number): void;
|
||||
|
||||
/**
|
||||
* Sets the end date of a recurring appointment series.
|
||||
*
|
||||
@@ -9640,7 +9747,6 @@ declare namespace Office {
|
||||
* @param date End date of the recurring appointment series represented in the {@link https://www.iso.org/iso-8601-date-and-time-format.html | ISO 8601} date format: "YYYY-MM-DD".
|
||||
*/
|
||||
setEndDate(date: string): void;
|
||||
|
||||
/**
|
||||
* Sets the start date of a recurring appointment series.
|
||||
*
|
||||
@@ -9653,6 +9759,10 @@ declare namespace Office {
|
||||
*
|
||||
* Errors: Invalid date format - The date is not in an acceptable format.
|
||||
*
|
||||
* In addition to the main signature, this method also has these signatures:
|
||||
* setStartDate(date: string): void;
|
||||
* Where date is the start date of the recurring appointment series represented in the {@link https://www.iso.org/iso-8601-date-and-time-format.html | ISO 8601} date format: "YYYY-MM-DD".
|
||||
*
|
||||
* @param year The year value of the start date.
|
||||
* @param month The month value of the start date. Valid range is 0-11 where 0 represents the 1st month and 11 represents the 12th month.
|
||||
* @param day The day value of the start date.
|
||||
@@ -9687,6 +9797,10 @@ declare namespace Office {
|
||||
*
|
||||
* Errors: Invalid time format - The time is not in an acceptable format.
|
||||
*
|
||||
* In addition to the main signature, this method also has these signatures:
|
||||
* setStartTime(time: string): void;
|
||||
* Where time is the start time of all instances represented by standard datetime string format: "THH:mm:ss:mmm".
|
||||
*
|
||||
* @param hours The hour value of the start time. Valid range: 0-24.
|
||||
* @param minutes The minute value of the start time. Valid range: 0-59.
|
||||
*/
|
||||
@@ -9720,6 +9834,26 @@ declare namespace Office {
|
||||
* Applicable Outlook mode: Compose
|
||||
*/
|
||||
interface Subject {
|
||||
/**
|
||||
* Gets the subject of an appointment or message.
|
||||
*
|
||||
* The getAsync method starts an asynchronous call to the Exchange server to get the subject of an appointment or message.
|
||||
*
|
||||
* [Api set: Mailbox 1.1]
|
||||
*
|
||||
* @remarks
|
||||
* {@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}: ReadItem
|
||||
*
|
||||
* Applicable Outlook mode: Compose
|
||||
*
|
||||
* In addition to the main signature, this method also has these signatures:
|
||||
* getAsync(callback: (result: AsyncResult) => void): void;
|
||||
*
|
||||
* @param options An object literal that contains one or more of the following properties.
|
||||
* asyncContext: Developers can provide any object they wish to access in the callback method.
|
||||
* @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult.
|
||||
*/
|
||||
getAsync(options: AsyncContextOptions, callback: (result: AsyncResult) => void): void;
|
||||
/**
|
||||
* Gets the subject of an appointment or message.
|
||||
* The getAsync method starts an asynchronous call to the Exchange server to get the subject of an appointment or message.
|
||||
@@ -9734,23 +9868,6 @@ declare namespace Office {
|
||||
* @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult.
|
||||
*/
|
||||
getAsync(callback: (result: AsyncResult) => void): void;
|
||||
/**
|
||||
* Gets the subject of an appointment or message.
|
||||
*
|
||||
* The getAsync method starts an asynchronous call to the Exchange server to get the subject of an appointment or message.
|
||||
*
|
||||
* [Api set: Mailbox 1.1]
|
||||
*
|
||||
* @remarks
|
||||
* {@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}: ReadItem
|
||||
*
|
||||
* Applicable Outlook mode: Compose
|
||||
*
|
||||
* @param options An object literal that contains one or more of the following properties.
|
||||
* asyncContext: Developers can provide any object they wish to access in the callback method.
|
||||
* @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult.
|
||||
*/
|
||||
getAsync(options: AsyncContextOptions, callback: (result: AsyncResult) => void): void;
|
||||
/**
|
||||
* Sets the subject of an appointment or message.
|
||||
*
|
||||
@@ -9764,6 +9881,11 @@ declare namespace Office {
|
||||
* Applicable Outlook mode: Compose
|
||||
*
|
||||
* Errors: DataExceedsMaximumSize - The subject parameter is longer than 255 characters.
|
||||
*
|
||||
* In addition to the main signature, this method also has these signatures:
|
||||
* setAsync(subject: string): void;
|
||||
* setAsync(subject: string, options: AsyncContextOptions): void;
|
||||
* setAsync(subject: string, callback: (result: AsyncResult) => void): void;
|
||||
*
|
||||
* @param subject The subject of the appointment or message. The string is limited to 255 characters.
|
||||
* @param options An object literal that contains one or more of the following properties.
|
||||
@@ -9871,10 +9993,15 @@ declare namespace Office {
|
||||
* {@link https://docs.microsoft.com/outlook/add-ins/understanding-outlook-add-in-permissions | Minimum permission level}: ReadItem
|
||||
*
|
||||
* Applicable Outlook mode: Compose
|
||||
*
|
||||
* In addition to the main signature, this method also has these signatures:
|
||||
* getAsync(callback: (result: AsyncResult) => void): void;
|
||||
*
|
||||
* @param options An object literal that contains one or more of the following properties.
|
||||
* asyncContext: Developers can provide any object they wish to access in the callback method.
|
||||
* @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult.
|
||||
*/
|
||||
getAsync(callback: (result: AsyncResult) => void): void;
|
||||
getAsync(options: AsyncContextOptions, callback: (result: AsyncResult) => void): void;
|
||||
/**
|
||||
* Gets the start or end time of an appointment.
|
||||
*
|
||||
@@ -9887,11 +10014,9 @@ declare namespace Office {
|
||||
*
|
||||
* Applicable Outlook mode: Compose
|
||||
*
|
||||
* @param options An object literal that contains one or more of the following properties.
|
||||
* asyncContext: Developers can provide any object they wish to access in the callback method.
|
||||
* @param callback When the method completes, the function passed in the callback parameter is called with a single parameter of type AsyncResult.
|
||||
*/
|
||||
getAsync(options: AsyncContextOptions, callback: (result: AsyncResult) => void): void;
|
||||
getAsync(callback: (result: AsyncResult) => void): void;
|
||||
/**
|
||||
* Sets the start or end time of an appointment.
|
||||
*
|
||||
@@ -9907,6 +10032,11 @@ declare namespace Office {
|
||||
* Applicable Outlook mode: Compose
|
||||
*
|
||||
* Errors: InvalidEndTime - The appointment end time is before the appointment start time.
|
||||
*
|
||||
* In addition to the main signature, this method also has these signatures:
|
||||
* setAsync(dateTime: Date): void;
|
||||
* setAsync(dateTime: Date, options: AsyncContextOptions): void;
|
||||
* setAsync(dateTime: Date, callback: (result: AsyncResult) => void): void;
|
||||
*
|
||||
* @param dateTime A date-time object in Coordinated Universal Time (UTC).
|
||||
* @param options An object literal that contains one or more of the following properties.
|
||||
|
||||
Vendored
+5
-3
@@ -1,4 +1,4 @@
|
||||
// Type definitions for owl.carousel 2.2
|
||||
// Type definitions for owl.carousel 2.3
|
||||
// Project: https://github.com/OwlCarousel2/OwlCarousel2
|
||||
// Definitions by: Ismael Gorissen <https://github.com/igorissen>
|
||||
// Kenneth Ceyer <https://github.com/KennethanCeyer>
|
||||
@@ -31,9 +31,9 @@ declare namespace OwlCarousel {
|
||||
slideBy?: number | string;
|
||||
dots?: boolean;
|
||||
dotsEach?: number | boolean;
|
||||
dotData?: boolean;
|
||||
dotsData?: boolean;
|
||||
lazyLoad?: boolean;
|
||||
lazyContent?: boolean;
|
||||
lazyLoadEager?: number;
|
||||
autoplay?: boolean;
|
||||
autoplayTimeout?: number;
|
||||
autoplayHoverPause?: boolean;
|
||||
@@ -59,6 +59,8 @@ declare namespace OwlCarousel {
|
||||
stageElement?: string;
|
||||
navContainer?: string | boolean;
|
||||
dotsContainer?: string | boolean;
|
||||
checkVisible?: boolean;
|
||||
slideTransition?: string;
|
||||
// CLASSES
|
||||
refreshClass?: string;
|
||||
loadingClass?: string;
|
||||
|
||||
Vendored
+1
-1
@@ -5,7 +5,7 @@
|
||||
|
||||
declare namespace pDefer {
|
||||
interface DeferredPromise<T> {
|
||||
resolve<U>(value: U | PromiseLike<U>): Promise<U>;
|
||||
resolve<U>(value?: U | PromiseLike<U>): Promise<U>;
|
||||
reject(reason: any): Promise<never>;
|
||||
promise: Promise<T>;
|
||||
}
|
||||
|
||||
@@ -7,3 +7,7 @@ function delay(deferred: pDefer.DeferredPromise<string>, ms: number) {
|
||||
|
||||
let s: string;
|
||||
async function f() { s = await delay(pDefer<string>(), 100); }
|
||||
|
||||
async function u() {
|
||||
const u: Promise<any> = pDefer().resolve();
|
||||
}
|
||||
|
||||
Vendored
+19
@@ -0,0 +1,19 @@
|
||||
// Type definitions for pem-jwk 1.5
|
||||
// Project: https://github.com/dannycoates/pem-jwk
|
||||
// Definitions by: Alessio Paccoia <https://github.com/alessiopcc>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export interface RSA_JWK {
|
||||
kty: string;
|
||||
n: string;
|
||||
e: string;
|
||||
d?: string;
|
||||
p?: string;
|
||||
q?: string;
|
||||
dp?: string;
|
||||
dq?: string;
|
||||
qi?: string;
|
||||
}
|
||||
|
||||
export function pem2jwk(rsa_pem: string): RSA_JWK;
|
||||
export function jwk2pem(rsa_jwk: RSA_JWK): string;
|
||||
@@ -0,0 +1,17 @@
|
||||
import { jwk2pem, pem2jwk, RSA_JWK } from "pem-jwk";
|
||||
|
||||
const rsa_pem = `-----BEGIN PUBLIC KEY-----
|
||||
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDh6RzHEsTFjD8NlB4echurwfV2
|
||||
Zrlcg0k2JoP0Z3QAgXPMwJynvs2LeBHYaOFzGzjXRKsvaLwc5PjP3NcqcP3KkX5y
|
||||
1VA31VrJLfFbXthi0a8c/UBwxJD8i4S35OKr6yui3bJatgYWrSQ4MT9ktaS1TP9l
|
||||
XBW58V4VlkypTaQTSQIDAQAB
|
||||
-----END PUBLIC KEY-----`;
|
||||
|
||||
const rsa_jwk: RSA_JWK = {
|
||||
kty: 'RSA',
|
||||
n: '4ekcxxLExYw_DZQeHnIbq8H1dma5XINJNiaD9Gd0AIFzzMCcp77Ni3gR2Gjhcxs410SrL2i8HOT4z9zXKnD9ypF-ctVQN9VayS3xW17YYtGvHP1AcMSQ_IuEt-Tiq-srot2yWrYGFq0kODE_ZLWktUz_ZVwVufFeFZZMqU2kE0k',
|
||||
e: 'AQAB'
|
||||
};
|
||||
|
||||
jwk2pem(rsa_jwk); // $ExpectType string
|
||||
pem2jwk(rsa_pem); // $ExpectType RSA_JWK
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictFunctionTypes": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"pem-jwk-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
+4
-4
@@ -1,5 +1,5 @@
|
||||
declare namespace pc {
|
||||
type ComponentTypes = 'animation' | 'audiolistner' | 'camera' | 'collision' |
|
||||
type ComponentTypes = 'animation' | 'audiolistener' | 'camera' | 'collision' |
|
||||
'element' | 'light' | 'model' | 'particlesystem' |
|
||||
'rigidbody' | 'screen' | 'script' | 'sound' | 'zone';
|
||||
|
||||
@@ -169,11 +169,11 @@ declare namespace pc {
|
||||
* this.entity.parent.addChild(e); // Add it as a sibling to the original
|
||||
*/
|
||||
clone(): pc.Entity;
|
||||
|
||||
|
||||
|
||||
// Possible attached components
|
||||
animation: pc.AnimationComponent;
|
||||
audiolistner: pc.AudioListenerComponent;
|
||||
audiolistener: pc.AudioListenerComponent;
|
||||
camera: pc.CameraComponent;
|
||||
collision: pc.CollisionComponent;
|
||||
element: pc.ElementComponent;
|
||||
@@ -187,4 +187,4 @@ declare namespace pc {
|
||||
zone: pc.ZoneComponent;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+2
@@ -1,10 +1,12 @@
|
||||
// Type definitions for prismic-dom 2.0
|
||||
// Project: https://github.com/prismicio/prismic-dom#readme
|
||||
// Definitions by: Nick Whyte <https://github.com/nickw444>
|
||||
// Siggy Bilstein <https://github.com/sbilstein>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
interface RichText {
|
||||
asHtml(richText: any, linkResolver?: (doc: any) => string): string;
|
||||
asText(richText: any, joinString?: string): string;
|
||||
}
|
||||
|
||||
export const RichText: RichText;
|
||||
|
||||
Vendored
+82
@@ -169,6 +169,78 @@ export interface AreaPathProps extends AreaBaseProps {
|
||||
|
||||
export class AreaPath extends React.Component<AreaPathProps> { }
|
||||
|
||||
export interface AreaTextProps extends AreaBaseProps {
|
||||
style?: {
|
||||
/**
|
||||
* The background color, specified as a CSS color string.
|
||||
*/
|
||||
backgroundColor?: string;
|
||||
/**
|
||||
* The text color, specified as a CSS color string.
|
||||
*/
|
||||
color?: string;
|
||||
/**
|
||||
* The font family (only if available on the system).
|
||||
*/
|
||||
fontFamily?: string;
|
||||
/**
|
||||
* The font size (in pt).
|
||||
*/
|
||||
fontSize?: number;
|
||||
/**
|
||||
* Whether an italic font should be used.
|
||||
*/
|
||||
fontStyle?: 'normal' | 'oblique' | 'italic';
|
||||
/**
|
||||
* Whether a bold font should be used (and the amount).
|
||||
*/
|
||||
fontWeight?: 'minimum' | 'thin' | 'ultraLight' | 'light' | 'book' | 'normal' | 'medium' | 'semiBold' | 'bold' | 'ultraBold' | 'heavy' | 'ultraHeavy' | 'maximum' | number;
|
||||
/**
|
||||
* Wheter the text should be aligned to the left, center or right.
|
||||
*
|
||||
* **Works only on a top level text component, not it's children!**
|
||||
*/
|
||||
textAlign?: 'left' | 'center' | 'right';
|
||||
/**
|
||||
* How wide or narrow the characters should be.
|
||||
*/
|
||||
textStretch?: 'ultraCondensed' | 'extraCondensed' | 'condensed' | 'semiCondensed' | 'normal' | 'semiExpanded' | 'expanded' | 'extraExpanded' | 'ultraExpanded';
|
||||
/**
|
||||
* The text underline style.
|
||||
*/
|
||||
textUnderline?: 'none' | 'single' | 'double' | 'suggestion';
|
||||
/**
|
||||
* The text underline color.
|
||||
*
|
||||
* A color string | 'spelling' | 'grammar' | 'auxiliary'
|
||||
*/
|
||||
textUnderlineColor?: 'spelling' | 'grammar' | 'auxiliary' | string;
|
||||
};
|
||||
/**
|
||||
* The x coordinate of the text's top left corner. (Only in a top level text component.)
|
||||
*/
|
||||
x?: number | string;
|
||||
/**
|
||||
* The y coordinate of the text's top left corner. (Only in a top level text component.)
|
||||
*/
|
||||
y?: number | string;
|
||||
}
|
||||
|
||||
export class AreaText extends React.Component<AreaTextProps> { }
|
||||
|
||||
export interface AreaGroupProps extends AreaBaseProps {
|
||||
/**
|
||||
* Specify `width` and `height` to be able to use percentage values in transforms.
|
||||
*/
|
||||
width?: number | string;
|
||||
/**
|
||||
* Specify `width` and `height` to be able to use percentage values in transforms.
|
||||
*/
|
||||
height?: number | string;
|
||||
}
|
||||
|
||||
export class AreaGroup extends React.Component<AreaGroupProps> { }
|
||||
|
||||
export interface MouseEvent {
|
||||
button: number;
|
||||
height: number;
|
||||
@@ -242,6 +314,12 @@ export class Area extends React.Component<AreaProps> {
|
||||
* A circle to be displayed in an Area component.
|
||||
*/
|
||||
static Circle: typeof AreaCircle;
|
||||
/**
|
||||
* A component to apply props to all it's children in an Area component.
|
||||
*
|
||||
* To be able to use percentage values in transforms, the props `width` and `height` need to be specified (they have no graphical effect).
|
||||
*/
|
||||
static Group: typeof AreaGroup;
|
||||
/**
|
||||
* A straigt line to be displayed in an Area component.
|
||||
*/
|
||||
@@ -256,6 +334,10 @@ export class Area extends React.Component<AreaProps> {
|
||||
* A rectangle to be displayed in an Area component.
|
||||
*/
|
||||
static Rectangle: typeof AreaRectangle;
|
||||
/**
|
||||
* A (possibly styled) text to be displayed in an Area component. Nested `Area.Text` components inheirit the parent's style.
|
||||
*/
|
||||
static Text: typeof AreaText;
|
||||
}
|
||||
|
||||
export interface BoxProps extends GridChildrenProps, Label, Stretchy {
|
||||
|
||||
@@ -124,3 +124,29 @@ class GridTest extends React.Component {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class AreaTest extends React.Component {
|
||||
render() {
|
||||
return (
|
||||
<Area>
|
||||
<Area.Group width={30} height={20}>
|
||||
<Area.Rectangle height={10} width={20} x={30} y={40} />
|
||||
<Area.Path d="test" fillMode="nonzero" />
|
||||
<Area.Text
|
||||
style={{
|
||||
fontSize: 30,
|
||||
fontWeight: "maximum",
|
||||
textAlign: "center",
|
||||
textStretch: "ultraCondensed",
|
||||
}}
|
||||
>
|
||||
Parent text
|
||||
<Area.Text>
|
||||
Nested Text
|
||||
</Area.Text>
|
||||
</Area.Text>
|
||||
</Area.Group>
|
||||
</Area>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+4
@@ -188,6 +188,8 @@ export interface Cookie {
|
||||
expires: number;
|
||||
/** The cookie http only flag. */
|
||||
httpOnly: boolean;
|
||||
/** The session cookie flag. */
|
||||
session: boolean;
|
||||
/** The cookie secure flag. */
|
||||
secure: boolean;
|
||||
/** The cookie same site definition. */
|
||||
@@ -218,6 +220,8 @@ export interface SetCookie {
|
||||
expires?: number;
|
||||
/** The cookie http only flag. */
|
||||
httpOnly?: boolean;
|
||||
/** The session cookie flag. */
|
||||
session?: boolean;
|
||||
/** The cookie secure flag. */
|
||||
secure?: boolean;
|
||||
/** The cookie same site definition. */
|
||||
|
||||
Vendored
+204
-2
@@ -420,12 +420,72 @@ declare namespace R {
|
||||
fn0: (x0: V0, x1: V1, x2: V2) => T1): (x0: V0, x1: V1, x2: V2) => T6;
|
||||
|
||||
/**
|
||||
* TODO composeK
|
||||
* Returns the right-to-left Kleisli composition of the provided functions, each of which must return a value of a type supported by chain.
|
||||
* The typings only support arrays for now.
|
||||
* All functions must be unary.
|
||||
* R.composeK(h, g, f) is equivalent to R.compose(R.chain(h), R.chain(g), f).
|
||||
*/
|
||||
composeK<V0, T1>(
|
||||
fn0: (x0: V0) => T1[]): (x0: V0) => T1[];
|
||||
composeK<V0, T1, T2>(
|
||||
fn1: (x: T1) => T2[],
|
||||
fn0: (x0: V0) => T1[]): (x0: V0) => T2[];
|
||||
composeK<V0, T1, T2, T3>(
|
||||
fn2: (x: T2) => T3[],
|
||||
fn1: (x: T1) => T2[],
|
||||
fn0: (x: V0) => T1[]): (x: V0) => T3[];
|
||||
composeK<V0, T1, T2, T3, T4>(
|
||||
fn3: (x: T3) => T4[],
|
||||
fn2: (x: T2) => T3[],
|
||||
fn1: (x: T1) => T2[],
|
||||
fn0: (x: V0) => T1[]): (x: V0) => T4[];
|
||||
composeK<V0, T1, T2, T3, T4, T5>(
|
||||
fn4: (x: T4) => T5[],
|
||||
fn3: (x: T3) => T4[],
|
||||
fn2: (x: T2) => T3[],
|
||||
fn1: (x: T1) => T2[],
|
||||
fn0: (x: V0) => T1[]): (x: V0) => T5[];
|
||||
composeK<V0, T1, T2, T3, T4, T5, T6>(
|
||||
fn5: (x: T5) => T6[],
|
||||
fn4: (x: T4) => T5[],
|
||||
fn3: (x: T3) => T4[],
|
||||
fn2: (x: T2) => T3[],
|
||||
fn1: (x: T1) => T2[],
|
||||
fn0: (x: V0) => T1[]): (x: V0) => T6[];
|
||||
|
||||
/**
|
||||
* TODO composeP
|
||||
* Performs right-to-left composition of one or more Promise-returning functions.
|
||||
* All functions must be unary.
|
||||
*/
|
||||
composeP<V0, T1>(
|
||||
fn0: (x0: V0) => Promise<T1>): (x0: V0) => Promise<T1>;
|
||||
composeP<V0, T1, T2>(
|
||||
fn1: (x: T1) => Promise<T2>,
|
||||
fn0: (x0: V0) => Promise<T1>): (x0: V0) => Promise<T2>;
|
||||
composeP<V0, T1, T2, T3>(
|
||||
fn2: (x: T2) => Promise<T3>,
|
||||
fn1: (x: T1) => Promise<T2>,
|
||||
fn0: (x: V0) => Promise<T1>): (x: V0) => Promise<T3>;
|
||||
composeP<V0, T1, T2, T3, T4>(
|
||||
fn3: (x: T3) => Promise<T4>,
|
||||
fn2: (x: T2) => Promise<T3>,
|
||||
fn1: (x: T1) => Promise<T2>,
|
||||
fn0: (x: V0) => Promise<T1>): (x: V0) => Promise<T4>;
|
||||
composeP<V0, T1, T2, T3, T4, T5>(
|
||||
fn4: (x: T4) => Promise<T5>,
|
||||
fn3: (x: T3) => Promise<T4>,
|
||||
fn2: (x: T2) => Promise<T3>,
|
||||
fn1: (x: T1) => Promise<T2>,
|
||||
fn0: (x: V0) => Promise<T1>):
|
||||
(x: V0) => Promise<T5>;
|
||||
composeP<V0, T1, T2, T3, T4, T5, T6>(
|
||||
fn5: (x: T5) => Promise<T6>,
|
||||
fn4: (x: T4) => Promise<T5>,
|
||||
fn3: (x: T3) => Promise<T4>,
|
||||
fn2: (x: T2) => Promise<T3>,
|
||||
fn1: (x: T1) => Promise<T2>,
|
||||
fn0: (x: V0) => Promise<T1>):
|
||||
(x: V0) => Promise<T6>;
|
||||
|
||||
/**
|
||||
* Returns a new list consisting of the elements of the first list followed by the elements
|
||||
@@ -1501,6 +1561,148 @@ declare namespace R {
|
||||
fn8: (x: T8) => T9,
|
||||
fn9: (x: T9) => T10): (x0: V0, x1: V1, x2: V2) => T10;
|
||||
|
||||
/*
|
||||
* Returns the left-to-right Kleisli composition of the provided functions, each of which must return a value of a type supported by chain.
|
||||
* The typings currently support arrays only as return values.
|
||||
* All functions need to be unary.
|
||||
* R.pipeK(f, g, h) is equivalent to R.pipe(f, R.chain(g), R.chain(h)).
|
||||
*/
|
||||
pipeK<V0, T1>(
|
||||
fn0: (x0: V0) => T1[]): (x0: V0) => T1[];
|
||||
pipeK<V0, T1, T2>(
|
||||
fn0: (x0: V0) => T1[],
|
||||
fn1: (x: T1) => T2[]): (x0: V0) => T2[];
|
||||
pipeK<V0, T1, T2, T3>(
|
||||
fn0: (x: V0) => T1[],
|
||||
fn1: (x: T1) => T2[],
|
||||
fn2: (x: T2) => T3[]): (x: V0) => T3[];
|
||||
pipeK<V0, T1, T2, T3, T4>(
|
||||
fn0: (x: V0) => T1[],
|
||||
fn1: (x: T1) => T2[],
|
||||
fn2: (x: T2) => T3[],
|
||||
fn3: (x: T3) => T4[]): (x: V0) => T4[];
|
||||
pipeK<V0, T1, T2, T3, T4, T5>(
|
||||
fn0: (x: V0) => T1[],
|
||||
fn1: (x: T1) => T2[],
|
||||
fn2: (x: T2) => T3[],
|
||||
fn3: (x: T3) => T4[],
|
||||
fn4: (x: T4) => T5[]): (x: V0) => T5[];
|
||||
pipeK<V0, T1, T2, T3, T4, T5, T6>(
|
||||
fn0: (x: V0) => T1[],
|
||||
fn1: (x: T1) => T2[],
|
||||
fn2: (x: T2) => T3[],
|
||||
fn3: (x: T3) => T4[],
|
||||
fn4: (x: T4) => T5[],
|
||||
fn5: (x: T5) => T6[]): (x: V0) => T6[];
|
||||
pipeK<V0, T1, T2, T3, T4, T5, T6, T7>(
|
||||
fn0: (x: V0) => T1[],
|
||||
fn1: (x: T1) => T2[],
|
||||
fn2: (x: T2) => T3[],
|
||||
fn3: (x: T3) => T4[],
|
||||
fn4: (x: T4) => T5[],
|
||||
fn5: (x: T5) => T6[],
|
||||
fn: (x: T6) => T7[]): (x: V0) => T7[];
|
||||
pipeK<V0, T1, T2, T3, T4, T5, T6, T7, T8>(
|
||||
fn0: (x: V0) => T1[],
|
||||
fn1: (x: T1) => T2[],
|
||||
fn2: (x: T2) => T3[],
|
||||
fn3: (x: T3) => T4[],
|
||||
fn4: (x: T4) => T5[],
|
||||
fn5: (x: T5) => T6[],
|
||||
fn6: (x: T6) => T7[],
|
||||
fn: (x: T7) => T8[]): (x: V0) => T8[];
|
||||
pipeK<V0, T1, T2, T3, T4, T5, T6, T7, T8, T9>(
|
||||
fn0: (x0: V0) => T1[],
|
||||
fn1: (x: T1) => T2[],
|
||||
fn2: (x: T2) => T3[],
|
||||
fn3: (x: T3) => T4[],
|
||||
fn4: (x: T4) => T5[],
|
||||
fn5: (x: T5) => T6[],
|
||||
fn6: (x: T6) => T7[],
|
||||
fn7: (x: T7) => T8[],
|
||||
fn8: (x: T8) => T9[]): (x0: V0) => T9[];
|
||||
pipeK<V0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(
|
||||
fn0: (x0: V0) => T1[],
|
||||
fn1: (x: T1) => T2[],
|
||||
fn2: (x: T2) => T3[],
|
||||
fn3: (x: T3) => T4[],
|
||||
fn4: (x: T4) => T5[],
|
||||
fn5: (x: T5) => T6[],
|
||||
fn6: (x: T6) => T7[],
|
||||
fn7: (x: T7) => T8[],
|
||||
fn8: (x: T8) => T9[],
|
||||
fn9: (x: T9) => T10[]): (x0: V0) => T10[];
|
||||
|
||||
/*
|
||||
* Performs left-to-right composition of one or more Promise-returning functions.
|
||||
* All functions need to be unary.
|
||||
*/
|
||||
pipeP<V0, T1>(
|
||||
fn0: (x0: V0) => Promise<T1>): (x0: V0) => Promise<T1>;
|
||||
pipeP<V0, T1, T2>(
|
||||
fn0: (x0: V0) => Promise<T1>,
|
||||
fn1: (x: T1) => Promise<T2>): (x0: V0) => Promise<T2>;
|
||||
pipeP<V0, T1, T2, T3>(
|
||||
fn0: (x: V0) => Promise<T1>,
|
||||
fn1: (x: T1) => Promise<T2>,
|
||||
fn2: (x: T2) => Promise<T3>): (x: V0) => Promise<T3>;
|
||||
pipeP<V0, T1, T2, T3, T4>(
|
||||
fn0: (x: V0) => Promise<T1>,
|
||||
fn1: (x: T1) => Promise<T2>,
|
||||
fn2: (x: T2) => Promise<T3>,
|
||||
fn3: (x: T3) => Promise<T4>): (x: V0) => Promise<T4>;
|
||||
pipeP<V0, T1, T2, T3, T4, T5>(
|
||||
fn0: (x: V0) => Promise<T1>,
|
||||
fn1: (x: T1) => Promise<T2>,
|
||||
fn2: (x: T2) => Promise<T3>,
|
||||
fn3: (x: T3) => Promise<T4>,
|
||||
fn4: (x: T4) => Promise<T5>): (x: V0) => Promise<T5>;
|
||||
pipeP<V0, T1, T2, T3, T4, T5, T6>(
|
||||
fn0: (x: V0) => Promise<T1>,
|
||||
fn1: (x: T1) => Promise<T2>,
|
||||
fn2: (x: T2) => Promise<T3>,
|
||||
fn3: (x: T3) => Promise<T4>,
|
||||
fn4: (x: T4) => Promise<T5>,
|
||||
fn5: (x: T5) => Promise<T6>): (x: V0) => Promise<T6>;
|
||||
pipeP<V0, T1, T2, T3, T4, T5, T6, T7>(
|
||||
fn0: (x: V0) => Promise<T1>,
|
||||
fn1: (x: T1) => Promise<T2>,
|
||||
fn2: (x: T2) => Promise<T3>,
|
||||
fn3: (x: T3) => Promise<T4>,
|
||||
fn4: (x: T4) => Promise<T5>,
|
||||
fn5: (x: T5) => Promise<T6>,
|
||||
fn: (x: T6) => Promise<T7>): (x: V0) => Promise<T7>;
|
||||
pipeP<V0, T1, T2, T3, T4, T5, T6, T7, T8>(
|
||||
fn0: (x: V0) => Promise<T1>,
|
||||
fn1: (x: T1) => Promise<T2>,
|
||||
fn2: (x: T2) => Promise<T3>,
|
||||
fn3: (x: T3) => Promise<T4>,
|
||||
fn4: (x: T4) => Promise<T5>,
|
||||
fn5: (x: T5) => Promise<T6>,
|
||||
fn6: (x: T6) => Promise<T7>,
|
||||
fn: (x: T7) => Promise<T8>): (x: V0) => Promise<T8>;
|
||||
pipeP<V0, T1, T2, T3, T4, T5, T6, T7, T8, T9>(
|
||||
fn0: (x0: V0) => Promise<T1>,
|
||||
fn1: (x: T1) => Promise<T2>,
|
||||
fn2: (x: T2) => Promise<T3>,
|
||||
fn3: (x: T3) => Promise<T4>,
|
||||
fn4: (x: T4) => Promise<T5>,
|
||||
fn5: (x: T5) => Promise<T6>,
|
||||
fn6: (x: T6) => Promise<T7>,
|
||||
fn7: (x: T7) => Promise<T8>,
|
||||
fn8: (x: T8) => Promise<T9>): (x0: V0) => Promise<T9>;
|
||||
pipeP<V0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(
|
||||
fn0: (x0: V0) => Promise<T1>,
|
||||
fn1: (x: T1) => Promise<T2>,
|
||||
fn2: (x: T2) => Promise<T3>,
|
||||
fn3: (x: T3) => Promise<T4>,
|
||||
fn4: (x: T4) => Promise<T5>,
|
||||
fn5: (x: T5) => Promise<T6>,
|
||||
fn6: (x: T6) => Promise<T7>,
|
||||
fn7: (x: T7) => Promise<T8>,
|
||||
fn8: (x: T8) => Promise<T9>,
|
||||
fn9: (x: T9) => Promise<T10>): (x0: V0) => Promise<T10>;
|
||||
|
||||
/**
|
||||
* Returns a new list by plucking the same named property off all objects in the list supplied.
|
||||
*/
|
||||
|
||||
@@ -186,6 +186,68 @@ class F2 {
|
||||
const g_res: boolean = g([1, 2, 10, 13]);
|
||||
};
|
||||
|
||||
/* composeK */
|
||||
() => {
|
||||
const get = (prop: string) => (obj: any): any[] => {
|
||||
const propVal = obj[prop];
|
||||
if (propVal) {
|
||||
return [propVal];
|
||||
} else {
|
||||
return [];
|
||||
}
|
||||
};
|
||||
|
||||
const getStateCode: (input: any) => any[] = R.composeK(
|
||||
R.compose((val) => [val], R.toUpper),
|
||||
get('state'),
|
||||
get('address'),
|
||||
get('user'),
|
||||
);
|
||||
getStateCode({ user: { address: { state: "ny" } } }); // => []
|
||||
getStateCode({}); // => []
|
||||
|
||||
const nextThree = (num: number): number[] => ([num, num + 1, num + 2]);
|
||||
const onlyOverNine = (num: number): number[] => num > 9 ? [num] : [];
|
||||
const toString = (input: any): string[] => [`${input}`];
|
||||
const split = (input: string): string[] => input.split('');
|
||||
|
||||
const composed: (num: number) => string[] = R.composeK(
|
||||
split,
|
||||
toString,
|
||||
onlyOverNine,
|
||||
nextThree,
|
||||
);
|
||||
};
|
||||
|
||||
/* composeP */
|
||||
() => {
|
||||
interface User {
|
||||
name: string;
|
||||
followers: string[];
|
||||
}
|
||||
interface Db {
|
||||
users: { [index: string]: User };
|
||||
}
|
||||
const db: Db = {
|
||||
users: {
|
||||
JOE: {
|
||||
name: 'Joe',
|
||||
followers: ['STEVE', 'SUZY']
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// We'll pretend to do a db lookup which returns a promise
|
||||
const lookupUser = (userId: string): Promise<User> => Promise.resolve(db.users[userId]);
|
||||
const lookupFollowers = (user: User): Promise<string[]> => Promise.resolve(user.followers);
|
||||
lookupUser('JOE').then(lookupFollowers);
|
||||
|
||||
// followersForUser :: String -> Promise [UserId]
|
||||
const followersForUser: (input: string) => Promise<string[]> = R.composeP(lookupFollowers, lookupUser);
|
||||
followersForUser('JOE').then(followers => console.log('Followers:', followers));
|
||||
// Followers: ["STEVE","SUZY"]
|
||||
};
|
||||
|
||||
/* pipe */
|
||||
() => {
|
||||
const func: (x: number) => string = R.pipe(double, double, shout);
|
||||
@@ -201,6 +263,63 @@ class F2 {
|
||||
const fr: number = f(3, 4); // -(3^4) + 1
|
||||
};
|
||||
|
||||
/* pipeK */
|
||||
() => {
|
||||
const parseJson = (input: string): any[] => {
|
||||
try {
|
||||
return [JSON.parse(input)];
|
||||
} catch (e) {
|
||||
return [];
|
||||
}
|
||||
};
|
||||
const get = (prop: string) => (obj: any): any[] => {
|
||||
const propVal = obj[prop];
|
||||
if (propVal) {
|
||||
return [propVal];
|
||||
} else {
|
||||
return [];
|
||||
}
|
||||
};
|
||||
|
||||
const getStateCode: (input: string) => string[] = R.pipeK(
|
||||
parseJson,
|
||||
get('user'),
|
||||
get('address'),
|
||||
get('state'),
|
||||
R.compose((val) => [val], R.toUpper)
|
||||
);
|
||||
|
||||
getStateCode('{"user":{"address":{"state":"ny"}}}');
|
||||
// => Just('NY')
|
||||
getStateCode('[Invalid JSON]');
|
||||
// => Nothing()
|
||||
};
|
||||
|
||||
/* pipeP */
|
||||
() => {
|
||||
interface User {
|
||||
followers: string[];
|
||||
name: string;
|
||||
}
|
||||
|
||||
const db = {
|
||||
getUserById(userName: string): Promise<User> {
|
||||
return Promise.resolve({
|
||||
name: 'Jon',
|
||||
followers: [
|
||||
'Samwell',
|
||||
'Edd',
|
||||
'Grenn',
|
||||
],
|
||||
});
|
||||
},
|
||||
getFollowers(user: User): Promise<string[]> {
|
||||
return Promise.resolve(user.followers);
|
||||
},
|
||||
};
|
||||
const followersForUser: (userName: string) => Promise<string[]> = R.pipeP(db.getUserById, db.getFollowers);
|
||||
};
|
||||
|
||||
() => {
|
||||
R.invoker(1, "slice")(6, "abcdefghijklm");
|
||||
R.invoker(2, "slice")(6)(8, "abcdefghijklm");
|
||||
|
||||
Vendored
+13
-1
@@ -144,4 +144,16 @@ declare namespace Autocomplete {
|
||||
debug?: boolean;
|
||||
}
|
||||
}
|
||||
declare class Autocomplete extends Component<Autocomplete.Props> {}
|
||||
declare class Autocomplete extends Component<Autocomplete.Props> {
|
||||
/**
|
||||
* Autocomplete exposes a subset of `HTMLInputElement` properties to the parent component.
|
||||
* They can be accessed through Autocomplete's `ref` prop.
|
||||
*/
|
||||
blur: HTMLInputElement['blur'];
|
||||
checkValidity: HTMLInputElement['checkValidity'];
|
||||
click: HTMLInputElement['click'];
|
||||
focus: HTMLInputElement['focus'];
|
||||
select: HTMLInputElement['select'];
|
||||
setCustomValidity: HTMLInputElement['setCustomValidity'];
|
||||
setSelectionRange: HTMLInputElement['setSelectionRange'];
|
||||
}
|
||||
|
||||
Vendored
+1
@@ -88,6 +88,7 @@ export interface ReactDatePickerProps {
|
||||
yearDropdownItemNumber?: number;
|
||||
shouldCloseOnSelect?: boolean;
|
||||
showTimeSelect?: boolean;
|
||||
showTimeSelectOnly?: boolean;
|
||||
timeFormat?: string;
|
||||
timeIntervals?: number;
|
||||
minTime?: moment.Moment;
|
||||
|
||||
+343
-224
@@ -1,12 +1,14 @@
|
||||
// Type definitions for react-dates v16.0.0
|
||||
// Type definitions for react-dates v16.7.0
|
||||
// Project: https://github.com/airbnb/react-dates
|
||||
// Definitions by: Artur Ampilogov <https://github.com/Artur-A>
|
||||
// Definitions by: Artur Ampilogov <https://github.com/ArturAmpilogov>
|
||||
// Nathan Holland <https://github.com/NathanNZ>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.6
|
||||
|
||||
import * as React from "react";
|
||||
import * as moment from "moment";
|
||||
// Required fields are made according to 'minimum REQUIRED setup' in https://github.com/airbnb/react-dates/blob/master/README.md
|
||||
|
||||
import * as React from 'react';
|
||||
import * as moment from 'moment';
|
||||
|
||||
export = ReactDates;
|
||||
|
||||
@@ -18,42 +20,273 @@ declare namespace momentPropTypes {
|
||||
|
||||
|
||||
declare namespace ReactDates {
|
||||
// SHAPES
|
||||
//
|
||||
// shapes/AnchorDirectionShape.js
|
||||
type AnchorDirectionShape = 'left' | 'right';
|
||||
type FocusedInputShape = 'startDate' | 'endDate';
|
||||
type OrientationShape = 'horizontal' | 'vertical';
|
||||
type ScrollableOrientationShape = 'horizontal' | 'vertical' | 'verticalScrollable';
|
||||
|
||||
// shapes/CalendarInfoPositionShape.js
|
||||
type CalendarInfoPositionShape = 'top' | 'bottom' | 'before' | 'after';
|
||||
|
||||
//https://github.com/airbnb/react-dates/blob/v16.0.1/src/defaultPhrases.js
|
||||
type SingleDatePickerPhrases = {
|
||||
closeDatePicker: string,
|
||||
clearDate: string,
|
||||
jumpToPrevMonth: string,
|
||||
jumpToNextMonth: string,
|
||||
keyboardShortcuts: string,
|
||||
showKeyboardShortcutsPanel: string,
|
||||
hideKeyboardShortcutsPanel: string,
|
||||
openThisPanel: string,
|
||||
enterKey: string,
|
||||
leftArrowRightArrow: string,
|
||||
upArrowDownArrow: string,
|
||||
pageUpPageDown: string,
|
||||
homeEnd: string,
|
||||
escape: string,
|
||||
questionMark: string,
|
||||
selectFocusedDate: string,
|
||||
moveFocusByOneDay: string,
|
||||
moveFocusByOneWeek: string,
|
||||
moveFocusByOneMonth: string,
|
||||
moveFocustoStartAndEndOfWeek: string,
|
||||
returnFocusToInput: string,
|
||||
keyboardNavigationInstructions: string,
|
||||
chooseAvailableDate: (date: string) => string,
|
||||
dateIsUnavailable: (date: string) => string,
|
||||
|
||||
// shapes/DateRangePickerShape.js
|
||||
interface DateRangePickerShape {
|
||||
// required props for a functional interactive DateRangePicker
|
||||
startDate: momentPropTypes.momentObj | null,
|
||||
startDateId: string,
|
||||
endDate: momentPropTypes.momentObj | null,
|
||||
endDateId: string,
|
||||
focusedInput: FocusedInputShape | null,
|
||||
|
||||
onDatesChange: (arg: {
|
||||
startDate: momentPropTypes.momentObj | null,
|
||||
endDate: momentPropTypes.momentObj | null
|
||||
}) => void,
|
||||
onFocusChange: (arg: FocusedInputShape | null) => void,
|
||||
|
||||
onClose?: (final: { startDate: momentPropTypes.momentObj, endDate: momentPropTypes.momentObj }) => void,
|
||||
|
||||
// input related props
|
||||
startDatePlaceholderText?: string,
|
||||
endDatePlaceholderText?: string,
|
||||
disabled?: boolean,
|
||||
required?: boolean,
|
||||
readOnly?: boolean,
|
||||
screenReaderInputMessage?: string,
|
||||
showClearDates?: boolean,
|
||||
showDefaultInputIcon?: boolean,
|
||||
customInputIcon?: string | JSX.Element,
|
||||
customArrowIcon?: string | JSX.Element,
|
||||
customCloseIcon?: string | JSX.Element,
|
||||
noBorder?: boolean,
|
||||
block?: boolean,
|
||||
small?: boolean,
|
||||
regular?: boolean,
|
||||
keepFocusOnInput?: boolean,
|
||||
|
||||
// calendar presentation and interaction related props
|
||||
renderMonth?: (day: momentPropTypes.momentObj) => (string | JSX.Element),
|
||||
orientation?: OrientationShape,
|
||||
anchorDirection?: AnchorDirectionShape,
|
||||
openDirection?: OpenDirectionShape,
|
||||
horizontalMargin?: number,
|
||||
withPortal?: boolean,
|
||||
withFullScreenPortal?: boolean,
|
||||
appendToBody?: boolean,
|
||||
disableScroll?: boolean,
|
||||
daySize?: number,
|
||||
isRTL?: boolean,
|
||||
firstDayOfWeek?: DayOfWeekShape,
|
||||
initialVisibleMonth?: () => momentPropTypes.momentObj,
|
||||
numberOfMonths?: number,
|
||||
keepOpenOnDateSelect?: boolean,
|
||||
reopenPickerOnClearDates?: boolean,
|
||||
renderCalendarInfo?: () => (string | JSX.Element),
|
||||
calendarInfoPosition?: CalendarInfoPositionShape,
|
||||
hideKeyboardShortcutsPanel?: boolean,
|
||||
verticalHeight?: number,
|
||||
transitionDuration?: number,
|
||||
verticalSpacing?: number,
|
||||
|
||||
// navigation related props
|
||||
navPrev?: string | JSX.Element,
|
||||
navNext?: string | JSX.Element,
|
||||
onPrevMonthClick?: (newCurrentMonth: momentPropTypes.momentObj) => void,
|
||||
onNextMonthClick?: (newCurrentMonth: momentPropTypes.momentObj) => void,
|
||||
|
||||
// day presentation and interaction related props
|
||||
renderCalendarDay?: (day: momentPropTypes.momentObj) => (string | JSX.Element),
|
||||
renderDayContents?: (day: momentPropTypes.momentObj) => (string | JSX.Element),
|
||||
minimumNights?: number,
|
||||
enableOutsideDays?: boolean,
|
||||
isDayBlocked?: (day: any) => boolean,
|
||||
isOutsideRange?: (day: any) => boolean,
|
||||
isDayHighlighted?: (day: any) => boolean,
|
||||
|
||||
|
||||
// internationalization props
|
||||
displayFormat?: (string | (() => string)),
|
||||
monthFormat?: string,
|
||||
weekDayFormat?: string,
|
||||
phrases?: DateRangePickerPhrases,
|
||||
dayAriaLabelFormat?: string
|
||||
}
|
||||
|
||||
// shapes/DayOfWeekShape.js
|
||||
type DayOfWeekShape = 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
||||
|
||||
// shapes/DisabledShape.js
|
||||
type DisabledShape = boolean | 'startDate' | 'endDate';
|
||||
|
||||
// shapes/FocusedInputShape.js
|
||||
type FocusedInputShape = 'startDate' | 'endDate';
|
||||
|
||||
// shape/IconPositionShape.js
|
||||
type IconPositionShape = 'before' | 'after';
|
||||
|
||||
// type/OpenDirectionShape.js
|
||||
type OpenDirectionShape = 'down' | 'up';
|
||||
|
||||
// shpae/OrientationShape.js
|
||||
type OrientationShape = 'horizontal' | 'vertical';
|
||||
|
||||
// shape/ScrollableOrientationShape.js
|
||||
type ScrollableOrientationShape = 'horizontal' | 'vertical' | 'verticalScrollable';
|
||||
|
||||
|
||||
// shapes/SingleDatePickerShape.js
|
||||
interface SingleDatePickerShape {
|
||||
id: string,
|
||||
|
||||
// required props for a functional interactive SingleDatePicker
|
||||
date: momentPropTypes.momentObj | null,
|
||||
focused: boolean,
|
||||
|
||||
onDateChange: (date: momentPropTypes.momentObj | null) => void,
|
||||
onFocusChange: (arg: { focused: boolean | null }) => void,
|
||||
|
||||
// input related props
|
||||
placeholder?: string,
|
||||
disabled?: boolean,
|
||||
required?: boolean,
|
||||
readOnly?: boolean,
|
||||
screenReaderInputMessage?: string,
|
||||
showClearDate?: boolean,
|
||||
customCloseIcon?: string | JSX.Element,
|
||||
showDefaultInputIcon?: boolean,
|
||||
inputIconPosition?: IconPositionShape,
|
||||
customInputIcon?: string | JSX.Element,
|
||||
noBorder?: boolean,
|
||||
block?: boolean,
|
||||
small?: boolean,
|
||||
regular?: boolean,
|
||||
verticalSpacing?: number,
|
||||
keepFocusOnInput?: boolean,
|
||||
|
||||
// calendar presentation and interaction related props
|
||||
renderMonth?: (day: momentPropTypes.momentObj) => (string | JSX.Element),
|
||||
orientation?: OrientationShape,
|
||||
anchorDirection?: AnchorDirectionShape,
|
||||
horizontalMargin?: number,
|
||||
withPortal?: boolean,
|
||||
withFullScreenPortal?: boolean,
|
||||
appendToBody?: boolean,
|
||||
disableScroll?: boolean,
|
||||
initialVisibleMonth?: () => momentPropTypes.momentObj,
|
||||
firstDayOfWeek?: DayOfWeekShape,
|
||||
numberOfMonths?: number,
|
||||
keepOpenOnDateSelect?: boolean,
|
||||
reopenPickerOnClearDates?: boolean,
|
||||
renderCalendarInfo?: () => (string | JSX.Element),
|
||||
calendarInfoPosition?: CalendarInfoPositionShape,
|
||||
hideKeyboardShortcutsPanel?: boolean,
|
||||
daySize?: number,
|
||||
isRTL?: boolean,
|
||||
verticalHeight?: number | null,
|
||||
transitionDuration?: number,
|
||||
|
||||
// navigation related props
|
||||
navPrev?: string | JSX.Element,
|
||||
navNext?: string | JSX.Element,
|
||||
onPrevMonthClick?: (newCurrentMonth: momentPropTypes.momentObj) => void,
|
||||
onNextMonthClick?: (newCurrentMonth: momentPropTypes.momentObj) => void,
|
||||
onClose?: (final: { startDate: momentPropTypes.momentObj, endDate: momentPropTypes.momentObj }) => void,
|
||||
|
||||
// day presentation and interaction related props
|
||||
renderCalendarDay?: (day: momentPropTypes.momentObj) => (string | JSX.Element),
|
||||
renderDayContents?: (day: momentPropTypes.momentObj) => (string | JSX.Element),
|
||||
enableOutsideDays?: boolean,
|
||||
isDayBlocked?: (day: any) => boolean,
|
||||
isOutsideRange?: (day: any) => boolean,
|
||||
isDayHighlighted?: (day: any) => boolean,
|
||||
|
||||
// internationalization props
|
||||
displayFormat?: (string | (() => string)),
|
||||
monthFormat?: string,
|
||||
weekDayFormat?: string,
|
||||
phrases?: SingleDatePickerPhrases,
|
||||
dayAriaLabelFormat?: string,
|
||||
}
|
||||
|
||||
// PHRASES
|
||||
//
|
||||
// defaultPhrases.js
|
||||
type DateRangePickerPhrases = {
|
||||
calendarLabel?: string,
|
||||
closeDatePicker?: string,
|
||||
clearDates?: string,
|
||||
focusStartDate?: string,
|
||||
jumpToPrevMonth?: string,
|
||||
jumpToNextMonth?: string,
|
||||
keyboardShortcuts?: string,
|
||||
showKeyboardShortcutsPanel?: string,
|
||||
hideKeyboardShortcutsPanel?: string,
|
||||
openThisPanel?: string,
|
||||
enterKey?: string,
|
||||
leftArrowRightArrow?: string,
|
||||
upArrowDownArrow?: string,
|
||||
pageUpPageDown?: string,
|
||||
homeEnd?: string,
|
||||
escape?: string,
|
||||
questionMark?: string,
|
||||
selectFocusedDate?: string,
|
||||
moveFocusByOneDay?: string,
|
||||
moveFocusByOneWeek?: string,
|
||||
moveFocusByOneMonth?: string,
|
||||
moveFocustoStartAndEndOfWeek?: string,
|
||||
returnFocusToInput?: string,
|
||||
keyboardNavigationInstructions?: string,
|
||||
chooseAvailableStartDate?: (date: string) => string,
|
||||
chooseAvailableEndDate?: (date: string) => string,
|
||||
dateIsUnavailable?: (date: string) => string,
|
||||
dateIsSelected?: (date: string) => string
|
||||
};
|
||||
|
||||
//https://github.com/airbnb/react-dates/blob/v16.0.1/src/defaultPhrases.js
|
||||
type DateRangePickerPhrases = {
|
||||
// defaultPhrases.js
|
||||
type DateRangePickerInputPhrases = {
|
||||
focusStartDate?: string,
|
||||
clearDates?: string,
|
||||
keyboardNavigationInstructions?: string,
|
||||
}
|
||||
|
||||
// defaultPhrases.js
|
||||
type SingleDatePickerPhrases = {
|
||||
calendarLabel?: string,
|
||||
closeDatePicker?: string,
|
||||
clearDate?: string,
|
||||
jumpToPrevMonth?: string,
|
||||
jumpToNextMonth?: string,
|
||||
keyboardShortcuts?: string,
|
||||
showKeyboardShortcutsPanel?: string,
|
||||
hideKeyboardShortcutsPanel?: string,
|
||||
openThisPanel?: string,
|
||||
enterKey?: string,
|
||||
leftArrowRightArrow?: string,
|
||||
upArrowDownArrow?: string,
|
||||
pageUpPageDown?: string,
|
||||
homeEnd?: string,
|
||||
escape?: string,
|
||||
questionMark?: string,
|
||||
selectFocusedDate?: string,
|
||||
moveFocusByOneDay?: string,
|
||||
moveFocusByOneWeek?: string,
|
||||
moveFocusByOneMonth?: string,
|
||||
moveFocustoStartAndEndOfWeek?: string,
|
||||
returnFocusToInput?: string,
|
||||
keyboardNavigationInstructions?: string,
|
||||
chooseAvailableDate?: (date: string) => string,
|
||||
dateIsUnavailable?: (date: string) => string,
|
||||
dateIsSelected?: (date: string) => string,
|
||||
};
|
||||
|
||||
// defaultPhrases.js
|
||||
type SingleDatePickerInputPhrases = {
|
||||
clearDate?: string,
|
||||
keyboardNavigationInstructions?: string,
|
||||
}
|
||||
|
||||
// defaultPhrases.js
|
||||
type DayPickerPhrases = {
|
||||
calendarLabel?: string,
|
||||
jumpToPrevMonth?: string,
|
||||
jumpToNextMonth?: string,
|
||||
@@ -78,156 +311,52 @@ declare namespace ReactDates {
|
||||
chooseAvailableEndDate?: (date: string) => string,
|
||||
chooseAvailableDate?: (date: string) => string,
|
||||
dateIsUnavailable?: (date: string) => string,
|
||||
dateIsSelected?: (date: string) => string
|
||||
dateIsSelected?: (date: string) => string,
|
||||
};
|
||||
|
||||
//https://github.com/airbnb/react-dates/blob/v16.0.1/src/shapes/DateRangePickerShape.js
|
||||
interface DateRangePickerShape {
|
||||
// REQUIRED props
|
||||
startDate: momentPropTypes.momentObj | null,
|
||||
endDate: momentPropTypes.momentObj | null,
|
||||
onDatesChange: (arg: {
|
||||
startDate: momentPropTypes.momentObj | null,
|
||||
endDate: momentPropTypes.momentObj | null
|
||||
}
|
||||
) => void,
|
||||
focusedInput: FocusedInputShape | null,
|
||||
onFocusChange: (arg: FocusedInputShape | null) => void,
|
||||
|
||||
// input related props
|
||||
startDateId?: string,
|
||||
startDatePlaceholderText?: string,
|
||||
endDateId?: string,
|
||||
endDatePlaceholderText?: string,
|
||||
disabled?: boolean,
|
||||
keepFocusOnInput?: boolean,
|
||||
required?: boolean,
|
||||
readOnly?: boolean,
|
||||
screenReaderInputMessage?: string,
|
||||
showClearDates?: boolean,
|
||||
showDefaultInputIcon?: boolean,
|
||||
customInputIcon?: string | JSX.Element,
|
||||
customArrowIcon?: string | JSX.Element,
|
||||
customCloseIcon?: string | JSX.Element,
|
||||
noBorder?: boolean,
|
||||
block?: boolean,
|
||||
// defaultPhrases.js
|
||||
type DayPickerKeyboardShortcutsPhrases = {
|
||||
keyboardShortcuts?: string,
|
||||
showKeyboardShortcutsPanel?: string,
|
||||
hideKeyboardShortcutsPanel?: string,
|
||||
openThisPanel?: string,
|
||||
enterKey?: string,
|
||||
leftArrowRightArrow?: string,
|
||||
upArrowDownArrow?: string,
|
||||
pageUpPageDown?: string,
|
||||
homeEnd?: string,
|
||||
escape?: string,
|
||||
questionMark?: string,
|
||||
selectFocusedDate?: string,
|
||||
moveFocusByOneDay?: string,
|
||||
moveFocusByOneWeek?: string,
|
||||
moveFocusByOneMonth?: string,
|
||||
moveFocustoStartAndEndOfWeek?: string,
|
||||
returnFocusToInput?: string,
|
||||
};
|
||||
|
||||
// calendar presentation and interaction related props
|
||||
renderMonth?: (day: momentPropTypes.momentObj) => (string | JSX.Element),
|
||||
orientation?: OrientationShape,
|
||||
anchorDirection?: AnchorDirectionShape,
|
||||
horizontalMargin?: number,
|
||||
withPortal?: boolean,
|
||||
withFullScreenPortal?: boolean,
|
||||
initialVisibleMonth?: () => momentPropTypes.momentObj,
|
||||
firstDayOfWeek?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
|
||||
numberOfMonths?: number,
|
||||
keepOpenOnDateSelect?: boolean,
|
||||
reopenPickerOnClearDates?: boolean,
|
||||
renderCalendarInfo?: () => (string | JSX.Element),
|
||||
hideKeyboardShortcutsPanel?: boolean,
|
||||
daySize?: number,
|
||||
isRTL?: boolean,
|
||||
// defaultPhrases.js
|
||||
type DayPickerNavigationPhrases = {
|
||||
jumpToPrevMonth?: string,
|
||||
jumpToNextMonth?: string,
|
||||
};
|
||||
|
||||
// defaultPhrases.js
|
||||
type CalendarDayPhrases = {
|
||||
chooseAvailableDate: (date: string) => string,
|
||||
dateIsUnavailable: (date: string) => string,
|
||||
dateIsSelected: (date: string) => string,
|
||||
};
|
||||
|
||||
// navigation related props
|
||||
navPrev?: string | JSX.Element,
|
||||
navNext?: string | JSX.Element,
|
||||
onPrevMonthClick?: (newCurrentMonth: momentPropTypes.momentObj) => void,
|
||||
onNextMonthClick?: (newCurrentMonth: momentPropTypes.momentObj) => void,
|
||||
onClose?: (final: { startDate: momentPropTypes.momentObj, endDate: momentPropTypes.momentObj }) => void,
|
||||
transitionDuration?: number,
|
||||
|
||||
// day presentation and interaction related props
|
||||
renderCalendarDay?: (day: momentPropTypes.momentObj) => (string | JSX.Element),
|
||||
renderDayContents?: (day: momentPropTypes.momentObj) => (string | JSX.Element),
|
||||
minimumNights?: number,
|
||||
enableOutsideDays?: boolean,
|
||||
isDayBlocked?: (day: any) => boolean,
|
||||
isOutsideRange?: (day: any) => boolean,
|
||||
isDayHighlighted?: (day: any) => boolean,
|
||||
|
||||
|
||||
// internationalization props
|
||||
displayFormat?: (string | (() => string)),
|
||||
monthFormat?: string,
|
||||
weekDayFormat?: string,
|
||||
phrases?: DateRangePickerPhrases
|
||||
}
|
||||
// COMPONENTS
|
||||
//
|
||||
// components/DateRangePicker.js
|
||||
|
||||
type DateRangePicker = React.ClassicComponentClass<DateRangePickerShape>;
|
||||
var DateRangePicker: React.ClassicComponentClass<DateRangePickerShape>;
|
||||
|
||||
//https://github.com/airbnb/react-dates/blob/v16.0.1/src/shapes/SingleDatePickerShape.js
|
||||
interface SingleDatePickerShape {
|
||||
// REQUIRED props
|
||||
date: momentPropTypes.momentObj | null,
|
||||
onDateChange: (date: momentPropTypes.momentObj | null) => void,
|
||||
focused: boolean,
|
||||
onFocusChange: (arg: { focused: boolean | null }) => void,
|
||||
|
||||
id: string,
|
||||
|
||||
// input related props
|
||||
placeholder?: string,
|
||||
disabled?: boolean,
|
||||
required?: boolean,
|
||||
readOnly?: boolean,
|
||||
screenReaderInputMessage?: string,
|
||||
showClearDate?: boolean,
|
||||
customCloseIcon?: string | JSX.Element,
|
||||
showDefaultInputIcon?: boolean,
|
||||
customInputIcon?: string | JSX.Element,
|
||||
noBorder?: boolean,
|
||||
block?: boolean,
|
||||
small?: boolean,
|
||||
regular?: boolean,
|
||||
keepFocusOnInput?: boolean,
|
||||
|
||||
// calendar presentation and interaction related props
|
||||
renderMonth?: (day: momentPropTypes.momentObj) => (string | JSX.Element),
|
||||
orientation?: OrientationShape,
|
||||
anchorDirection?: AnchorDirectionShape,
|
||||
horizontalMargin?: number,
|
||||
withPortal?: boolean,
|
||||
withFullScreenPortal?: boolean,
|
||||
initialVisibleMonth?: () => momentPropTypes.momentObj,
|
||||
firstDayOfWeek?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
|
||||
numberOfMonths?: number,
|
||||
keepOpenOnDateSelect?: boolean,
|
||||
reopenPickerOnClearDates?: boolean,
|
||||
renderCalendarInfo?: () => (string | JSX.Element),
|
||||
hideKeyboardShortcutsPanel?: boolean,
|
||||
daySize?: number,
|
||||
isRTL?: boolean,
|
||||
verticalSpacing?: number,
|
||||
verticalHeight?: number | null,
|
||||
|
||||
// navigation related props
|
||||
navPrev?: string | JSX.Element,
|
||||
navNext?: string | JSX.Element,
|
||||
onPrevMonthClick?: (newCurrentMonth: momentPropTypes.momentObj) => void,
|
||||
onNextMonthClick?: (newCurrentMonth: momentPropTypes.momentObj) => void,
|
||||
onClose?: (final: { startDate: momentPropTypes.momentObj, endDate: momentPropTypes.momentObj }) => void,
|
||||
transitionDuration?: number,
|
||||
|
||||
// day presentation and interaction related props
|
||||
renderCalendarDay?: (day: momentPropTypes.momentObj) => (string | JSX.Element),
|
||||
renderDayContents?: (day: momentPropTypes.momentObj) => (string | JSX.Element),
|
||||
enableOutsideDays?: boolean,
|
||||
isDayBlocked?: (day: any) => boolean,
|
||||
isOutsideRange?: (day: any) => boolean,
|
||||
isDayHighlighted?: (day: any) => boolean,
|
||||
|
||||
// internationalization props
|
||||
displayFormat?: (string | (() => string)),
|
||||
monthFormat?: string,
|
||||
phrases?: SingleDatePickerPhrases
|
||||
}
|
||||
type SingleDatePicker = React.ClassicComponentClass<SingleDatePickerShape>;
|
||||
var SingleDatePicker: React.ClassicComponentClass<SingleDatePickerShape>;
|
||||
|
||||
//https://github.com/airbnb/react-dates/blob/v16.0.1/src/components/DayPickerRangeController.jsx
|
||||
interface DayPickerRangeControllerShape {
|
||||
// components/DayPickerRangeController.jsx
|
||||
interface DayPickerRangeControllerShape extends DayPickerShape{
|
||||
// REQUIRED props
|
||||
startDate: momentPropTypes.momentObj | null,
|
||||
endDate: momentPropTypes.momentObj | null,
|
||||
@@ -236,62 +365,27 @@ declare namespace ReactDates {
|
||||
endDate: momentPropTypes.momentObj | null
|
||||
}
|
||||
) => void,
|
||||
focusedInput: FocusedInputShape | null,
|
||||
focusedInput: FocusedInputShape,
|
||||
onFocusChange: (arg: FocusedInputShape | null) => void,
|
||||
|
||||
// calendar presentation and interaction related props
|
||||
enableOutsideDays?: boolean,
|
||||
numberOfMonths?: number,
|
||||
orientation?: ScrollableOrientationShape,
|
||||
withPortal?: boolean,
|
||||
initialVisibleMonth?: () => momentPropTypes.momentObj,
|
||||
renderCalendarInfo?: () => (string | JSX.Element),
|
||||
onOutsideClick?: (e: any) => void,
|
||||
startDateOffset?: (day: any) => any,
|
||||
endDateOffset?: (day: any) => any,
|
||||
|
||||
onClose?: (final: { startDate: momentPropTypes.momentObj, endDate: momentPropTypes.momentObj }) => void,
|
||||
|
||||
keepOpenOnDateSelect?: boolean,
|
||||
hideKeyboardShortcutsPanel?: boolean;
|
||||
noBorder?: boolean,
|
||||
verticalBorderSpacing?: number,
|
||||
firstDayOfWeek? : 0 | 1 | 2 | 3 | 4 | 5 | 6,
|
||||
|
||||
// navigation related props
|
||||
navPrev?: string | JSX.Element,
|
||||
navNext?: string | JSX.Element,
|
||||
onPrevMonthClick?: (newCurrentMonth: momentPropTypes.momentObj) => void,
|
||||
onNextMonthClick?: (newCurrentMonth: momentPropTypes.momentObj) => void,
|
||||
transitionDuration?: number,
|
||||
|
||||
// day presentation and interaction related props
|
||||
daySize?: number,
|
||||
renderCalendarDay?: (day: momentPropTypes.momentObj) => (string | JSX.Element),
|
||||
renderDayContents?: (day: momentPropTypes.momentObj) => (string | JSX.Element),
|
||||
minimumNights?: number,
|
||||
disabled?: DisabledShape,
|
||||
isOutsideRange?: (day: any) => boolean,
|
||||
isDayBlocked?: (day: any) => boolean,
|
||||
isDayHighlighted?: (day: any) => boolean,
|
||||
|
||||
// internationalization props
|
||||
monthFormat?: string,
|
||||
phrases?: DateRangePickerPhrases
|
||||
}
|
||||
|
||||
type DayPickerRangeController = React.ClassicComponentClass<DayPickerRangeControllerShape>;
|
||||
var DayPickerRangeController: React.ClassicComponentClass<DayPickerRangeControllerShape>;
|
||||
|
||||
//https://github.com/airbnb/react-dates/blob/97bf16e72dbf5ce88f0181c49212080061a83f69/src/components/DayPickerSingleDateController.jsx
|
||||
interface DayPickerSingleDateControllerShape {
|
||||
date: momentPropTypes.momentObj | null,
|
||||
onDateChange: (date: momentPropTypes.momentObj | null) => void,
|
||||
focused: boolean,
|
||||
|
||||
onFocusChange: (arg: { focused: boolean | null }) => void,
|
||||
onClose?: (final: { date: momentPropTypes.momentObj }) => void,
|
||||
|
||||
keepOpenOnDateSelect?: boolean,
|
||||
isOutsideRange?: (day: any) => boolean,
|
||||
isDayBlocked?: (day: any) => boolean,
|
||||
isDayHighlighted?: (day: any) => boolean,
|
||||
|
||||
// DayPicker props
|
||||
// components/DayPickerShape.jsx
|
||||
interface DayPickerShape {
|
||||
renderMonth?: (day: momentPropTypes.momentObj) => (string | JSX.Element),
|
||||
enableOutsideDays?: boolean,
|
||||
numberOfMonths?: number,
|
||||
@@ -327,20 +421,45 @@ declare namespace ReactDates {
|
||||
phrases?: SingleDatePickerPhrases,
|
||||
dayAriaLabelFormat?: string,
|
||||
|
||||
isRTL?: boolean,
|
||||
isRTL?: boolean
|
||||
}
|
||||
|
||||
// components/DayPickerSingleDateController.jsx
|
||||
interface DayPickerSingleDateControllerShape extends DayPickerShape {
|
||||
date: momentPropTypes.momentObj | null,
|
||||
onDateChange: (date: momentPropTypes.momentObj | null) => void,
|
||||
focused: boolean,
|
||||
onFocusChange: (arg: { focused: boolean | null }) => void,
|
||||
|
||||
onClose?: (final: { date: momentPropTypes.momentObj }) => void,
|
||||
|
||||
keepOpenOnDateSelect?: boolean,
|
||||
isOutsideRange?: (day: any) => boolean,
|
||||
isDayBlocked?: (day: any) => boolean,
|
||||
isDayHighlighted?: (day: any) => boolean,
|
||||
}
|
||||
|
||||
type DayPickerSingleDateController = React.ClassicComponentClass<DayPickerSingleDateControllerShape>;
|
||||
var DayPickerSingleDateController: React.ClassicComponentClass<DayPickerSingleDateControllerShape>;
|
||||
|
||||
// components/SingleDatePicker.js
|
||||
type SingleDatePicker = React.ClassicComponentClass<SingleDatePickerShape>;
|
||||
var SingleDatePicker: React.ClassicComponentClass<SingleDatePickerShape>;
|
||||
|
||||
// UTILS
|
||||
//
|
||||
// utils/isInclusivelyAfterDay.js
|
||||
var isInclusivelyAfterDay: (a: moment.Moment, b: moment.Moment) => boolean;
|
||||
// utils/isInclusivelyBeforeDay.js
|
||||
var isInclusivelyBeforeDay: (a: moment.Moment, b: moment.Moment) => boolean;
|
||||
// utils/isNextDay.js
|
||||
var isNextDay: (a: moment.Moment, b: moment.Moment) => boolean;
|
||||
// utils/isSameDay.js
|
||||
var isSameDay: (a: moment.Moment, b: moment.Moment) => boolean;
|
||||
|
||||
// utils/toISODateString.js
|
||||
var toISODateString: (date: moment.MomentInput, currentFormat: moment.MomentFormatSpecification) => string | null;
|
||||
// utils/toLocalizedDateString.js
|
||||
var toLocalizedDateString: (date: moment.MomentInput, currentFormat: moment.MomentFormatSpecification) => string | null;
|
||||
|
||||
// utils/toMomentObject.js
|
||||
var toMomentObject: (dateString: moment.MomentInput, customFormat: moment.MomentFormatSpecification) => moment.Moment | null;
|
||||
}
|
||||
|
||||
Regular → Executable
+6
-3
@@ -1,5 +1,5 @@
|
||||
import * as React from "react";
|
||||
import moment = require("moment");
|
||||
import * as React from 'react';
|
||||
import moment = require('moment');
|
||||
|
||||
import {
|
||||
SingleDatePicker,
|
||||
@@ -75,9 +75,11 @@ class DateRangePickerMinimumTest extends React.Component {
|
||||
render() {
|
||||
return <DateRangePicker
|
||||
startDate={moment()}
|
||||
startDateId='startDateId'
|
||||
endDate={moment()}
|
||||
onDatesChange={(arg)=> {}}
|
||||
endDateId='endDateId'
|
||||
focusedInput="startDate"
|
||||
onDatesChange={(arg) => {}}
|
||||
onFocusChange={(arg) => {}}
|
||||
/>
|
||||
}
|
||||
@@ -122,6 +124,7 @@ class DateRangePickerFullTest extends React.Component {
|
||||
orientation="horizontal"
|
||||
monthFormat="MM"
|
||||
renderDayContents={day => day.toString()}
|
||||
onClose={(final:any) =>{}}
|
||||
/>
|
||||
}
|
||||
}
|
||||
|
||||
+4
-2
@@ -21,7 +21,7 @@ interface ReactFacebookLoginProps {
|
||||
icon?: string | React.ReactNode;
|
||||
isDisabled?: boolean;
|
||||
language?: string;
|
||||
onClick?(): void;
|
||||
onClick?(event: React.MouseEvent<HTMLDivElement>): void;
|
||||
reAuthenticate?: boolean;
|
||||
redirectUri?: string;
|
||||
scope?: string;
|
||||
@@ -40,7 +40,9 @@ export interface ReactFacebookFailureResponse {
|
||||
|
||||
export interface ReactFacebookLoginInfo {
|
||||
id: string;
|
||||
name: string;
|
||||
accessToken: string;
|
||||
name?: string;
|
||||
email?: string;
|
||||
}
|
||||
|
||||
interface ReactFacebookLoginState {
|
||||
|
||||
+8
-6
@@ -1,6 +1,7 @@
|
||||
// Type definitions for react-native-navigation 1.1
|
||||
// Project: https://github.com/wix/react-native-navigation
|
||||
// Definitions by: Egor Shulga <https://github.com/egorshulga>
|
||||
// Jason Merino <https://github.com/jasonmerino>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.6
|
||||
|
||||
@@ -85,13 +86,13 @@ export interface ModalScreen extends Screen {
|
||||
animationType?: 'slide-up' | 'none';
|
||||
}
|
||||
|
||||
export interface ResetScreen extends Screen {
|
||||
passProps?: object;
|
||||
export interface ResetScreen<P> extends Screen {
|
||||
passProps?: P;
|
||||
animated?: boolean;
|
||||
animationType?: 'fade' | 'slide-horizontal';
|
||||
}
|
||||
|
||||
export interface PushedScreen extends ResetScreen {
|
||||
export interface PushedScreen<P> extends ResetScreen<P> {
|
||||
titleImage?: any;
|
||||
backButtonTitle?: string;
|
||||
backButtonHidden?: boolean;
|
||||
@@ -119,14 +120,15 @@ export interface LightBox {
|
||||
}
|
||||
|
||||
export interface NavigatorEvent {
|
||||
id: 'willAppear' | 'didAppear' | 'willDisappear' | 'didDisappear' | 'willCommitPreview' | 'backPress';
|
||||
id: 'willAppear' | 'didAppear' | 'willDisappear' | 'didDisappear' | 'willCommitPreview' | 'backPress' | 'bottomTabSelected' | 'bottomTabReselected' | string;
|
||||
type: 'NavBarButtonPress' | 'DeepLink';
|
||||
}
|
||||
|
||||
export class Navigator {
|
||||
push(params: PushedScreen): void;
|
||||
push<P>(params: PushedScreen<P>): void;
|
||||
pop(params?: { animated?: boolean; animationType?: 'fade' | 'slide-horizontal'; }): void;
|
||||
popToRoot(params?: { animated?: boolean; animationType?: 'fade' | 'slide-horizontal'; }): void;
|
||||
resetTo(params: PushedScreen): void;
|
||||
resetTo<P>(params: PushedScreen<P>): void;
|
||||
showModal(params: ModalScreen): void;
|
||||
dismissModal(params?: { animationType?: 'none' | 'slide-down' }): void;
|
||||
dismissAllModals(params?: { animationType?: 'none' | 'slide-down' }): void;
|
||||
|
||||
@@ -20,6 +20,8 @@ class Screen1 extends React.Component<Props> {
|
||||
onNavigatorEvent = (event: NavigatorEvent) => {
|
||||
if (event.id === 'willAppear') {
|
||||
console.log('will appear');
|
||||
} else if (event.type === 'NavBarButtonPress' && event.id === 'sideMenu') {
|
||||
console.log('side menu pressed');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,7 +32,11 @@ class Screen1 extends React.Component<Props> {
|
||||
};
|
||||
|
||||
componentDidMount() {
|
||||
this.props.navigator.push({ screen: 'example.Screen2', overrideBackPress: false });
|
||||
this.props.navigator.push<Screen2OwnProps>({
|
||||
screen: 'example.Screen2',
|
||||
overrideBackPress: false,
|
||||
passProps: { name: 'Henrik' },
|
||||
});
|
||||
this.props.navigator.setTabBadge({ badge: null });
|
||||
}
|
||||
|
||||
@@ -43,7 +49,13 @@ class Screen1 extends React.Component<Props> {
|
||||
}
|
||||
}
|
||||
|
||||
class Screen2 extends React.Component<NavigationComponentProps> {
|
||||
interface Screen2OwnProps {
|
||||
name: string;
|
||||
}
|
||||
|
||||
type Screen2Props = Screen2OwnProps & NavigationComponentProps;
|
||||
|
||||
class Screen2 extends React.Component<Screen2Props> {
|
||||
static navigatorStyle: NavigatorStyle = {
|
||||
drawUnderNavBar: true,
|
||||
navBarTranslucent: true
|
||||
@@ -57,6 +69,7 @@ class Screen2 extends React.Component<NavigationComponentProps> {
|
||||
return (
|
||||
<View>
|
||||
<Text>Screen 2</Text>
|
||||
<Text>Hello {this.props.name}</Text>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
{ "extends": "dtslint/dt.json", "rules": {"no-unnecessary-generics": false} }
|
||||
|
||||
Vendored
+4
@@ -10,6 +10,7 @@
|
||||
// Manuel Alabor <https://github.com/swissmanu>
|
||||
// Michele Bombardi <https://github.com/bm-software>
|
||||
// Tanguy Krotoff <https://github.com/tkrotoff>
|
||||
// Alexander T. <https://github.com/a-tarasyuk>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.6
|
||||
|
||||
@@ -360,6 +361,9 @@ export interface NativeSyntheticEvent<T> {
|
||||
eventPhase: number;
|
||||
isTrusted: boolean;
|
||||
nativeEvent: T;
|
||||
isPropagationStopped(): boolean;
|
||||
isDefaultPrevented(): boolean;
|
||||
persist(): void;
|
||||
preventDefault(): void;
|
||||
stopPropagation(): void;
|
||||
target: NodeHandle;
|
||||
|
||||
@@ -49,10 +49,12 @@ import {
|
||||
NativeModules,
|
||||
MaskedViewIOS,
|
||||
TextInput,
|
||||
TouchableNativeFeedback,
|
||||
TextInputFocusEventData,
|
||||
InputAccessoryView,
|
||||
StatusBar,
|
||||
NativeSyntheticEvent
|
||||
NativeSyntheticEvent,
|
||||
GestureResponderEvent
|
||||
} from "react-native";
|
||||
|
||||
declare module "react-native" {
|
||||
@@ -195,6 +197,27 @@ class Welcome extends React.Component {
|
||||
|
||||
export default Welcome;
|
||||
|
||||
// SyntheticEventsTest
|
||||
export class SyntheticEventsTest extends React.Component {
|
||||
onPressButton(e: GestureResponderEvent) {
|
||||
e.persist();
|
||||
e.isPropagationStopped();
|
||||
e.isDefaultPrevented();
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<TouchableNativeFeedback
|
||||
onPress={this.onPressButton}
|
||||
>
|
||||
<View style={{width: 150, height: 100, backgroundColor: 'red'}}>
|
||||
<Text style={{margin: 30}}>Button</Text>
|
||||
</View>
|
||||
</TouchableNativeFeedback>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
// App State
|
||||
|
||||
function appStateListener(state: string) {
|
||||
|
||||
Vendored
+30
@@ -341,6 +341,21 @@ export interface NavigationPushAction {
|
||||
key?: string;
|
||||
}
|
||||
|
||||
export interface NavigationOpenDrawerAction {
|
||||
key?: string;
|
||||
type: 'Navigation/OPEN_DRAWER';
|
||||
}
|
||||
|
||||
export interface NavigationCloseDrawerAction {
|
||||
key?: string;
|
||||
type: 'Navigation/CLOSE_DRAWER';
|
||||
}
|
||||
|
||||
export interface NavigationToggleDrawerAction {
|
||||
key?: string;
|
||||
type: 'Navigation/TOGGLE_DRAWER';
|
||||
}
|
||||
|
||||
export interface NavigationStackViewConfig {
|
||||
mode?: 'card' | 'modal';
|
||||
headerMode?: HeaderMode;
|
||||
@@ -607,6 +622,7 @@ export interface NavigationScene {
|
||||
isStale: boolean;
|
||||
key: string;
|
||||
route: NavigationRoute;
|
||||
descriptor: NavigationDescriptor;
|
||||
}
|
||||
|
||||
export interface NavigationTransitionProps {
|
||||
@@ -964,6 +980,19 @@ export namespace NavigationActions {
|
||||
): NavigationPopToTopAction;
|
||||
}
|
||||
|
||||
/**
|
||||
* DrawerActions
|
||||
*/
|
||||
export namespace DrawerActions {
|
||||
const OPEN_DRAWER: 'Navigation/OPEN_DRAWER';
|
||||
const CLOSE_DRAWER: 'Navigation/CLOSE_DRAWER';
|
||||
const TOGGLE_DRAWER: 'Navigation/TOGGLE_DRAWER';
|
||||
|
||||
function openDrawer(): NavigationOpenDrawerAction;
|
||||
function closeDrawer(): NavigationCloseDrawerAction;
|
||||
function toggleDrawer(): NavigationToggleDrawerAction;
|
||||
}
|
||||
|
||||
/**
|
||||
* StackActions
|
||||
*/
|
||||
@@ -1058,6 +1087,7 @@ export interface NavigationDescriptor<Params = NavigationParams> {
|
||||
key: string;
|
||||
state: NavigationLeafRoute<Params> | NavigationStateRoute<Params>;
|
||||
navigation: NavigationScreenProp<any>;
|
||||
options: NavigationScreenOptions;
|
||||
getComponent: () => React.ComponentType;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import * as React from 'react';
|
||||
import {
|
||||
Text,
|
||||
TouchableOpacity,
|
||||
View,
|
||||
ViewStyle,
|
||||
@@ -469,3 +470,22 @@ const BottomStack = createBottomTabNavigator({
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
const CustomHeaderStack = createStackNavigator({
|
||||
Page1: { screen: Page1 },
|
||||
Page2: { screen: Page2 }
|
||||
},
|
||||
{
|
||||
navigationOptions: {
|
||||
header: headerProps => {
|
||||
const { scene } = headerProps;
|
||||
const { options } = scene.descriptor;
|
||||
const { title, headerStyle, headerTitleStyle } = options;
|
||||
return (
|
||||
<View style={headerStyle}>
|
||||
<Text style={headerTitleStyle}>{title}</Text>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Vendored
+2
-2
@@ -910,7 +910,7 @@ export interface XAxisProps extends EventAttributes {
|
||||
interval?: AxisInterval;
|
||||
reversed?: boolean;
|
||||
// see label section at http://recharts.org/#/en-US/api/XAxis
|
||||
label?: string | number | Label;
|
||||
label?: string | number | Label | LabelProps;
|
||||
}
|
||||
|
||||
export class XAxis extends React.Component<XAxisProps> { }
|
||||
@@ -961,7 +961,7 @@ export interface YAxisProps extends EventAttributes {
|
||||
interval?: AxisInterval;
|
||||
reversed?: boolean;
|
||||
// see label section at http://recharts.org/#/en-US/api/YAxis
|
||||
label?: string | number | Label;
|
||||
label?: string | number | Label | LabelProps;
|
||||
}
|
||||
|
||||
export class YAxis extends React.Component<YAxisProps> { }
|
||||
|
||||
@@ -136,12 +136,8 @@ class Component extends React.Component<{}, ComponentState> {
|
||||
</ResponsiveContainer>
|
||||
<ResponsiveContainer>
|
||||
<LineChart width={500} height={300} data={data}>
|
||||
<XAxis dataKey="name">
|
||||
<Label>X axis - name</Label>
|
||||
</XAxis>
|
||||
<YAxis>
|
||||
<Label>Y axis</Label>
|
||||
</YAxis>
|
||||
<XAxis dataKey="name" label={{ value: "X axis - name" }} />
|
||||
<YAxis label={{ value: "Y axis" }} />
|
||||
<CartesianGrid stroke="#eee" strokeDasharray="5 5" />
|
||||
<Line type="monotone" dataKey="uv" stroke="#8884d8" onClick={ this.clickHandler } />
|
||||
<Line type="monotone" dataKey="pv" stroke="#82ca9d" />
|
||||
|
||||
Vendored
+1
-1
@@ -406,7 +406,7 @@ export class Display {
|
||||
clear(): void;
|
||||
computeSize(availWidth: number, availHeight: number): [number, number];
|
||||
computeFontSize(availWidth: number, availHeight: number): number;
|
||||
draw(x: number, y: number, character: string | string[], fg?: string, bg?: string): void;
|
||||
draw(x: number, y: number, character: string | string[], fg?: string | string[], bg?: string | string[]): void;
|
||||
drawText(x: number, y: number, text: string, maxWidth?: number): number;
|
||||
eventToPosition(e: UIEvent): [number, number] | number;
|
||||
getContainer(): Node;
|
||||
|
||||
@@ -324,6 +324,35 @@ tileSet.onload = () => {
|
||||
display.draw(2, 1, "#", "transparent", "rgba(250, 250, 0, 0.5)");
|
||||
};
|
||||
|
||||
// Console display / graphical tiles / Colorized tile stacks
|
||||
|
||||
tileSet = document.createElement("img");
|
||||
tileSet.src = "tiles.png";
|
||||
|
||||
options = {
|
||||
layout: "tile",
|
||||
bg: "transparent",
|
||||
tileWidth: 64,
|
||||
tileHeight: 64,
|
||||
tileSet,
|
||||
tileColorize: true,
|
||||
tileMap: {
|
||||
"@": [0, 0],
|
||||
"#": [0, 64]
|
||||
},
|
||||
width: 1,
|
||||
height: 1
|
||||
};
|
||||
display = new ROT.Display(options);
|
||||
SHOW(display.getContainer());
|
||||
|
||||
tileSet.onload = () => {
|
||||
const ch = ["#", "@"];
|
||||
const fg = ["rgba(255, 0, 0, 0.5)", "rgba(0, 0, 255, 0.5)"];
|
||||
const bg = ["transparent", "transparent"];
|
||||
display.draw(0, 0, ch, fg, bg);
|
||||
};
|
||||
|
||||
// Map creation
|
||||
let map = new ROT.Map.Arena(3, 3);
|
||||
const userCallback = (x: number, y: number, value: number) => {
|
||||
|
||||
Vendored
+6
@@ -13,6 +13,7 @@
|
||||
// Florian Oellerich <https://github.com/Raigen>
|
||||
// Todd Bealmear <https://github.com/todd>
|
||||
// Nick Schultz <https://github.com/nrschultz>
|
||||
// Thomas Breleur <https://github.com/thomas-b>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
@@ -3270,6 +3271,11 @@ declare namespace sequelize {
|
||||
paranoid?: boolean;
|
||||
|
||||
all?: boolean | string;
|
||||
|
||||
/**
|
||||
* if true, it will also eager load the relations of the child models, recursively.
|
||||
*/
|
||||
nested?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -933,6 +933,7 @@ User.findAll( { include : [{ all : 'HasMany', attributes : ['name'] }] } );
|
||||
User.findAll( { include : [{ all : true }, { model : User, attributes : ['id'] }] } );
|
||||
User.findAll( { include : [{ all : 'BelongsTo' }] } );
|
||||
User.findAll( { include : [{ all : true }] } );
|
||||
User.findAll( { include : [{ nested : true }] } );
|
||||
User.findAll( { where : { username : 'barfooz' }, raw : true } );
|
||||
User.findAll( { where : { name : 'worker' }, include : [{ model : User, as : 'ToDos' }] } );
|
||||
User.findAll( { where : { user_id : 1 }, attributes : ['a', 'b'], include : [{ model : User, attributes : ['c'] }] } );
|
||||
|
||||
Vendored
+5
@@ -12,6 +12,11 @@ declare class SerialPort extends Stream.Duplex {
|
||||
constructor(path: string, callback?: SerialPort.ErrorCallback);
|
||||
constructor(path: string, options?: SerialPort.OpenOptions, callback?: SerialPort.ErrorCallback);
|
||||
|
||||
readonly baudRate: number;
|
||||
readonly binding: SerialPort.BaseBinding;
|
||||
readonly isOpen: boolean;
|
||||
readonly path: string;
|
||||
|
||||
open(callback?: SerialPort.ErrorCallback): void;
|
||||
update(options: SerialPort.UpdateOptions, callback?: SerialPort.ErrorCallback): void;
|
||||
|
||||
|
||||
@@ -117,3 +117,12 @@ function test_parsers() {
|
||||
port.pipe(ReadyParser);
|
||||
port.pipe(RegexParser);
|
||||
}
|
||||
|
||||
function test_properties() {
|
||||
const port = new SerialPort('');
|
||||
|
||||
const baudRate: number = port.baudRate;
|
||||
const binding: SerialPort.BaseBinding = port.binding;
|
||||
const isOpen: boolean = port.isOpen;
|
||||
const path: string = port.path;
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -3,7 +3,7 @@
|
||||
// Definitions by: Sean Kelley <https://github.com/seansfkelley>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare function shallowEqual(objA: any, objB: any, compare?: (objA: any, objB: any, indexOrKey?: number | string) => boolean, compareContext?: any): boolean;
|
||||
declare function shallowEqual(objA: any, objB: any, compare?: (objA: any, objB: any, indexOrKey?: number | string) => (boolean | undefined), compareContext?: any): boolean;
|
||||
|
||||
declare namespace shallowEqual { }
|
||||
|
||||
|
||||
Vendored
+22
-2
@@ -1,6 +1,8 @@
|
||||
// Type definitions for sinon-chai 2.7.0
|
||||
// Type definitions for sinon-chai 3.2.0
|
||||
// Project: https://github.com/domenic/sinon-chai
|
||||
// Definitions by: Kazi Manzur Rashid <https://github.com/kazimanzurrashid>, Jed Mao <https://github.com/jedmao>
|
||||
// Definitions by: Kazi Manzur Rashid <https://github.com/kazimanzurrashid>
|
||||
// Jed Mao <https://github.com/jedmao>
|
||||
// Eyal Lapid <https://github.com/elpdpt>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
@@ -46,6 +48,16 @@ declare global {
|
||||
* Returns true if the spy was called after anotherSpy.
|
||||
*/
|
||||
calledAfter(anotherSpy: Sinon.SinonSpy): Assertion;
|
||||
/**
|
||||
* Returns true if spy was called before anotherSpy, and no spy calls occurred
|
||||
* between spy and anotherSpy.
|
||||
*/
|
||||
calledImmediatelyBefore(anotherSpy: Sinon.SinonSpy): Assertion;
|
||||
/**
|
||||
* Returns true if spy was called after anotherSpy, and no spy calls occurred
|
||||
* between anotherSpy and spy.
|
||||
*/
|
||||
calledImmediatelyAfter(anotherSpy: Sinon.SinonSpy): Assertion;
|
||||
/**
|
||||
* Returns true if spy/stub was called with the new operator. Beware that
|
||||
* this is inferred based on the value of the this object and the spy
|
||||
@@ -61,10 +73,18 @@ declare global {
|
||||
* Returns true if call received provided arguments (and possibly others).
|
||||
*/
|
||||
calledWith(...args: any[]): Assertion;
|
||||
/**
|
||||
* Returns true if spy was called at exactly once with the provided arguments.
|
||||
*/
|
||||
calledOnceWith(...args: any[]): Assertion;
|
||||
/**
|
||||
* Returns true if call received provided arguments and no others.
|
||||
*/
|
||||
calledWithExactly(...args: any[]): Assertion;
|
||||
/**
|
||||
* Returns true if spy was called exactly once with the provided arguments and no others.
|
||||
*/
|
||||
calledOnceWithExactly(...args: any[]): Assertion;
|
||||
/**
|
||||
* Returns true if call received matching arguments (and possibly others).
|
||||
* This behaves the same as spyCall.calledWith(sinon.match(arg1), sinon.match(arg2), ...).
|
||||
|
||||
@@ -17,14 +17,18 @@ function test() {
|
||||
expect(spy).to.have.been.calledTwice;
|
||||
expect(spy).to.have.been.calledThrice;
|
||||
expect(spy).to.have.been.calledBefore(anotherSpy);
|
||||
expect(spy).to.have.been.calledImmediatelyBefore(anotherSpy);
|
||||
expect(spy).to.have.been.calledAfter(anotherSpy);
|
||||
expect(spy).to.have.been.calledImmediatelyAfter(anotherSpy);
|
||||
expect(spy).to.have.been.calledWithNew;
|
||||
expect(spy).to.always.have.been.calledWithNew;
|
||||
expect(spy).to.have.been.calledOn(context);
|
||||
expect(spy).to.always.have.been.calledOn(context);
|
||||
expect(spy).to.have.been.calledWith('foo', 'bar');
|
||||
expect(spy).to.have.been.calledOnceWith('foo', 'bar');
|
||||
expect(spy).to.always.have.been.calledWith('foo', 'bar');
|
||||
expect(spy).to.have.been.calledWithExactly('foo', 'bar');
|
||||
expect(spy).to.have.been.calledOnceWithExactly('foo', 'bar');
|
||||
expect(spy).to.always.have.been.calledWithExactly('foo', 'bar');
|
||||
expect(spy).to.have.been.calledWithMatch(match);
|
||||
expect(spy).to.always.have.been.calledWithMatch(match);
|
||||
|
||||
Vendored
+89
@@ -0,0 +1,89 @@
|
||||
// Type definitions for sinon-chai 2.7.0
|
||||
// Project: https://github.com/domenic/sinon-chai
|
||||
// Definitions by: Kazi Manzur Rashid <https://github.com/kazimanzurrashid>, Jed Mao <https://github.com/jedmao>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
/// <reference types="chai" />
|
||||
/// <reference types="sinon" />
|
||||
|
||||
import * as Sinon from 'sinon';
|
||||
|
||||
declare global {
|
||||
|
||||
export namespace Chai {
|
||||
|
||||
interface LanguageChains {
|
||||
always: Assertion;
|
||||
}
|
||||
|
||||
interface Assertion {
|
||||
/**
|
||||
* true if the spy was called at least once.
|
||||
*/
|
||||
called: Assertion;
|
||||
/**
|
||||
* @param count The number of recorded calls.
|
||||
*/
|
||||
callCount(count: number): Assertion;
|
||||
/**
|
||||
* true if the spy was called exactly once.
|
||||
*/
|
||||
calledOnce: Assertion;
|
||||
/**
|
||||
* true if the spy was called exactly twice.
|
||||
*/
|
||||
calledTwice: Assertion;
|
||||
/**
|
||||
* true if the spy was called exactly thrice.
|
||||
*/
|
||||
calledThrice: Assertion;
|
||||
/**
|
||||
* Returns true if the spy was called before anotherSpy.
|
||||
*/
|
||||
calledBefore(anotherSpy: Sinon.SinonSpy): Assertion;
|
||||
/**
|
||||
* Returns true if the spy was called after anotherSpy.
|
||||
*/
|
||||
calledAfter(anotherSpy: Sinon.SinonSpy): Assertion;
|
||||
/**
|
||||
* Returns true if spy/stub was called with the new operator. Beware that
|
||||
* this is inferred based on the value of the this object and the spy
|
||||
* function's prototype, so it may give false positives if you actively
|
||||
* return the right kind of object.
|
||||
*/
|
||||
calledWithNew: Assertion;
|
||||
/**
|
||||
* Returns true if context was this for this call.
|
||||
*/
|
||||
calledOn(context: any): Assertion;
|
||||
/**
|
||||
* Returns true if call received provided arguments (and possibly others).
|
||||
*/
|
||||
calledWith(...args: any[]): Assertion;
|
||||
/**
|
||||
* Returns true if call received provided arguments and no others.
|
||||
*/
|
||||
calledWithExactly(...args: any[]): Assertion;
|
||||
/**
|
||||
* Returns true if call received matching arguments (and possibly others).
|
||||
* This behaves the same as spyCall.calledWith(sinon.match(arg1), sinon.match(arg2), ...).
|
||||
*/
|
||||
calledWithMatch(...args: any[]): Assertion;
|
||||
/**
|
||||
* Returns true if spy returned the provided value at least once. Uses
|
||||
* deep comparison for objects and arrays. Use spy.returned(sinon.match.same(obj))
|
||||
* for strict comparison (see matchers).
|
||||
*/
|
||||
returned(obj: any): Assertion;
|
||||
/**
|
||||
* Returns true if spy threw the provided exception object at least once.
|
||||
*/
|
||||
thrown(obj?: Error | typeof Error | string): Assertion;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
declare function sinonChai(chai: any, utils: any): void;
|
||||
declare namespace sinonChai { }
|
||||
export = sinonChai;
|
||||
@@ -0,0 +1,39 @@
|
||||
import Sinon = require('sinon');
|
||||
|
||||
import chai = require('chai');
|
||||
import sinonChai = require('sinon-chai');
|
||||
|
||||
chai.use(sinonChai);
|
||||
var expect = chai.expect;
|
||||
declare var spy: Sinon.SinonSpy;
|
||||
declare var anotherSpy: Sinon.SinonSpy;
|
||||
declare var context: {};
|
||||
declare var match: RegExp;
|
||||
|
||||
// ReSharper disable WrongExpressionStatement
|
||||
function test() {
|
||||
expect(spy).to.have.been.called;
|
||||
expect(spy).to.have.been.calledOnce;
|
||||
expect(spy).to.have.been.calledTwice;
|
||||
expect(spy).to.have.been.calledThrice;
|
||||
expect(spy).to.have.been.calledBefore(anotherSpy);
|
||||
expect(spy).to.have.been.calledAfter(anotherSpy);
|
||||
expect(spy).to.have.been.calledWithNew;
|
||||
expect(spy).to.always.have.been.calledWithNew;
|
||||
expect(spy).to.have.been.calledOn(context);
|
||||
expect(spy).to.always.have.been.calledOn(context);
|
||||
expect(spy).to.have.been.calledWith('foo', 'bar');
|
||||
expect(spy).to.always.have.been.calledWith('foo', 'bar');
|
||||
expect(spy).to.have.been.calledWithExactly('foo', 'bar');
|
||||
expect(spy).to.always.have.been.calledWithExactly('foo', 'bar');
|
||||
expect(spy).to.have.been.calledWithMatch(match);
|
||||
expect(spy).to.always.have.been.calledWithMatch(match);
|
||||
expect(spy).to.have.returned(1);
|
||||
expect(spy).to.have.always.returned(1);
|
||||
expect(spy).to.have.thrown(new Error());
|
||||
expect(spy).to.have.thrown(Error);
|
||||
expect(spy).to.have.thrown('an error');
|
||||
expect(spy).to.have.always.thrown(new Error());
|
||||
expect(spy).to.have.always.thrown(Error);
|
||||
expect(spy).to.have.always.thrown('an error');
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": false,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../../",
|
||||
"typeRoots": [
|
||||
"../../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"paths": {
|
||||
"sinon-chai": [ "sinon-chai/v2" ]
|
||||
}
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"sinon-chai-tests.ts"
|
||||
]
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user