question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Typescript support

See original GitHub issue

I am implementing firebase-analytics for mobile app and I am using angular. I am not sure if I am missing something but once I hover on some function I don’t see any information in VS Code regarding its parameters and output.

Is the project missing types declaration?

I am using TSlint if it helps. Example of my implementation, hovering on logEvent() only shows any:

import { Plugins } from '@capacitor/core';
const { FirebaseAnalytics } = Plugins;

publishEvent(event: Event): void {
  FirebaseAnalytics.logEvent({ name: eventName, params: value });
}

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:3
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
michalsisakcommented, Apr 6, 2021

@brownoxford Importing import "@capacitor-community/firebase-analytics"; solved the issue! Thank you. Will close the issue now.

1reaction
brownoxfordcommented, Mar 26, 2021

Hmm, here are my imports for the working capacitor v2 implementation where I got that screenshot:

import { Plugins } from "@capacitor/core";
import "@capacitor-community/firebase-analytics";

const { FirebaseAnalytics } = Plugins;

It looks like your first implementation may not have been working because you were not also importing “@capacitor-community/firebase-analytics” - you need that import because it actually exports all of the definitions for the plugin via export * from './definitions'

import { Plugins } from '@capacitor/core';
const { FirebaseAnalytics } = Plugins;

The new style you show is only for capacitor v3, so I would not use that unless you are upgrading:

# Capacitor V3 only
import { FirebaseAnalytics } from '@capacitor-community/firebase-analytics';
Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeScript: JavaScript With Syntax For Types.
TypeScript extends JavaScript by adding types to the language. ... TypeScript adds additional syntax to JavaScript to support a tighter integration with ...
Read more >
TypeScript - Wikipedia
TypeScript supports definition files that can contain type information of existing JavaScript libraries, much like C++ header files can describe the ...
Read more >
TypeScript Programming with Visual Studio Code
VS Code comes with great debugging support for TypeScript, including support for sourcemaps. Set breakpoints, inspect objects, navigate the call stack, and ...
Read more >
TypeScript | WebStorm Documentation
WebStorm supports developing, running, and debugging TypeScript source code. ... Learn more from Compiling TypeScript into JavaScript.
Read more >
Using Vue with TypeScript
Volar is the official VSCode extension that provides TypeScript support inside Vue SFCs, along with many other great features.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found