npm

Ready to take your JavaScript development to the next level? Meet npm Enterprise - the ultimate in enterprise JavaScript.Learn more »

@verdaccio/types

6.1.0 • Public • Published

Flow/Typescript types for Verdaccio

Typescript / Flow definitions for verdaccio plugins and internal code

Typescript

For usage with the library, the tsconfig.json should looks like this. Typescript is only available since "@verdaccio/types": "5.0.0-beta.2".

//tsconfig.json
{
  "compilerOptions": {
    "target": "esnext",
    "module": "commonjs",
    "declaration": true,
    "noImplicitAny": false,
    "strict": true,
    "outDir": "lib",
    "allowSyntheticDefaultImports": true,
    "esModuleInterop": true,
    "typeRoots": [
      "./node_modules/@verdaccio/types/lib/verdaccio",
      "./node_modules/@types"
    ]
  },
  "include": [
    "src/*.ts",
    "types/*.d.ts"
  ]
}

Flow

Usage

To set up the types we need to add them to the .flowconfig flow configuration file.

[libs]
node_modules/@verdaccio/types/lib/

[options]
suppress_comment= \\(.\\|\n\\)*\\$FlowFixMe

Imports

import type {ILocalData, LocalStorage, Logger, Config} from '@verdaccio/types';

 class LocalData implements ILocalData {

  path: string;
  logger: Logger;
  data: LocalStorage;
  config: Config;
  locked: boolean;
  ...  
}

install

npm i @verdaccio/types

Downloadsweekly downloads

399

version

6.1.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
  • avatar
  • avatar
  • avatar
Report a vulnerability