mirror of
https://github.com/zulip/zulip-desktop.git
synced 2025-11-11 09:26:27 +00:00
typescript: Migrate params-util.js to typescript.
This commit is contained in:
committed by
Akash Nimare
parent
4d679acb0c
commit
aa2c55538f
@@ -1,15 +1,11 @@
|
|||||||
// This util function returns the page params if they're present else returns null
|
// This util function returns the page params if they're present else returns null
|
||||||
function isPageParams() {
|
export function isPageParams(): null | object {
|
||||||
let webpageParams = null;
|
let webpageParams = null;
|
||||||
try {
|
try {
|
||||||
// eslint-disable-next-line no-undef, camelcase
|
// eslint-disable-next-line no-undef, @typescript-eslint/camelcase
|
||||||
webpageParams = page_params;
|
webpageParams = page_params;
|
||||||
} catch (err) {
|
} catch (_) {
|
||||||
webpageParams = null;
|
webpageParams = null;
|
||||||
}
|
}
|
||||||
return webpageParams;
|
return webpageParams;
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
isPageParams
|
|
||||||
};
|
|
||||||
2
typings.d.ts
vendored
2
typings.d.ts
vendored
@@ -4,5 +4,7 @@
|
|||||||
// are not supported
|
// are not supported
|
||||||
declare module '*';
|
declare module '*';
|
||||||
|
|
||||||
|
declare var page_params: object;
|
||||||
|
|
||||||
// since requestIdleCallback didn't make it into lib.dom.d.ts yet
|
// since requestIdleCallback didn't make it into lib.dom.d.ts yet
|
||||||
declare function requestIdleCallback(callback: Function, options?: object): void;
|
declare function requestIdleCallback(callback: Function, options?: object): void;
|
||||||
|
|||||||
Reference in New Issue
Block a user