/** * Extensions Node will import from disk. Python's twin tests for a * single one (`.py`) because it has one module language; here `.ts` and * `.mts` ride on Node's own type stripping, which is strip-only: a file * using `enum`, a parameter property, a runtime `namespace` or a legacy * decorator is refused at load with ERR_UNSUPPORTED_TYPESCRIPT_SYNTAX. * `.mjs` is the spelling with no caveats. */ export declare const MODULE_SUFFIXES: string[]; /** * True when a ref's source is a file on disk rather than a package * specifier Node resolves for itself. * * This is Node's own rule, deliberately NOT Python's. Python's twin asks * `"/" in source`, which is sound there because a module dotpath is * dotted, so a slash can only mean a path. In Node a bare specifier * carries slashes all the time (`@scope/pkg`, `pkg/subpath`), so the * same test would rebase an installed package under the config * directory and then report it as a missing file. A path is what Node * calls a path: relative (`./`, `../`) or absolute. The one addition is * a bare filename carrying a module suffix (`tool.mjs`), which mirrors * the convenience Python allows for `tool.py`; it is restricted to * sources with no slash so that `pkg/dist/index.js` stays a subpath * export, and `./dist/index.js` says path by saying so. * * The config loader's `absolutizeCliRef` calls this same function, so * the two cannot disagree about what a path is. */ export declare function isModulePath(source: string): boolean; /** Split a `source:exportName` ref on its last colon. */ export declare function splitRef(spec: string): [string, string]; /** * Load a module export from a `source:exportName` reference. * * Two forms, auto-detected the way Python's `load_attr` detects them: * a file (`"./my_cli.mjs:TALLY"`) or a package specifier * (`"my-package/clis:JIRA"`). Only a missing file is reworded; every * other load failure propagates with Node's own diagnostic, because a * syntax error in the user's file is the message they need to read. * * A CommonJS file resolves through `default` as well as through named * exports, since cjs-module-lexer only detects some assignment shapes * and `module.exports = { TALLY }` is one it can miss. */ export declare function loadAttr(spec: string): Promise; //# sourceMappingURL=loader.d.ts.map