@types/lockfile-lint-api
TypeScript icon, indicating that this package has built-in type declarations

5.1.5 • Public • Published

Installation

npm install --save @types/lockfile-lint-api

Summary

This package contains type definitions for lockfile-lint-api (https://github.com/lirantal/lockfile-lint/tree/master/packages/lockfile-lint-api).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/lockfile-lint-api.

index.d.ts

export type Hosts = readonly string[];

export interface PackageMetadata {
    version: string;
    resolved?: string | undefined;
    dependencies?: Record<string, string> | undefined; // e.g. {'balanced-match': '^1.0.0', 'concat-map': '0.0.1'}
}

export type Packages = Record<string, PackageMetadata>;

export interface ValidationOptions {
    emptyHostname?: boolean | undefined;
}

export interface Error {
    message: string;
    package: string;
}

export interface ValidationError {
    type: "error";
    errors: Error[];
}

export interface ValidationSuccess {
    type: "success";
    object: Packages;
}

export type ValidationResult = ValidationError | ValidationSuccess;

export class ValidateHost {
    constructor(packages: { packages: Packages });
    validate(hosts: Hosts, options?: ValidationOptions): ValidationResult;
    validateSingle(packageName: string, hosts: Hosts): boolean;
}

export class ValidateHttps {
    constructor(packages: { packages: Packages });
    validate(): ValidationResult;
}

export class ValidateScheme {
    constructor(packages: { packages: Packages });
    validate(schemes: readonly string[]): ValidationResult;
}

export class ValidateUrl {
    constructor(packages: { packages: Packages });
    validate(allowedUrls: readonly string[], options?: ValidationOptions): ValidationResult;
    validateSingle(packageName: string, allowedUrls: Hosts): boolean;
}

export interface ParseLockfileOptions {
    lockfilePath: string;
    lockfileType: string;
}

export interface ParseLockfileResult {
    type: "success";
    object: Packages;
}

export class ParseLockfile {
    constructor(options: ParseLockfileOptions);
    parseSync(): ParseLockfileResult;
}

Additional Details

  • Last updated: Mon, 20 Nov 2023 23:36:24 GMT
  • Dependencies: none

Credits

These definitions were written by Markus Lasermann.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/lockfile-lint-api

Weekly Downloads

16

Version

5.1.5

License

MIT

Unpacked Size

6.07 kB

Total Files

5

Last publish

Collaborators

  • types