mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-12-06 13:11:46 +00:00
more accurate importer definition
- sync and async variants - return object declares either `file` or `contents`, not both - can also return Error to throw or `null` to opt out of handling path
This commit is contained in:
Vendored
+3
-1
@@ -5,9 +5,11 @@
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
type ImporterReturnType = { file: string } | { contents: string } | Error | null;
|
||||
|
||||
interface Importer {
|
||||
(url: string, prev: string, done: (data: { file: string; contents: string; }) => void): void;
|
||||
(url: string, prev: string): ImporterReturnType;
|
||||
(url: string, prev: string, done: (data: ImporterReturnType) => void): void;
|
||||
}
|
||||
|
||||
interface Options {
|
||||
|
||||
Reference in New Issue
Block a user