@types/browser-resolve
TypeScript definitions for browser-resolve
Last updated 10 years ago by types .
MIT · Repository · Original npm · Tarball · package.json
$ cnpm install @types/browser-resolve 
SYNC missed versions from official npm registry.

Installation

npm install --save @types/browser-resolve

Summary

This package contains type definitions for browser-resolve (https://github.com/defunctzombie/node-browser-resolve).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/browser-resolve.

index.d.ts

// Type definitions for browser-resolve 2.0
// Project: https://github.com/defunctzombie/node-browser-resolve
// Definitions by: Mario Nebl <https://github.com/marionebl>
//                 Piotr Błażejewicz <https://github.com/peterblazejewicz>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

import * as resv from 'resolve';

/**
 * Resolve a module path and call cb(err, path)
 *
 * @param id Identifier to resolve
 * @param callback
 */
declare function resolve(id: string, cb: resolve.Callback): void;

/**
 * Resolve a module path and call cb(err, path)
 *
 * @param id Identifier to resolve
 * @param options Options to use for resolving, optional.
 * @param callback
 */
declare function resolve(id: string, opts: resolve.AsyncOpts, cb: resolve.Callback): void;

declare namespace resolve {
    interface Opts {
        /**
         * directory to begin resolving from
         */
        basedir?: string | undefined;
        /**
         * the 'browser' property to use from package.json
         * @default 'browser'
         */
        browser?: string | undefined;
        /**
         * the calling filename where the require() call originated (in the source)
         */
        filename?: string | undefined;
        /**
         * modules object with id to path mappings to consult before doing manual resolution
         * (use to provide core modules)
         */
        modules?: { [id: string]: string } | undefined;
        /**
         * transform the parsed package.json contents before looking at the main field
         */
        packageFilter?: ((info: any, pkgdir: string) => any) | undefined;
        /**
         * require.paths array to use if nothing is found on the normal node_modules recursive walk
         */
        paths?: string[] | undefined;
    }

    type AsyncOpts = resv.AsyncOpts & Opts;
    type SyncOpts = resv.SyncOpts & Opts;

    /**
     * Callback invoked when resolving asynchronously
     * @param error
     * @param resolved Absolute path to resolved identifier
     */
    type Callback = (err: Error | null, resolved?: string) => void;

    /**
     * Returns a module path
     * @param id Identifier to resolve
     * @param options Options to use for resolving.
     */
    function sync(id: string, opts?: SyncOpts): string;
}

export = resolve;

Additional Details

  • Last updated: Tue, 06 Jul 2021 18:05:45 GMT
  • Dependencies: @types/resolve
  • Global values: none

Credits

These definitions were written by Mario Nebl, and Piotr Błażejewicz.

Current Tags

  • 2.0.1                                ...           latest (5 years ago)
  • 0.0.5                                ...           ts2.0 (9 years ago)
  • 0.0.5                                ...           ts2.1 (9 years ago)
  • 0.0.5                                ...           ts2.2 (9 years ago)
  • 0.0.5                                ...           ts2.3 (9 years ago)
  • 0.0.5                                ...           ts2.4 (9 years ago)
  • 0.0.5                                ...           ts2.5 (9 years ago)
  • 0.0.5                                ...           ts2.6 (9 years ago)
  • 0.0.5                                ...           ts2.7 (9 years ago)
  • 1.11.0                                ...           ts2.8 (6 years ago)
  • 1.11.0                                ...           ts2.9 (6 years ago)
  • 1.11.0                                ...           ts3.0 (6 years ago)
  • 1.11.0                                ...           ts3.1 (6 years ago)
  • 2.0.0                                ...           ts3.2 (5 years ago)
  • 2.0.0                                ...           ts3.3 (5 years ago)
  • 2.0.0                                ...           ts3.4 (5 years ago)
  • 2.0.0                                ...           ts3.5 (5 years ago)
  • 2.0.1                                ...           ts3.6 (5 years ago)
  • 2.0.1                                ...           ts3.7 (5 years ago)
  • 2.0.1                                ...           ts3.8 (5 years ago)
  • 2.0.1                                ...           ts3.9 (5 years ago)
  • 2.0.1                                ...           ts4.0 (5 years ago)
  • 2.0.1                                ...           ts4.1 (5 years ago)
  • 2.0.1                                ...           ts4.2 (5 years ago)
  • 2.0.1                                ...           ts4.3 (5 years ago)
  • 2.0.1                                ...           ts4.4 (5 years ago)
  • 2.0.1                                ...           ts4.5 (5 years ago)
  • 2.0.1                                ...           ts4.6 (5 years ago)
  • 2.0.1                                ...           ts4.7 (5 years ago)
  • 2.0.1                                ...           ts4.8 (5 years ago)
  • 2.0.1                                ...           ts4.9 (5 years ago)
  • 2.0.1                                ...           ts5.0 (5 years ago)
  • 2.0.1                                ...           ts5.1 (5 years ago)

8 Versions

  • 2.0.1                                ...           5 years ago
  • 2.0.0                                ...           5 years ago
  • 1.11.0                                ...           6 years ago
  • 0.0.5                                ...           9 years ago
  • 0.0.4                                ...           10 years ago
  • 0.0.3                                ...           10 years ago
  • 0.0.2                                ...           10 years ago
  • 0.0.1                                ...           10 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 1
Last Month 0
Dependencies (0)
None
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2013 - present © cnpmjs.org | Home |