import * as rrule from 'rrule';
import * as _angular_core from '@angular/core';
import { OnInit } from '@angular/core';

type AXROptionsType = rrule.Options;
interface AXParsedOptionsType extends AXROptionsType {
    dtstart: Date;
    wkst: number;
    bysetpos: number[];
    bymonth: number[];
    bymonthday: number[];
    bynmonthday: number[];
    byyearday: number[];
    byweekno: number[];
    byweekday: number[];
    byhour: number[];
    byminute: number[];
    bysecond: number[];
}
type AXRRuleType = rrule.RRule;
declare const defaultOptions: AXROptionsType;
declare const defaultRrule = "RRULE:FREQ=WEEKLY;INTERVAL=1;WKST=MO;COUNT=5";

/**
 * Service for working with RRule recurrence patterns.
 * Provides methods to create RRule instances from options or strings,
 * convert between formats, and query occurrences.
 */
declare class AXRruleService {
    /**
     * Creates an RRule instance from options object.
     * @param options Partial RRule options to create the rule from
     * @returns Promise resolving to the RRule instance
     */
    rruleFromOptions(options: Partial<AXROptionsType>): Promise<AXRRuleType>;
    /**
     * Creates an RRule instance from a RRULE string.
     * @param ruleString Valid RRULE string (e.g., "RRULE:FREQ=WEEKLY;COUNT=5")
     * @returns Promise resolving to the RRule instance
     */
    rruleFromString(ruleString: string): Promise<AXRRuleType>;
    /**
     * Creates an RRule instance from human-readable text.
     * @param ruleText Human-readable text describing the recurrence (e.g., "every Monday for 5 weeks")
     * @returns Promise resolving to the RRule instance
     */
    rruleFromText(ruleText: string): Promise<AXRRuleType>;
    /**
     * Extracts options from an RRule instance.
     * @param rule RRule instance to extract options from
     * @returns Parsed options with all required fields
     */
    rruleToOptions(rule: AXRRuleType): AXParsedOptionsType;
    /**
     * Converts an RRule instance to RRULE string format.
     * @param rule RRule instance to convert
     * @returns RRULE string representation
     */
    rruleToString(rule: AXRRuleType): string;
    /**
     * Converts an RRule instance to human-readable text.
     * @param rule RRule instance to convert
     * @returns Human-readable text description
     */
    rruleToText(rule: AXRRuleType): string;
    /**
     * Gets all occurrences of the rule up to a limit.
     * @param rule RRule instance to query
     * @param limit Maximum number of occurrences to return (default: 500)
     * @returns Array of occurrence dates
     */
    rruleGetAll(rule: AXRRuleType, limit?: number): Date[];
    /**
     * Gets occurrences between two dates.
     * @param rule RRule instance to query
     * @param after Start date (exclusive by default)
     * @param before End date (exclusive by default)
     * @param inclusive Whether to include the boundary dates
     * @returns Array of occurrence dates between the specified dates
     */
    rruleGetBetween(rule: AXRRuleType, after: Date, before: Date, inclusive?: boolean): Date[];
    /**
     * Gets the last occurrence before the specified date.
     * @param rule RRule instance to query
     * @param date Date to search before
     * @param inclusive Whether to include the specified date
     * @returns Last occurrence before the date, or null if none found
     */
    rruleGetBefore(rule: AXRRuleType, date: Date, inclusive?: boolean): Date | null;
    /**
     * Gets the first occurrence after the specified date.
     * @param rule RRule instance to query
     * @param date Date to search after
     * @param inclusive Whether to include the specified date
     * @returns First occurrence after the date, or null if none found
     */
    rruleGetAfter(rule: AXRRuleType, date: Date, inclusive?: boolean): Date | null;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<AXRruleService, never>;
    static ɵprov: _angular_core.ɵɵInjectableDeclaration<AXRruleService>;
}

