mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-06-02 14:38:20 +08:00
angular: gave a more precise return type to $q.all<T>()
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
|
||||
let app: angular.IModule = angular.module('at', ['blockUI']);
|
||||
|
||||
app.config((blockUIConfig: angular.blockUI.BlockUIConfig) => {
|
||||
|
||||
1
types/angular-block-ui/index.d.ts
vendored
1
types/angular-block-ui/index.d.ts
vendored
@@ -2,6 +2,7 @@
|
||||
// Project: https://github.com/McNull/angular-block-ui
|
||||
// Definitions by: Lasse Nørregaard <https://github.com/lassebn>, Stephan Classen <https://github.com/sclassen>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
import * as angular from "angular";
|
||||
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
|
||||
import * as ng from "angular";
|
||||
import * as angular from "angular";
|
||||
|
||||
|
||||
1
types/angular-gridster/index.d.ts
vendored
1
types/angular-gridster/index.d.ts
vendored
@@ -2,6 +2,7 @@
|
||||
// Project: https://github.com/ManifestWebDesign/angular-gridster
|
||||
// Definitions by: Joao Monteiro <https://github.com/jpmnteiro>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
import * as angular from "angular";
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
import * as angular from 'angular';
|
||||
|
||||
angular.module('angular-oauth2-test', ['angular-oauth2'])
|
||||
|
||||
1
types/angular-oauth2/index.d.ts
vendored
1
types/angular-oauth2/index.d.ts
vendored
@@ -2,6 +2,7 @@
|
||||
// Project: https://github.com/oauthjs/angular-oauth2
|
||||
// Definitions by: Antério Vieira <https://github.com/anteriovieira>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
import * as angular from 'angular';
|
||||
|
||||
|
||||
@@ -337,6 +337,16 @@ namespace TestQ {
|
||||
let result: angular.IPromise<{a: number; b: string; }>;
|
||||
result = $q.all<{a: number; b: string; }>({a: promiseAny, b: promiseAny});
|
||||
}
|
||||
{
|
||||
let result = $q.all({ num: $q.when(2), str: $q.when('test') });
|
||||
// TS should infer that num is a number and str is a string
|
||||
result.then(r => (r.num * 2) + r.str.indexOf('s'));
|
||||
}
|
||||
{
|
||||
let result = $q.all({ num: $q.when(2), str: 'test' });
|
||||
// TS should infer that num is a number and str is a string
|
||||
result.then(r => (r.num * 2) + r.str.indexOf('s'));
|
||||
}
|
||||
|
||||
// $q.defer
|
||||
{
|
||||
|
||||
2
types/angular/index.d.ts
vendored
2
types/angular/index.d.ts
vendored
@@ -1029,7 +1029,7 @@ declare namespace angular {
|
||||
*
|
||||
* @param promises A hash of promises.
|
||||
*/
|
||||
all<T extends {}>(promises: { [K in keyof T]: IPromise<T[K]>; }): IPromise<T>;
|
||||
all<T>(promises: { [K in keyof T]: (IPromise<T[K]> | T[K]); }): IPromise<T>;
|
||||
/**
|
||||
* Creates a Deferred object which represents a task which will finish in the future.
|
||||
*/
|
||||
|
||||
1
types/ng-stomp/index.d.ts
vendored
1
types/ng-stomp/index.d.ts
vendored
@@ -2,6 +2,7 @@
|
||||
// Project: https://github.com/beevelop/ng-stomp
|
||||
// Definitions by: Lukasz Potapczuk <https://github.com/lpotapczuk>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
/// <reference types="angular" />
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
class test {
|
||||
constructor(private ngstomp: ngStomp) {
|
||||
const connectHeaders = {
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
// Project: http://help.qlik.com/en-US/sense-developer/3.2/Subsystems/Extensions/Content/extensions-introduction.htm
|
||||
// Definitions by: Konrad Mattheis <https://github.com/konne>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
/// <reference types="angular" />
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
import qlik = require("qlik");
|
||||
|
||||
const t = qlik.currApp();
|
||||
|
||||
1
types/ui-router-extras/index.d.ts
vendored
1
types/ui-router-extras/index.d.ts
vendored
@@ -2,6 +2,7 @@
|
||||
// Project: https://github.com/christopherthielen/ui-router-extras
|
||||
// Definitions by: Michael Putters <https://github.com/mputters/>, Marcel van de Kamp <https://github.com/marcel-k/>, Viktor Smirnov <https://github.com/LaserUnicorns/>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
/// <reference types="angular-ui-router" />
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
import * as angular from 'angular';
|
||||
const myApp = angular.module('testModule');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user