Skip to content

Why not use declare module typings? #269

@pauldraper

Description

@pauldraper

Path mappings work, but are rarely used since every downstream TypeScript project also has to set them.

More typical is module declarations.

declare module "N/log" {
}

These are then added by one of:

  1. Installing under @types as a npm alias (or having the project in DefinitelyTyped to begin with)
  2. Adding typeRoots.
  3. Referencing the types via tripe slash /// <reference types="..." />

Note that module declarations is how Node.js typings work (@types/node).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions