typescript: Migrate params-util.js to typescript.

This commit is contained in:
Priyank Patel
2019-06-19 20:59:43 -04:00
committed by Akash Nimare
parent 4d679acb0c
commit aa2c55538f
2 changed files with 5 additions and 7 deletions

View File

@@ -1,15 +1,11 @@
// This util function returns the page params if they're present else returns null
function isPageParams() {
export function isPageParams(): null | object {
let webpageParams = null;
try {
// eslint-disable-next-line no-undef, camelcase
// eslint-disable-next-line no-undef, @typescript-eslint/camelcase
webpageParams = page_params;
} catch (err) {
} catch (_) {
webpageParams = null;
}
return webpageParams;
}
module.exports = {
isPageParams
};

2
typings.d.ts vendored
View File

@@ -4,5 +4,7 @@
// are not supported
declare module '*';
declare var page_params: object;
// since requestIdleCallback didn't make it into lib.dom.d.ts yet
declare function requestIdleCallback(callback: Function, options?: object): void;