bitwarden-browser/apps/browser/src/autofill/services/abstractions/collect-autofill-content.se...

33 lines
1.0 KiB
TypeScript

import AutofillField from "../../models/autofill-field";
import AutofillForm from "../../models/autofill-form";
import AutofillPageDetails from "../../models/autofill-page-details";
import { ElementWithOpId, FormFieldElement } from "../../types";
type AutofillFormElements = Map<ElementWithOpId<HTMLFormElement>, AutofillForm>;
type AutofillFieldElements = Map<ElementWithOpId<FormFieldElement>, AutofillField>;
type UpdateAutofillDataAttributeParams = {
element: ElementWithOpId<HTMLFormElement | FormFieldElement>;
attributeName: string;
dataTarget?: AutofillForm | AutofillField;
dataTargetKey?: string;
};
interface CollectAutofillContentService {
getPageDetails(): Promise<AutofillPageDetails>;
getAutofillFieldElementByOpid(opid: string): HTMLElement | null;
queryAllTreeWalkerNodes(
rootNode: Node,
filterCallback: CallableFunction,
isObservingShadowRoot?: boolean,
): Node[];
}
export {
AutofillFormElements,
AutofillFieldElements,
UpdateAutofillDataAttributeParams,
CollectAutofillContentService,
};