@studiometa/js-toolkit
Version:
A set of useful little bits of JavaScript to boost your project! 🚀
15 lines (14 loc) • 548 B
TypeScript
import type { BaseConstructor } from '../Base/index.js';
/**
* Import a component when given media query is true.
*
* @template {BaseConstructor} T
* @param {() => Promise<T|{default:T}>} fn
* The import function.
* @param {string} media
* The media query name and value (see https://developer.mozilla.org/en-US/docs/Web/CSS/@media#media_features)
* @returns {Promise<T>}
*/
export declare function importOnMediaQuery<T extends BaseConstructor = BaseConstructor>(fn: () => Promise<T | {
default: T;
}>, media: string): Promise<T>;