// responsive-at-rule.d.ts

import type { Rule as PostCSSRule, AtRule as PostCSSAtRule } from 'postcss';

/**
 * A PostCSS plugin function that returns an object
 * with `postcssPlugin` and a custom `AtRule` handler.
 */
declare function plugin(): {
  postcssPlugin: 'responsive-at-rule';
  /**
   * This method is called for each at-rule. If the at-rule is "responsive",
   * we generate new media queries based on breakpoints.
   */
  AtRule(targetRule: PostCSSAtRule, helpers: { Rule: typeof PostCSSRule; AtRule: typeof PostCSSAtRule }): void;
};

/**
 * PostCSS uses this property to identify valid plugins.
 */
declare namespace plugin {
  const postcss: true;
}

export = plugin;
