import { C as CheckResult, a as CheckRules, R as RulesV2, b as Rules } from './types-OoUNo2KB.js'; type ElementState = 'idle' | 'checking' | 'invalid' | 'valid' | 'uploading' | 'uploaded' | 'uploadfailed'; type GivenRules = CheckRules | RulesV2; /** Build check rules from an element's HTML attributes; invalid values are ignored. @internal */ declare function attributeRules(el: Element): CheckRules; declare const Base: typeof HTMLElement; declare class ExcelElement extends Base { static formAssociated: boolean; static get observedAttributes(): string[]; private view; private internals; private _file; private _result; private _state; private _rules; private _uploadResponse; private formDisabled; private checkToken; private recheckQueued; private templateUrl; private templateToken; private templateBytes; private templateRules; private templateReady; private templateError; private rulesToken; private attrRules; private rulesReady; private rulesFailed; /** v2 rules (as given) of the current result, and the masking of its row values. */ private resultRules; private resultMask; /** Message of the last check() exception, shown in the notice until the next check or reset. */ private checkError; private uploadToken; private uploadAbort; /** A beforeupload listener cancelled the upload of the current file. */ private uploadCanceled; private uploadProgress; /** The file whose upload produced `_uploadResponse`. */ private uploadedFile; /** Form whose submit we intercept for upload-auto="false". */ private boundForm; /** Set while we re-submit the form ourselves, so that submit passes through. */ private resubmitting; private readonly onSubmit; constructor(); get file(): File | null; get result(): CheckResult | null; get info(): CheckResult['info'] | null; get state(): ElementState; get uploadResponse(): string | null; /** * Rules set from JS: 0.1 rules, v2 rules JSON or `defineRules()` output. When set they replace the `rules` * attribute and the rules built from attributes and the template. */ get rules(): GivenRules | Rules | null; set rules(v: GivenRules | Rules | null); get form(): HTMLFormElement | null; get validity(): ValidityState | null; get validationMessage(): string; checkValidity(): boolean; reportValidity(): boolean; connectedCallback(): void; disconnectedCallback(): void; formAssociatedCallback(): void; attributeChangedCallback(name: string, oldValue: string | null, value: string | null): void; formResetCallback(): void; formDisabledCallback(disabled: boolean): void; /** Check a file against the current rules. Only the latest call updates the element. */ check(file: File): Promise; /** Forget the file and result and go back to idle. */ reset(): void; /** * Upload the checked file to the `upload` URL. Works when the state is valid (or uploadfailed, to retry). * Resolves true once uploaded; false if there is nothing to upload, beforeupload was cancelled, * the upload failed, or a new file / reset() superseded it. */ upload(): Promise; private get uploadUrl(); private get uploadAuto(); private get uploadAsJson(); private get uploadAsFile(); private get uploadFileIncluded(); private get uploadReport(); private get uploadField(); /** * v2 upload (spec ยง5 P-1). JSON (default): `{ fileName, sheet, schema, columns, rows, report }`. * `upload-file="include"`: multipart `file`, `data` (that JSON without report) and `report`. * `upload-as="file"`: multipart `file` and `report`. `upload-report="off"` drops the report. */ private v2Body; /** `{ fileName, sheet, columns, rows }`; reuses the rows read during the check when present. */ private jsonBody; /** Abort any upload in flight and forget its outcome. */ private cancelUpload; /** Listen to submit on the owning form (capture phase) while connected; used by upload-auto="false". */ private bindForm; private interceptSubmit; private get disabled(); private get locale(); private get errorReportFormat(); /** The rules JSON in effect as given: the `rules` property (defineRules() output as its source JSON), else the attribute. */ private givenRules; /** * The `rules` attribute failed and the `rules` property does not replace it: do not check (Ruling V42). * The 0.1 attributes and `template` never stand in, so v2 rules cannot silently become a 0.1 check and upload. */ private get rulesUnavailable(); private setResultRules; private get previewRows(); private get templateFormat(); private effectiveRules; /** Auto upload was cancelled by beforeupload: the form is blocked until a retry succeeds. */ private get canceledAutoUpload(); /** upload-as="json" needs the rows; read them during the check instead of parsing the file twice. */ private get wantsRows(); private setState; private render; private notices; private updateForm; private queueRecheck; /** `rules` attribute: JSON when it starts with `{`, else a URL to fetch the JSON from. */ private loadRules; private loadTemplate; /** `sheet` or `header-row` changed: derive the template rules again from the bytes already fetched. */ private refreshTemplate; private deriveTemplateRules; private applyTemplate; private wireEvents; private downloadTemplate; /** `error-report` button: the CSV report, or the annotated xlsx (v2 results; code loaded on first use). */ private downloadErrorReport; } /** Register the element (default tag `excel-82`). Does nothing outside a browser or if the tag is taken. */ declare function defineExcelElement(tag?: string): void; export { type ElementState, ExcelElement, attributeRules, defineExcelElement };