Skip to content

Type declaration #20

@mindplay-dk

Description

@mindplay-dk

Hi,

There's no third-party types available for this package, so I had to add my own:

declare module "serialize-to-js" {
  export = serialize;

  function serialize(source: any, options?: { ignoreCircular?: boolean, reference?: boolean, unsafe?: boolean }): string;
}

I'm honestly not an expert in this area, but putting this in a serialize-to-js.d.ts file in the root of my project worked - you could probably just dump this as index.d.ts in the root folder and the package would have type-checking in TS and auto-completions in VS Code and other editors.

Cheers 🙂

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