From 5b78db64d36880770c61a81ca76e2cfcacb173a3 Mon Sep 17 00:00:00 2001 From: Gilad Gray Date: Tue, 22 Nov 2016 23:33:26 -0800 Subject: [PATCH] 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 --- node-sass/index.d.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/node-sass/index.d.ts b/node-sass/index.d.ts index a91d56e370..75cc33bcd2 100644 --- a/node-sass/index.d.ts +++ b/node-sass/index.d.ts @@ -5,9 +5,11 @@ /// +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 {