Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8643617
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T12:05:38+00:00 2026-06-12T12:05:38+00:00

obviously I am trying to get facebooks async init working. Doing it, I need

  • 0

obviously I am trying to get facebooks async init working. Doing it, I need to create a function on object window called “fbAsyncInit”. I am having simillar problem, when writing web workers, because there I want to use self.postMessage but self is once again having as its interface interface Window.
However I try to do it, the typscript compiler is not happy with me adding a field to window which is not specified in Window interface.
I tried to do it like this at first:

interface WindowFB extends Window { 
    fbAsyncInit: ()=>any;
}

declare var window: WindowFB;

that didn’t help so I tried some other things and managed to get type checker happy, but it seems like it is just bugged(because for the solutions it is not happy 100%).
Does anybody know what the right solution for this might be?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T12:05:40+00:00Added an answer on June 12, 2026 at 12:05 pm

    The ‘Window’ interface is open. You can just write:

    interface Window {
        fbAsyncInit: () => any;
    }
    
    window.fbAsyncInit();
    

    Due to some bugs around lib.d.ts, this won’t quite work in the TypeScript Playground, but the command-line compiler should be able to accept this.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to get mod_rewrite working with the following URLs: /events.php?view=details&id=$var /events.php?view=edit&id=$var Obviously my
I am trying to get the ckeditor working. Obviously it doesn't make use of
I am trying to get around a Cross Thread Exception, Invalid Object Exception. Here
I'm trying to get a count from 2 tables working and I'm struggling! I've
Been trying to get the following working using nhibernate HQL or QueryOver. I am
I'm trying to get a webcamera stream working on my page, and I want
Right, I'm trying to get a label with text in it (done already obviously),
Whilst trying to get our app working in Firefox (I'm a big proponent of
I am trying to get one last thing working: I have a blog link
I am trying to get jscrollpane working on a very simple page, but for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.