Upstream repo SYNCHRONISATION

This commit is contained in:
Hinell
2017-01-13 01:09:19 +03:00
526 changed files with 40058 additions and 23457 deletions
+3 -3
View File
@@ -86,6 +86,7 @@ First, [fork](https://guides.github.com/activities/forking/) this repository, in
* `cd my-package-to-edit`
* Make changes. Remember to edit tests.
* You may also want to add yourself to "Definitions by" section of the package header.
- Do this by adding your name to the end of the line, as in `// Definitions by: Alice <https://github.com/alice>, Bob <https://github.com/bob>`.
* `npm install -g typescript@2.0` and run `tsc`.
When you make a PR to edit an existing package, `dt-bot` should @-mention previous authors.
@@ -206,7 +207,7 @@ Here are the [currently requested definitions](https://github.com/DefinitelyType
If types are part of a web standard, they should be contributed to [TSJS-lib-generator](https://github.com/Microsoft/TSJS-lib-generator) so that they can become part of the default `lib.dom.d.ts`.
### A package uses `export =`, but I prefer to use default imports. Can I change `export =` to `export default`?
#### A package uses `export =`, but I prefer to use default imports. Can I change `export =` to `export default`?
If default imports work in your environment, consider turning on the [`--allowSyntheticDefaultImports`](http://www.typescriptlang.org/docs/handbook/compiler-options.html) compiler option.
Do not change the type definition if it is accurate.
@@ -214,8 +215,7 @@ For an NPM package, `export =` is accurate if `node -p 'require("foo")'` is the
#### I want to use features from TypeScript 2.1.
Then you will have to add a comment to your definition header: `// TypeScript Version: 2.1`.
If it is merged before January 7, it will be published as a prerelease version, such as `4.3.0-next.0`.
Then you will have to add a comment to the last line of your definition header (after `// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped`): `// TypeScript Version: 2.1`.
#### I want to add a DOM API not present in TypeScript by default.
+17 -17
View File
@@ -15,22 +15,22 @@
},
"files": [
"index.d.ts",
"tests/ace-anchor-tests.ts",
"tests/ace-background_tokenizer-tests.ts",
"tests/ace-default-tests.ts",
"tests/ace-document-tests.ts",
"tests/ace-edit_session-tests.ts",
"tests/ace-editor1-tests.ts",
"tests/ace-editor_highlight_selected_word-tests.ts",
"tests/ace-editor_navigation-tests.ts",
"tests/ace-editor_text_edit-tests.ts",
"tests/ace-multi_select-tests.ts",
"tests/ace-placeholder-tests.ts",
"tests/ace-range-tests.ts",
"tests/ace-range_list-tests.ts",
"tests/ace-search-tests.ts",
"tests/ace-selection-tests.ts",
"tests/ace-token_iterator-tests.ts",
"tests/ace-virtual_renderer-tests.ts"
"test/anchor.ts",
"test/background_tokenizer.ts",
"test/default.ts",
"test/document.ts",
"test/edit_session.ts",
"test/editor1.ts",
"test/editor_highlight_selected_word.ts",
"test/editor_navigation.ts",
"test/editor_text_edit.ts",
"test/multi_select.ts",
"test/placeholder.ts",
"test/range.ts",
"test/range_list.ts",
"test/search.ts",
"test/selection.ts",
"test/token_iterator.ts",
"test/virtual_renderer.ts"
]
}
+3 -3
View File
@@ -15,8 +15,8 @@
},
"files": [
"index.d.ts",
"acl-tests.ts",
"acl-mongodbBackend-tests.ts",
"acl-redisBackend-tests.ts"
"test/index.ts",
"test/mongodbBackend.ts",
"test/redisBackend.ts"
]
}
+19
View File
@@ -20,3 +20,22 @@ const helloChannel = App.cable.subscriptions.create('NetworkChannel', {
}) as HelloChannel;
helloChannel.hello('World');
const channelParams: ActionCable.ChannelNameWithParams = {
channel: 'NetworkChannel',
token: 'foo',
data: {
bar: 'baz'
}
};
const channelWithParams = App.cable.subscriptions.create(channelParams, {
connected(): void {
console.log('connected');
},
disconnected(): void {
console.log('disconnected');
},
received(obj: Object): void {
console.log(obj);
}
});
+6 -1
View File
@@ -11,7 +11,7 @@ declare module ActionCable {
}
interface Subscriptions {
create(chan_name: string, obj: CreateMixin): Channel;
create(channel: string|ChannelNameWithParams, obj: CreateMixin): Channel;
}
interface Cable {
@@ -25,6 +25,11 @@ declare module ActionCable {
[key: string]: Function;
}
interface ChannelNameWithParams {
channel: string;
[key: string]: any;
}
function createConsumer(): Cable;
function createConsumer(url: string): Cable;
}
+2 -1
View File
@@ -1,4 +1,4 @@
// Type definitions for ADAL.JS 1.0.8
// Type definitions for ADAL.JS 1.0.13
// Project: https://github.com/AzureAD/azure-activedirectory-library-for-js
// Definitions by: mmaitre314 <https://github.com/mmaitre314>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
@@ -16,6 +16,7 @@ declare namespace adal {
tenant?: string;
clientId: string;
redirectUri?: string;
instance?: string;
cacheLocation?: string;
displayCall?: (urlNavigate: string) => any;
correlationId?: string;
+2 -2
View File
@@ -15,8 +15,8 @@
},
"files": [
"index.d.ts",
"adal-tests.ts",
"adal-angular.d.ts",
"adal-angular-tests.ts"
"test/index.ts",
"test/angular.ts"
]
}
+1 -1
View File
@@ -15,6 +15,6 @@
},
"files": [
"index.d.ts",
"amplifyjs-tests.ts"
"amplify-tests.ts"
]
}
+66 -59
View File
@@ -4,76 +4,83 @@
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="angular-ui-router" />
declare namespace angular.ui {
export interface IState {
ncyBreadcrumb?: {
import * as angular from 'angular';
declare var _: string;
export = _;
declare module 'angular' {
namespace ui {
export interface IState {
ncyBreadcrumb?: {
/**
* Contains the label for the step in the breadcrumb. The state name is used if not defined.
**/
label?: string;
/**
* Override the parent state (only for the breadcrumb)
**/
parent?: string|Function;
/**
* When defined to true, the state is never included in the chain of states and never appears in the breadcrumb
**/
skip?: boolean;
};
ncyBreadcrumbLabel?: string;
ncyBreadcrumbLink?: string;
}
}
namespace ncy {
/**
* Provider that returns an instance of $breadcrumb service. It contains the global configuration of the module.
**/
export interface $breadcrumbProvider {
/**
* Contains the label for the step in the breadcrumb. The state name is used if not defined.
**/
label?: string;
/**
* Override the parent state (only for the breadcrumb)
**/
parent?: string|Function;
/**
* When defined to true, the state is never included in the chain of states and never appears in the breadcrumb
* Setter for options defined in a module.config block
**/
skip?: boolean;
},
ncyBreadcrumbLabel?: string;
ncyBreadcrumbLink?: string;
}
}
setOptions(options: breadcrumbProviderOptions): void;
}
declare namespace ncy {
/**
* Provider that returns an instance of $breadcrumb service. It contains the global configuration of the module.
**/
export interface $breadcrumbProvider {
/**
* Setter for options defined in a module.config block
* Global configuration options for angular-breadcrumb
**/
setOptions(options: breadcrumbProviderOptions): void;
}
/**
* Global configuration options for angular-breadcrumb
**/
export interface breadcrumbProviderOptions {
/**
* An existing state's name to be the state is the first step of the breadcrumb
**/
prefixStateName?: string;
export interface breadcrumbProviderOptions {
/**
* An existing state's name to be the state is the first step of the breadcrumb
**/
prefixStateName?: string;
/**
* Contains a predefined template's name; 'bootstrap3' (default), 'bootstrap2' or HTML for a custom template. This property is ignored if templateUrl is defined.
**/
template?: string;
/**
* Contains a predefined template's name; 'bootstrap3' (default), 'bootstrap2' or HTML for a custom template. This property is ignored if templateUrl is defined.
**/
template?: string;
/**
* Contains the path to a template file. This property takes precedence over the template property.
**/
templateUrl?: string;
/**
* Contains the path to a template file. This property takes precedence over the template property.
**/
templateUrl?: string;
/**
* If true, abstract states are included in the breadcrumb. This option has a lower priority than the state-specific option skip
**/
includeAbstract?: boolean;
}
/**
* If true, abstract states are included in the breadcrumb. This option has a lower priority than the state-specific option skip
**/
includeAbstract?: boolean;
}
/**
* Service responsible for access to $state and for directive configuration.
**/
export interface $breadcrumbService {
/**
* Returns the state chain to the current state (i.e. all the steps of the breadcrumb). It's an array of state object enriched with the module-specific property ncyBreadcrumbLink (the href for the breadcrumb step).
* Service responsible for access to $state and for directive configuration.
**/
getStatesChain(): angular.ui.IState[];
export interface $breadcrumbService {
/**
* Returns the state chain to the current state (i.e. all the steps of the breadcrumb). It's an array of state object enriched with the module-specific property ncyBreadcrumbLink (the href for the breadcrumb step).
**/
getStatesChain(): angular.ui.IState[];
/**
* Return the last step of the breadcrumb, generally the one relative to the current state, expect if it is configured as skipped (the method returns its parent). As getStatesChain, the state object is enriched with ncyBreadcrumbLink.
**/
getLastStep(): angular.ui.IState;
/**
* Return the last step of the breadcrumb, generally the one relative to the current state, expect if it is configured as skipped (the method returns its parent). As getStatesChain, the state object is enriched with ncyBreadcrumbLink.
**/
getLastStep(): angular.ui.IState;
}
}
}
@@ -58,8 +58,8 @@ function RetrieveCurrentURL(Analytics: angular.google.analytics.AnalyticsService
}
function ManualScriptTagInjection(Analytics: angular.google.analytics.AnalyticsService) {
Analytics.createScriptTag();
Analytics.createAnalyticsScriptTag();
Analytics.registerScriptTags();
Analytics.registerTrackers();
}
function SetCustomDimensions(Analytics: angular.google.analytics.AnalyticsService) {
+26 -2
View File
@@ -1,6 +1,6 @@
// Type definitions for angular-google-analytics v1.1.0
// Type definitions for angular-google-analytics v1.1.8
// Project: https://github.com/revolunet/angular-google-analytics
// Definitions by: Cyril Schumacher <https://github.com/cyrilschumacher>
// Definitions by: Cyril Schumacher <https://github.com/cyrilschumacher>, Thomas Fuchs <https://github.com/Toxantron>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="angular" />
@@ -24,6 +24,18 @@ declare module 'angular' {
* All calls queued to the offlineQueue are not outbound calls yet and hence do not show up in the log.
*/
offlineQueue: Array<Object>;
/**
* @summary If delayScriptTag(true) was set during configuration then manual script tag injection is required.
* @return {boolean} True if scripts were registered.
*/
registerScriptTags(): boolean;
/**
* @summary If delayScriptTag(true) was set during configuration then manual tracker setup is required.
* @return {boolean} True if trackers were registered.
*/
registerTrackers(): boolean;
/**
* @summary Returns the current URL that would be sent if a `trackPage` call was made.
@@ -166,6 +178,18 @@ declare module 'angular' {
* @param {RegExp} regex The regex.
*/
setRemoveRegExp(regex: RegExp): AnalyticsProvider;
/**
* @summary Activate reading custom tracking urls from $routeProvider config (default is false)
* This is more flexible than using RegExp and easier to maintain for multiple parameters.
* It also reduces tracked pages to routes (only those with a templateUrl) defined in the
* $routeProvider and therefore reduces bounce rate created by redirects.
* See https://github.com/revolunet/angular-google-analytics#set-route-tracking-behaviors for details
* @param {boolean} val If true, the module tries to read tracking information from the
* $routeProvider config.
* @return {angular.google.analytics.IAnalyticsProvider} The object instance.
*/
readFromRoute(useRoute: boolean): AnalyticsProvider;
/**
* @summary Starts the offline mode.
+1 -1
View File
@@ -15,6 +15,6 @@
},
"files": [
"index.d.ts",
"angular-localForage-tests.ts"
"angular-localforage-tests.ts"
]
}
+12 -1
View File
@@ -4,7 +4,8 @@ var myApp = angular.module('testModule', ['ngMaterial']);
myApp.config((
$mdThemingProvider: ng.material.IThemingProvider,
$mdIconProvider: ng.material.IIconProvider) => {
$mdIconProvider: ng.material.IIconProvider,
$mdProgressCircularProvider: ng.material.IProgressCircularProvider) => {
$mdThemingProvider.alwaysWatchTheme(true);
var neonRedMap: ng.material.IPalette = $mdThemingProvider.extendPalette('red', {
@@ -27,11 +28,21 @@ myApp.config((
};
$mdThemingProvider.enableBrowserColor(browserColors);
// Disable theming generation at runtime
$mdThemingProvider.disableTheming();
$mdIconProvider
.defaultIconSet('my/app/icons.svg') // Register a default set of SVG icons
.iconSet('social', 'my/app/social.svg') // Register a named icon set of SVGs
.icon('android', 'my/app/android.svg') // Register a specific icon (by name)
.icon('work:chair', 'my/app/chair.svg'); // Register icon in a specific set
// Example of changing the default progress options.
$mdProgressCircularProvider.configure({
progressSize: 100,
strokeWidth: 20,
duration: 800
});
});
myApp.controller('BottomSheetController', ($scope: ng.IScope, $mdBottomSheet: ng.material.IBottomSheetService) => {
+28 -1
View File
@@ -1,6 +1,6 @@
// Type definitions for Angular Material (angular.material module) 1.1
// Project: https://github.com/angular/material
// Definitions by: Blake Bigelow <https://github.com/blbigelow>, Peter Hajdu <https://github.com/PeterHajdu>
// Definitions by: Blake Bigelow <https://github.com/blbigelow>, Peter Hajdu <https://github.com/PeterHajdu>, Davide Donadello <https://github.com/Dona278>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
import * as angular from 'angular';
@@ -259,6 +259,15 @@ declare module 'angular' {
dark(isDark?: boolean): ITheme;
}
interface IThemeConfig {
disableTheming: boolean;
generateOnDemand: boolean;
nonce: string;
defaultTheme: string;
alwaysWatchTheme: boolean;
registeredStyles: Array<string>;
}
interface IThemingProvider {
alwaysWatchTheme(alwaysWatch: boolean): void;
definePalette(name: string, palette: IPalette): IThemingProvider;
@@ -268,6 +277,9 @@ declare module 'angular' {
setDefaultTheme(theme: string): void;
setNonce(nonce: string): void;
theme(name: string, inheritFrom?: string): ITheme;
generateThemesOnDemand(onDemand: boolean): void;
disableTheming(isDisabled?: boolean): void;
configuration(): IThemeConfig;
}
interface IDateLocaleProvider {
@@ -423,5 +435,20 @@ declare module 'angular' {
LEFT: string,
};
}
interface IProgressCircularConfig {
progressSize?: number;
strokeWidth?: number;
duration?: number;
easeFn?: Function;
durationIndeterminate?: number;
startIndeterminate?: number;
endIndeterminate?: number;
easeFnIndeterminate?: Function;
}
interface IProgressCircularProvider {
configure(options: IProgressCircularConfig): void;
}
}
}
+1 -1
View File
@@ -15,6 +15,6 @@
},
"files": [
"index.d.ts",
"match-media-tests.ts"
"angular-media-queries-tests.ts"
]
}
+7
View File
@@ -259,6 +259,13 @@ class TestProvider implements ng.IServiceProvider {
}
}
// QProvider tests
angular.module('qprovider-test', [])
.config(['$qProvider', function ($qProvider: ng.IQProvider) {
const provider: ng.IQProvider = $qProvider.errorOnUnhandledRejections(false);
const currentValue: boolean = $qProvider.errorOnUnhandledRejections();
}]);
// Promise signature tests
var foo: ng.IPromise<number>;
foo.then((x) => {
+26 -7
View File
@@ -1,4 +1,4 @@
// Type definitions for Angular JS 1.5
// Type definitions for Angular JS 1.6
// Project: http://angularjs.org
// Definitions by: Diego Vilar <http://github.com/diegovilar>, Georgii Dolzhykov <http://github.com/thorn0>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
@@ -10,7 +10,7 @@ declare var angular: angular.IAngularStatic;
// Support for painless dependency injection
declare global {
interface Function {
$inject?: string[];
$inject?: ReadonlyArray<string>;
}
}
@@ -660,7 +660,7 @@ declare namespace angular {
interface IFilterFilterComparatorFunc<T> {
(actual: T, expected: T): boolean;
}
interface IFilterOrderByItem {
value: any,
type: string,
@@ -1059,6 +1059,25 @@ declare namespace angular {
when(): IPromise<void>;
}
interface IQProvider {
/**
* Retrieves or overrides whether to generate an error when a rejected promise is not handled.
* This feature is enabled by default.
*
* @returns {boolean} Current value
*/
errorOnUnhandledRejections(): boolean;
/**
* Retrieves or overrides whether to generate an error when a rejected promise is not handled.
* This feature is enabled by default.
*
* @param {boolean} value Whether to generate an error when a rejected promise is not handled.
* @returns {ng.IQProvider} Self for chaining otherwise.
*/
errorOnUnhandledRejections(value: boolean): IQProvider;
}
interface IPromise<T> {
/**
* Regardless of when the promise was or will be resolved or rejected, then calls one of the success or error callbacks asynchronously as soon as the result is available. The callbacks are called with a single argument: the result or rejection reason. Additionally, the notify callback may be called zero or more times to provide a progress indication, before the promise is resolved or rejected.
@@ -1216,7 +1235,7 @@ declare namespace angular {
debugInfoEnabled(): boolean;
debugInfoEnabled(enabled: boolean): ICompileProvider;
/**
* Sets the number of times $onChanges hooks can trigger new changes before giving up and assuming that the model is unstable.
* Increasing the TTL could have performance implications, so you should not change it without proper justification.
@@ -1225,7 +1244,7 @@ declare namespace angular {
*/
onChangesTtl(): number;
onChangesTtl(limit: number): ICompileProvider;
/**
* It indicates to the compiler whether or not directives on comments should be compiled.
* It results in a compilation performance gain since the compiler doesn't have to check comments when looking for directives.
@@ -1234,7 +1253,7 @@ declare namespace angular {
*/
commentDirectivesEnabled(): boolean;
commentDirectivesEnabled(enabled: boolean): ICompileProvider;
/**
* It indicates to the compiler whether or not directives on element classes should be compiled.
* It results in a compilation performance gain since the compiler doesn't have to check element classes when looking for directives.
@@ -1878,7 +1897,7 @@ declare namespace angular {
* like jQuery plugins do, that's why all jQuery objects have these Angular-specific methods, not
* only those returned from angular.element.
* See: http://docs.angularjs.org/api/angular.element
*/
*/
interface IAugmentedJQueryStatic extends JQueryStatic {}
interface IAugmentedJQuery extends JQuery {}
+1 -1
View File
@@ -15,6 +15,6 @@
},
"files": [
"index.d.ts",
"angularLocalStorage-tests.ts"
"angularlocalstorage-tests.ts"
]
}
+16 -11
View File
@@ -1,7 +1,5 @@
import esri = require("esri");
import Map = require("esri/map");
import Map = require("esri/Map");
import MapView = require("esri/views/MapView");
import Point = require("esri/geometry/Point");
export = MapController;
@@ -13,13 +11,20 @@ class MapController {
}
start() {
var point = new Point(-122.45, 37.75); // long, lat
let point = new Point({
latitude: 37.75,
longitude: -122.45
});
var mapOptions: esri.MapOptions = {};
mapOptions.basemap = "topo";
mapOptions.center = point;
mapOptions.zoom = 13;
this.map = new Map(this.mapDiv, mapOptions);
this.map = new Map({
basemap: "topo"
});
let view = new MapView({
center: point,
container: this.mapDiv,
map: this.map,
zoom: 13
});
}
}
+8013 -17488
View File
File diff suppressed because it is too large Load Diff
+23
View File
@@ -0,0 +1,23 @@
import esri = require("esri");
import Map = require("esri/map");
import Point = require("esri/geometry/Point");
export = MapController;
class MapController {
map: Map;
constructor(public mapDiv: string) {
}
start() {
let point = new Point(-122.45, 37.75); // long, lat
let mapOptions: esri.MapOptions = {};
mapOptions.basemap = "topo";
mapOptions.center = point;
mapOptions.zoom = 13;
this.map = new Map(this.mapDiv, mapOptions);
}
}
+17892
View File
File diff suppressed because it is too large Load Diff
+23
View File
@@ -0,0 +1,23 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": false,
"baseUrl": "../../",
"typeRoots": [
"../../"
],
"types": [],
"paths": {
"arcgis-js-api": ["arcgis-js-api/v3"]
},
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"arcgis-js-api-tests.ts"
]
}
+3 -3
View File
@@ -17,21 +17,21 @@ arrayForEach(array, (i: number, index: number, array: Array<number>) => {
const resultThis: Array<{i: number, that: string}> = [];
arrayForEach(array, function(i: number) {
arrayForEach(array, function(i) {
resultThis.push({
i: i,
that: this.that
});
}, { that: 'jeff' });
arrayForEach(array, function(i: number, index: number) {
arrayForEach(array, function(i, index) {
resultThis.push({
i: i + index,
that: this.that
});
}, { that: 'jeff' });
arrayForEach(array, function(i: number, index: number, array: Array<number>) {
arrayForEach(array, function(i, index, array) {
resultThis.push({
i: array[i],
that: this.that
+1 -1
View File
@@ -15,6 +15,6 @@
},
"files": [
"index.d.ts",
"index-tests.ts"
"array-uniq-tests.ts"
]
}
+2 -2
View File
@@ -15,7 +15,7 @@
},
"files": [
"index.d.ts",
"async-tests.ts",
"async-explicit-tests.ts"
"test/index.ts",
"test/explicit.ts"
]
}
@@ -1,5 +1,5 @@
/// <reference types="auth0-js" />
/// <reference path="index.d.ts" />
const CLIENT_ID = "YOUR_AUTH0_APP_CLIENTID";
const DOMAIN = "YOUR_DOMAIN_AT.auth0.com";
@@ -10,6 +10,29 @@ lock.show();
lock.hide();
lock.logout(() => {});
// Show supports UI arguments
var showOptions : Auth0LockShowOptions = {
allowedConnections: [ "twitter", "facebook" ],
allowSignUp: true,
allowForgotPassword: false,
auth: {
params: { state: "foo" },
redirect: true,
redirectUrl: "some url",
responseType: "token",
sso: true
},
initialScreen: "login",
flashMessage: {
type: "error",
text: "an error has occurred"
},
rememberLastLogin: false
};
lock.show(showOptions);
// The examples below are lifted from auth0-lock documentation on Github
// "on" event-driven example
+25 -10
View File
@@ -1,4 +1,4 @@
// Type definitions for auth0-lock v10.0.1
// Type definitions for auth0-lock 10.9
// Project: http://auth0.com
// Definitions by: Brian Caruso <https://github.com/carusology>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
@@ -103,22 +103,37 @@ interface Auth0LockConstructorOptions {
usernameStyle?: string;
}
interface Auth0LockFlashMessageOptions {
type: "success" | "error";
text: string;
}
interface Auth0LockShowOptions {
allowedConnections?: string[];
allowForgotPassword?: boolean;
allowLogin?: boolean;
allowSignUp?: boolean;
auth?: Auth0LockAuthOptions;
initialScreen?: "login" | "signUp" | "forgotPassword";
flashMessage?: Auth0LockFlashMessageOptions;
rememberLastLogin?: boolean;
}
interface Auth0LockStatic {
new (clientId: string, domain: string, options?: Auth0LockConstructorOptions): Auth0LockStatic;
getProfile(token: string, callback: (error: Auth0Error, profile: Auth0UserProfile) => void) : void;
getUserInfo(token: string, callback: (error: Auth0Error, profile: Auth0UserProfile) => void) : void;
// deprecated
getProfile(token: string, callback: (error: Auth0Error, profile: Auth0UserProfile) => void): void;
getUserInfo(token: string, callback: (error: Auth0Error, profile: Auth0UserProfile) => void): void;
show(): void;
show(options?: Auth0LockShowOptions): void;
hide(): void;
logout(query: any): void;
on(event: "show", callback: () => void) : void;
on(event: "hide", callback: () => void) : void;
on(event: "unrecoverable_error", callback: (error: Auth0Error) => void) : void;
on(event: "authorization_error", callback: (error: Auth0Error) => void) : void;
on(event: "authenticated", callback: (authResult: any) => void) : void;
on(event: string, callback: (...args: any[]) => void) : void;
on(event: "show" | "hide", callback: () => void): void;
on(event: "unrecoverable_error" | "authorization_error", callback: (error: Auth0Error) => void): void;
on(event: "authenticated", callback: (authResult: any) => void): void;
on(event: string, callback: (...args: any[]) => void): void;
}
declare var Auth0Lock: Auth0LockStatic;
+1 -1
View File
@@ -15,6 +15,6 @@
},
"files": [
"index.d.ts",
"auth0.lock-tests.ts"
"auth0-lock-tests.ts"
]
}
+1 -1
View File
@@ -15,6 +15,6 @@
},
"files": [
"index.d.ts",
"AzureMobileServicesClient-tests.ts"
"azure-mobile-services-client-tests.ts"
]
}
+1 -1
View File
@@ -15,6 +15,6 @@
},
"files": [
"index.d.ts",
"babylon-tests.ts"
"babylonjs-tests.ts"
]
}
+1 -1
View File
@@ -15,6 +15,6 @@
},
"files": [
"index.d.ts",
"marionette-tests.ts"
"backbone.marionette-tests.ts"
]
}
-404
View File
@@ -1,404 +0,0 @@
import * as Backbone from "backbone";
import * as _ from "lodash";
function test_events() {
var object = new Backbone.Events();
object.on("alert", (eventName: string) => alert("Triggered " + eventName));
object.trigger("alert", "an event");
var onChange = () => alert('whatever');
var context: any;
object.off("change", onChange);
object.off("change");
object.off(null, onChange);
object.off(null, null, context);
object.off();
}
class SettingDefaults extends Backbone.Model {
// 'defaults' could be set in one of the following ways:
defaults() {
return {
name: "Joe"
}
}
constructor(attributes?: any, options?: any) {
super(attributes, options); // TODO error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class.
this.defaults = <any>{
name: "Joe"
}
// super has to come last
}
// or set it like this
initialize() {
this.defaults = <any>{
name: "Joe"
}
}
// same patterns could be used for setting 'Router.routes' and 'View.events'
}
class Sidebar extends Backbone.Model {
promptColor() {
var cssColor = prompt("Please enter a CSS color:");
this.set({ color: cssColor });
}
}
class Note extends Backbone.Model {
initialize() { }
author() { }
coordinates() { }
allowedToEdit(account: any) {
return true;
}
}
class PrivateNote extends Note {
allowedToEdit(account: any) {
return account.owns(this);
}
set(attributes: any, options?: any): Backbone.Model {
return Backbone.Model.prototype.set.call(this, attributes, options);
}
}
function test_models() {
var sidebar = new Sidebar();
sidebar.on('change:color', (model: {}, color: string) => $('#sidebar').css({ background: color }));
sidebar.set({ color: 'white' });
sidebar.promptColor();
//////////
var note = new PrivateNote();
note.get("title");
note.set({ title: "March 20", content: "In his eyes she eclipses..." });
note.set("title", "A Scandal in Bohemia");
let strings: string[]
let value: any;
let values: any[];
let bool: boolean;
// underscore methods
strings = note.keys();
values = note.values();
values = note.pairs();
values = note.invert();
value = note.pick("foo");
value = note.pick("foo", "bar");
value = note.pick((value: any, key: any, object: any) => true);
value = note.omit("foo");
value = note.omit("foo", "bar");
value = note.omit((value: any, key: any, object: any) => true);
value = note.chain().pick().omit().value();
bool = note.isEmpty();
}
class Employee extends Backbone.Model {
reports: EmployeeCollection;
constructor(attributes?: any, options?: any) {
super(options);
this.reports = new EmployeeCollection();
this.reports.url = '../api/employees/' + this.id + '/reports';
}
more() {
this.reports.reset();
}
}
class EmployeeCollection extends Backbone.Collection<Employee> {
findByName(key: any) { }
}
class Book extends Backbone.Model {
title: string;
author: string;
published: boolean;
}
class Library extends Backbone.Collection<Book> {
// This model definition is here only to test type compatibility of the model, but it
// is not necessary in working code as it is automatically inferred through generics.
model: typeof Book;
}
class Books extends Backbone.Collection<Book> { }
function test_collection() {
var books = new Books();
var book1: Book = new Book({ title: "Title 1", author: "Mike" });
books.add(book1);
// Objects can be added to collection by casting to model type.
// Compiler will check if object properties are valid for the cast.
// This gives better type checking than declaring an `any` overload.
books.add(<Book>{ title: "Title 2", author: "Mikey" });
var model: Book = book1.collection.first();
if (model !== book1) {
throw new Error("Error");
}
books.each(book =>
book.get("title"));
var titles = books.map(book =>
book.get("title"));
var publishedBooks = books.filter(book =>
book.get("published") === true);
var alphabetical = books.sortBy((book: Book): number => null);
let one: Book;
let models: Book[];
let bool: boolean;
let numDict: _.Dictionary<number>;
let modelDict: _.Dictionary<Book>;
let modelsDict: _.Dictionary<Book[]>;
let num: number;
models = books.slice(1);
models = books.slice(1, 3);
// underscore methods
bool = books.all((value: Book, index: number, list: Book[]) => true);
bool = books.any((value: Book, index: number, list: Book[]) => true);
bool = books.chain().any((value: Book, index: number, list: Book[]) => true).value();
models = books.collect((value: Book, index: number, list: Book[]) => value);
bool = books.contains(book1);
numDict = books.countBy((value: Book, index: number, list: Book[]) => true);
numDict = books.countBy("foo");
one = books.detect((value: Book, index: number, list: Book[]) => true);
models = books.difference([book1]);
models = books.drop();
models = books.each((value: Book, index: number, list: Book[]) => true);
bool = books.every((value: Book, index: number, list: Book[]) => true);
models = books.filter((value: Book, index: number, list: Book[]) => true);
one = books.find((value: Book, index: number, list: Book[]) => true);
num = books.findIndex((value: Book, index: number, list: Book[]) => true);
num = books.findLastIndex((value: Book, index: number, list: Book[]) => true);
one = books.first();
models = books.first(3);
models = books.foldl((prev: Book[], curr: Book, index: number, list: Book[]) => prev, []);
models = books.foldr((prev: Book[], curr: Book, index: number, list: Book[]) => prev, []);
models = books.forEach((value: Book, index: number, list: Book[]) => true);
modelsDict = books.groupBy((value: Book, index: number, list: Book[]) => true);
modelsDict = books.groupBy("foo");
one = books.head();
models = books.head(3);
bool = books.include(book1);
bool = books.includes(book1);
modelDict = books.indexBy((value: Book, index: number, list: Book[]) => true);
modelDict = books.indexBy("foo");
num = books.indexOf(book1, true);
one = books.initial();
models = books.initial(3);
models = books.inject((prev: Book[], curr: Book, index: number, list: Book[]) => prev, []);
one = books.invoke("at", 3);
bool = books.isEmpty();
one = books.last();
models = books.last(3);
num = books.lastIndexOf(book1, 3);
models = books.map((value: Book, index: number, list: Book[]) => value);
one = books.max((value: Book, index: number, list: Book[]) => value);
one = books.min((value: Book, index: number, list: Book[]) => value);
[models] = books.partition((value: Book, index: number, list: Book[]) => true);
models = books.reduce((prev: Book[], curr: Book, index: number, list: Book[]) => prev, []);
models = books.reduceRight((prev: Book[], curr: Book, index: number, list: Book[]) => prev, []);
models = books.reject((value: Book, index: number, list: Book[]) => true);
models = books.rest(3);
one = books.sample();
models = books.sample(3);
models = books.select((value: Book, index: number, list: Book[]) => true);
models = books.shuffle();
num = books.size();
bool = books.some((value: Book, index: number, list: Book[]) => true);
models = books.sortBy((value: Book, index: number, list: Book[]) => value);
models = books.sortBy("foo");
models = books.tail(3);
one = books.take();
models = books.take(3);
models = books.toArray();
models = books.without(book1, book1);
}
//////////
Backbone.history.start();
namespace v1Changes {
namespace events {
function test_once() {
var model = new Employee;
model.once('invalid', () => { }, this);
model.once('invalid', () => { });
}
function test_listenTo() {
var model = new Employee;
var view = new Backbone.View<Employee>();
view.listenTo(model, 'invalid', () => { });
}
function test_listenToOnce() {
var model = new Employee;
var view = new Backbone.View<Employee>();
view.listenToOnce(model, 'invalid', () => { });
}
function test_stopListening() {
var model = new Employee;
var view = new Backbone.View<Employee>();
view.stopListening(model, 'invalid', () => { });
view.stopListening(model, 'invalid');
view.stopListening(model);
}
}
namespace ModelAndCollection {
function test_url() {
Employee.prototype.url = () => '/employees';
EmployeeCollection.prototype.url = () => '/employees';
}
function test_parse() {
var model = new Employee();
model.parse('{}', {});
var collection = new EmployeeCollection;
collection.parse('{}', {});
}
function test_toJSON() {
var model = new Employee();
model.toJSON({});
var collection = new EmployeeCollection;
collection.toJSON({});
}
function test_sync() {
var model = new Employee();
model.sync();
var collection = new EmployeeCollection;
collection.sync();
}
}
namespace Model {
function test_validationError() {
var model = new Employee;
if (model.validationError) {
console.log('has validation errors');
}
}
function test_fetch() {
var model = new Employee({ id: 1 });
model.fetch({
success: () => { },
error: () => { }
});
}
function test_set() {
var model = new Employee;
model.set({ name: 'JoeDoe', age: 21 }, { validate: false });
model.set('name', 'JoeDoes', { validate: false });
}
function test_destroy() {
var model = new Employee;
model.destroy({
wait: true,
success: (m?, response?, options?) => { },
error: (m?, jqxhr?, options?) => { }
});
model.destroy({
success: (m?, response?, options?) => { },
error: (m?, jqxhr?) => { }
});
model.destroy({
success: () => { },
error: (m?, jqxhr?) => { }
});
}
function test_save() {
var model = new Employee;
model.save({
name: 'Joe Doe',
age: 21
},
{
wait: true,
validate: false,
success: (m?, response?, options?) => { },
error: (m?, jqxhr?, options?) => { }
});
model.save({
name: 'Joe Doe',
age: 21
},
{
success: () => { },
error: (m?, jqxhr?) => { }
});
}
function test_validate() {
var model = new Employee;
model.validate({ name: 'JoeDoe', age: 21 }, { validateAge: false })
}
}
namespace Collection {
function test_fetch() {
var collection = new EmployeeCollection;
collection.fetch({ reset: true });
}
function test_create() {
var collection = new EmployeeCollection;
var model = new Employee;
collection.create(model, {
validate: false
});
}
}
namespace Router {
function test_navigate() {
var router = new Backbone.Router;
router.navigate('/employees', { trigger: true });
router.navigate('/employees', true);
}
}
}
+1 -2
View File
@@ -15,7 +15,6 @@
},
"files": [
"index.d.ts",
"backbone-tests.ts",
"backbone-with-lodash-tests.ts"
"backbone-tests.ts"
]
}
+13
View File
@@ -3,6 +3,7 @@ import bcryptjs = require("bcryptjs");
let str: string;
let num: number;
let bool: boolean;
let error: Error;
str = bcryptjs.genSaltSync();
str = bcryptjs.genSaltSync(10);
@@ -13,6 +14,12 @@ bcryptjs.genSalt((err: Error, salt: string) => {
bcryptjs.genSalt(10, (err: Error, salt: string) => {
str = salt;
});
bcryptjs.genSalt()
.then(salt => str = salt)
.catch(err => error = err);
bcryptjs.genSalt(10)
.then(salt => str = salt)
.catch(err => error = err);
str = bcryptjs.hashSync("string");
str = bcryptjs.hashSync("string", 10);
@@ -26,6 +33,9 @@ bcryptjs.hash("string", 10, (err: Error, hash: string) => {
}, (percent: number) => {
num = percent;
});
bcryptjs.hash("string", 10)
.then(salt => str = salt)
.catch(err => error = err);
bcryptjs.hash("string", "salt", (err: Error, hash: string) => {
str = hash;
@@ -46,6 +56,9 @@ bcryptjs.compare("string1", "string2", (err: Error, success: boolean) => {
}, (percent: number) => {
num = percent;
});
bcryptjs.compare("string1", "string2")
.then(success => bool = success)
.catch(err => error = err);
num = bcryptjs.getRounds("string");
+28 -4
View File
@@ -1,6 +1,6 @@
// Type definitions for bcryptjs v2.3.0
// Type definitions for bcryptjs v2.4.0
// Project: https://github.com/dcodeIO/bcrypt.js
// Definitions by: Joshua Filby <https://github.com/Joshua-F/>
// Definitions by: Joshua Filby <https://github.com/Joshua-F/>, Rafael Kraut <https://github.com/RafaelKr/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
@@ -16,9 +16,17 @@ export declare function setRandomFallback(random: (random: number) => number[]):
* Synchronously generates a salt.
* @param rounds Number of rounds to use, defaults to 10 if omitted
* @return Resulting salt
* @throws If a random fallback is required but not set
*/
export declare function genSaltSync(rounds?: number): string;
/**
* Asynchronously generates a salt.
* @param rounds Number of rounds to use, defaults to 10 if omitted
* @return Promise with resulting salt, if callback has been omitted
*/
export declare function genSalt(rounds?: number): Promise<string>;
/**
* Asynchronously generates a salt.
* @param callback Callback receiving the error, if any, and the resulting salt
@@ -40,6 +48,14 @@ export declare function genSalt(rounds: number, callback: (err: Error, salt: str
*/
export declare function hashSync(s: string, salt?: number | string): string;
/**
* Asynchronously generates a hash for the given string.
* @param s String to hash
* @param salt Salt length to generate or salt to use
* @return Promise with resulting hash, if callback has been omitted
*/
export declare function hash(s: string, salt: number | string): Promise<string>;
/**
* Asynchronously generates a hash for the given string.
* @param s String to hash
@@ -47,7 +63,7 @@ export declare function hashSync(s: string, salt?: number | string): string;
* @param callback Callback receiving the error, if any, and the resulting hash
* @param progressCallback Callback successively called with the percentage of rounds completed (0.0 - 1.0), maximally once per MAX_EXECUTION_TIME = 100 ms.
*/
export declare function hash(s: string, salt: number | string, callback: (err: Error, hash: string) => void, progressCallback?: (percent: number) => void): void;
export declare function hash(s: string, salt: number | string, callback?: (err: Error, hash: string) => void, progressCallback?: (percent: number) => void): void;
/**
* Synchronously tests a string against a hash.
@@ -57,6 +73,14 @@ export declare function hash(s: string, salt: number | string, callback: (err: E
*/
export declare function compareSync(s: string, hash: string): boolean;
/**
* Asynchronously compares the given data against the given hash.
* @param s Data to compare
* @param hash Data to be compared to
* @return Promise, if callback has been omitted
*/
export declare function compare(s: string, hash: string): Promise<boolean>;
/**
* Asynchronously compares the given data against the given hash.
* @param s Data to compare
@@ -64,7 +88,7 @@ export declare function compareSync(s: string, hash: string): boolean;
* @param callback Callback receiving the error, if any, otherwise the result
* @param progressCallback Callback successively called with the percentage of rounds completed (0.0 - 1.0), maximally once per MAX_EXECUTION_TIME = 100 ms.
*/
export declare function compare(s: string, hash: string, callback: (err: Error, success: boolean) => void, progressCallback?: (percent: number) => void): void;
export declare function compare(s: string, hash: string, callback?: (err: Error, success: boolean) => void, progressCallback?: (percent: number) => void): void;
/**
* Gets the number of rounds used to encrypt the specified hash.
+11 -19
View File
@@ -3,24 +3,16 @@
// Definitions by: Douglas Eichelberger <https://github.com/dduugg/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
interface BigScreenStatic {
// Properties
element: Element;
enabled: boolean;
export as namespace BigScreen;
// Methods
exit(): void;
onchange(element: Element): void;
onenter(element: Element): void;
onerror(element: Element, reason: string): void;
onexit(): void;
request(element: Element, onEnter?: (element: Element) => void, onExit?: () => void, onError?: (element: Element, reason: string) => void): void;
toggle(element: Element, onEnter?: (element: Element) => void, onExit?: () => void, onError?: (element: Element, reason: string) => void): void;
videoEnabled(video: HTMLVideoElement): boolean;
}
export const element: Element;
export const enabled: boolean;
declare var bigscreen: BigScreenStatic;
declare module "bigscreen" {
export = bigscreen;
}
export function exit(): void;
export function onchange(element: Element): void;
export function onenter(element: Element): void;
export function onerror(element: Element, reason: string): void;
export function onexit(): void;
export function request(element: Element, onEnter?: (element: Element) => void, onExit?: () => void, onError?: (element: Element, reason: string) => void): void;
export function toggle(element?: Element, onEnter?: (element: Element) => void, onExit?: () => void, onError?: (element: Element, reason: string) => void): void;
export function videoEnabled(video: HTMLVideoElement): boolean;
+1 -1
View File
@@ -15,6 +15,6 @@
},
"files": [
"index.d.ts",
"bounce-tests.ts"
"bounce.js-tests.ts"
]
}
-9
View File
@@ -1,9 +0,0 @@
import Bowser = require('bowser');
Bowser.msedge === true;
Bowser.test(['msie']) === true;
Bowser.a === Bowser.c;
Bowser.osversion > 10;
Bowser.osversion === '10.1A';
+1 -2
View File
@@ -15,7 +15,6 @@
},
"files": [
"index.d.ts",
"bowser-module-tests.ts",
"bowser-global-tests.ts"
"bowser-tests.ts"
]
}
+1 -1
View File
@@ -15,6 +15,6 @@
},
"files": [
"index.d.ts",
"box2dweb-tests.ts"
"box2d-tests.ts"
]
}
+25
View File
@@ -0,0 +1,25 @@
import getCharm = require("charm");
const charm = getCharm();
charm.pipe(process.stdout);
charm.reset();
var colors: getCharm.CharmColor[] = [ 'red', 'cyan', 'yellow', 'green', 'blue' ];
var text = 'Always after me lucky charms.';
var offset = 0;
var iv = setInterval(function () {
var y = 0, dy = 1;
for (var i = 0; i < 40; i++) {
var color = colors[(i + offset) % colors.length];
var c = text[(i + offset) % text.length];
charm
.move(1, dy)
.foreground(color)
.write(c)
;
y += dy;
if (y <= 0 || y >= 5) dy *= -1;
}
charm.position(0, 1);
offset ++;
}, 150);
+154
View File
@@ -0,0 +1,154 @@
// Type definitions for Charm 1.0
// Project: https://github.com/substack/node-charm/
// Definitions by: Jad Sarout <https://github.com/Xananax/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="node" />
declare namespace charm {
type CharmColorName = "red" | "yellow" | "green" | "blue" | "cyan" | "magenta" | "black" | "white";
type CharmColorHex = number;
type CharmColor = CharmColorName | CharmColorHex;
type CharmAnyStream = NodeJS.WritableStream|NodeJS.ReadableStream|NodeJS.Process;
interface CharmInstance extends NodeJS.WritableStream {
/** Reset the entire screen, like the /usr/bin/reset command. */
reset(): void;
/** Emit an "end" event downstream. */
destroy(): void;
/** Emit an "end" event downstream. */
end(): void;
/**
* Pass along `msg` to the output stream.
* @param cb Unused by charm, only there to comply to the WritableStream interface
*/
write(msg: string | Buffer, cb?: Function): boolean;
write(msgs: string | Buffer, encoding?: string, cb?: Function): boolean;
/** Set the cursor position to the absolute coordinates `x`, `y`. */
position(x: number, y: number): void;
/**
* Query the absolute cursor position from the input stream through the output stream
* (the shell does this automatically) and get the response back as `cb(x, y)`.
*/
position(callback: (x: number, y: number) => void): void;
/** Move the cursor position by the relative coordinates `x`, `y`. */
move(x: number, y: number): this;
/** Move the cursor up by `y` rows. */
up(y: number): this;
/** Move the cursor down by `y` rows. */
down(y: number): this;
/** Move the cursor left by `x` columns. */
left(x: number): this;
/** Move the cursor right by `x` columns. */
right(x: number): this;
/** Push the cursor state and optionally the attribute state. */
push(withAttributes?: boolean): this;
/** Pop the cursor state and optionally the attribute state. */
pop(withAttributes?: boolean): this;
/**
* Erase a region defined by the string `s`.
*
* `s` can be:
*
* - end - erase from the cursor to the end of the line
* - start - erase from the cursor to the start of the line
* - line - erase the current line
* - down - erase everything below the current line
* - up - erase everything above the current line
* - screen - erase the entire screen
*/
erase(s: "end"|"start"|"line"|"down"|"up"|"screen"): this;
/**
* Delete `'line'` or `'char'`s. delete differs from erase because it does not write over
* the deleted characters with whitesapce, but instead removes the deleted space.
*
* mode can be `'line'` or `'char'`. `n` is the number of items to be deleted.
* `n` must be a positive integer.
*
* The cursor position is not updated.
*/
delete(mode: "line"|"char", n?: number): this;
/**
* Insert space into the terminal. `insert` is the opposite of `delete`,
*
* mode can be `'line'` or `'char'`. `n` is the number of items to be deleted.
* `n` must be a positive integer.
*/
insert(mode: "line"|"char", n: number): this;
/**
* Set the display mode with the string `attr.`
*
* `attr` can be:
*
* - reset
* - bright
* - dim
* - underscore
* - blink
* - reverse
* - hidden
*/
display(attr: "reset" | "bright" | "dim" | "underscore" | "blink" | "reverse" | "hidden"): this;
/**
* Set the foreground color with the string `color`, which can be:
*
* - red
* - yellow
* - green
* - blue
* - cyan
* - magenta
* - black
* - white
* - or `color` can be an integer from 0 to 255, inclusive.
*/
foreground(color: CharmColor): this;
/**
* Set the background color with the string `color`, which can be:
*
* - red
* - yellow
* - green
* - blue
* - cyan
* - magenta
* - black
* - white
* - or `color` can be an integer from 0 to 255, inclusive.
*/
background(color: CharmColor): this;
/** Set the cursor visibility with a boolean `visible`. */
cursor(visible: boolean): any;
/** Pipes the output of Charm to a writeable stream `stream` */
pipe(stream: NodeJS.WritableStream): void;
}
}
/**
* Create a new readable/writable charm stream.
*
* You can pass in readable or writable streams as parameters
* and they will be piped to or from accordingly.
* You can also pass `process` in which case
* `process.stdin` and `process.stdout` will be used.
*/
declare function charm(param?: charm.CharmAnyStream): charm.CharmInstance;
export = charm;
+20
View File
@@ -0,0 +1,20 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"charm-tests.ts"
]
}
+6
View File
@@ -0,0 +1,6 @@
{
"extends": "../tslint.json",
"rules": {
"forbidden-types": false
}
}
+1 -1
View File
@@ -62,7 +62,7 @@ declare namespace Chart {
afterBody?: (item?: ChartTooltipItem[], data?: any) => void;
beforeFooter?: (item?: ChartTooltipItem[], data?: any) => void;
footer?: (item?: ChartTooltipItem[], data?: any) => void;
afterfooter?: (item?: ChartTooltipItem[], data?: any) => void;
afterFooter?: (item?: ChartTooltipItem[], data?: any) => void;
}
export interface ChartAnimationParameter {
+1 -1
View File
@@ -15,6 +15,6 @@
},
"files": [
"index.d.ts",
"chart-tests.ts"
"chartjs-tests.ts"
]
}
+2 -2
View File
@@ -16,8 +16,8 @@
"files": [
"index.d.ts",
"chrome-app.d.ts",
"chrome-app-tests.ts",
"chrome-cast.d.ts",
"chrome-tests.ts"
"test/index.ts",
"test/chrome-app.ts"
]
}
@@ -1,5 +1,3 @@
/// <reference path="cldr.js-event.d.ts" />
Cldr.on("get", (path, value) => {
console.log(path);
console.log(value);
+3 -3
View File
@@ -16,8 +16,8 @@
"files": [
"index.d.ts",
"cldr.js-supplemental.d.ts",
"cldr.js-tests.ts",
"cldr.js-event-tests.ts",
"cldr.js-supplemental-tests.ts"
"test/index.ts",
"test/event.ts",
"test/supplemental.ts"
]
}
+5 -5
View File
@@ -15,14 +15,14 @@
},
"files": [
"index.d.ts",
"codemirror-tests.ts",
"codemirror-matchbrackets.d.ts",
"codemirror-matchbrackets-tests.ts",
"codemirror-runmode.d.ts",
"codemirror-runmode-tests.ts",
"codemirror-showhint.d.ts",
"codemirror-showhint-tests.ts",
"searchcursor.d.ts",
"searchcursor-tests.ts"
"test/index.ts",
"test/matchbrackets.ts",
"test/runmode.ts",
"test/searchcursor.ts",
"test/showhint.ts"
]
}
+20
View File
@@ -0,0 +1,20 @@
import concat = require("concat-stream")
import { Readable } from "stream";
class MyReadable extends Readable {
i: number = 1;
_read() {
if (this.i <= 100) {
this.push(this.i.toString());
this.i++;
} else {
this.push(null);
}
}
}
let myReadable = new MyReadable();
myReadable.pipe(concat((buf) => console.log(buf.toString())));
myReadable.pipe(concat({}, (buf) => console.log(buf.toString())));
+17
View File
@@ -0,0 +1,17 @@
// Type definitions for concat-stream 1.6
// Project: https://github.com/maxogden/concat-stream
// Definitions by: Joey Marianer <https://github.com/jmarianer>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="node" />
import { Writable } from "stream";
interface ConcatOpts {
encoding?: string;
}
declare function concat(cb: (buf: Buffer) => void): Writable;
declare function concat(opts: ConcatOpts, cb: (buf: Buffer) => void): Writable;
export = concat;
+20
View File
@@ -0,0 +1,20 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"concat-stream-tests.ts"
]
}

Some files were not shown because too many files have changed in this diff Show More