LegacyAsyncFunction
LegacyAsyncFunction : ((this: LegacyPluginThis, done: ((result: LegacyValue) => void)) => void) | ((this: LegacyPluginThis, arg1: LegacyValue, done: LegacyAsyncFunctionDone) => void) | ((this: LegacyPluginThis, arg1: LegacyValue, arg2: LegacyValue, done: LegacyAsyncFunctionDone) => void) | ((this: LegacyPluginThis, arg1: LegacyValue, arg2: LegacyValue, arg3: LegacyValue, done: LegacyAsyncFunctionDone) => void) | ((this: LegacyPluginThis, arg1: LegacyValue, arg2: LegacyValue, arg3: LegacyValue, arg4: LegacyValue, done: LegacyAsyncFunctionDone) => void) | ((this: LegacyPluginThis, arg1: LegacyValue, arg2: LegacyValue, arg3: LegacyValue, arg4: LegacyValue, arg5: LegacyValue, done: LegacyAsyncFunctionDone) => void) | ((this: LegacyPluginThis, arg1: LegacyValue, arg2: LegacyValue, arg3: LegacyValue, arg4: LegacyValue, arg5: LegacyValue, arg6: LegacyValue, done: LegacyAsyncFunctionDone) => void) | ((this: LegacyPluginThis, …args: […LegacyValue[], LegacyAsyncFunctionDone]) => void)
カスタムSass関数を実装する非同期コールバックです。これはfunctionsに渡すことができますが、renderの場合のみです。
非同期関数は
undefined
を返す必要があります。その最後の引数は常にコールバックとなり、実行が完了したら関数の結果とともにコールバックを呼び出す必要があります。これがエラーをスローした場合、Sassはそのエラーメッセージで関数が失敗したとみなします。
これは、functionsに渡されるシグネチャで宣言されている各引数に対して1つの引数が渡されます。シグネチャが任意の引数を取る場合、それらはコールバックの前の最後の引数として、単一の引数リストとして渡されます。
非推奨
これは、レガシーなrenderおよびrenderSync APIでのみ動作します。CustomFunctionをcompile、compileString、compileAsync、およびcompileStringAsyncとともに使用してください 。