Skip to content

Commit

Permalink
Merge pull request #5 from DefinitelyTyped/master
Browse files Browse the repository at this point in the history
Update master
  • Loading branch information
TonyPythoneer committed Sep 21, 2016
2 parents bb69a33 + 70a693e commit 2698720
Show file tree
Hide file tree
Showing 101 changed files with 15,812 additions and 10,176 deletions.
31 changes: 31 additions & 0 deletions angular-feature-flags/angular-feature-flags-tests.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/// <reference path="angular-feature-flags.d.ts" />

let myApp = angular.module('myApp', ['feature-flags']);

const flagsData: Array<angular.featureflags.FlagData> = [
{
key: '1',
active: true,
name: 'flag1',
description: 'This is the first flag'
},
{
key: '2',
active: false,
name: 'flag2',
description: 'This is the second flag'
}
];

myApp.config(function (featureFlagsProvider: angular.featureflags.FeatureFlagsProvider) {
featureFlagsProvider.setInitialFlags(flagsData);
});

myApp.run(function ($q: angular.IQService, $http: angular.IHttpService, featureFlags: angular.featureflags.FeatureFlagsService) {
let deferred = $q.defer();
deferred.resolve(flagsData);

featureFlags.set(deferred.promise);

featureFlags.set($http.get('/data/flags.json'));
});
38 changes: 38 additions & 0 deletions angular-feature-flags/angular-feature-flags.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// Type definitions for angular-feature-flags 1.4.0
// Project: https://github.com/mjt01/angular-feature-flags
// Definitions by: Borislav Zhivkov <https://github.com/borislavjivkov/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

/// <reference path="../angularjs/angular.d.ts" />

declare namespace angular.featureflags {
export interface FlagData {
/**
* Unique key that is used from the markup to resolve whether a flag is active or not.
*/
key: string;

/**
* Boolean value for enabling/disabling the feature
*/
active: boolean;

/**
* A short name of the flag (only visible in the list of flags)
*/
name: string;

/**
* A long description of the flag to further explain the feature being toggled (only visible in the list of flags)
*/
description: string;
}

export interface FeatureFlagsProvider {
setInitialFlags(flags: Array<FlagData>): void;
}

export interface FeatureFlagsService {
set(flagsPromise: angular.IPromise<FlagData> | angular.IHttpPromise<FlagData>): void;
}
}
5 changes: 4 additions & 1 deletion angular-material/angular-material-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,10 @@ myApp.controller('SidenavController', ($scope: ng.IScope, $mdSidenav: ng.materia
});

myApp.controller('ToastController', ($scope: ng.IScope, $mdToast: ng.material.IToastService) => {
$scope['openToast'] = () => $mdToast.show($mdToast.simple().textContent('Hello!'));
$scope['openToast'] = () => {
$mdToast.show($mdToast.simple().textContent('Hello!'));
$mdToast.updateTextContent('New Content');
}

$scope['customToast'] = () => {
var options = {
Expand Down
3 changes: 2 additions & 1 deletion angular-material/angular-material.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,8 @@ declare namespace angular.material {
showSimple(content: string): angular.IPromise<any>;
simple(): ISimpleToastPreset;
build(): IToastPreset<any>;
updateContent(): void;
updateContent(newContent: string): void;
updateTextContent(newContent: string): void
hide(response?: any): void;
cancel(response?: any): void;
}
Expand Down
11 changes: 11 additions & 0 deletions angular-ui-bootstrap/angular-ui-bootstrap.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,17 @@ declare namespace angular.ui.bootstrap {
* @default 'body'
*/
appendTo?: angular.IAugmentedJQuery;

/**
* A string reference to the component to be rendered that is registered with Angular's compiler. If using a directive, the directive must have `restrict: 'E'` and a template or templateUrl set.
*
* It supports these bindings:
* - `close` - A method that can be used to close a modal, passing a result. The result must be passed in this format: `{$value: myResult}`
* - `dismiss` - A method that can be used to dismiss a modal, passing a result. The result must be passed in this format: `{$value: myRejectedResult}`
* - `modalInstance` - The modal instance. This is the same `$uibModalInstance` injectable found when using `controller`.
* - `resolve` - An object of the modal resolve values. See [UI Router resolves] for details.
*/
component?: string;
}

interface IModalStackService {
Expand Down
20 changes: 20 additions & 0 deletions angularjs/angular-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -867,6 +867,26 @@ angular.module('docsTabsExample', [])
};
});

angular.module('multiSlotTranscludeExample', [])
.directive('dropDownMenu', function() {
return {
transclude: {
button: 'button',
list: 'ul',
},
link: function(scope, element, attrs, ctrl, transclude) {
// without scope
transclude().appendTo(element);
transclude(clone => clone.appendTo(element));

// with scope
transclude(scope, clone => clone.appendTo(element));
transclude(scope, clone => clone.appendTo(element), element, 'button');
transclude(scope, null, element, 'list').addClass('drop-down-list').appendTo(element);
}
};
});

angular.module('componentExample', [])
.component('counter', {
require: {'ctrl': '^ctrl'},
Expand Down
2 changes: 1 addition & 1 deletion angularjs/angular.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1259,7 +1259,7 @@ declare namespace angular {
// This corresponds to $transclude (and also the transclude function passed to link).
interface ITranscludeFunction {
// If the scope is provided, then the cloneAttachFn must be as well.
(scope: IScope, cloneAttachFn: ICloneAttachFunction): JQuery;
(scope: IScope, cloneAttachFn: ICloneAttachFunction, futureParentElement?: JQuery, slotName?: string): JQuery;
// If one argument is provided, then it's assumed to be the cloneAttachFn.
(cloneAttachFn?: ICloneAttachFunction): JQuery;
}
Expand Down
2 changes: 1 addition & 1 deletion auth0.lock/auth0.lock.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ interface Auth0LockConstructorOptions {
initialScreen?: "login" | "signUp" | "forgotPassword";
language?: string;
languageDictionary?: any;
loginAfterSignup?: boolean;
loginAfterSignUp?: boolean;
mustAcceptTerms?: boolean;
popupOptions?: Auth0LockPopupOptions;
prefill?: { email?: string, username?: string};
Expand Down
Loading

0 comments on commit 2698720

Please sign in to comment.