declare class AXRrulePreviewComponent implements OnInit {
    value: _angular_core.InputSignal<string>;
    repeat: _angular_core.InputSignal<number>;
    format: _angular_core.InputSignal<string>;
    protected rruleService: AXRruleService;
    protected rrule: _angular_core.WritableSignal<rrule.RRule>;
    protected timeZone: _angular_core.WritableSignal<string>;
    protected text: _angular_core.Signal<string>;
    protected string: _angular_core.Signal<string>;
    protected dates: _angular_core.Signal<Date[]>;
    protected options: _angular_core.Signal<{}>;
    eff: _angular_core.EffectRef;
    ngOnInit(): void;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<AXRrulePreviewComponent, never>;
    static ɵcmp: _angular_core.ɵɵComponentDeclaration<AXRrulePreviewComponent, "ax-rrule-preview", never, { "value": { "alias": "value"; "required": false; "isSignal": true; }; "repeat": { "alias": "repeat"; "required": false; "isSignal": true; }; "format": { "alias": "format"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
}

/**
 * RRule component provides a user-friendly interface for creating and managing recurrence rules.
 * Supports various frequencies, intervals, and date constraints with real-time preview and validation.
 */
declare class AXRruleComponent {
    #private;
    /**
     * Current recurrence rule model value (options object or RRULE string).
     * @default null
     */
    value: _angular_core.ModelSignal<string | rrule.Options>;
    /**
     * Emitted when the model value changes.
     */
    valueChange: _angular_core.OutputEmitterRef<string | rrule.Options>;
    /**
     * Emitted with the computed RRule instance when updated.
     */
    rruleChange: _angular_core.OutputEmitterRef<rrule.RRule>;
    /**
     * Emitted with the normalized options whenever they change.
     */
    optionsChange: _angular_core.OutputEmitterRef<rrule.Options>;
    /**
     * Emitted with the RRULE string representation.
     */
    stringChange: _angular_core.OutputEmitterRef<string>;
    /**
     * Emitted with the human-readable text of the rule.
     */
    textChange: _angular_core.OutputEmitterRef<string>;
    protected freqs: {
        text: string;
        value: number;
    }[];
    protected weekdays: {
        text: string;
        value: number;
    }[];
    protected months: {
        text: string;
        value: number;
    }[];
    protected timezones: string[];
    protected hours: number[];
    protected minutes: number[];
    protected seconds: number[];
    protected monthdays: number[];
    protected nmonthdays: number[];
    protected yeardays: number[];
    protected weeknos: number[];
    protected setpos: number[];
    protected options: _angular_core.WritableSignal<rrule.Options>;
    protected rrule: _angular_core.WritableSignal<rrule.RRule>;
    protected string: _angular_core.Signal<string>;
    protected text: _angular_core.Signal<string>;
    private rruleService;
    private _isUpdating;
    private _applyToken;
    private _scheduleApplyIncoming;
    private _applyIncomingAsync;
    private _emitAll;
    private _areOptionValuesEqual;
    private _clearOptions;
    /**
     * Updates a single option and recomputes the rule.
     * @param key The option key to update
     * @param value The new value for the option
     */
    updateOption<K extends keyof AXROptionsType>(key: K, value: AXROptionsType[K]): Promise<void>;
    /**
     * Resets options to defaults and recomputes the rule.
     */
    resetOptions(): Promise<void>;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<AXRruleComponent, never>;
    static ɵcmp: _angular_core.ɵɵComponentDeclaration<AXRruleComponent, "ax-rrule", never, { "value": { "alias": "value"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; "valueChange": "valueChange"; "rruleChange": "rruleChange"; "optionsChange": "optionsChange"; "stringChange": "stringChange"; "textChange": "textChange"; }, never, never, true, never>;
}

export { AXRruleComponent, AXRrulePreviewComponent, AXRruleService, defaultOptions, defaultRrule };
export type { AXParsedOptionsType, AXROptionsType, AXRRuleType };
