mirror of
https://github.com/zulip/zulip-desktop.git
synced 2025-11-01 20:43:33 +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
|
||||
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
2
typings.d.ts
vendored
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user