Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error TS2304: Cannot find name 'object' #27

Closed
texirv0203 opened this issue Jan 12, 2018 · 1 comment
Closed

error TS2304: Cannot find name 'object' #27

texirv0203 opened this issue Jan 12, 2018 · 1 comment

Comments

@texirv0203
Copy link

hi,

  • I am getting below error when I install intercom package.
    https://github.com/CaliStyle/angular2-intercom
    npm install ng-intercom@latest --save
  • its pointing to this line ---> init(intercomData?: object): any;
  • can you guys tell me how to fix it.
  • providing my code snippet below.
  • this is the line I included in app.module.ts ---> import { IntercomModule } from 'ng-intercom';

node_modules/ng-intercom/dist/intercom/intercom.d.ts(19,25): error TS2304: Cannot find name 'object'.
node_modules/ng-intercom/dist/intercom/intercom.d.ts(26,25): error TS2304: Cannot find name 'object'.
node_modules/ng-intercom/dist/intercom/intercom.d.ts(41,19): error TS2304: Cannot find name 'object'.

import { Router } from '@angular/router';
import { IntercomConfig } from '../shared/intercom-config';
/**

  • @description A provider with every Intercom.JS method
  • @export
  • @Class Intercom
    /
    export declare class Intercom {
    private config;
    private router;
    constructor(config: IntercomConfig, router: Router);
    /
    *
    • @description Method used to instantiate Intercom
    • @param {object} [intercomData]
    • @memberof Intercom
    • @deprecated
      /
      init(intercomData?: object): any;
      /
      *
    • @description
    • If you'd like to control when Intercom is loaded, you can use the 'boot' method. This is useful in situations like a one-page Javascript based application where the user may not be logged in when the page loads. You call this method with the standard intercomSettings object.
    • @param {object} [intercomData] Your intercom configuration
    • @memberof Intercom
      /
      boot(intercomData?: object): any;
      /
      *
    • @description
    • If you have the Respond product (combined with another product like Engage) you should call the Intercom shutdown method to clear your users’ conversations anytime they logout of your application. Otherwise, the cookie we use to track who was most recently logged in on a given device or computer will keep these conversations in the Messenger for one week. This method will effectively clear out any user data that you have been passing through the JS API.
    • @memberof Intercom
      /
      shutdown(): any;
      /
      *
    • @description
    • Calling the update method without any other arguments will trigger the JavaScript to look for new messages that should be displayed to the current user (the one whose details are in the window.intercomSettings variable) and show them if they exist.
    • Calling the update method with a JSON object of user details will update those fields on the current user in addition to logging an impression at the current URL and looking for new messages for the user.
    • @param {object} [data]
    • @memberof Intercom
      /
      update(data?: object): any;
      /
      *
    • @description
    • This will hide the main Messenger panel if it is open. It will not hide the Messenger Launcher.
    • @memberof Intercom
      /
      hide(): any;
      /
      *
    • @description
    • This will show the Messenger. If there are no conversations it will open with the new message view, if there are it will open with the message list.
    • If a message parameter is supplied, it will automatically open a new message window, aliasing showNewMessage().
    • @param {string} [message]
    • @memberof Intercom
      /
      show(message?: string): any;
      /
      *
    • @description To open the message window with the message list you can call showMessages().
    • @memberof Intercom
      /
      showMessages(): any;
      /
      *
    • @description To open the message window with the new message view you can call showNewMessage().
    • This function takes an optional parameter that can be used to pre-populate the message composer as shown below.
    • @param {string} message
    • @memberof Intercom
      /
      showNewMessage(message?: string): any;
      /
      *
    • @description
    • You can submit an event using the trackEvent method. This will associate the event with the currently logged in user and send it to Intercom. The final parameter is a map that can be used to send optional metadata about the event.
    • You can also add custom information to events in the form of event metadata.
    • @param {string} eventName
    • @param {*} [metadata]
    • @memberof Intercom
      /
      trackEvent(eventName: string, metadata?: any): any;
      /
      *
    • @description
    • A visitor is someone who goes to your site but does not use the messenger. You can track these visitors via the visitor user_id. This user_id can be used to retrieve the visitor or lead through the REST API.
    • @returns {string}
    • @memberof Intercom
      /
      getVisitorId(): string;
      /
      *
    • @description Alias for getVisitorId()
    • @alias getVisitorId()
    • @readonly
    • @type {string}
    • @memberof Intercom
      /
      readonly visitorId: string;
      /
      *
    • @description
    • Gives you the ability to hook into the show event. Requires a function argument.
    • @param {() => void} handler
    • @memberof Intercom
      /
      onShow(handler: () => void): any;
      /
      *
    • @description
    • Gives you the ability to hook into the hide event. Requires a function argument.
    • @param {() => void} handler
    • @memberof Intercom
      /
      onHide(handler: () => void): any;
      /
      *
    • @description
    • This method allows you to register a function that will be called when the current number of unread messages changes.
    • @param {(unreadCount?: number) => void} handler
    • @memberof Intercom
      */
      onUnreadCountChange(handler: (unreadCount?: number) => void): any;
      }
@wbhob
Copy link
Contributor

wbhob commented Jan 15, 2018

Yeah this requires typescript >2.3

@wbhob wbhob closed this as completed Jan 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants