Skip to content

Any plan to support ES6 style imports ? #102

@Xample

Description

@Xample

My linter raises this error

suggestion:

instead of :

export = PGPubsub;
/** @typedef {(payload: any) => void} PGPubsubCallback */
declare class PGPubsub extends NodeJS.EventEmitter {

use

/** @typedef {(payload: any) => void} PGPubsubCallback */
export class PGPubsub extends NodeJS.EventEmitter {

same for

declare namespace PGPubsub {
    export { PGPubsubCallback };
}
type PGPubsubCallback = (payload: any) => void;

use

export type PGPubsubCallback = (payload: any) => void;

no need to add complex namespace and avoid using a global declare at all cost.
Usage will be
import {PGPubsub} from 'pg-pubsub'; Which is ES6 compliant

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions