Add types for $mdUtil (#34115)

This commit is contained in:
chivesrs 2019-03-25 07:43:27 -07:00 committed by Sheetal Nandi
parent 92b0d5bb4e
commit 22e9e40427
2 changed files with 17 additions and 0 deletions

View File

@ -419,3 +419,14 @@ myApp.controller('StickyController', ($scope: TestScope, $mdSticky: ng.material.
$mdSticky($scope, stickyElement);
$mdSticky($scope, stickyElement, cloneStickyElement);
});
function mdUtil($mdUtil: ng.material.IUtilService) {
// $ExpectType void
$mdUtil.enableScrolling();
// $ExpectType () => void
$mdUtil.debounce(() => {});
// $ExpectType () => string
$mdUtil.debounce((): string => "");
}

View File

@ -517,5 +517,11 @@ declare module 'angular' {
getLastInteractionType(): string|null;
isUserInvoked(checkDelay?: number): boolean;
}
interface IUtilService {
// tslint:disable-next-line:ban-types debounce takes in a user provided function
debounce<T extends Function>(func: T, wait?: number, scope?: any, invokeApply?: boolean): T;
enableScrolling(): void;
}
}
}