Skip to content

Commit

Permalink
Fix puppeteer type error
Browse files Browse the repository at this point in the history
  • Loading branch information
danielcardeenas committed Jun 10, 2019
1 parent 96cba56 commit baf0ab0
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ Javascript whatsapp framework (web whatsapp driver)
## Usage

```javascript
import { create } from 'sulla';
// var create = require("sulla").create;
import { create, Whatsapp } from 'sulla';

create().then(client => start(client));

function start(client) {
function start(client: Whatsapp) {
client.onMessage(message => {
if (message.body === 'Hi') {
client.sendText(message.from, '👋 Hello from sulla!');
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sulla",
"version": "1.0.1",
"version": "1.0.3",
"description": "Javascript whatsapp framework",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion src/controllers/browser.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as path from 'path';
import * as puppeteer from 'puppeteer';
import puppeteer from 'puppeteer';
import { puppeteerConfig } from '../config/puppeteer.config';

export async function initWhatsapp() {
Expand Down
4 changes: 2 additions & 2 deletions src/controllers/initializer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const spinner = ora();
/**
* Should be called to initialize whatsapp client
*/
export const create = async () => {
export async function create() {
spinner.start('Initializing whatsapp');
let waPage = await initWhatsapp();
spinner.succeed();
Expand All @@ -32,4 +32,4 @@ export const create = async () => {
spinner.succeed('Whatsapp is ready');

return new Whatsapp(waPage);
};
}

0 comments on commit baf0ab0

Please sign in to comment.