UNPKG

872 BMarkdownView Raw
1# Typescript types
2
3Typescript definitions for verdaccio plugins and internal code
4
5## Usage
6
7For usage with the library, the `tsconfig.json` should looks like this.
8
9```
10//tsconfig.json
11{
12 "compilerOptions": {
13 "target": "esnext",
14 "module": "commonjs",
15 "declaration": true,
16 "noImplicitAny": false,
17 "strict": true,
18 "outDir": "lib",
19 "allowSyntheticDefaultImports": true,
20 "esModuleInterop": true,
21 "typeRoots": [
22 "./node_modules/@verdaccio/types/lib/verdaccio",
23 "./node_modules/@types"
24 ]
25 },
26 "include": [
27 "src/*.ts",
28 "types/*.d.ts"
29 ]
30}
31```
32
33### Example
34
35```typescript
36import type {ILocalData, LocalStorage, Logger, Config} from '@verdaccio/types';
37
38 class LocalData implements ILocalData {
39
40 path: string;
41 logger: Logger;
42 data: LocalStorage;
43 config: Config;
44 locked: boolean;
45 ...
46}
47```
48
49#### Plugins